Commit 1f28623e authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Fixing parking by making KStars set sidereal time along with UTC on connection

svn path=/trunk/kdeedu/kstars/; revision=292094
parent 7628d8f4
......@@ -125,8 +125,8 @@ static ISwitchVectorProperty FocusMotionSw = {mydev, "Motion", "", FOCUS_GROUP,
/* Data & Time */
static IText UTC[] = {{"UTC", "UTC", "YYYY-MM-DDTHH:MM:SS"}};
ITextVectorProperty Time = { mydev, "TIME", "UTC Time", DATETIME_GROUP, IP_RW, 0, IPS_IDLE, UTC, NARRAY(UTC)};
static INumber STime[] = {{"SDTime", "Sidereal time", "%10.6m" , 0.,0.,0.,0.}};
INumberVectorProperty SDTime = { mydev, "Sidereal Time", "", DATETIME_GROUP, IP_RW, 0, IPS_IDLE, STime, NARRAY(STime)};
static INumber STime[] = {{"LST", "Sidereal time", "%10.6m" , 0.,0.,0.,0.}};
INumberVectorProperty SDTime = { mydev, "SDTIME", "Sidereal Time", DATETIME_GROUP, IP_RW, 0, IPS_IDLE, STime, NARRAY(STime)};
/* Site managment */
......
......@@ -75,11 +75,11 @@
#include <kstatusbar.h>
#include <kpopupmenu.h>
#define NINDI_STD 12
#define NINDI_STD 13
/* INDI standard property used across all clients to enable interoperability. */
const char * indi_std[NINDI_STD] =
{"CONNECTION", "EQUATORIAL_COORD", "ON_COORD_SET", "ABORT_MOTION", "SOLAR_SYSTEM",
"GEOGRAPHIC_COORD", "HORIZONTAL_COORD", "TIME", "EXPOSE_DURATION", "DEVICE_PORT", "PARK", "MOVEMENT"};
"GEOGRAPHIC_COORD", "HORIZONTAL_COORD", "TIME", "EXPOSE_DURATION", "DEVICE_PORT", "PARK", "MOVEMENT", "SDTIME"};
/*******************************************************************
** INDI Device: The work-horse. Responsible for handling its
......
......@@ -48,7 +48,7 @@ typedef enum {PG_NONE = 0, PG_TEXT, PG_NUMERIC, PG_BUTTONS,
/* N.B. Need to modify corresponding entry in indidevice.cpp when changed */
enum stdProperties { CONNECTION, EQUATORIAL_COORD, ON_COORD_SET, ABORT_MOTION, SOLAR_SYSTEM,
GEOGRAPHIC_COORD, HORIZONTAL_COORD, TIME, EXPOSE_DURATION,
DEVICE_PORT, PARK, MOVEMENT };
DEVICE_PORT, PARK, MOVEMENT, SDTIME };
/* Devices families that we explicity support (i.e. with std properties) */
enum deviceFamily { KSTARS_TELESCOPE, KSTARS_CCD, KSTARS_FOCUSER, KSTARS_DOME, KSTARS_GPS };
......
......@@ -55,6 +55,11 @@
handleDevCounter();
break;
case SDTIME:
if (ksw->options()->indiAutoTime)
handleDevCounter();
break;
case GEOGRAPHIC_COORD:
if (ksw->options()->indiAutoGeo)
handleDevCounter();
......@@ -117,6 +122,14 @@
.arg(newDate.day()).arg(newTime.hour())
.arg(newTime.minute()).arg(newTime.second()));
pp->newText();
pp = dp->findProp("SDTIME");
if (!pp) return;
lp = pp->findElement("LST");
if (!lp) return;
lp->write_w->setText(ksw->LST()->toHMSString());
pp->newText();
}
void INDIStdDevice::updateLocation()
......@@ -174,7 +187,7 @@ void INDIStdDevice::initDeviceOptions()
if (prop)
{
updateTime();
initDevCounter += 2;
initDevCounter += 5;
}
}
......@@ -479,6 +492,7 @@ bool INDIStdProperty::newSwitch(int id, INDI_E* el)
void INDIStdProperty::newTime()
{
INDI_E * timeEle;
INDI_P *SDProp;
timeEle = pp->findElement("UTC");
if (!timeEle) return;
......@@ -496,4 +510,12 @@ void INDIStdProperty::newTime()
.arg(newTime.minute()).arg(newTime.second()));
pp->newText();
}
SDProp = pp->pg->dp->findProp("SDTIME");
if (!SDProp) return;
timeEle = SDProp->findElement("LST");
if (!timeEle) return;
timeEle->write_w->setText(ksw->LST()->toHMSString());
SDProp->newText();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment