#include <ccommandhandler.h>


Definition at line 35 of file ccommandhandler.h.
Definition at line 40 of file ccommandhandler.h.
00041 { 00042 rcOK = 0, /** Normal / Okay. */ 00043 rcWrongArgCount = 1, /** Wrong number of arguments. */ 00044 rcOutOfRange = 2, /** An argument value was out of range. */ 00045 rcDataType = 3, /** An argument was the wrong data type. */ 00046 rcCommandNotFound = 4, /** An Invalid command. */ 00047 rcOpenFailed = 5, /** Open Failure. */ 00048 rcCommitFailed = 6, /** Commit Failure. */ 00049 rcBadCRC = 7, /** CRC Mismatch. */ 00050 rcBadSignature = 8, /** Bad Signature. */ 00051 rcMemoryFault = 9, /** A Memory Fault Was Detected. */ 00052 rcInvalidData =10, /** An argument contained invalid data. */ 00053 rcNotAvailable =11, /** Function is not available. */ 00054 } tReturnCode;
| PikeAero::CCommandHandler::CCommandHandler | ( | CCommunication * | comm, | |
| CTaskAggregator * | aggrigator | |||
| ) |
Definition at line 77 of file ccommandhandler.cpp.
00078 : inherited() 00079 , mComm(comm) 00080 , mAggregator(aggregator) 00081 { 00082 }
| PikeAero::CCommandHandler::~CCommandHandler | ( | ) | [virtual] |
| CTaskAggregator* PikeAero::CCommandHandler::aggregator | ( | ) | [inline] |
Definition at line 68 of file ccommandhandler.h.
References mAggregator.
Referenced by commandA(), commandOPEN(), and commandR().
00068 {return mAggregator;}

| CCommunication* PikeAero::CCommandHandler::comm | ( | ) | [inline] |
Definition at line 67 of file ccommandhandler.h.
References mComm.
Referenced by commandQM2C(), commandQM2S(), commandQMC(), commandQMDT(), commandQMS(), commandQSM2C(), commandQSM2S(), commandQSM2X(), commandQSM2Y(), commandQSMC(), commandQSMS(), commandQSMV(), commandSM2C(), commandSM2S(), commandSMC(), commandSMDT(), commandSMS(), commandSSM2C(), commandSSM2S(), commandSSM2X(), commandSSM2Y(), commandSSMC(), commandSSMS(), commandSSMV(), and replyReturn().
00067 {return mComm;}

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandA | ( | CArray< CString * > & | argv | ) | [private] |
Query an Analog input. "A:c".
Firmware Version
| rc | == return code. | |
| c | == channel. | |
| v | == value. |
Definition at line 161 of file ccommandhandler.cpp.
References aggregator(), PikeAero::CTaskAggregator::analog(), PikeAero::CArray< T >::at(), rcOK, rcOutOfRange, replyReturn(), and PikeAero::CString::toUBit32().
00162 { 00163 CMachine::ubit32 c = argv.at(1)->toUBit32(); 00164 CMachine::ubit32 v = ( c >= 0 && c <= 23) ? aggregator()->analog(c) : 0; 00165 tReturnCode rc = ( c >= 0 && c <= 23) ? rcOK : rcOutOfRange; 00166 return replyReturn( rc, "A:%d:%d:%d", rc, c, v ); 00167 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCLOSE | ( | CArray< CString * > & | argv | ) | [private] |
Close a record. "CLOSE:n".
Open a record
| n | == record number. | |
| rc | == return code. |
Definition at line 255 of file ccommandhandler.cpp.
References PikeAero::CArray< T >::at(), PikeAero::CConfiguration::close(), PikeAero::CMachine::config(), PikeAero::CMachine::numberOfConfigs(), rcOK, replyReturn(), and PikeAero::CString::toUBit32().
00256 { 00257 tReturnCode rc = rcOK; 00258 CMachine::ubit32 record = argv.at(2)->toUBit32(); 00259 if ( record < CMachine::numberOfConfigs() ) 00260 { 00261 CConfiguration* configuration = CMachine::config(record); 00262 CMachine::config()->close(); 00263 } 00264 return replyReturn( rc, "CLOSE:%d:%d", rc, record ); 00265 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCOMMIT | ( | CArray< CString * > & | argv | ) | [private] |
Commit the currently opened record. "COMMIT".
Close a record
| rc | == return code. |
Definition at line 272 of file ccommandhandler.cpp.
References PikeAero::CArray< T >::at(), PikeAero::CConfiguration::close(), PikeAero::CMachine::config(), PikeAero::CMachine::numberOfConfigs(), rcOK, replyReturn(), and PikeAero::CString::toUBit32().
00273 { 00274 tReturnCode rc = rcOK; 00275 CMachine::ubit32 record = argv.at(2)->toUBit32(); 00276 if ( record < CMachine::numberOfConfigs() ) 00277 { 00278 CConfiguration* configuration = CMachine::config(record); 00279 CMachine::config()->close(); 00280 } 00281 return replyReturn( rc, "CLOSE:%d:%d", rc, record ); 00282 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCOPY | ( | CArray< CString * > & | argv | ) | [private] |
Copy a record. "COPY:dst:src".
Erase a record
| src | == source record number. | |
| dst | == destination record number. | |
| rc | == return code. |
Definition at line 317 of file ccommandhandler.cpp.
References PikeAero::CArray< T >::at(), PikeAero::CConfiguration::close(), PikeAero::CMachine::config(), PikeAero::CConfiguration::copy(), PikeAero::CMachine::numberOfConfigs(), rcBadCRC, rcOK, rcOutOfRange, replyReturn(), PikeAero::CString::toUBit32(), and PikeAero::CConfiguration::valid().
00318 { 00319 tReturnCode rc = rcOK; 00320 CMachine::ubit32 dst = argv.at(1)->toUBit32(); 00321 CMachine::ubit32 src = argv.at(2)->toUBit32(); 00322 if ( dst < CMachine::numberOfConfigs() && src < CMachine::numberOfConfigs() ) 00323 { 00324 CConfiguration* dstConfig = CMachine::config(dst); 00325 CConfiguration* srcConfig = CMachine::config(src); 00326 if ( srcConfig->valid() ) 00327 { 00328 dstConfig->close(); 00329 srcConfig->close(); 00330 dstConfig->copy( *srcConfig ); 00331 } 00332 else 00333 { 00334 rc = rcBadCRC; 00335 } 00336 } 00337 else 00338 { 00339 rc = rcOutOfRange; 00340 } 00341 return replyReturn( rc, "COPY:%d:%d:%d", rc, dst, src ); 00342 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandERASE | ( | CArray< CString * > & | argv | ) | [private] |
Erase a record. "ERASE:n".
Commit a record
| n | == record number. | |
| rc | == return code. |
Definition at line 290 of file ccommandhandler.cpp.
References PikeAero::CArray< T >::at(), PikeAero::CConfiguration::close(), PikeAero::CMachine::config(), PikeAero::CConfiguration::initializeStorage(), PikeAero::CMachine::numberOfConfigs(), rcMemoryFault, rcOK, rcOutOfRange, replyReturn(), and PikeAero::CString::toUBit32().
00291 { 00292 tReturnCode rc = rcOK; 00293 CMachine::ubit32 record = argv.at(2)->toUBit32(); 00294 if ( record < CMachine::numberOfConfigs() ) 00295 { 00296 CConfiguration* configuration = CMachine::config(record); 00297 configuration->close(); 00298 if ( !configuration->initializeStorage() ) 00299 { 00300 rc = rcMemoryFault; 00301 } 00302 } 00303 else 00304 { 00305 rc = rcOutOfRange; 00306 } 00307 return replyReturn( rc, "ERASE:%d:%d", rc, record ); 00308 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandNOP | ( | CArray< CString * > & | argv | ) | [private] |
No Operation "NOP".
| rc | == return code. |
Definition at line 139 of file ccommandhandler.cpp.
References rcOK, and replyReturn().
00140 { 00141 return replyReturn( rcOK, "NOP:%d", rcOK ); 00142 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandOPEN | ( | CArray< CString * > & | argv | ) | [private] |
Open a record. "OPEN:m:n".
Which record is currently opened
| m | == mode [R|W]. | |
| n | == record number. | |
| rc | == return code. |
read
write
Definition at line 200 of file ccommandhandler.cpp.
References aggregator(), PikeAero::CArray< T >::at(), PikeAero::CConfiguration::close(), PikeAero::CMachine::config(), PikeAero::CMachine::numberOfConfigs(), PikeAero::CConfiguration::openRead(), PikeAero::CConfiguration::openWrite(), rcBadCRC, rcInvalidData, rcOK, rcOpenFailed, rcOutOfRange, replyReturn(), PikeAero::CTaskAggregator::rpm(), PikeAero::CMachine::setConfig(), PikeAero::CString::toUBit32(), and PikeAero::CConfiguration::valid().
00201 { 00202 tReturnCode rc = rcOK; 00203 CMachine::ubit32 record = argv.at(2)->toUBit32(); 00204 if ( record < CMachine::numberOfConfigs() ) 00205 { 00206 CConfiguration* configuration = CMachine::config(record); 00207 CMachine::config()->close(); 00208 if ( *(argv.at(1)) == "R" ) /** read */ 00209 { 00210 if ( configuration->openRead() ) 00211 { 00212 CMachine::setConfig(record); 00213 } 00214 else 00215 { 00216 rc = rcOpenFailed; 00217 } 00218 } 00219 else if ( *(argv.at(1)) == "W" ) 00220 { 00221 if ( configuration->valid() || (!configuration->valid() && aggregator()->rpm() < 1000) ) 00222 { 00223 if ( !configuration->openWrite() ) /** write */ 00224 { 00225 CMachine::setConfig(record); 00226 } 00227 else 00228 { 00229 rc = rcOpenFailed; 00230 } 00231 } 00232 else 00233 { 00234 rc = rcBadCRC; 00235 } 00236 } 00237 else 00238 { 00239 rc = rcInvalidData; 00240 } 00241 } 00242 else 00243 { 00244 rc = rcOutOfRange; 00245 } 00246 return replyReturn( rc, "OPEN:%d:%d", rc, record ); 00247 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQM2C | ( | CArray< CString * > & | argv | ) | [private] |
Query 2D Map Size
Query 2D Map Cell Value
Definition at line 462 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00463 { 00464 CString str; 00465 tReturnCode rc = rcOK; 00466 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00467 return rc; 00468 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQM2S | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled Map Scale Cell Value Un-Scaled 2D Map
Query 2D Map Size
Definition at line 453 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00454 { 00455 CString str; 00456 tReturnCode rc = rcOK; 00457 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00458 return rc; 00459 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQMC | ( | CArray< CString * > & | argv | ) | [private] |
Query Map Size
Query Map Cell Value
Definition at line 372 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00373 { 00374 CString str; 00375 tReturnCode rc = rcOK; 00376 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00377 return rc; 00378 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQMDT | ( | CArray< CString * > & | argv | ) | [private] |
Copy a record Map Data Types
Query Map Data Type
Definition at line 345 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00346 { 00347 CString str; 00348 tReturnCode rc = rcOK; 00349 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00350 return rc; 00351 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQMS | ( | CArray< CString * > & | argv | ) | [private] |
Set Map Data Type Un-Scaled 1D Map
Query Map Size
Definition at line 363 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00364 { 00365 CString str; 00366 tReturnCode rc = rcOK; 00367 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00368 return rc; 00369 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSM2C | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled 2D Map Size
Query Scaled 2D Map Cell Value
Definition at line 498 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00499 { 00500 CString str; 00501 tReturnCode rc = rcOK; 00502 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00503 return rc; 00504 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSM2S | ( | CArray< CString * > & | argv | ) | [private] |
Set 2D Map Cell Value Scaled 2D Map
Query Scaled 2D Map Size
Definition at line 489 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00490 { 00491 CString str; 00492 tReturnCode rc = rcOK; 00493 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00494 return rc; 00495 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSM2X | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled 2D Map Cell Value
Query Scaled Map Scale-X Cell Value
Definition at line 507 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00508 { 00509 CString str; 00510 tReturnCode rc = rcOK; 00511 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00512 return rc; 00513 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSM2Y | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled Map Scale-X Cell Value
Query Scaled Map Scale-Y Cell Value
Definition at line 516 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00517 { 00518 CString str; 00519 tReturnCode rc = rcOK; 00520 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00521 return rc; 00522 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSMC | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled Map Size
Query Scaled Map Cell Value
Definition at line 408 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00409 { 00410 CString str; 00411 tReturnCode rc = rcOK; 00412 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00413 return rc; 00414 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSMS | ( | CArray< CString * > & | argv | ) | [private] |
Set Map Cell Value Scaled 1D Map
Query Scaled Map Size
Definition at line 399 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00400 { 00401 CString str; 00402 tReturnCode rc = rcOK; 00403 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00404 return rc; 00405 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandQSMV | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled Map Cell Value
Query Scaled Map Scale Cell Value
Definition at line 417 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00418 { 00419 CString str; 00420 tReturnCode rc = rcOK; 00421 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00422 return rc; 00423 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandR | ( | CArray< CString * > & | argv | ) | [private] |
Query RPM. "R".
Analog
| rc | == return code. | |
| r | == rpm. |
Definition at line 175 of file ccommandhandler.cpp.
References aggregator(), rcOK, and replyReturn().
00176 { 00177 return replyReturn( rcOK, "R:%d:%d", rcOK, aggregator()->rpm() ); 00178 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSM2C | ( | CArray< CString * > & | argv | ) | [private] |
Set 2D Map Size
Set 2D Map Cell Value
Definition at line 480 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00481 { 00482 CString str; 00483 tReturnCode rc = rcOK; 00484 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00485 return rc; 00486 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSM2S | ( | CArray< CString * > & | argv | ) | [private] |
Query 2D Map Cell Value
Set 2D Map Size
Definition at line 471 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00472 { 00473 CString str; 00474 tReturnCode rc = rcOK; 00475 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00476 return rc; 00477 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSMC | ( | CArray< CString * > & | argv | ) | [private] |
Set Map Size
Set Map Cell Value
Definition at line 390 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00391 { 00392 CString str; 00393 tReturnCode rc = rcOK; 00394 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00395 return rc; 00396 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSMDT | ( | CArray< CString * > & | argv | ) | [private] |
Query Map Data Type
Set Map Data Type
Definition at line 354 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00355 { 00356 CString str; 00357 tReturnCode rc = rcOK; 00358 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00359 return rc; 00360 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSMS | ( | CArray< CString * > & | argv | ) | [private] |
Query Map Cell Value
Set Map Size
Definition at line 381 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00382 { 00383 CString str; 00384 tReturnCode rc = rcOK; 00385 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00386 return rc; 00387 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSM2C | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled 2D Map Size
Set Scaled 2D Map Cell Value
Definition at line 534 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00535 { 00536 CString str; 00537 tReturnCode rc = rcOK; 00538 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00539 return rc; 00540 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSM2S | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled Map Scale-Y Cell Value
Set Scaled 2D Map Size
Definition at line 525 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00526 { 00527 CString str; 00528 tReturnCode rc = rcOK; 00529 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00530 return rc; 00531 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSM2X | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled 2D Map Cell Value
Set Scaled Map Scale-X Cell Value
Definition at line 543 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00544 { 00545 CString str; 00546 tReturnCode rc = rcOK; 00547 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00548 return rc; 00549 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSM2Y | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled Map Scale-X Cell Value
Set Scaled Map Scale-Y Cell Value
Definition at line 552 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00553 { 00554 CString str; 00555 tReturnCode rc = rcOK; 00556 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00557 return rc; 00558 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSMC | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled Map Size
Set Scaled Map Cell Value
Definition at line 435 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00436 { 00437 CString str; 00438 tReturnCode rc = rcOK; 00439 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00440 return rc; 00441 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSMS | ( | CArray< CString * > & | argv | ) | [private] |
Query Scaled Map Scale Cell Value
Set Scaled Map Size
Definition at line 426 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00427 { 00428 CString str; 00429 tReturnCode rc = rcOK; 00430 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00431 return rc; 00432 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandSSMV | ( | CArray< CString * > & | argv | ) | [private] |
Set Scaled Map Cell Value
Set Scaled Map Scale Cell Value
Definition at line 444 of file ccommandhandler.cpp.
References comm(), rcOK, PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
00445 { 00446 CString str; 00447 tReturnCode rc = rcOK; 00448 comm()->txnl( str.sprintf( "NOP:%d", rc ) ); 00449 return rc; 00450 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandVERSION | ( | CArray< CString * > & | argv | ) | [private] |
No Operation "VERSION".
No Operation
| rc | == return code. |
Definition at line 149 of file ccommandhandler.cpp.
References rcOK, replyReturn(), and STINGRAY_VERSION.
00150 { 00151 return replyReturn( rcOK, ":VERSION:%d:%s", rcOK, STINGRAY_VERSION ); 00152 }

| CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandWHICH | ( | CArray< CString * > & | argv | ) | [private] |
Query the current configuration record. "WHICH".
RPM Records Management
| m | == mode [R|W]. | |
| n | == record number. | |
| rc | == return code. |
Definition at line 187 of file ccommandhandler.cpp.
References PikeAero::CMachine::config(), PikeAero::CMachine::configIndex(), rcOK, and replyReturn().
00188 { 00189 tReturnCode rc = rcOK; 00190 return replyReturn( rc, "WHICH:%d:%s:%d", rc, CMachine::config()->writable() ? "W" : "R", CMachine::configIndex() ); 00191 }

| CMachine::bit32 PikeAero::CCommandHandler::execute | ( | CArray< CString * > & | argv | ) |
Lookup the command in the mCommandMap[] table, and if found, execute the command.
| argv | Variable length argument list where index 0 is the command phrase. |
Yield once in a while....
Test for command found...
Test for argument count match...
Execute the command...
Definition at line 93 of file ccommandhandler.cpp.
References PikeAero::CArray< T >::at(), PikeAero::CCommandHandler::CCommandHandler::_tCommandMap::commandFn, PikeAero::CCommandHandler::CCommandHandler::_tCommandMap::commandStr, PikeAero::CArray< T >::count(), mCommandMap, rcCommandNotFound, rcOK, rcWrongArgCount, and PikeAero::CTaskScheduler::yield().
Referenced by PikeAero::CTaskConsolePacket::execute().
00094 { 00095 if ( argv.count() ) 00096 { 00097 CString command = *(argv.at(0)); 00098 for( int i=0; mCommandMap[i].commandStr != NULL; i++ ) 00099 { 00100 if ( (i & 0x07) == 7 ) /** Yield once in a while.... */ 00101 { 00102 CTaskScheduler::yield(); 00103 } 00104 if ( command == mCommandMap[i].commandStr ) /** Test for command found... */ 00105 { 00106 if ( mCommandMap[i].commandArgs+1 == argv.count() ) /** Test for argument count match... */ 00107 { 00108 return (CMachine::bit32) (this->*(mCommandMap[i].commandFn))( argv ); /** Execute the command... */ 00109 } 00110 else 00111 { 00112 return (CMachine::bit32) rcWrongArgCount; 00113 } 00114 } 00115 } 00116 return (CMachine::bit32) rcCommandNotFound; 00117 } 00118 return (CMachine::bit32) rcOK; 00119 }


| CCommandHandler::tReturnCode PikeAero::CCommandHandler::replyReturn | ( | tReturnCode | rc, | |
| CMachine::bit8 * | fmt, | |||
| ... | ||||
| ) | [protected] |
Reply the return string and return the result code.
Reply the return string over the communications channel, and return the result code.
result code tReturnCode.
Definition at line 125 of file ccommandhandler.cpp.
References comm(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::txnl().
Referenced by commandA(), commandCLOSE(), commandCOMMIT(), commandCOPY(), commandERASE(), commandNOP(), commandOPEN(), commandR(), commandVERSION(), and commandWHICH().
00126 { 00127 va_list ap; 00128 CString str; 00129 str.sprintf( fmt, ap ); 00130 comm()->txnl( str ); 00131 return rc; 00132 }


CCommunication* PikeAero::CCommandHandler::mComm [private] |
Set Scaled Map Scale-Y Cell Value
Definition at line 119 of file ccommandhandler.h.
Referenced by comm().
CCommandHandler::tCommandMap PikeAero::CCommandHandler::mCommandMap [static, private] |
1.5.8