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())
317 RotatorCalibrationSP.
update(states, names, n);
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();
357 RotatorAbortSP.
update(states, names, n);
358 bool rc = rotatorAbort();
360 RotatorAbortSP.
apply();
369 GotoHomeSP.
update(states, names, n);
371 rc = rotatorGotoHome();
382 HomeOptionsSP.
update(states, names, n);
384 double newAz, curHome;
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();
411 ShutterCalibrationSP.
update(states, names, n);
412 bool rc = shutterFindHome();
416 ShutterCalibrationSP.
apply();
425 ShutterAbortSP.
update(states, names, n);
426 bool rc = shutterAbort();
428 ShutterAbortSP.
apply();
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();
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();
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);
566 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Measuring Home"))
570 RotatorCalibrationSP.
apply();
571 std::string rStatus =
"Home";
572 RotatorStatusTP[0].setText(rStatus);
576 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Finding Home"))
580 RotatorCalibrationSP.
apply();
581 std::string rStatus =
"Home";
582 RotatorStatusTP[0].setText(rStatus);
586 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Measuring Full Dome"))
590 RotatorCalibrationSP.
apply();
591 std::string rStatus =
"Home";
592 RotatorStatusTP[0].setText(rStatus);
596 else if (!strcmp(RotatorStatusTP[0].
getText(),
"Homing"))
599 std::string rStatus =
"Home";
600 RotatorStatusTP[0].setText(rStatus);
609 RotatorStatusTP.
apply();
612 RotatorCalibrationSP.
apply();
613 std::string rStatus =
"Idle";
614 RotatorStatusTP[0].setText(rStatus);
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();
871 std::string rStatus =
"unParked";
872 RotatorStatusTP[0].setText(rStatus);
873 RotatorStatusTP.
apply();
891bool Beaver::rotatorSetPark(
double az)
894 char cmd[DRIVER_LEN] = {0};
895 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %.2f#", az);
896 if (sendCommand(
cmd, res))
912 char cmd[DRIVER_LEN] = {0};
913 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %.2f#",
DomeAbsPosNP[0].getValue());
914 if (sendCommand(
cmd, res))
930 char cmd[DRIVER_LEN] = {0};
931 snprintf(
cmd, DRIVER_LEN,
"!domerot setpark %d#", 0);
932 if (sendCommand(
cmd, res))
935 LOG_INFO(
"Park set to default: 0.00");
946bool Beaver::rotatorGotoHome()
949 if (sendCommand(
"!dome gohome#", res))
952 std::string rStatus =
"Homing";
953 RotatorStatusTP[0].setText(rStatus);
954 RotatorStatusTP.
apply();
963bool Beaver::rotatorMeasureHome()
966 if (sendCommand(
"!dome autocalrot 1#", res))
970 LOGF_ERROR(
"Rotator refused to start measuring home, error code: %.0f", res);
974 std::string rStatus =
"Measuring Home";
975 RotatorStatusTP[0].setText(rStatus);
976 RotatorStatusTP.
apply();
985bool Beaver::rotatorFindHome()
988 if (sendCommand(
"!dome autocalrot 0#", res))
992 LOGF_ERROR(
"Rotator refused to start finding home, error code: %.0f", res);
996 std::string rStatus =
"Finding Home";
997 RotatorStatusTP[0].setText(rStatus);
998 RotatorStatusTP.
apply();
1008bool Beaver::rotatorFullMeasure()
1011 if (sendCommand(
"!dome autocalrot 2#", res))
1015 LOGF_ERROR(
"Rotator refused to start full measurement, error code: %.0f", res);
1019 std::string rStatus =
"Measuring Full Dome";
1020 RotatorStatusTP[0].setText(rStatus);
1021 RotatorStatusTP.
apply();
1030bool Beaver::rotatorIsHome()
1033 if (sendCommand(
"!dome athome#", status))
1038 LOGF_DEBUG(
"Rotator Home? %s", (status == 1) ?
"true" :
"false");
1049bool Beaver::rotatorIsParked()
1052 if (!sendCommand(
"!dome atpark#", status))
1057 LOGF_DEBUG(
"Rotator Parked? %s", (status == 1) ?
"true" :
"false");
1067bool Beaver::getDomeStatus(uint16_t &domeStatus)
1070 if (!sendCommand(
"!dome status#", res))
1075 domeStatus =
static_cast<uint16_t
>(res);
1083bool Beaver::shutterOnLine()
1086 uint16_t domeStatus;
1087 bool shutterIsUp =
false;
1089 if (!sendCommand(
"!dome shutterisup#", res))
1091 LOG_ERROR(
"Shutter status cmd errored out");
1096 shutterIsUp =
static_cast<bool>(res);
1097 if (!getDomeStatus(domeStatus))
1099 LOG_ERROR(
"Shutter status cmd errored out");
1103 LOGF_DEBUG(
"ShutterIsUp %s Comms error %s", shutterIsUp ?
"true" :
"false",
1106 LOGF_DEBUG(
"ShuttOnLine %s", status ?
"true" :
"false");
1121bool Beaver::abortAll()
1124 if (sendCommand(
"!dome abort 1 1 1#", res))
1126 std::string rStatus =
"Idle";
1127 RotatorStatusTP[0].setText(rStatus);
1128 RotatorStatusTP.
apply();
1129 if (!rotatorGetAz())
1140bool Beaver::rotatorAbort()
1143 if (sendCommand(
"!dome abort 0 1#", res))
1145 std::string rStatus =
"Idle";
1146 RotatorStatusTP[0].setText(rStatus);
1147 RotatorStatusTP.
apply();
1148 if (!rotatorGetAz())
1159bool Beaver::shutterAbort()
1162 return sendCommand(
"!dome abort 0 0 1#", res);
1168bool Beaver::shutterSetSettings(
double maxSpeed,
double minSpeed,
double acceleration,
double voltage)
1170 if (shutterOnLine())
1172 char cmd[DRIVER_LEN] = {0};
1175 snprintf(
cmd, DRIVER_LEN,
"!dome setshuttermaxspeed %.2f#", maxSpeed);
1176 if (!sendCommand(
cmd, res))
1178 LOG_ERROR(
"Problem setting shutter max speed");
1181 snprintf(
cmd, DRIVER_LEN,
"!dome setshutterminspeed %.2f#", minSpeed);
1182 if (!sendCommand(
cmd, res))
1184 LOG_ERROR(
"Problem setting shutter min speed");
1187 snprintf(
cmd, DRIVER_LEN,
"!dome setshutteracceleration %.2f#", acceleration);
1188 if (!sendCommand(
cmd, res))
1190 LOG_ERROR(
"Problem setting shutter acceleration");
1193 snprintf(
cmd, DRIVER_LEN,
"!dome setshuttersafevoltage %.2f#", voltage);
1194 if (!sendCommand(
cmd, res))
1196 LOG_ERROR(
"Problem setting shutter safe voltage");
1199 if(!sendCommand(
"!seletek savefs#", res))
1201 LOG_ERROR(
"Problem setting shutter savefs");
1204 LOG_INFO(
"Shutter parameters have been updated");
1213bool Beaver::shutterGetSettings()
1216 if (shutterOnLine())
1218 if (!sendCommand(
"!dome getshuttermaxspeed#", res))
1220 LOG_ERROR(
"Problem getting shutter max speed");
1225 ShutterSettingsNP[SHUTTER_MAX_SPEED].setValue(res);
1226 LOGF_DEBUG(
"Shutter reports max speed of: %.1f", res);
1228 if (!sendCommand(
"!dome getshutterminspeed#", res))
1230 LOG_ERROR(
"Problem getting shutter min speed");
1235 ShutterSettingsNP[SHUTTER_MIN_SPEED].setValue(res);
1236 LOGF_DEBUG(
"Shutter reports min speed of: %.1f", res);
1238 if (!sendCommand(
"!dome getshutteracceleration#", res))
1240 LOG_ERROR(
"Problem getting shutter acceleration");
1245 ShutterSettingsNP[SHUTTER_ACCELERATION].setValue(res);
1246 LOGF_DEBUG(
"Shutter reports acceleration of: %.1f", res);
1248 if (!sendCommand(
"!dome getshuttertimeoutopenclose#", res))
1250 LOG_ERROR(
"Problem getting shutter timeout");
1255 ShutterSettingsTimeoutNP[0].setValue(res);
1256 LOGF_DEBUG(
"Shutter reports safe timeout of: %.1f", res);
1258 if (!sendCommand(
"!dome getshuttersafevoltage#", res))
1260 LOG_ERROR(
"Problem getting shutter safe voltage");
1265 ShutterSettingsNP[SHUTTER_SAFE_VOLTAGE].setValue(res);
1266 LOGF_DEBUG(
"Shutter reports safe voltage of: %.1f", res);
1268 ShutterSettingsNP.
apply();
1277bool Beaver::rotatorSetSettings(
double maxSpeed,
double minSpeed,
double acceleration,
double timeout)
1279 char cmd[DRIVER_LEN] = {0};
1282 snprintf(
cmd, DRIVER_LEN,
"!domerot setmaxspeed %.2f#", maxSpeed);
1283 if (!sendCommand(
cmd, res))
1285 LOG_ERROR(
"Problem setting rotator max speed");
1288 snprintf(
cmd, DRIVER_LEN,
"!domerot setminspeed %.2f#", minSpeed);
1289 if (!sendCommand(
cmd, res))
1291 LOG_ERROR(
"Problem setting rotator min speed");
1294 snprintf(
cmd, DRIVER_LEN,
"!domerot setacceleration %.2f#", acceleration);
1295 if (!sendCommand(
cmd, res))
1297 LOG_ERROR(
"Problem setting rotator acceleration");
1300 snprintf(
cmd, DRIVER_LEN,
"!domerot setmaxfullrotsecs %.2f#", timeout);
1301 if (!sendCommand(
cmd, res))
1303 LOG_ERROR(
"Problem setting rotator full rot secs");
1306 if(!sendCommand(
"!seletek savefs#", res))
1311 LOG_INFO(
"Rotator parameters have been updated");
1319bool Beaver::rotatorGetSettings()
1322 if (!sendCommand(
"!domerot getmaxspeed#", res))
1324 LOG_ERROR(
"Problem getting rotator max speed");
1329 RotatorSettingsNP[ROTATOR_MAX_SPEED].setValue(res);
1330 LOGF_DEBUG(
"Rotator reports max speed of: %.1f", res);
1332 if (!sendCommand(
"!domerot getminspeed#", res))
1334 LOG_ERROR(
"Problem getting rotator min speed");
1339 RotatorSettingsNP[ROTATOR_MIN_SPEED].setValue(res);
1340 LOGF_DEBUG(
"Rotator reports min speed of: %.1f", res);
1342 if (!sendCommand(
"!domerot getacceleration#", res))
1344 LOG_ERROR(
"Problem getting rotator acceleration");
1349 RotatorSettingsNP[ROTATOR_ACCELERATION].setValue(res);
1350 LOGF_DEBUG(
"Rotator reports acceleration of: %.1f", res);
1352 if (!sendCommand(
"!domerot getmaxfullrotsecs#", res))
1354 LOG_ERROR(
"Problem getting rotator full rot secs");
1359 RotatorSettingsNP[ROTATOR_TIMEOUT].setValue(res);
1360 LOGF_DEBUG(
"Rotator reports timeout(s) of: %.1f", res);
1362 RotatorSettingsNP.
apply();
1370bool Beaver::shutterFindHome()
1372 if (shutterOnLine())
1375 return sendCommand(
"!dome autocalshutter#", res);
1383bool Beaver::sendRawCommand(
const char *
cmd,
char * response)
1386 for (
int i = 0; i < 3; i++)
1388 int nbytes_written = 0, nbytes_read = 0;
1395 LOGF_ERROR(
"Serial write error: %s.", errstr);
1407 tcflush(
PortFD, TCIFLUSH);
1413 response[nbytes_read - 1] = 0;
1414 LOGF_DEBUG(
"Command Response: %s", response);
1423 LOGF_ERROR(
"Serial read error: %s.", errstr);
1430bool Beaver::sendCommand(
const char *
cmd,
double &res)
1432 char response[DRIVER_LEN] = {0};
1433 sendRawCommand(
cmd, response);
1435 std::regex rgx(R
"(.*:((-*\d+(\.\d*)*)))");
1437 std::string input(response);
1439 if (std::regex_search(input, match, rgx))
1443 res = std::stof(match.str(1));
1448 LOGF_ERROR(
"Failed to process response: %s.", response);
1452 LOGF_DEBUG(
"Command error: %s response: %d",
cmd, response);
@ 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 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.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Switch field updated.
void setDefaultBaudRate(BaudRate newRate)
setDefaultBaudRate Set default baud rate. The default baud rate is 9600 unless otherwise changed by t...
void setDefaultHost(const char *addressHost)
void setConnectionType(int type)
TODO should be renamed to setDefaultConnectionType.
void setDefaultPort(uint32_t addressPort)
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::PropertySwitch ShutterParkPolicySP
INDI::PropertyNumber ParkPositionNP
void SetAxis1Park(double value)
SetRAPark Set current AZ parking position. The data park file (stored in ~/.indi/ParkData....
void SetAxis1ParkDefault(double steps)
SetAxis1Park Set default AZ parking position.
ShutterOperation
Shutter operation command.
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.
INDI::PropertySwitch DomeShutterSP
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 setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
const char * getName() const
bool isNameMatch(const char *otherName) const
bool update(const double values[], const char *const names[], int n)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
bool update(const ISState states[], const char *const names[], int n)
int findOnSwitchIndex() const
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, ISRule rule, double timeout, IPState state)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
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.
#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,...)