/** @class DetectorTemperature.cpp @author Brian Magill @datecreated 6/20/2007 $Date: 2006/04/06 20:40:24 $ $Revision: 1.1 $ @copyright (©) Copyright 2006 by GATS Inc. 11864 Canon Blvd., Suite 101, Newport News, VA 23606 All Rights Reserved. No part of this software or publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written permission of GATS Inc. @brief A sequence of detector temperatures */ //---------------------------------------------------------------------- // #include #include #include "DetectorTemperature.h" using namespace std; DetectorTemperature& DetectorTemperature::operator = (const DetectorTemperature& rhs ) { if (this == &rhs) return *this; TemperatureInfo = rhs.TemperatureInfo; return *this; } std::valarray DetectorTemperature::getTime() const { int j; int cnt = TemperatureInfo.size(); valarray time(cnt); for (j = 0; j < cnt; ++j) time[j] = TemperatureInfo[j].getTime(); return time; } std::valarray DetectorTemperature::getTemperature(int index) const { unsigned long j; unsigned long cnt = TemperatureInfo.size(); valarray temperature(cnt); if (index < 0 || index >= num_of_signals()) throw runtime_error("Index for DetectorTemperature::getTemperature out of range!"); for (j = 0; j < cnt; ++j) temperature[j] = TemperatureInfo[j].getTemperature(index); return temperature; } unsigned long DetectorTemperature::num_of_signals() const { if (TemperatureInfo.size() == 0) return 0; return TemperatureInfo[0].size(); }; void DetectorTemperature::dump() const { for(unsigned long i = 0; i < TemperatureInfo.size(); i++) TemperatureInfo[i].dump(); }