32 #define ROLLOFF_DURATION 10
58 bool RollOff::SetupParms()
66 fullClosedLimitSwitch =
ISS_ON;
70 fullOpenLimitSwitch =
ISS_ON;
71 fullClosedLimitSwitch =
ISS_OFF;
78 fullClosedLimitSwitch =
ISS_OFF;
97 return (
const char *)
"RollOff Simulator";
125 if (MotionRequest < 0)
127 LOG_INFO(
"Roof motion is stopped.");
172 LOG_WARN(
"Roof is already fully opened.");
182 LOG_WARN(
"Roof is already fully closed.");
188 "Cannot close dome when mount is locking. See: Telescope parking policy, in options tab");
193 fullClosedLimitSwitch =
ISS_OFF;
195 gettimeofday(&MotionStart,
nullptr);
220 LOG_INFO(
"Roll off is unparking...");
232 if (fullOpenLimitSwitch ==
ISS_OFF && fullClosedLimitSwitch ==
ISS_OFF)
242 float RollOff::CalcTimeLeft(timeval start)
250 gettimeofday(&now,
nullptr);
253 (double)(now.tv_sec * 1000.0 + now.tv_usec / 1000) - (double)(start.tv_sec * 1000.0 + start.tv_usec / 1000);
254 timesince = timesince / 1000;
255 timeleft = MotionRequest - timesince;
261 double timeleft = CalcTimeLeft(MotionStart);
265 fullOpenLimitSwitch =
ISS_ON;
274 double timeleft = CalcTimeLeft(MotionStart);
278 fullClosedLimitSwitch =
ISS_ON;
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
void SetDomeCapability(uint32_t cap)
SetDomeCapability set the dome capabilities. All capabilities must be initialized.
bool isParked()
isParked is dome currently parked?
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
bool isLocked()
isLocked, is the dome currently locked?
ISwitchVectorProperty ParkSP
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
ISwitchVectorProperty DomeMotionSP
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Dome Presets in the configuration file
void setDomeState(const DomeState &value)
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
void SetParkDataType(DomeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
virtual IPState Move(DomeDirection dir, DomeMotionCommand operation)
Move the Dome in a particular direction.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool getFullOpenedLimitSwitch()
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override
Move the Dome in a particular direction.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Dome Presets in the configuration file
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
bool Disconnect() override
Disconnect from device.
virtual IPState UnPark() override
UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutte...
virtual bool Abort() override
Abort all dome motion.
virtual IPState Park() override
Goto Park Position. The park position is an absolute azimuth value.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
const char * getDefaultName() override
virtual bool getFullClosedLimitSwitch()
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Implementations for common driver routines.
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
#define DEBUG(priority, msg)
Macro to print log messages. Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");.
std::unique_ptr< RollOff > rollOff(new RollOff())