39static std::unique_ptr<Beaver> dome(
new Beaver());
60 RotatorStatusTP[0].fill(
"RSTATUS",
"Status",
"Idle");
64 ShutterStatusTP[0].fill(
"SSTATUS",
"Status",
"Idle");
68 ShutterVoltsNP[0].fill(
"SHUTTERvolts",
"Volts",
"%.2f", 0.00, 15.00, 0.00, 0.00);
72 GotoHomeSP[0].fill(
"ROTATOR_HOME_GOTO",
"Home",
ISS_OFF);
80 HomePositionNP[0].fill(
"HOME_AZ",
"AZ D:M:S",
"%10.6m", 0.0, 360.0, 0.0, 0);
84 HomeOptionsSP[HOMECURRENT].fill(
"HOME_CURRENT",
"Current",
ISS_OFF);
85 HomeOptionsSP[HOMEDEFAULT].fill(
"HOME_DEFAULT",
"Default (0)",
ISS_OFF);
89 RotatorCalibrationSP[ROTATOR_HOME_FIND].fill(
"ROTATOR_HOME_FIND",
"Find Home",
ISS_OFF);
90 RotatorCalibrationSP[ROTATOR_HOME_MEASURE].fill(
"ROTATOR_HOME_MEASURE",
"Measure Home",
ISS_OFF);
91 RotatorCalibrationSP[ROTATOR_FULL_MEASURE].fill(
"ROTATOR_FULL_MEASURE",
"Full Measurement",
ISS_OFF);
96 RotatorAbortSP[0].fill(
"ROTATOR_ABORT",
"Abort",
ISS_OFF);
100 RotatorSettingsNP[ROTATOR_MAX_SPEED].fill(
"ROTATOR_MAX_SPEED",
"Max Speed (m/s)",
"%.f", 1, 1000, 10, 800);
101 RotatorSettingsNP[ROTATOR_MIN_SPEED].fill(
"ROTATOR_MIN_SPEED",
"Min Speed (m/s)",
"%.f", 1, 1000, 10, 400);
102 RotatorSettingsNP[ROTATOR_ACCELERATION].fill(
"ROTATOR_ACCELERATION",
"Acceleration (m/s^2)",
"%.f", 1, 1000, 10, 500);
103 RotatorSettingsNP[ROTATOR_TIMEOUT].fill(
"ROTATOR_TIMEOUT",
"Timeout (s)",
"%.f", 1, 1000, 10, 83);
110 ShutterCalibrationSP[SHUTTER_HOME_FIND].fill(
"SHUTTER_HOME_FIND",
"AutoCalibrate",
ISS_OFF);
114 ShutterAbortSP[0].fill(
"SHUTTER_ABORT",
"Abort",
ISS_OFF);
118 ShutterSettingsNP[SHUTTER_MAX_SPEED].fill(
"SHUTTER_MAX_SPEED",
"Max Speed (m/s)",
"%.f", 1, 1000, 10, 800);
119 ShutterSettingsNP[SHUTTER_MIN_SPEED].fill(
"SHUTTER_MIN_SPEED",
"Min Speed (m/s)",
"%.f", 1, 1000, 10, 400);
120 ShutterSettingsNP[SHUTTER_ACCELERATION].fill(
"SHUTTER_ACCELERATION",
"Acceleration (m/s^2)",
"%.f", 1, 1000, 10, 500);
121 ShutterSettingsNP[SHUTTER_SAFE_VOLTAGE].fill(
"SHUTTER_SAFE_VOLTAGE",
"Safe Voltage",
"%.1f", 10, 14, .5, 11);
124 ShutterSettingsTimeoutNP[0].fill(
"SHUTTER_TIMEOUT",
"Timeout (s)",
"%.f", 1, 1000, 10, 83);
131 VersionTP[0].fill(
"CVERSION",
"Controller",
"");
152 if (!sendCommand(
"!domerot getpark#", curPark))
224 LOG_DEBUG(
"Shutter in online, enabling Dome has shutter property");
239 return "NexDome Beaver";
250 char result[DRIVER_LEN] = {0};
251 if (!sendRawCommand(
"!seletek tversion#", result))
256 std::string resString = result;
257 LOGF_DEBUG(
"Version string returned %s", resString.c_str());
258 std::regex e(R
"(.*:\d*:(.*))");
259 std::sregex_iterator iter(resString.begin(), resString.end(), e);
260 if (iter == std::sregex_iterator())
262 LOGF_ERROR(
"Unexpected version response: %s", resString.c_str());
265 VersionTP[0].setText((*iter)[1]);
274 if (!sendCommand(
"!domerot gethome#", res))
278 HomePositionNP[0].setValue(res);
279 LOGF_INFO(
"Dome reports home offset: %f", res);
283 if (!sendCommand(
"!domerot getpark#", res))
288 LOGF_INFO(
"Dome reports park: %.1f", res);
292 if (!rotatorGetSettings())
298 if (!shutterGetSettings())
314 if (RotatorCalibrationSP.isNameMatch(name))
317 RotatorCalibrationSP.update(states, names,
n);
319 switch (RotatorCalibrationSP.findOnSwitchIndex())
321 case ROTATOR_HOME_FIND:
322 rc = rotatorFindHome();
326 case ROTATOR_HOME_MEASURE:
327 rc = rotatorMeasureHome();
331 case ROTATOR_FULL_MEASURE:
332 rc = rotatorFullMeasure();
348 RotatorCalibrationSP.apply();
355 if (RotatorAbortSP.isNameMatch(name))
357 RotatorAbortSP.update(states, names,
n);
358 bool rc = rotatorAbort();
360 RotatorAbortSP.apply();
367 if (GotoHomeSP.isNameMatch(name))
369 GotoHomeSP.update(states, names,
n);
371 rc = rotatorGotoHome();
380 if (HomeOptionsSP.isNameMatch(name))
382 HomeOptionsSP.update(states, names,
n);
384 double newAz, curHome;
385 switch (HomeOptionsSP.findOnSwitchIndex())
388 if (!sendCommand(
"!domerot getpark#", curHome))
390 newAz = 360.0 - curHome + rotatorGetAz();
391 rc = rotatorSetHome(newAz);
392 LOGF_DEBUG(
"New home az %.1f (from 360 - %1f + %1f)", newAz, curHome, rotatorGetAz());
397 rc = rotatorSetHome(0.0);
401 HomeOptionsSP.apply();
408 if (ShutterCalibrationSP.isNameMatch(name))
411 ShutterCalibrationSP.update(states, names,
n);
412 bool rc = shutterFindHome();
416 ShutterCalibrationSP.apply();
423 if (ShutterAbortSP.isNameMatch(name))
425 ShutterAbortSP.update(states, names,
n);
426 bool rc = shutterAbort();
428 ShutterAbortSP.apply();
446 if (RotatorSettingsNP.isNameMatch(name))
448 RotatorSettingsNP.update(values, names,
n);
449 RotatorSettingsNP.setState(rotatorSetSettings(RotatorSettingsNP[ROTATOR_MAX_SPEED].getValue(),
450 RotatorSettingsNP[ROTATOR_MIN_SPEED].getValue(),
451 RotatorSettingsNP[ROTATOR_ACCELERATION].getValue(),
452 RotatorSettingsNP[ROTATOR_TIMEOUT].getValue()
454 RotatorSettingsNP.apply();
461 if (ShutterSettingsNP.isNameMatch(name))
463 ShutterSettingsNP.update(values, names,
n);
464 ShutterSettingsNP.setState(shutterSetSettings(ShutterSettingsNP[SHUTTER_MAX_SPEED].getValue(),
465 ShutterSettingsNP[SHUTTER_MIN_SPEED].getValue(),
466 ShutterSettingsNP[SHUTTER_ACCELERATION].getValue(),
467 ShutterSettingsNP[SHUTTER_SAFE_VOLTAGE].getValue()
469 ShutterSettingsNP.apply();
476 if (HomePositionNP.isNameMatch(name))
478 HomePositionNP.update(values, names,
n);
479 if (rotatorSetHome(HomePositionNP[0].getValue()))
481 HomePositionNP.apply();
526 uint16_t domeStatus = 0;
527 if (!getDomeStatus(domeStatus))
539 RotatorStatusTP.apply();
545 RotatorStatusTP.apply();
560 std::string rStatus =
"Parked";
561 RotatorStatusTP[0].setText(rStatus);
562 RotatorStatusTP.setState(
IPS_OK);
566 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Measuring Home"))
569 RotatorCalibrationSP.setState(
IPS_OK);
570 RotatorCalibrationSP.apply();
571 std::string rStatus =
"Home";
572 RotatorStatusTP[0].setText(rStatus);
573 RotatorStatusTP.setState(
IPS_OK);
576 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Finding Home"))
579 RotatorCalibrationSP.setState(
IPS_OK);
580 RotatorCalibrationSP.apply();
581 std::string rStatus =
"Home";
582 RotatorStatusTP[0].setText(rStatus);
583 RotatorStatusTP.setState(
IPS_OK);
586 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Measuring Full Dome"))
589 RotatorCalibrationSP.setState(
IPS_OK);
590 RotatorCalibrationSP.apply();
591 std::string rStatus =
"Home";
592 RotatorStatusTP[0].setText(rStatus);
593 RotatorStatusTP.setState(
IPS_OK);
596 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Homing"))
599 std::string rStatus =
"Home";
600 RotatorStatusTP[0].setText(rStatus);
601 RotatorStatusTP.setState(
IPS_OK);
602 GotoHomeSP.setState(
IPS_OK);
609 RotatorStatusTP.apply();
611 RotatorCalibrationSP.setState(
IPS_OK);
612 RotatorCalibrationSP.apply();
613 std::string rStatus =
"Idle";
614 RotatorStatusTP[0].setText(rStatus);
615 RotatorStatusTP.setState(
IPS_OK);
616 LOG_DEBUG(
"Dome reached target position.");
618 RotatorStatusTP.apply();
631 std::string rStatus =
"Mechanical Error";
632 ShutterStatusTP[0].setText(rStatus);
633 ShutterStatusTP.apply();
644 std::string rStatus =
"Opening";
645 ShutterStatusTP[0].setText(rStatus);
646 LOG_DEBUG(
"Shutter state set to Opening");
651 std::string rStatus =
"Closing";
652 ShutterStatusTP[0].setText(rStatus);
653 LOG_DEBUG(
"Shutter state set to Closing");
658 std::string rStatus =
"Moving";
659 ShutterStatusTP[0].setText(rStatus);
669 std::string rStatus =
"Open";
670 ShutterStatusTP[0].setText(rStatus);
676 std::string rStatus =
"Closed";
677 ShutterStatusTP[0].setText(rStatus);
678 LOG_DEBUG(
"Shutter state set to CLOSED");
680 ShutterStatusTP.apply();
685 if (sendCommand(
"!dome getshutterbatvoltage#", res))
687 LOGF_DEBUG(
"Shutter voltage currently is: %.2f", res);
688 ShutterVoltsNP[0].setValue(res);
689 (res < ShutterSettingsNP[SHUTTER_SAFE_VOLTAGE].getValue()) ? ShutterVoltsNP.setState(
IPS_ALERT) : ShutterVoltsNP.setState(
691 ShutterVoltsNP.apply();
703 if (rotatorGotoAz(az))
705 m_TargetRotatorAz = az;
707 std::string rStatus =
"Moving";
708 RotatorStatusTP[0].setText(rStatus);
709 RotatorStatusTP.apply();
720 azDiff = domeDir * azDiff;
722 LOGF_DEBUG(
"Requested rel move of %.1f", azDiff);
723 lastAzDiff = fabs(azDiff);
724 return MoveAbs(m_TargetRotatorAz);
732 LOG_DEBUG(
"Re-implemented move was called");
757 if (sendCommand(
"!dome openshutter#", res))
759 std::string rStatus =
"Opening";
760 ShutterStatusTP[0].setText(rStatus);
761 ShutterStatusTP.apply();
770 if (sendCommand(
"!dome closeshutter#", res))
772 std::string rStatus =
"Shutting";
773 ShutterStatusTP[0].setText(rStatus);
774 ShutterStatusTP.apply();
796bool Beaver::rotatorGotoAz(
double az)
798 char cmd[DRIVER_LEN] = {0};
800 snprintf(
cmd, DRIVER_LEN,
"!dome gotoaz %.2f#", az);
802 std::string rStatus =
"Moving";
803 RotatorStatusTP[0].setText(rStatus);
804 RotatorStatusTP.apply();
805 return sendCommand(
cmd, res);
811bool Beaver::rotatorGetAz()
814 if (sendCommand(
"!dome getaz#", res))
826bool Beaver::rotatorSetHome(
double az)
828 char cmd[DRIVER_LEN] = {0};
830 snprintf(
cmd, DRIVER_LEN,
"!domerot sethome %.2f#", az);
831 if (sendCommand(
cmd, res))
845 if (sendCommand(
"!dome gopark#", res))
847 std::string rStatus =
"Parking";
848 RotatorStatusTP[0].setText(rStatus);
849 RotatorStatusTP.apply();
860 std::string rStatus =
"unParked";
861 RotatorStatusTP[0].setText(rStatus);
862 RotatorStatusTP.apply();
869bool Beaver::rotatorSetPark(
double az)
872 char cmd[DRIVER_LEN] = {0};
873 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %.2f#", az);
874 if (sendCommand(
cmd, res))
890 char cmd[DRIVER_LEN] = {0};
891 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %.2f#",
DomeAbsPosNP[0].getValue());
892 if (sendCommand(
cmd, res))
908 char cmd[DRIVER_LEN] = {0};
909 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %d#", 0);
910 if (sendCommand(
cmd, res))
913 LOG_INFO(
"Park set to default: 0.00");
924bool Beaver::rotatorGotoHome()
927 if (sendCommand(
"!dome gohome#", res))
930 std::string rStatus =
"Homing";
931 RotatorStatusTP[0].setText(rStatus);
932 RotatorStatusTP.
apply();
941bool Beaver::rotatorMeasureHome()
944 if (sendCommand(
"!dome autocalrot 1#", res))
948 LOGF_ERROR(
"Rotator refused to start measuring home, error code: %.0f", res);
952 std::string rStatus =
"Measuring Home";
953 RotatorStatusTP[0].setText(rStatus);
954 RotatorStatusTP.apply();
963bool Beaver::rotatorFindHome()
966 if (sendCommand(
"!dome autocalrot 0#", res))
970 LOGF_ERROR(
"Rotator refused to start finding home, error code: %.0f", res);
974 std::string rStatus =
"Finding Home";
975 RotatorStatusTP[0].setText(rStatus);
976 RotatorStatusTP.apply();
986bool Beaver::rotatorFullMeasure()
989 if (sendCommand(
"!dome autocalrot 2#", res))
993 LOGF_ERROR(
"Rotator refused to start full measurement, error code: %.0f", res);
997 std::string rStatus =
"Measuring Full Dome";
998 RotatorStatusTP[0].setText(rStatus);
999 RotatorStatusTP.apply();
1008bool Beaver::rotatorIsHome()
1011 if (sendCommand(
"!dome athome#", status))
1016 LOGF_DEBUG(
"Rotator Home? %s", (status == 1) ?
"true" :
"false");
1027bool Beaver::rotatorIsParked()
1030 if (!sendCommand(
"!dome atpark#", status))
1035 LOGF_DEBUG(
"Rotator Parked? %s", (status == 1) ?
"true" :
"false");
1045bool Beaver::getDomeStatus(uint16_t &domeStatus)
1048 if (!sendCommand(
"!dome status#", res))
1053 domeStatus =
static_cast<uint16_t
>(
res);
1061bool Beaver::shutterOnLine()
1064 uint16_t domeStatus;
1065 bool shutterIsUp =
false;
1067 if (!sendCommand(
"!dome shutterisup#", res))
1069 LOG_ERROR(
"Shutter status cmd errored out");
1074 shutterIsUp =
static_cast<bool>(
res);
1075 if (!getDomeStatus(domeStatus))
1077 LOG_ERROR(
"Shutter status cmd errored out");
1081 LOGF_DEBUG(
"ShutterIsUp %s Comms error %s", shutterIsUp ?
"true" :
"false",
1084 LOGF_DEBUG(
"ShuttOnLine %s", status ?
"true" :
"false");
1099bool Beaver::abortAll()
1102 if (sendCommand(
"!dome abort 1 1 1#", res))
1104 std::string rStatus =
"Idle";
1105 RotatorStatusTP[0].setText(rStatus);
1106 RotatorStatusTP.
apply();
1107 if (!rotatorGetAz())
1118bool Beaver::rotatorAbort()
1121 if (sendCommand(
"!dome abort 0 1#", res))
1123 std::string rStatus =
"Idle";
1124 RotatorStatusTP[0].setText(rStatus);
1125 RotatorStatusTP.apply();
1126 if (!rotatorGetAz())
1137bool Beaver::shutterAbort()
1140 return sendCommand(
"!dome abort 0 0 1#", res);
1146bool Beaver::shutterSetSettings(
double maxSpeed,
double minSpeed,
double acceleration,
double voltage)
1148 if (shutterOnLine())
1150 char cmd[DRIVER_LEN] = {0};
1153 snprintf(
cmd, DRIVER_LEN,
"!dome setshuttermaxspeed %.2f#", maxSpeed);
1154 if (!sendCommand(
cmd, res))
1156 LOG_ERROR(
"Problem setting shutter max speed");
1159 snprintf(
cmd, DRIVER_LEN,
"!dome setshutterminspeed %.2f#", minSpeed);
1160 if (!sendCommand(
cmd, res))
1162 LOG_ERROR(
"Problem setting shutter min speed");
1165 snprintf(
cmd, DRIVER_LEN,
"!dome setshutteracceleration %.2f#", acceleration);
1166 if (!sendCommand(
cmd, res))
1168 LOG_ERROR(
"Problem setting shutter acceleration");
1171 snprintf(
cmd, DRIVER_LEN,
"!dome setshuttersafevoltage %.2f#", voltage);
1172 if (!sendCommand(
cmd, res))
1174 LOG_ERROR(
"Problem setting shutter safe voltage");
1177 if(!sendCommand(
"!seletek savefs#", res))
1179 LOG_ERROR(
"Problem setting shutter savefs");
1182 LOG_INFO(
"Shutter parameters have been updated");
1191bool Beaver::shutterGetSettings()
1194 if (shutterOnLine())
1196 if (!sendCommand(
"!dome getshuttermaxspeed#", res))
1198 LOG_ERROR(
"Problem getting shutter max speed");
1203 ShutterSettingsNP[SHUTTER_MAX_SPEED].setValue(res);
1204 LOGF_DEBUG(
"Shutter reports max speed of: %.1f", res);
1206 if (!sendCommand(
"!dome getshutterminspeed#", res))
1208 LOG_ERROR(
"Problem getting shutter min speed");
1213 ShutterSettingsNP[SHUTTER_MIN_SPEED].setValue(res);
1214 LOGF_DEBUG(
"Shutter reports min speed of: %.1f", res);
1216 if (!sendCommand(
"!dome getshutteracceleration#", res))
1218 LOG_ERROR(
"Problem getting shutter acceleration");
1223 ShutterSettingsNP[SHUTTER_ACCELERATION].setValue(res);
1224 LOGF_DEBUG(
"Shutter reports acceleration of: %.1f", res);
1226 if (!sendCommand(
"!dome getshuttertimeoutopenclose#", res))
1228 LOG_ERROR(
"Problem getting shutter timeout");
1233 ShutterSettingsTimeoutNP[0].setValue(res);
1234 LOGF_DEBUG(
"Shutter reports safe timeout of: %.1f", res);
1236 if (!sendCommand(
"!dome getshuttersafevoltage#", res))
1238 LOG_ERROR(
"Problem getting shutter safe voltage");
1243 ShutterSettingsNP[SHUTTER_SAFE_VOLTAGE].setValue(res);
1244 LOGF_DEBUG(
"Shutter reports safe voltage of: %.1f", res);
1246 ShutterSettingsNP.apply();
1255bool Beaver::rotatorSetSettings(
double maxSpeed,
double minSpeed,
double acceleration,
double timeout)
1257 char cmd[DRIVER_LEN] = {0};
1260 snprintf(
cmd, DRIVER_LEN,
"!domerot setmaxspeed %.2f#", maxSpeed);
1261 if (!sendCommand(
cmd, res))
1263 LOG_ERROR(
"Problem setting rotator max speed");
1266 snprintf(
cmd, DRIVER_LEN,
"!domerot setminspeed %.2f#", minSpeed);
1267 if (!sendCommand(
cmd, res))
1269 LOG_ERROR(
"Problem setting rotator min speed");
1272 snprintf(
cmd, DRIVER_LEN,
"!domerot setacceleration %.2f#", acceleration);
1273 if (!sendCommand(
cmd, res))
1275 LOG_ERROR(
"Problem setting rotator acceleration");
1278 snprintf(
cmd, DRIVER_LEN,
"!domerot setmaxfullrotsecs %.2f#", timeout);
1279 if (!sendCommand(
cmd, res))
1281 LOG_ERROR(
"Problem setting rotator full rot secs");
1284 if(!sendCommand(
"!seletek savefs#", res))
1289 LOG_INFO(
"Rotator parameters have been updated");
1297bool Beaver::rotatorGetSettings()
1300 if (!sendCommand(
"!domerot getmaxspeed#", res))
1302 LOG_ERROR(
"Problem getting rotator max speed");
1307 RotatorSettingsNP[ROTATOR_MAX_SPEED].setValue(res);
1308 LOGF_DEBUG(
"Rotator reports max speed of: %.1f", res);
1310 if (!sendCommand(
"!domerot getminspeed#", res))
1312 LOG_ERROR(
"Problem getting rotator min speed");
1317 RotatorSettingsNP[ROTATOR_MIN_SPEED].setValue(res);
1318 LOGF_DEBUG(
"Rotator reports min speed of: %.1f", res);
1320 if (!sendCommand(
"!domerot getacceleration#", res))
1322 LOG_ERROR(
"Problem getting rotator acceleration");
1327 RotatorSettingsNP[ROTATOR_ACCELERATION].setValue(res);
1328 LOGF_DEBUG(
"Rotator reports acceleration of: %.1f", res);
1330 if (!sendCommand(
"!domerot getmaxfullrotsecs#", res))
1332 LOG_ERROR(
"Problem getting rotator full rot secs");
1337 RotatorSettingsNP[ROTATOR_TIMEOUT].setValue(res);
1338 LOGF_DEBUG(
"Rotator reports timeout(s) of: %.1f", res);
1340 RotatorSettingsNP.apply();
1348bool Beaver::shutterFindHome()
1350 if (shutterOnLine())
1353 return sendCommand(
"!dome autocalshutter#", res);
1361bool Beaver::sendRawCommand(
const char *
cmd,
char * response)
1364 for (
int i = 0; i < 3; i++)
1366 int nbytes_written = 0, nbytes_read = 0;
1373 LOGF_ERROR(
"Serial write error: %s.", errstr);
1385 tcflush(
PortFD, TCIFLUSH);
1391 response[nbytes_read - 1] = 0;
1392 LOGF_DEBUG(
"Command Response: %s", response);
1401 LOGF_ERROR(
"Serial read error: %s.", errstr);
1408bool Beaver::sendCommand(
const char *
cmd,
double &res)
1410 char response[DRIVER_LEN] = {0};
1411 sendRawCommand(
cmd, response);
1413 std::regex rgx(R
"(.*:((-*\d+(\.\d*)*)))");
1415 std::string input(response);
1417 if (std::regex_search(input, match, rgx))
1421 res = std::stof(match.str(1));
1426 LOGF_ERROR(
"Failed to process response: %s.", response);
1430 LOGF_DEBUG(
"Command error: %s response: %d",
cmd, response);
virtual IPState UnPark() override
Rotator unpark.
virtual IPState ControlShutter(ShutterOperation operation) override
open or close the shutter (will not show if shutter is not present)
virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override
Rotator move (calc's offset and calles abs move).
virtual IPState MoveRel(double azDiff) override
Rotator relative move (calc's offset and calles abs move).
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual IPState Park() override
Rotator park.
virtual bool SetCurrentPark() override
Rotator set park position to current.
virtual void TimerHit() override
Timer hit - update appropriate fields.
virtual bool SetDefaultPark() override
Rotator set park position to default (0 az).
virtual bool Abort() override
abort everything
const char * getDefaultName() override
Set default name.
bool Handshake() override
Handshake.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual IPState MoveAbs(double az) override
Rotator absolute move.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Number field updated.
virtual bool saveConfigItems(FILE *fp) override
INDI save config.
@ DOME_STATUS_SHUTTER_CLOSING
@ DOME_STATUS_SHUTTER_COMM
@ DOME_STATUS_SHUTTER_OPENED
@ DOME_STATUS_SHUTTER_CLOSED
@ DOME_STATUS_ROTATOR_MOVING
@ DOME_STATUS_SHUTTER_MOVING
@ DOME_STATUS_SHUTTER_OPENING
@ DOME_STATUS_SHUTTER_ERROR
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Switch field updated.
INDI::PropertyText getText(const char *name) const
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
Connection::Interface * getActiveConnection()
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
void addDebugControl()
Add Debug control to the driver.
Connection::TCP * tcpConnection
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.
void setDomeConnection(const uint8_t &value)
setDomeConnection Set Dome connection mode. Child class should call this in the constructor before Do...
INDI::PropertyNumber ParkPositionNP
void SetAxis1Park(double value)
SetRAPark Set current AZ parking position. The data park file (stored in ~/.indi/ParkData....
ShutterOperation
Shutter operation command.
void SetAxis1ParkDefault(double steps)
SetAxis1Park Set default AZ parking position.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
uint32_t GetDomeCapability() const
GetDomeCapability returns the capability of the dome.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
INDI::PropertyNumber DomeAbsPosNP
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Dome Presets in the configuration file
void setShutterState(const ShutterState &value)
void setDomeState(const DomeState &value)
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
Connection::Serial * serialConnection
void SetParkDataType(DomeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
ShutterState getShutterState() const
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
DomeState getDomeState() const
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
const char * CONNECTION_TAB
CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlle...
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * SITE_TAB
SITE_TAB Where all site information setting are located.
void tty_set_generic_udp_format(int enabled)
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
int tty_write_string(int fd, const char *buf, int *nbytes_written)
Writes a null terminated string to fd.
void tty_error_msg(int err_code, char *err_msg, int err_msg_len)
Retrieve the tty error message.
int tty_nread_section(int fd, char *buf, int nsize, char stop_char, int timeout, int *nbytes_read)
read buffer from terminal with a delimiter
Implementations for common driver routines.
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_INFO(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
#define LOGF_ERROR(fmt,...)