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

Jasem Mutlaq mutlaqja at ikarustech.com
Wed Sep 15 19:38:11 CEST 2010


SVN commit 1175723 by mutlaqja:

Enable user to select whether KStars may receive binary data transfers from a driver or not.

CCMAIL:kstars-devel at kde.org



 M  +12 -1     devicemanager.cpp  
 M  +1 -0      devicemanager.h  
 M  +17 -0     indidevice.cpp  
 M  +2 -0      indidevice.h  
 M  +1 -1      indimenu.cpp  
 M  +0 -4      indimenu.h  


--- trunk/KDE/kdeedu/kstars/kstars/indi/devicemanager.cpp #1175722:1175723
@@ -128,6 +128,16 @@
    connectionError();
   }
   
+void DeviceManager::enableBLOB(bool enable)
+{
+    QTextStream serverFP(&serverSocket);
+
+    if (enable)
+        serverFP << QString("<enableBLOB>Also</enableBLOB>\n");
+    else
+        serverFP << QString("<enableBLOB>Never</enableBLOB>\n");
+}
+
 void DeviceManager::connectionSuccess()
 {
    QTextStream serverFP(&serverSocket);
@@ -139,7 +149,8 @@
         delLilXML(XMLParser);
     XMLParser = newLilXML();
 
-    serverFP << QString("<enableBLOB>Also</enableBLOB>\n");
+    enableBLOB(true);
+
     serverFP << QString("<getProperties version='%1'/>\n").arg(INDIVERSION);
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/indi/devicemanager.h #1175722:1175723
@@ -77,6 +77,7 @@
     void appendManagedDevices(QList<IDevice *> & processed_devices);
     void startServer();
     void connectToServer();
+    void enableBLOB(bool enable);
 
     QString getServerBuffer() { return serverBuffer; }
 
--- trunk/KDE/kdeedu/kstars/kstars/indi/indidevice.cpp #1175722:1175723
@@ -100,6 +100,12 @@
     msgST_w        	= new KTextEdit();
     msgST_w->setReadOnly(true);
   
+    enableBLOBC = new QCheckBox(i18n("Binary Transfer"));
+    enableBLOBC->setChecked(true);
+    enableBLOBC->setToolTip(i18n("Enable binary data transfer from driver to KStars and vica versa"));
+
+    connect(enableBLOBC, SIGNAL(stateChanged(int)), this, SLOT(setBLOBOption(int)));
+  
     dataBuffer 		= (unsigned char *) malloc (1);
   
     stdDev 		= new INDIStdDevice(this, parent->ksw);
@@ -110,6 +116,7 @@
 
     deviceVBox->addWidget(groupContainer);
     deviceVBox->addWidget(msgST_w);
+    deviceVBox->addWidget(enableBLOBC);
 
     parent->mainTabWidget->addTab(deviceVBox, label);
 }
@@ -1100,5 +1107,15 @@
 
 }
 
+void INDI_D::setBLOBOption(int state)
+{
+    if (deviceManager == NULL)
+        return;
 
+    if (state == Qt::Checked)
+        deviceManager->enableBLOB(true);
+    else
+        deviceManager->enableBLOB(false);
+}
+
 #include "indidevice.moc"
--- trunk/KDE/kdeedu/kstars/kstars/indi/indidevice.h #1175722:1175723
@@ -70,6 +70,7 @@
     QTabWidget  *groupContainer;	/* Groups within the device */
     QTextEdit	*msgST_w;		/* scrolled text for messages */
     unsigned char *dataBuffer;          /* Generic buffer */
+    QCheckBox    *enableBLOBC;
 
     INDIStdDevice  *stdDev;
 
@@ -142,6 +143,7 @@
 
 public slots:
     void engageTracking();
+    void setBLOBOption(int state);
 
 
 
--- trunk/KDE/kdeedu/kstars/kstars/indi/indimenu.cpp #1175722:1175723
@@ -79,7 +79,6 @@
     buttonLayout->addWidget(clearB, 0, Qt::AlignRight);
     buttonLayout->addWidget(closeB, 0, Qt::AlignRight);
 
-    
     mainLayout->addLayout(buttonLayout);
 
     connect(closeB, SIGNAL(clicked()), this, SLOT(close()));
@@ -205,4 +204,5 @@
 
 }
 
+
 #include "indimenu.moc"
--- trunk/KDE/kdeedu/kstars/kstars/indi/indimenu.h #1175722:1175723
@@ -68,12 +68,8 @@
     void stopDeviceManager(QList<IDevice *> &processed_devices);
 
   private:
-
-
     QPushButton  *clearB;
     QPushButton  *closeB;
-
-
     QString currentDevice;
   
   public slots:


More information about the Kstars-devel mailing list