// //----------------------------------------------------------------------- /// @copyright /// (c) Copyright 2007 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. /// //----------------------------------------------------------------------- /// /// @file SunSensorSample.cpp /// /// @author John Burton /// /// @date Mon Dec 10 14:43:24 2007 /// //----------------------------------------------------------------------- // //----------------------------------------------------------------------- // Include Files: //----------------------------------------------------------------------- // #include #include "SunSensorSample.h" #include #include // //----------------------------------------------------------------------- // Defines and Macros: //----------------------------------------------------------------------- // using namespace std; // //----------------------------------------------------------------------- // Global Variables: //----------------------------------------------------------------------- // // //----------------------------------------------------------------------- // Class Methods: //----------------------------------------------------------------------- // SunSensorSample& SunSensorSample::operator = (const SunSensorSample& rhs ) { if (this == &rhs) return *this; time = rhs.time; X_Low = rhs.X_Low; X_High = rhs.X_High; Y_Low = rhs.Y_Low; Y_High = rhs.Y_High; Elev = rhs.Elev; Azim = rhs.Azim; Status = rhs.Status; SumsData.resize(NSums); SumsData = rhs.SumsData; return *this; } bool SunSensorSample::operator < (const SunSensorSample& rhs ) const { if ( time < rhs.time ) return true; else return false; } bool SunSensorSample::operator > (const SunSensorSample& rhs ) const { if ( time > rhs.time ) return true; else return false; } void SunSensorSample::dump() const { unsigned long Ind; std::cout << "time: " << std::setw(16) << std::setprecision (15) << time << std::endl; std::cout << " X_Low: " << X_Low << std::endl; std::cout << " X_High: " << X_High << std::endl; std::cout << " Y_Low: " << Y_Low << std::endl; std::cout << " Y_High: " << Y_High << std::endl; std::cout << " Elev: " << Elev << std::endl; std::cout << " Azim: " << Azim << std::endl; std::cout << " Status: " << Status << std::endl; std::cout << ": "; for(Ind = 0; Ind < SumsData.size(); Ind++) std::cout << SumsData[Ind] << " "; std::cout << std::endl; } int SunSensorSample::getSum(unsigned long indx) const { // if (0 < indx && indx < ImageData.size() ) if (indx < SumsData.size() ) return SumsData[indx]; else throw runtime_error("SunSensorData::getSum(): invalid image element"); }