[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/kstars/kstars/indi/drivers/telescope
From: Jasem Mutlaq <mutlaqja () ikarustech ! com>
Date: 2007-10-03 13:11:35
Message-ID: 1191417095.900506.31583.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 720677 by mutlaqja:
Fixed state issue in orion atlas startup
M +13 -10 orionatlas.cpp
M +1 -1 orionatlas.h
--- trunk/KDE/kdeedu/kstars/kstars/indi/drivers/telescope/orionatlas.cpp \
#720676:720677 @@ -69,7 +69,7 @@
/* Fundamental group */
static ISwitch PowerS[] = \
{{"CONNECT","Connect",ISS_OFF,0,0},{"DISCONNECT","Disconnect",ISS_ON,0,0},{"RECONNECT","Reconnect",ISS_OFF,0,0}};
-static ISwitchVectorProperty PowerSw = { mydev, "CONNECTION" , "Connection", \
COMM_GROUP, IP_RW, ISR_1OFMANY, 0, IPS_OK, PowerS, NARRAY(PowerS), "", 0}; +static \
ISwitchVectorProperty PowerSw = { mydev, "CONNECTION" , "Connection", COMM_GROUP, \
IP_RW, ISR_1OFMANY, 0, IPS_IDLE, PowerS, NARRAY(PowerS), "", 0}; static IText \
PortT[] = {{"PORT", "Port", 0, 0, 0, 0}}; static ITextVectorProperty Port = { mydev, \
"DEVICE_PORT", "Ports", COMM_GROUP, IP_RW, 0, IPS_OK, PortT, NARRAY(PortT), "", 0};
@@ -305,13 +305,15 @@
return;
// FIRST Switch ALWAYS for power
- if (!strcmp(name,PowerSw.name)) {
- IUResetSwitch(&PowerSw); // sets all to off?
- IUUpdateSwitch(&PowerSw,states,names,n);
- if (PowerS[2].s == ISS_ON) {
- DisconnectTel();
- }
- powerTelescope();
+ if (!strcmp(name,PowerSw.name))
+ {
+ if (IUUpdateSwitch(&PowerSw,states,names,n) < 0)
+ return;
+
+ if (PowerS[1].s == ISS_ON)
+ DisconnectTel();
+ else
+ ConnectTel();
return;
}
else if (!strcmp(name,UpdateSw.name)) {
@@ -432,10 +434,11 @@
UpdateCoords();
}
-void OrionAtlas::powerTelescope()
+void OrionAtlas::ConnectTel()
{
if (PowerSw.sp[0].s==ISS_ON||PowerSw.sp[2].s==ISS_ON) { // CONNECT or RECONNECT
- if (ConnectTel(Port.tp[0].text) < 0) {
+ if (ConnectTel(Port.tp[0].text) < 0)
+ {
PowerS[0].s = PowerS[2].s = ISS_OFF;
PowerS[1].s = ISS_ON;
IDSetSwitch (&PowerSw, "Error connecting to port %s", Port.tp[0].text);
--- trunk/KDE/kdeedu/kstars/kstars/indi/drivers/telescope/orionatlas.h #720676:720677
@@ -47,7 +47,7 @@
int checkPower(INumberVectorProperty *np);
int checkPower(ISwitchVectorProperty *sp);
int checkPower(ITextVectorProperty *tp);
- void powerTelescope();
+ void ConnectTel();
void log(const char *fmt,...);
// void slewError(int slewCode);
// int handleCoordSet();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic