Index: trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc	(revision 8847)
+++ trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc	(revision 8869)
@@ -61,5 +61,6 @@
 
     //cout << "MDriveCom - TRACK... start." << endl;
-    fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
+    if (fQueue)
+        fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
     //cout << "MDriveCom - TRACK... done." << endl;
     return true;
@@ -87,5 +88,6 @@
 
     //cout << "MDriveCom - TRACK... start." << endl;
-    fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
+    if (fQueue)
+        fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
     //cout << "MDriveCom - TRACK... done." << endl;
     return true;
@@ -112,5 +114,6 @@
 
     //cout << "MDriveCom - POSITION... start." << endl;
-    fQueue->PostMsg(WM_POSITION, &za, sizeof(za));
+    if (fQueue)
+        fQueue->PostMsg(WM_POSITION, &za, sizeof(za));
     //cout << "MDriveCom - POSITION... done." << endl;
     return true;
@@ -136,6 +139,13 @@
 
     //cout << "MDriveCom - TRACK... start." << endl;
-    fQueue->PostMsg(WM_PREPS, (void*)str.Data(), str.Length()+1);
+    if (fQueue)
+        fQueue->PostMsg(WM_PREPS, (void*)str.Data(), str.Length()+1);
     //cout << "MDriveCom - TRACK... done." << endl;
+    return true;
+}
+
+bool MDriveCom::CommandTPOINT(TString &str)
+{
+    cout << "CC-COMMAND " << MTime(-1) << " TPOIN " << str << endl;
     return true;
 }
@@ -166,5 +176,6 @@
     bool lock = str=="lock";
 
-    fQueue->PostMsg(WM_ARM, &lock, sizeof(lock));
+    if (fQueue)
+        fQueue->PostMsg(WM_ARM, &lock, sizeof(lock));
     return true;
 }
@@ -176,5 +187,6 @@
         //cout << "MDriveCom - WAIT... start." << endl;
         cout << "CC-COMMAND " << MTime(-1) << " WAIT" << endl;
-        fQueue->PostMsg(WM_WAIT);
+        if (fQueue)
+            fQueue->PostMsg(WM_WAIT);
         //cout << "MDriveCom - WAIT... done." << endl;
         return true;
@@ -185,5 +197,6 @@
         //cout << "MDriveCom - STOP!... start." << endl;
         cout << "CC-COMMAND " << MTime(-1) << " STOP!" << endl;
-        fQueue->PostMsg(WM_STOP);
+        if (fQueue)
+            fQueue->PostMsg(WM_STOP);
         //cout << "MDriveCom - STOP!... done." << endl;
         return true;
@@ -202,4 +215,10 @@
         return CommandPREPS(str);
 
+    if (cmd==(TString)"TPOIN")
+        return CommandTPOINT(str);
+
+    if (cmd==(TString)"ARM")
+        return CommandARM(str);
+
     if (cmd.IsNull() && str.IsNull())
     {
@@ -223,5 +242,5 @@
 }
 
-bool MDriveCom::SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er)
+bool MDriveCom::SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er, Bool_t armed)
 {
     // rd [rad]
@@ -259,5 +278,6 @@
     Print(str, is.Az());
     str += txt.Print("%08.3f ", er.Zd());
-    str += txt.Print("%08.3f", er.Az());
+    str += txt.Print("%08.3f ", er.Az());
+    str += armed ? "1 " : "0 ";
 
     return SendRep("DRIVE-REPORT", str, kFALSE);
@@ -303,2 +323,39 @@
     return SendRep("STARG-REPORT", str, kTRUE);
 }
+
+bool MDriveCom::SendTPoint(UInt_t stat)
+{
+    /*
+    // miss   [deg]
+    // nompos [deg]
+    const MTime t(-1);
+
+    miss *= 60;        // [arcmin]
+
+    // Set status flag
+    if (stat&kError)
+        SetStatus(0);
+    if (stat&kStandby)
+        SetStatus(2);
+    if (stat&kMonitoring)
+        SetStatus(4);
+    
+    MString txt;
+
+    TString str;
+    str += txt.Print("%05.3f ", miss.Zd());       //[arcmin]
+    str += txt.Print("%05.3f ", miss.Az());       //[arcmin]
+    Print(str, nompos.Zd());                      //[deg]
+    Print(str, nompos.Az());                      //[deg]
+    str += txt.Print("%05.1f ",   center.GetX()); //number
+    str += txt.Print("%05.1f ",   center.GetY()); //number
+    str += txt.Print("%04d ",   n);               //number of correleated stars
+    str += txt.Print("%03.1f ",  bright);
+    str += txt.Print("%12.6f ", t.GetMjd());      // mjd
+    str += txt.Print("%.1f ", x);
+    str += txt.Print("%.1f ", y);
+    str += txt.Print("%04d ", num);               //number of detected stars
+    */
+
+    return SendRep("TPOINT-REPORT", "", kTRUE);
+}
