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

Jasem Mutlaq mutlaqja at ikarustech.com
Mon Aug 1 22:50:51 CEST 2005


SVN commit 442176 by mutlaqja:

Adding telescope objects to the list of data objects in KStars data.
This will enable KStars to properly track telescopes across the skymap.

Run 'svn up' to get the latest updates.

CCMAIL: kstars-devel at kde.org
CCMAIL: dougp at intermind.net


 M  +6 -0      indi/lx200basic.cpp  
 M  +2 -1      indiproperty.cpp  
 M  +13 -7     indistd.cpp  
 M  +1 -0      kspopupmenu.cpp  
 M  +9 -0      kstarsdata.cpp  
 M  +6 -0      kstarsdata.h  
 M  +1 -1      skymapdraw.cpp  


--- branches/KDE/3.5/kdeedu/kstars/kstars/indi/lx200basic.cpp #442175:442176
@@ -780,8 +780,14 @@
          PowerS[0].s = ISS_OFF;
 	 PowerS[1].s = ISS_ON;
          PowerSP.s = IPS_IDLE;
+	 if (simulation)
+         {
+	    IDSetSwitch (&PowerSP, "Simulated Telescope is offline.");
+	    return;
+         }
          IDSetSwitch (&PowerSP, "Telescope is offline.");
 	 IDLog("Telescope is offline.");
+         
 	 Disconnect();
 	 break;
 
--- branches/KDE/3.5/kdeedu/kstars/kstars/indiproperty.cpp #442175:442176
@@ -217,9 +217,10 @@
  }
 
  /* Another special case, center telescope */
- if (assosiatedPopup->text(id) == i18n("Center Telescope"))
+ if (assosiatedPopup->text(id) == i18n("Center && Track Crosshair"))
  {
         if (!indistd->stdDev->dp->isOn()) return;
+	if (indistd->stdDev->telescopeSkyObject == NULL) return;
 	indistd->ksw->map()->setClickedObject(indistd->stdDev->telescopeSkyObject);
 	indistd->ksw->map()->setClickedPoint(indistd->stdDev->telescopeSkyObject);
 	indistd->ksw->map()->slotCenter();
--- branches/KDE/3.5/kdeedu/kstars/kstars/indistd.cpp #442175:442176
@@ -72,10 +72,10 @@
 	 
    devTimer 		= new QTimer(this);
    seqLister		= new KDirLister();
+   
    telescopeSkyObject   = new SkyObject(0, 0, 0, 0, i18n("Telescope"));
-
-   telescopeSkyObject->EquatorialToHorizontal(ksw->LST(), ksw->geo()->lat());
-   
+   ksw->data()->appendTelescopeObject(telescopeSkyObject);
+	
    connect( devTimer, SIGNAL(timeout()), this, SLOT(timerDone()) );
    connect( seqLister, SIGNAL(newItems (const KFileItemList & )), this, SLOT(checkSeqBoundary(const KFileItemList &)));
    
@@ -93,7 +93,6 @@
    CCDPreviewWindow->close();
    streamDisabled();
    delete (seqLister);
-   delete (telescopeSkyObject);
  }
  
 void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString dataFormat)
@@ -303,6 +302,7 @@
 
        case EQUATORIAL_COORD:
        case EQUATORIAL_EOD_COORD:
+	if (!dp->isOn()) break;
 	el = pp->findElement("RA");
 	if (!el) return;
 	telescopeSkyObject->setRA(el->value);
@@ -314,6 +314,7 @@
 	break;
 
 	case HORIZONTAL_COORD:
+        if (!dp->isOn()) break;
 	el = pp->findElement("ALT");
 	if (!el) return;
 	telescopeSkyObject->setAlt(el->value);
@@ -349,8 +350,8 @@
       {
         initDeviceOptions();
 	emit linkAccepted();
-	
-	imgProp = dp->findProp("CCD_EXPOSE_DURATION");
+
+        imgProp = dp->findProp("CCD_EXPOSE_DURATION");
 	if (imgProp)
 	{
         	tmpAction = ksw->actionCollection()->action("capture_sequence");
@@ -372,7 +373,12 @@
 	    //close(streamFD);
 	}
 	
-	
+	if (ksw->map()->focusObject() == telescopeSkyObject)
+	{
+		ksw->map()->stopTracking();
+		ksw->map()->setFocusObject(NULL);
+	}
+
 	drivers->updateMenuActions();
        	ksw->map()->forceUpdateNow();
         emit linkRejected();
--- branches/KDE/3.5/kdeedu/kstars/kstars/kspopupmenu.cpp #442175:442176
@@ -216,6 +216,7 @@
  		else   	
 			prop = dev->findElem("ALT")->pp;
 
+		prop->assosiatedPopup = menuDevice;
 		QObject::connect(menuDevice, SIGNAL(activated(int)), prop, SLOT(convertSwitch(int)));	
 	}
        } // end device
--- branches/KDE/3.5/kdeedu/kstars/kstars/kstarsdata.cpp #442175:442176
@@ -122,6 +122,7 @@
 
 	VariableStarsList.setAutoDelete(TRUE);
 	INDIHostsList.setAutoDelete(TRUE);
+	INDITelescopeList.setAutoDelete(TRUE);
 
 	//Initialize object type strings
 	TypeName[0] = i18n( "star" );
@@ -2201,6 +2202,9 @@
 			}
 		}
 
+		for (SkyObject *o = INDITelescopeList.first(); o; o = INDITelescopeList.next())
+			o->EquatorialToHorizontal(LST, geo->lat());
+
 		//Update focus
 		skymap->updateFocus();
 
@@ -2535,6 +2539,11 @@
 	return false;
 }
 
+void KStarsData::appendTelescopeObject(SkyObject * object)
+{
+  INDITelescopeList.append(object);
+}
+
 void KStarsData::saveTimeBoxShaded( bool b ) { Options::setShadeTimeBox( b ); }
 void KStarsData::saveGeoBoxShaded( bool b ) { Options::setShadeGeoBox( b ); }
 void KStarsData::saveFocusBoxShaded( bool b ) { Options::setShadeFocusBox( b ); }
--- branches/KDE/3.5/kdeedu/kstars/kstars/kstarsdata.h #442175:442176
@@ -545,6 +545,11 @@
 
 	bool useDefaultOptions, startupComplete;
 
+	/**@short Appends telescope sky object to the list of INDI telescope objects. This enables KStars to track all telescopes properly.
+		*@param object pointer to telescope sky object
+	*/
+	void appendTelescopeObject(SkyObject * object);
+
 signals:
 	/**Signal that specifies the text that should be drawn in the KStarsSplash window.
 		*/
@@ -710,6 +715,7 @@
 	QPtrList<VariableStarInfo> VariableStarsList;
 	QPtrList<ADVTreeData> ADVtreeList;
 	QPtrList<INDIHostsInfo> INDIHostsList;
+	QPtrList<SkyObject> INDITelescopeList;
 	
 	QPtrList<CustomCatalog> CustomCatalogs;
 
--- branches/KDE/3.5/kdeedu/kstars/kstars/skymapdraw.cpp #442175:442176
@@ -235,7 +235,7 @@
 							indi_sp.apparentCoord( (double) J2000, ksw->data()->ut().djd());
 						}
 							
-						indi_sp.EquatorialToHorizontal( ksw->LST(), ksw->geo()->lat() );
+						if ( Options::useAltAz() ) indi_sp.EquatorialToHorizontal( ksw->LST(), ksw->geo()->lat() );
 
 						}
 


More information about the Kstars-devel mailing list