- Timestamp:
- 03/30/13 16:39:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/drivectrl.cc
r15100 r15206 1125 1125 Time fSunRise; 1126 1126 1127 Time GetSunRise(const Time &time=Time())1128 {1129 #ifdef HAVE_LIBNOVA1130 const double lon = -(17.+53./60+26.525/3600);1131 const double lat = 28.+45./60+42.462/3600;1132 1133 ln_lnlat_posn observer;1134 observer.lng = lon;1135 observer.lat = lat;1136 1137 // This caluclates the sun-rise of the next day after 12:00 noon1138 ln_rst_time sun_day;1139 if (ln_get_solar_rst(time.JD(), &observer, &sun_day)==1)1140 {1141 T::Fatal("GetSunRise reported the sun to be circumpolar!");1142 return Time(Time::none);1143 }1144 1145 if (Time(sun_day.rise)>=time)1146 return Time(sun_day.rise);1147 1148 if (ln_get_solar_rst(time.JD()+0.5, &observer, &sun_day)==1)1149 {1150 T::Fatal("GetSunRise reported the sun to be circumpolar!");1151 return Time(Time::none);1152 }1153 1154 return Time(sun_day.rise);1155 #else1156 return Time(boost::date_time::pos_infin);1157 #endif1158 }1159 1160 1127 int ShiftSunRise() 1161 1128 { 1162 1129 const Time sunrise = fSunRise; 1163 1130 1164 fSunRise = GetSunRise(Time()); 1165 if (!fSunRise) 1166 return T::kSM_FatalError; 1131 fSunRise = Time().GetNextSunRise(); 1167 1132 1168 1133 if (sunrise==fSunRise) … … 1219 1184 StateMachineDrive(ostream &out=cout) : 1220 1185 T(out, "DRIVE_CONTROL"), ba::io_service::work(static_cast<ba::io_service&>(*this)), 1221 fDrive(*this, *this), fAutoResume(false), fSunRise( GetSunRise())1186 fDrive(*this, *this), fAutoResume(false), fSunRise(Time().GetNextSunRise()) 1222 1187 { 1223 1188 // State names
Note:
See TracChangeset
for help on using the changeset viewer.