Changeset 14669 for trunk/FACT++/src/drivectrl.cc
- Timestamp:
- 11/20/12 14:35:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/drivectrl.cc
r14617 r14669 1151 1151 } 1152 1152 1153 int ShiftSunRise() 1154 { 1155 const Time sunrise = fSunRise; 1156 1157 fSunRise = GetSunRise(Time()); 1158 if (!fSunRise) 1159 return T::kSM_FatalError; 1160 1161 if (sunrise==fSunRise) 1162 return Drive::State::kLocked; 1163 1164 ostringstream msg; 1165 msg << "Next sun-rise will be at " << fSunRise; 1166 T::Info(msg); 1167 1168 return Drive::State::kLocked; 1169 } 1170 1153 1171 int Execute() 1154 1172 { … … 1161 1179 1162 1180 if (T::GetCurrentState()==Drive::State::kLocked) 1163 return Drive::State::kLocked; 1164 1181 return ShiftSunRise(); 1165 1182 1166 1183 if (T::GetCurrentState()>Drive::State::kLocked) 1167 1184 { 1168 Time now; 1169 if (now>fSunRise) 1185 if (Time()>fSunRise) 1170 1186 { 1171 1187 SendCommand("PREPS Park", false); 1172 1173 fSunRise = GetSunRise(now);1174 if (!fSunRise)1175 return T::kSM_FatalError;1176 1177 ostringstream msg;1178 msg << "Next sun-rise will be at " << fSunRise;1179 T::Info(msg);1180 1181 1188 return Drive::State::kLocked; 1182 1189 }
Note:
See TracChangeset
for help on using the changeset viewer.