[Kstars-devel] KDE/kdeedu/kstars/kstars

Jasem Mutlaq mutlaqja at ikarustech.com
Sun Nov 23 12:07:36 CET 2008


SVN commit 887896 by mutlaqja:

Fixing a bug with telescope wizard that prevented it from properly detecting and identifying telescopes.

CCMAIL:kstars-devel at kde.org



 M  +0 -4      data/clines.dat  
 M  +2 -2      detaildialog.cpp  
 M  +8 -2      devicemanager.cpp  
 M  +2 -2      indidevice.cpp  
 M  +1 -1      indielement.h  
 M  +0 -73     indimenu.cpp  
 M  +8 -0      indistd.cpp  
 M  +3 -2      kstarsactions.cpp  
 M  +5 -3      kstarsinit.cpp  
 M  +0 -1      kstarsui-indi.rc  
 M  +15 -9     telescopewizardprocess.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/data/clines.dat #887895:887896
@@ -4,11 +4,7 @@
 # GNU General Public License (GPL), Version 2:
 # http://www.gnu.org/licenses/gpl.html
 #
-# Much of the data for non-western sky cultures has been
-# obtained from Stellarium and incorporated into KStars
-# by Jérôme Sonrier. See README.sources for more information
 #
-#
 C Western
 # Andromeda
 M 358
--- trunk/KDE/kdeedu/kstars/kstars/detaildialog.cpp #887895:887896
@@ -852,10 +852,10 @@
         {
             indidev = imenu->managers.at(i)->indi_dev.at(j);
             indidev->stdDev->currentObject = NULL;
-            prop = indidev->findProp("EQUATORIAL_EOD_COORD");
+            prop = indidev->findProp("EQUATORIAL_EOD_COORD_REQUEST");
             if (prop == NULL)
             {
-                prop = indidev->findProp("EQUATORIAL_COORD");
+                prop = indidev->findProp("EQUATORIAL_EOD_COORD");
                 if (prop == NULL)
                 {
                     prop = indidev->findProp("HORIZONTAL_COORD");
--- trunk/KDE/kdeedu/kstars/kstars/devicemanager.cpp #887895:887896
@@ -84,7 +84,7 @@
         return;
       }
   
-    *serverProcess << "indiserver";
+    *serverProcess << Options::indiServer();
     *serverProcess << "-v" << "-p" << QString::number(port);
 
     foreach(IDevice *device, managed_devices)
@@ -131,6 +131,9 @@
    kDebug() << "Connection success!!";
     
    QTextStream serverFP(&serverSocket);
+   
+   foreach (IDevice *device, managed_devices)
+   		device->state = IDevice::DEV_START;
   
    if (XMLParser)
         delLilXML(XMLParser);
@@ -470,7 +473,10 @@
     {
         serverFP << QString("  <oneNumber\n");
         serverFP << QString("    name='%1'>\n").arg(qPrintable( lp->name));
-        serverFP << QString("      %1\n").arg(lp->targetValue);
+        if (lp->text.isEmpty())
+        	serverFP << QString("      %1\n").arg(lp->targetValue);
+        else
+        	serverFP << QString("      %1\n").arg(lp->text);
         serverFP << QString("  </oneNumber>\n");
     }
     serverFP << QString("</newNumberVector>\n");
--- trunk/KDE/kdeedu/kstars/kstars/indidevice.cpp #887895:887896
@@ -74,11 +74,11 @@
 #include <ktabwidget.h>
 #include <ktextedit.h>
 
-#define NINDI_STD	26
+#define NINDI_STD	27
 
 /* INDI standard property used across all clients to enable interoperability. */
 const char * indi_std[NINDI_STD] =
-    {"CONNECTION", "DEVICE_PORT", "TIME_UTC", "TIME_LST", "TIME_UTC_OFFSET" , "GEOGRAPHIC_COORD", "EQUATORIAL_COORD", "EQUATORIAL_EOD_COORD", "HORIZONTAL_COORD", "TELESCOPE_ABORT_MOTION", "ON_COORD_SET", "SOLAR_SYSTEM", "TELESCOPE_MOTION_NS", "TELESCOPE_MOTION_WE",  "TELESCOPE_PARK", "CCD_EXPOSURE", "CCD_TEMPERATURE", "CCD_FRAME", "CCD_FRAME_TYPE", "CCD_BINNING", "CCD_INFO", "VIDEO_STREAM", "FOCUS_SPEED", "FOCUS_MOTION", "FOCUS_TIMER", "FILTER_SLOT" };
+    {"CONNECTION", "DEVICE_PORT", "TIME_UTC", "TIME_LST", "TIME_UTC_OFFSET" , "GEOGRAPHIC_COORD", "EQUATORIAL_COORD", "EQUATORIAL_EOD_COORD", "EQUATORIAL_EOD_COORD_REQUEST", "HORIZONTAL_COORD", "TELESCOPE_ABORT_MOTION", "ON_COORD_SET", "SOLAR_SYSTEM", "TELESCOPE_MOTION_NS", "TELESCOPE_MOTION_WE",  "TELESCOPE_PARK", "CCD_EXPOSURE", "CCD_TEMPERATURE", "CCD_FRAME", "CCD_FRAME_TYPE", "CCD_BINNING", "CCD_INFO", "VIDEO_STREAM", "FOCUS_SPEED", "FOCUS_MOTION", "FOCUS_TIMER", "FILTER_SLOT" };
 
 /*******************************************************************
 ** INDI Device: The work-horse. Responsible for handling its
--- trunk/KDE/kdeedu/kstars/kstars/indielement.h #887895:887896
@@ -53,7 +53,7 @@
 /* INDI std properties */
 /* N.B. Need to modify corresponding entry in indidevice.cpp when changed */
 enum stdProperties { CONNECTION, DEVICE_PORT, TIME_UTC, TIME_LST, TIME_UTC_OFFSET, GEOGRAPHIC_COORD,   /* General */
-                     EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, HORIZONTAL_COORD,  /* Telescope */
+                     EQUATORIAL_COORD, EQUATORIAL_EOD_COORD, EQUATORIAL_EOD_COORD_REQUEST, HORIZONTAL_COORD,  /* Telescope */
                      TELESCOPE_ABORT_MOTION, ON_COORD_SET, SOLAR_SYSTEM, TELESCOPE_MOTION_NS, /* Telescope */
                      TELESCOPE_MOTION_WE, TELESCOPE_PARK,  /* Telescope */
                      CCD_EXPOSURE, CCD_TEMPERATURE, CCD_FRAME,           /* CCD */
--- trunk/KDE/kdeedu/kstars/kstars/indimenu.cpp #887895:887896
@@ -123,79 +123,6 @@
 	}
 }
 
-
-#if 0
-void INDIMenu::processServer(IDevice *device)
-{
-
-    DeviceManager *deviceManager;
-
-    // Devices ready to run but not yet managed
-    if (device->state && device->managed == false && device->mode == DeviceManager::M_LOCAL)
-      {
-            deviceManager = new DeviceManager(this);
-            connect(deviceManager, SIGNAL(newDevice(INDI_D *)), device, SLOT(startDeivceManager(DeviceManager *)));
-	    connect(deviceManager, SIGNAL(deviceManagerError(DeviceManager *)), this, SLOT(removeDeviceManager(DeivceManager*)));
-            connect(deviceManager, SIGNAL(newDevice(DeviceManager *)), this, SLOT(discoverDevice()));
-  
-            dev->indiConnect("localhost", QString::number(device->indiPort));
-     }
-     // Devices running and they need to be shutdown
-     else if (!device->state && device->managed == true && device->mode == DeviceManager::M_LOCAL)
-     {
-              device->managed = false;
-            removeDeviceManager(device->DeviceManager);
-              return true;
-  
-      }
-  }
-
-int INDIMenu::processClient(const QString &hostname, const QString &portnumber)
-{
-
-    DeviceManager *dev;
-    INDIDriver *drivers = ksw->indiDriver();
-
-    dev = new DeviceManager(this, managersCounter);
-    if (dev->indiConnect(hostname, portnumber))
-    {
-        managers.append(dev);
-        if (drivers)
-        {
-            connect(dev, SIGNAL(newDevice(DeviceManager *)), drivers, SLOT(updateMenuActions()));
-            connect(dev, SIGNAL(newDevice(DeviceManager *)), this, SLOT(discoverDevice(DeviceManager *)));
-        }
-    }
-    else
-    {
-        delete (dev);
-        return (-1);
-    }
-
-    managersCounter++;
-    return (managersCounter - 1);
-}
-
-void INDIMenu::removeDeviceMgr(int managersID)
-{
-
-    for (int i=0; i < managers.size(); i++)
-    {
-        if (managersID == managers.at(i)->managersID)
-        {
-            delete managers.takeAt(i);
-            emit driverDisconnected(managersID);
-        }
-    }
-
-    //FIXME try to hide unnecessary left over, only leave the msg box
-    // don't use KDialogBase.. just a regular QWidget will suffice
-    //if (managers.empty())
-    //deviceContainer->hide();
-}
-
-#endif 
-
 void INDIMenu::removeDeviceManager(DeviceManager *deviceManager)
 {
     if (deviceManager == NULL)
--- trunk/KDE/kdeedu/kstars/kstars/indistd.cpp #887895:887896
@@ -1065,9 +1065,17 @@
         {
         case 0:
             if (stdDev->currentObject)
+            {
+            	kDebug() << "standard object - RA: " << stdDev->currentObject->ra()->toHMSString()
+            	<< " DEC: " << stdDev->currentObject->dec()->toDMSString();  
                 sp.set (stdDev->currentObject->ra(), stdDev->currentObject->dec());
+            }
             else
+            {
                 sp.set (ksw->map()->clickedPoint()->ra(), ksw->map()->clickedPoint()->dec());
+                kDebug() << "Skymap click - RA: " << sp.ra()->toHMSString() <<
+                " DEC: " << sp.dec()->toDMSString();
+            }
 
             if (useJ2000)
                 sp.apparentCoord(ksw->data()->ut().djd(), (long double) J2000);
--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #887895:887896
@@ -298,8 +298,9 @@
 void KStars::slotTelescopeProperties()
 {
 #ifdef HAVE_INDI_H
-    telescopeProp scopeProp(this);
-    scopeProp.exec();
+	// TODO JM: redesign after KDE 4.2 is released.
+    //telescopeProp scopeProp(this);
+    //scopeProp.exec();
 #endif
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #887895:887896
@@ -387,13 +387,15 @@
     // devices Menu
 #ifdef HAVE_INDI_H
 #ifndef Q_WS_WIN
+
     ka = actionCollection()->addAction( "telescope_wizard");
     ka->setText( i18n("Telescope Wizard...") );
     connect( ka, SIGNAL( triggered() ), this, SLOT( slotTelescopeWizard() ) );
 
-    ka = actionCollection()->addAction( "telescope_properties");
-    ka->setText( i18n("Telescope Properties...") );
-    connect( ka, SIGNAL( triggered() ), this, SLOT( slotTelescopeProperties() ) );
+    // TODO redesign after KDE 4.2 is released
+    //ka = actionCollection()->addAction( "telescope_properties");
+    //ka->setText( i18n("Telescope Properties...") );
+    //connect( ka, SIGNAL( triggered() ), this, SLOT( slotTelescopeProperties() ) );
 
     ka = actionCollection()->addAction( "device_manager");
     ka->setText( i18n("Device Manager...") );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsui-indi.rc #887895:887896
@@ -58,7 +58,6 @@
 
 	<Menu name="devices" noMerge="1"><text>&amp;Devices</text>
 		<Action name="telescope_wizard" />
-		<Action name="telescope_properties" />
 		<Action name="device_manager" />
 		
 		<Separator />
--- trunk/KDE/kdeedu/kstars/kstars/telescopewizardprocess.cpp #887895:887896
@@ -81,8 +81,8 @@
     if (device->deviceType == KSTARS_TELESCOPE)
         ui->telescopeCombo->addItem(device->tree_label);
 
-    if ( !Options::telescopePort().isEmpty())
-        portList << Options::telescopePort();
+    //if ( !Options::telescopePort().isEmpty())
+       // portList << Options::telescopePort();
 
     portList << "/dev/ttyS0" <<  "/dev/ttyS1" << "/dev/ttyS2" << "/dev/ttyS3" << "/dev/ttyS4"
     << "/dev/ttyUSB0" << "/dev/ttyUSB1" << "/dev/ttyUSB2" << "/dev/ttyUSB3";
@@ -227,9 +227,8 @@
         indidriver->processLocalTree(IDevice::DEV_TERMINATE);
     }
 
-    // Set custome label for device
-    //indimenu->setCustomLabel(ui->telescopeCombo->currentText());
-    //currentDevice = indimenu->currentLabel;
+    // Get Unique Name
+    currentDevice = indimenu->getUniqueDeviceLabel(ui->telescopeCombo->currentText());
     // Select it
     indidriver->ui->localTreeWidget->setCurrentItem(driverItem);
     // Make sure we start is locally
@@ -238,6 +237,8 @@
     connect (indidriver, SIGNAL(newTelescope()), this, SLOT(processPort()));
     // Run it
     indidriver->processLocalTree(IDevice::DEV_START);
+    
+    kDebug() << "Processing device tree for " << ui->telescopeCombo->currentText();
 
     if (!indidriver->isDeviceRunning(ui->telescopeCombo->currentText()))
         return;
@@ -249,15 +250,16 @@
                                                 "attached telescopes.\nThis process might take few "
                                                 "minutes to complete."), Qt::Dialog);
         progressScan->progressBar()->setValue(0);
+        kDebug() << "KProgressDialog for automatic search has been initiated";
 
     }
     else
     {
         progressScan = new KProgressDialog(this, i18n("Telescope Wizard"), i18n("Please wait while KStars tries to connect to your telescope..."), Qt::Dialog);
         progressScan->progressBar()->setValue(portList.count());
+        kDebug() << "KProgressDialog for manual search has been initiated";
     }
-
-
+    
     progressScan->setAutoClose(true);
     progressScan->setAutoReset(true);
     progressScan->progressBar()->setMinimum(0);
@@ -271,6 +273,7 @@
     INDI_P * pp;
     INDI_E * lp;
 
+    
     if (!indidriver || !indimenu)
         return;
 
@@ -285,6 +288,8 @@
         return;
     }
 
+kDebug () << "New telescope discovered, processing port";
+
     indiDev = indimenu->findDeviceByLabel(currentDevice);
     if (!indiDev) return;
 
@@ -351,7 +356,8 @@
         KMessageBox::sorry(0, i18n("Sorry. KStars failed to detect any attached telescopes, please check your settings and try again."));
 
         linkRejected = true;
-        indidriver->processLocalTree(IDevice::DEV_TERMINATE);
+	//FIXME this causes crash
+        //indidriver->processLocalTree(IDevice::DEV_TERMINATE);
         Reset();
         return;
     }
@@ -390,7 +396,7 @@
 
 void telescopeWizardProcess::Reset()
 {
-
+    kDebug() << "Resetting";
     currentPort = -1;
     timeOutCount = 0;
 


More information about the Kstars-devel mailing list