Changeset 7788 for trunk/MagicSoft/Cosy/tcpip
- Timestamp:
- 07/12/06 03:00:16 (18 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r7764 r7788 118 118 } 119 119 120 bool MDriveCom::CommandPREPS(TString &str) 121 { 122 str = str.Strip(TString::kBoth); 123 if (str.IsNull()) 124 { 125 cout << "ERROR - No identifier for preposition (PREPS) given." << endl; 126 return false; 127 } 128 if (str.First(' ')>=0) 129 { 130 cout << "ERROR - PREPS command syntax error (contains whitespaces)." << endl; 131 return false; 132 } 133 134 str.ToLower(); 135 136 cout << "CC-COMMAND " << MTime(-1) << " PREPS '" << str << "'" << endl; 137 138 //cout << "MDriveCom - TRACK... start." << endl; 139 fQueue->PostMsg(WM_PREPS, (void*)str.Data(), str.Length()+1); 140 //cout << "MDriveCom - TRACK... done." << endl; 141 return true; 142 } 143 144 bool MDriveCom::CommandARM(TString &str) 145 { 146 str = str.Strip(TString::kBoth); 147 if (str.IsNull()) 148 { 149 cout << "ERROR - No identifier for ARM command." << endl; 150 return false; 151 } 152 if (str.First(' ')>=0) 153 { 154 cout << "ERROR - ARM command syntax error (contains whitespaces)." << endl; 155 return false; 156 } 157 158 str.ToLower(); 159 if (str!="lock" && str!="unlock") 160 { 161 cout << "ERROR - ARM command syntax error (neither LOCK nor UNLOCK)." << endl; 162 return false; 163 } 164 165 cout << "CC-COMMAND " << MTime(-1) << " ARM '" << str << "'" << endl; 166 167 bool lock = str=="lock"; 168 169 fQueue->PostMsg(WM_ARM, &lock, sizeof(lock)); 170 return true; 171 } 172 120 173 bool MDriveCom::InterpreteCmd(TString cmd, TString str) 121 174 { … … 148 201 149 202 if (cmd==(TString)"PREPS") 150 { 151 cout << "Prepos: " << str << endl; 152 return true; 153 } 203 return CommandPREPS(str); 154 204 155 205 if (cmd.IsNull() && str.IsNull()) -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r7764 r7788 25 25 bool CommandGRB(TString &str); 26 26 bool CommandZDAZ(TString &str); 27 bool CommandPREPS(TString &str); 28 bool CommandARM(TString &str); 27 29 28 30 public: … … 46 48 47 49 #endif 48 49 50 51 52 53 54 55 56 57 58
Note:
See TracChangeset
for help on using the changeset viewer.