diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/CMakeLists.txt libindiQT/CMakeLists.txt --- libindi_1.2.0/CMakeLists.txt 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/CMakeLists.txt 2016-08-02 15:51:14.082408938 +0200 @@ -256,6 +256,7 @@ ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200ap.cpp ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200fs2.cpp ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200ss2000pc.cpp + ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200_OnStep.cpp ) add_executable(indi_lx200generic ${lx200generic_SRCS}) @@ -275,6 +276,7 @@ exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200pulsar2)\n exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200fs2)\n exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ss2000pc)\n +exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200_OnStep)\n ") set_target_properties(indi_lx200generic PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_lx200generic_symlink.cmake) ################################################################################# diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/.directory libindiQT/.directory --- libindi_1.2.0/.directory 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/.directory 2016-08-02 15:51:14.082408938 +0200 @@ -0,0 +1,4 @@ +[Dolphin] +Timestamp=2016,7,31,16,50,5 +Version=3 +ViewMode=1 diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/.directory libindiQT/drivers/telescope/.directory --- libindi_1.2.0/drivers/telescope/.directory 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/drivers/telescope/.directory 2016-08-02 15:51:14.158408936 +0200 @@ -0,0 +1,5 @@ +[Dolphin] +SortOrder=1 +Timestamp=2016,7,31,16,50,42 +Version=3 +ViewMode=1 diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200classic.cpp libindiQT/drivers/telescope/lx200classic.cpp --- libindi_1.2.0/drivers/telescope/lx200classic.cpp 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/drivers/telescope/lx200classic.cpp 2016-08-02 15:51:14.158408936 +0200 @@ -80,7 +80,7 @@ IUFillNumber(&MaxSlewRateN[0], "maxSlew", "Rate", "%g", 2.0, 9.0, 1.0, 9.0); IUFillNumberVector(&MaxSlewRateNP, MaxSlewRateN, 1, getDeviceName(), "Max slew Rate", "", MOTION_TAB, IP_RW, 0, IPS_IDLE); - IUFillNumber(&ElevationLimitN[0], "minAlt", "Speed", "%%+03f", -90.0, 90.0, 0.0, 0.0); + IUFillNumber(&ElevationLimitN[0], "minAlt", "Speed", "%%+03f", -90.0, 90.0, 0.0, 0.0); //azwing double % typo IUFillNumber(&ElevationLimitN[1], "maxAlt", "Speed", "%+03f", -90.0, 90.0, 0.0, 0.0); IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 1, getDeviceName(), "Slew elevation Limit", "", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE); return true; diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200driver.cpp libindiQT/drivers/telescope/lx200driver.cpp --- libindi_1.2.0/drivers/telescope/lx200driver.cpp 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/drivers/telescope/lx200driver.cpp 2016-08-02 20:55:59.161868675 +0200 @@ -401,15 +401,13 @@ DEBUGFDEVICE(lx200Name, DBG_SCOPE, "RES <%s>", temp_string); - nbytes_read = sscanf(temp_string, "(%d)", &tMode); + nbytes_read = sscanf(temp_string, "%d", &tMode); //azwing remove parentheses, expect 24 or 12 as return value if (nbytes_read < 1) return -1; else *format = tMode; - - return 0; - + return 0; } int getSiteName(int fd, char *siteName, int siteNum) @@ -887,7 +885,7 @@ getSexComponents(Long, &d, &m, &s); - snprintf(temp_string, sizeof( temp_string ), ":Sg%03d:%02d#", d, m); + snprintf(temp_string, sizeof( temp_string ), ":Sg%+03d:%02d#", d, m); //azwing must be with sign return (setStandardProcedure(fd, temp_string)); } @@ -1270,22 +1268,22 @@ { case 1: DEBUGFDEVICE(lx200Name, DBG_SCOPE, "CMD <%s>", ":W1#"); - if ( (error_type = tty_write_string(fd, ":W1#", &nbytes_write)) != TTY_OK) + if ( (error_type = tty_write_string(fd, ":W0#", &nbytes_write)) != TTY_OK) //azwing starts with W0 return error_type; break; case 2: DEBUGFDEVICE(lx200Name, DBG_SCOPE, "CMD <%s>", ":W2#"); - if ( (error_type = tty_write_string(fd, ":W2#", &nbytes_write)) != TTY_OK) + if ( (error_type = tty_write_string(fd, ":W1#", &nbytes_write)) != TTY_OK) //azwing starts with W0 return error_type; break; case 3: DEBUGFDEVICE(lx200Name, DBG_SCOPE, "CMD <%s>", ":W3#"); - if ( (error_type = tty_write_string(fd, ":W3#", &nbytes_write)) != TTY_OK) + if ( (error_type = tty_write_string(fd, ":W2#", &nbytes_write)) != TTY_OK) //azwing starts with W0 return error_type; break; case 4: DEBUGFDEVICE(lx200Name, DBG_SCOPE, "CMD <%s>", ":W4#"); - if ( (error_type = tty_write_string(fd, ":W4#", &nbytes_write)) != TTY_OK) + if ( (error_type = tty_write_string(fd, ":W3#", &nbytes_write)) != TTY_OK) //azwing starts with W0 return error_type; break; default: diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200generic.cpp libindiQT/drivers/telescope/lx200generic.cpp --- libindi_1.2.0/drivers/telescope/lx200generic.cpp 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/drivers/telescope/lx200generic.cpp 2016-08-02 21:42:55.761785453 +0200 @@ -45,6 +45,7 @@ #include "lx200pulsar2.h" #include "lx200fs2.h" #include "lx200ss2000pc.h" +#include "lx200_OnStep.h" // We declare an auto pointer to LX200Generic. std::unique_ptr telescope; @@ -82,6 +83,14 @@ } + if (strstr(me, "indi_lx200_OnStep")) + { + IDLog("initializing from LX200 OnStep device...\n"); + + if(telescope.get() == 0) telescope.reset(new LX200_OnStep()); + + + } else if (strstr(me, "indi_lx200gps")) { IDLog("initializing from LX200 GPS device...\n"); @@ -620,10 +629,30 @@ ParkSP.s = IPS_BUSY; TrackState = SCOPE_PARKING; - IDMessage(getDeviceName(), "Parking telescope in progress..."); + IDMessage(getDeviceName(), "Generic Parking telescope in progress..."); return true; } +/* +bool LX200Generic::UnPark() +{ + // First we unpark + if (isSimulation() == false) + { + if (UnParkOnStep(PortFD) < 0) + { + DEBUG(INDI::Logger::DBG_ERROR, "Azwing UnParking OnStep Failed."); + return false; + } + } + IDMessage(getDeviceName(), "Generic UnParking telescope in progress... "); + SetParked(false); + EnaTrackOnStep(PortFD); + ParkSP.s = IPS_OK; + TrackState = SCOPE_TRACKING; + return true; +} +*/ bool LX200Generic::MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) { int current_move = (dir == DIRECTION_NORTH) ? LX200_NORTH : LX200_SOUTH; diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200generic.h libindiQT/drivers/telescope/lx200generic.h --- libindi_1.2.0/drivers/telescope/lx200generic.h 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/drivers/telescope/lx200generic.h 2016-08-02 18:39:13.106111136 +0200 @@ -66,6 +66,7 @@ virtual bool Goto(double,double); virtual bool Park(); +// virtual bool UnPark(); virtual bool Sync(double ra, double dec); virtual bool isSlewComplete(); diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200_OnStep.cpp libindiQT/drivers/telescope/lx200_OnStep.cpp --- libindi_1.2.0/drivers/telescope/lx200_OnStep.cpp 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/drivers/telescope/lx200_OnStep.cpp 2016-08-03 00:43:31.805465284 +0200 @@ -0,0 +1,429 @@ +/* + LX200 LX200_OnStep + Based on LX200 classic, azwing (alain@zwingelstein.org) + Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "lx200_OnStep.h" +#include "lx200driver.h" + +#include +#include +#include +#include + +#define LIBRARY_TAB "Library" +#define FIRMWARE_TAB "Firmware data" + +LX200_OnStep::LX200_OnStep() : LX200Generic() +{ + currentCatalog = LX200_STAR_C; + currentSubCatalog = 0; + MaxReticleFlashRate = 3; + + setVersion(1, 0); +} + +const char * LX200_OnStep::getDefaultName() +{ + return (const char *) "LX200 OnStep"; +} + +bool LX200_OnStep::initProperties() +{ + LX200Generic::initProperties(); + + IUFillText(&ObjectInfoT[0], "Info", "", ""); + IUFillTextVector(&ObjectInfoTP, ObjectInfoT, 1, getDeviceName(), "Object Info", "", MAIN_CONTROL_TAB, IP_RO, 0, IPS_IDLE); + + IUFillSwitch(&StarCatalogS[0], "Star", "", ISS_ON); + IUFillSwitch(&StarCatalogS[1], "SAO", "", ISS_OFF); + IUFillSwitch(&StarCatalogS[2], "GCVS", "", ISS_OFF); + IUFillSwitchVector(&StarCatalogSP, StarCatalogS, 3, getDeviceName(), "Star Catalogs", "", LIBRARY_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); + + IUFillSwitch(&DeepSkyCatalogS[0], "NGC", "", ISS_ON); + IUFillSwitch(&DeepSkyCatalogS[1], "IC", "", ISS_OFF); + IUFillSwitch(&DeepSkyCatalogS[2], "UGC", "", ISS_OFF); + IUFillSwitch(&DeepSkyCatalogS[3], "Caldwell", "", ISS_OFF); + IUFillSwitch(&DeepSkyCatalogS[4], "Arp", "", ISS_OFF); + IUFillSwitch(&DeepSkyCatalogS[5], "Abell", "", ISS_OFF); + IUFillSwitch(&DeepSkyCatalogS[6], "Messier", "", ISS_OFF); + IUFillSwitchVector(&DeepSkyCatalogSP, DeepSkyCatalogS, 7, getDeviceName(), "Deep Sky Catalogs", "", LIBRARY_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); + + IUFillSwitch(&SolarS[0], "Select", "Select item", ISS_ON); + IUFillSwitch(&SolarS[1], "1", "Mercury", ISS_OFF); + IUFillSwitch(&SolarS[2], "2", "Venus", ISS_OFF); + IUFillSwitch(&SolarS[3], "3", "Moon", ISS_OFF); + IUFillSwitch(&SolarS[4], "4", "Mars", ISS_OFF); + IUFillSwitch(&SolarS[5], "5", "Jupiter", ISS_OFF); + IUFillSwitch(&SolarS[6], "6", "Saturn", ISS_OFF); + IUFillSwitch(&SolarS[7], "7", "Uranus", ISS_OFF); + IUFillSwitch(&SolarS[8], "8", "Neptune", ISS_OFF); + IUFillSwitch(&SolarS[9], "9", "Pluto", ISS_OFF); + IUFillSwitchVector(&SolarSP, SolarS, 10, getDeviceName(), "SOLAR_SYSTEM", "Solar System", LIBRARY_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); + + IUFillNumber(&ObjectNoN[0], "ObjectN", "Number", "%+03f", 1.0, 1000.0, 1.0, 0); + IUFillNumberVector(&ObjectNoNP, ObjectNoN, 1, getDeviceName(), "Object Number", "", LIBRARY_TAB, IP_RW, 0, IPS_IDLE); + + IUFillNumber(&MaxSlewRateN[0], "maxSlew", "Rate", "%g", 2.0, 9.0, 1.0, 9.0); + IUFillNumberVector(&MaxSlewRateNP, MaxSlewRateN, 1, getDeviceName(), "Max slew Rate", "", MOTION_TAB, IP_RW, 0, IPS_IDLE); + + IUFillNumber(&ElevationLimitN[0], "minAlt", "Speed", "%+03f", -90.0, 90.0, 0.0, 0.0); // double % typo + IUFillNumber(&ElevationLimitN[1], "maxAlt", "Speed", "%+03f", -90.0, 90.0, 0.0, 0.0); + IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 1, getDeviceName(), "Slew elevation Limit", "", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE); + + IUFillSwitch(&EnaTrackS[0],"ENABLE","TrackOn/Off",ISS_OFF); + IUFillSwitchVector(&EnaTrackSP,EnaTrackS,1,getDeviceName(),"TELESCOPE_TRACK_ENABLE","Tracking On/Off",MAIN_CONTROL_TAB,IP_RW,ISR_ATMOST1,60,IPS_IDLE); + + IUFillText(&VersionT[0], "Date", "", ""); + IUFillText(&VersionT[1], "Time", "", ""); + IUFillText(&VersionT[2], "Number", "", ""); + IUFillText(&VersionT[3], "Name", "", ""); + //IUFillText(&VersionT[4], "Full", "", ""); //ToDo is not supported by OnStep Firmware + IUFillTextVector(&VersionTP, VersionT, 4, getDeviceName(), "Firmware Info", "", FIRMWARE_TAB, IP_RO, 0, IPS_IDLE); + + return true; +} + +void LX200_OnStep::ISGetProperties (const char *dev) +{ + + if(dev && strcmp(dev,getDeviceName())) + return; + + LX200Generic::ISGetProperties(dev); + + if (isConnected()) + { + defineSwitch(&EnaTrackSP); + defineNumber(&ElevationLimitNP); + defineText(&ObjectInfoTP); + defineSwitch(&SolarSP); + defineSwitch(&StarCatalogSP); + defineSwitch(&DeepSkyCatalogSP); + defineNumber(&ObjectNoNP); + defineNumber(&MaxSlewRateNP); + } +} + +bool LX200_OnStep::updateProperties() +{ + LX200Generic::updateProperties(); + + if (isConnected()) + { + defineSwitch(&EnaTrackSP); + defineText(&VersionTP); + defineNumber(&ElevationLimitNP); + defineText(&ObjectInfoTP); + defineSwitch(&SolarSP); + defineSwitch(&StarCatalogSP); + defineSwitch(&DeepSkyCatalogSP); + defineNumber(&ObjectNoNP); + defineNumber(&MaxSlewRateNP); + return true; + } + else + { + deleteProperty(EnaTrackSP.name); + deleteProperty(VersionTP.name); + deleteProperty(ElevationLimitNP.name); + deleteProperty(ObjectInfoTP.name); + deleteProperty(SolarSP.name); + deleteProperty(StarCatalogSP.name); + deleteProperty(DeepSkyCatalogSP.name); + deleteProperty(ObjectNoNP.name); + deleteProperty(MaxSlewRateNP.name); + return true; + } +} + +bool LX200_OnStep::ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) +{ + + if(strcmp(dev,getDeviceName())==0) + { + if ( !strcmp (name, ObjectNoNP.name) ) + { + + char object_name[256]; + + if (selectCatalogObject(PortFD, currentCatalog, (int) values[0]) < 0) + { + ObjectNoNP.s = IPS_ALERT; + IDSetNumber(&ObjectNoNP, "Failed to select catalog object."); + return false; + } + + getLX200RA(PortFD, &targetRA); + getLX200DEC(PortFD, &targetDEC); + + ObjectNoNP.s = IPS_OK; + IDSetNumber(&ObjectNoNP , "Object updated."); + + if (getObjectInfo(PortFD, object_name) < 0) + IDMessage(getDeviceName(), "Getting object info failed."); + else + { + IUSaveText(&ObjectInfoTP.tp[0], object_name); + IDSetText (&ObjectInfoTP, NULL); + } + + Goto(targetRA, targetDEC); + return true; + } + + if ( !strcmp (name, MaxSlewRateNP.name) ) + { + + + if ( setMaxSlewRate(PortFD, (int) values[0] < 0) ) + { + MaxSlewRateNP.s = IPS_ALERT; + IDSetNumber(&MaxSlewRateNP, "Error setting maximum slew rate."); + return false; + } + + MaxSlewRateNP.s = IPS_OK; + MaxSlewRateNP.np[0].value = values[0]; + IDSetNumber(&MaxSlewRateNP, NULL); + return true; + } + + if (!strcmp (name, ElevationLimitNP.name)) + { + // new elevation limits + double minAlt = 0, maxAlt = 0; + int i, nset; + + for (nset = i = 0; i < n; i++) + { + INumber *altp = IUFindNumber (&ElevationLimitNP, names[i]); + if (altp == &ElevationLimitN[0]) + { + minAlt = values[i]; + nset += minAlt >= -90.0 && minAlt <= 90.0; + } else if (altp == &ElevationLimitN[1]) + { + maxAlt = values[i]; + nset += maxAlt >= -90.0 && maxAlt <= 90.0; + } + } + if (nset == 2) + { + if ( setMinElevationLimit(PortFD, (int) minAlt) < 0) + { + ElevationLimitNP.s = IPS_ALERT; + IDSetNumber(&ElevationLimitNP, "Error setting elevation limit."); + return false; + } + + setMaxElevationLimit(PortFD, (int) maxAlt); + ElevationLimitNP.np[0].value = minAlt; + ElevationLimitNP.np[1].value = maxAlt; + ElevationLimitNP.s = IPS_OK; + IDSetNumber (&ElevationLimitNP, NULL); + return true; + } + else + { + ElevationLimitNP.s = IPS_IDLE; + IDSetNumber(&ElevationLimitNP, "elevation limit missing or invalid."); + return false; + } + } + + } + + return LX200Generic::ISNewNumber (dev, name, values, names, n); +} + + bool LX200_OnStep::ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) + { + + int index=0; + + if(strcmp(dev,getDeviceName())==0) + { + // Track Enable Button + if (!strcmp (name, EnaTrackSP.name)) + { + if (TrackState==SCOPE_TRACKING) + { + IUResetSwitch(&EnaTrackSP); + EnaTrackSP.s = IPS_IDLE; + DisTrackOnStep(PortFD); + TrackState=SCOPE_IDLE; + IDSetSwitch(&EnaTrackSP,"Idle"); + DEBUG(INDI::Logger::DBG_ERROR, "OnStep Tracking Disabled"); + } + else + { + IUResetSwitch (&EnaTrackSP); + EnaTrackSP.s = IPS_OK; + EnaTrackOnStep(PortFD); + TrackState=SCOPE_TRACKING; + IDSetSwitch(&EnaTrackSP,"Tracking"); + DEBUG(INDI::Logger::DBG_ERROR, "OOnStep Tracking Enabled"); + } + } + // Star Catalog + if (!strcmp (name, StarCatalogSP.name)) + { + + IUResetSwitch(&StarCatalogSP); + IUUpdateSwitch(&StarCatalogSP, states, names, n); + index = IUFindOnSwitchIndex(&StarCatalogSP); + + currentCatalog = LX200_STAR_C; + + if (selectSubCatalog(PortFD, currentCatalog, index)) + { + currentSubCatalog = index; + StarCatalogSP.s = IPS_OK; + IDSetSwitch(&StarCatalogSP, NULL); + return true; + } + else + { + StarCatalogSP.s = IPS_IDLE; + IDSetSwitch(&StarCatalogSP, "Catalog unavailable."); + return false; + } + } + + // Deep sky catalog + if (!strcmp (name, DeepSkyCatalogSP.name)) + { + + IUResetSwitch(&DeepSkyCatalogSP); + IUUpdateSwitch(&DeepSkyCatalogSP, states, names, n); + index = IUFindOnSwitchIndex(&DeepSkyCatalogSP); + + if (index == LX200_MESSIER_C) + { + currentCatalog = index; + DeepSkyCatalogSP.s = IPS_OK; + IDSetSwitch(&DeepSkyCatalogSP, NULL); + } + else + currentCatalog = LX200_DEEPSKY_C; + + if (selectSubCatalog(PortFD, currentCatalog, index)) + { + currentSubCatalog = index; + DeepSkyCatalogSP.s = IPS_OK; + IDSetSwitch(&DeepSkyCatalogSP, NULL); + } + else + { + DeepSkyCatalogSP.s = IPS_IDLE; + IDSetSwitch(&DeepSkyCatalogSP, "Catalog unavailable"); + return false; + } + + return true; + } + + // Solar system + if (!strcmp (name, SolarSP.name)) + { + + if (IUUpdateSwitch(&SolarSP, states, names, n) < 0) + return false; + + index = IUFindOnSwitchIndex(&SolarSP); + + // We ignore the first option : "Select item" + if (index == 0) + { + SolarSP.s = IPS_IDLE; + IDSetSwitch(&SolarSP, NULL); + return true; + } + + selectSubCatalog (PortFD, LX200_STAR_C, LX200_STAR); + selectCatalogObject(PortFD, LX200_STAR_C, index + 900); + + ObjectNoNP.s = IPS_OK; + SolarSP.s = IPS_OK; + + getObjectInfo(PortFD, ObjectInfoTP.tp[0].text); + IDSetNumber(&ObjectNoNP , "Object updated."); + IDSetSwitch(&SolarSP, NULL); + + if (currentCatalog == LX200_STAR_C || currentCatalog == LX200_DEEPSKY_C) + selectSubCatalog(PortFD, currentCatalog, currentSubCatalog); + + getObjectRA(PortFD, &targetRA); + getObjectDEC(PortFD, &targetDEC); + + Goto(targetRA, targetDEC); + + return true; + } + + } + + return LX200Generic::ISNewSwitch (dev, name, states, names, n); + + } + + void LX200_OnStep::getBasicData() + { + + // process parent + LX200Generic::getBasicData(); + + if (isSimulation() == false) + { + VersionTP.tp[0].text = new char[64]; + getVersionDate(PortFD, VersionTP.tp[0].text); + VersionTP.tp[1].text = new char[64]; + getVersionTime(PortFD, VersionTP.tp[1].text); + VersionTP.tp[2].text = new char[64]; + getVersionNumber(PortFD, VersionTP.tp[2].text); + VersionTP.tp[3].text = new char[128]; + getProductName(PortFD, VersionTP.tp[3].text); + //VersionTP.tp[4].text = new char[128]; + // getFullVersion(PortFD, VersionTP.tp[4].text); //ToDo not supported by OnStep firmware + } + IDSetText(&VersionTP, NULL); + DEBUG(INDI::Logger::DBG_ERROR, "OnStep GetBasicData"); + } + +bool LX200_OnStep::UnPark() +{ + // First we unpark + if (isSimulation() == false) + { + if (UnParkOnStep(PortFD) < 0) + { + DEBUG(INDI::Logger::DBG_ERROR, "OnsTep UnParking OnStep Failed."); + return false; + } + } + + IDMessage(getDeviceName(), "OnStep UnParking telescope in progress... "); + SetParked(false); + EnaTrackOnStep(PortFD); + ParkSP.s = IPS_OK; + TrackState = SCOPE_TRACKING; + return true; +} + diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers/telescope/lx200_OnStep.h libindiQT/drivers/telescope/lx200_OnStep.h --- libindi_1.2.0/drivers/telescope/lx200_OnStep.h 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/drivers/telescope/lx200_OnStep.h 2016-08-02 23:37:09.973582934 +0200 @@ -0,0 +1,90 @@ +/* + LX200 OnStep + based on LX200 Classic azwing (alain@zwingelstein.org) + Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#ifndef LX200_ONSTEP_H +#define LX200_ONSTEP_H + +#include "lx200generic.h" + +#define UnParkOnStep(fd) write(fd, "#:hR#", 5) // azwing +#define setParkOnStep(fd) write(fd, "#:hQ#", 5) // azwing +#define EnaTrackOnStep(fd) write(fd, "#:Te#", 5) // azwing +#define DisTrackOnStep(fd) write(fd, "#:Td#", 5) // azwing + + + +class LX200_OnStep:public LX200Generic +{ + public: + LX200_OnStep(); + ~LX200_OnStep() {} + + const char *getDefaultName(); + bool initProperties(); + void ISGetProperties (const char *dev); + bool updateProperties(); + bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n); + bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n); + + +protected: + + virtual void getBasicData(); + virtual bool UnPark(); + + ITextVectorProperty ObjectInfoTP; + IText ObjectInfoT[1]; + + ISwitchVectorProperty StarCatalogSP; + ISwitch StarCatalogS[3]; + + ISwitchVectorProperty DeepSkyCatalogSP; + ISwitch DeepSkyCatalogS[7]; + + ISwitchVectorProperty SolarSP; + ISwitch SolarS[10]; + + INumberVectorProperty ObjectNoNP; + INumber ObjectNoN[1]; + + INumberVectorProperty MaxSlewRateNP; + INumber MaxSlewRateN[1]; + + INumberVectorProperty ElevationLimitNP; + INumber ElevationLimitN[2]; + + ITextVectorProperty VersionTP; + IText VersionT[5]; + + // Enable / Disable Tracking + ISwitchVectorProperty EnaTrackSP; + ISwitch EnaTrackS[1]; + int IsTracking=0; + + private: + int currentCatalog; + int currentSubCatalog; + +}; + + +#endif + diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/drivers.xml libindiQT/drivers.xml --- libindi_1.2.0/drivers.xml 2016-02-02 06:52:24.000000000 +0100 +++ libindiQT/drivers.xml 2016-08-02 15:51:14.158408936 +0200 @@ -19,6 +19,10 @@ indi_lx200_16 2.0 + ^M + indi_lx200_OnStep^M + 0.0^M + ^M indi_lx200gps 2.0 diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/.kdev4/libindi.kdev4 libindiQT/.kdev4/libindi.kdev4 --- libindi_1.2.0/.kdev4/libindi.kdev4 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/.kdev4/libindi.kdev4 2016-08-02 15:51:14.082408938 +0200 @@ -0,0 +1,20 @@ +[Buildset] +BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x0e\x00l\x00i\x00b\x00i\x00n\x00d\x00i) + +[CMake] +Build Directory Count=1 +Current Build Directory Index=0 +ProjectRootRelative=./ + +[CMake][CMake Build Directory 0] +Build Directory Path=file:///home/alain/Development/Indi/libindi/build +Build Type=Release +CMake Binary=file:///usr/bin/cmake +Environment Profile= +Extra Arguments= +Install Directory=file:///usr + +[Defines And Includes][Compiler] +Name=GCC +Path=gcc +Type=GCC diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/libindi.kdev4 libindiQT/libindi.kdev4 --- libindi_1.2.0/libindi.kdev4 1970-01-01 01:00:00.000000000 +0100 +++ libindiQT/libindi.kdev4 2016-08-02 15:51:14.082408938 +0200 @@ -0,0 +1,3 @@ +[Project] +Manager=KDevCMakeManager +Name=libindi diff -ruN '--exclude=build' --exclude CMakeLists.txt.user libindi_1.2.0/libs/indibase/.directory libindiQT/libs/indibase/.directory --- libindi_1.2.0/libs/indibase/.directory 2016-08-02 17:11:04.474267398 +0200 +++ libindiQT/libs/indibase/.directory 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2016,8,2,17,11,4 -Version=3 -ViewMode=1