PikeAero::CCommandHandler Class Reference

#include <ccommandhandler.h>

Inheritance diagram for PikeAero::CCommandHandler:

Inheritance graph
[legend]
Collaboration diagram for PikeAero::CCommandHandler:

Collaboration graph
[legend]

Data Structures

struct  _tCommandMap

Public Types


Public Member Functions

CTaskAggregatoraggregator ()
 CCommandHandler (CCommunication *comm, CTaskAggregator *aggrigator)
CCommunicationcomm ()
CMachine::bit32 execute (CArray< CString * > &argv)
 Lookup the command in the mCommandMap[] table, and if found, execute the command.
virtual ~CCommandHandler ()

Protected Member Functions

tReturnCode replyReturn (tReturnCode rc, CMachine::bit8 *fmt,...)
 Reply the return string and return the result code.

Private Member Functions

tReturnCode commandA (CArray< CString * > &argv)
 Query an Analog input. "A:c".
tReturnCode commandCLOSE (CArray< CString * > &argv)
 Close a record. "CLOSE:n".
tReturnCode commandCOMMIT (CArray< CString * > &argv)
 Commit the currently opened record. "COMMIT".
tReturnCode commandCOPY (CArray< CString * > &argv)
 Copy a record. "COPY:dst:src".
tReturnCode commandERASE (CArray< CString * > &argv)
 Erase a record. "ERASE:n".
tReturnCode commandNOP (CArray< CString * > &argv)
 No Operation "NOP".
tReturnCode commandOPEN (CArray< CString * > &argv)
 Open a record. "OPEN:m:n".
tReturnCode commandQM2C (CArray< CString * > &argv)
tReturnCode commandQM2S (CArray< CString * > &argv)
tReturnCode commandQMC (CArray< CString * > &argv)
tReturnCode commandQMDT (CArray< CString * > &argv)
tReturnCode commandQMS (CArray< CString * > &argv)
tReturnCode commandQSM2C (CArray< CString * > &argv)
tReturnCode commandQSM2S (CArray< CString * > &argv)
tReturnCode commandQSM2X (CArray< CString * > &argv)
tReturnCode commandQSM2Y (CArray< CString * > &argv)
tReturnCode commandQSMC (CArray< CString * > &argv)
tReturnCode commandQSMS (CArray< CString * > &argv)
tReturnCode commandQSMV (CArray< CString * > &argv)
tReturnCode commandR (CArray< CString * > &argv)
 Query RPM. "R".
tReturnCode commandSM2C (CArray< CString * > &argv)
tReturnCode commandSM2S (CArray< CString * > &argv)
tReturnCode commandSMC (CArray< CString * > &argv)
tReturnCode commandSMDT (CArray< CString * > &argv)
tReturnCode commandSMS (CArray< CString * > &argv)
tReturnCode commandSSM2C (CArray< CString * > &argv)
tReturnCode commandSSM2S (CArray< CString * > &argv)
tReturnCode commandSSM2X (CArray< CString * > &argv)
tReturnCode commandSSM2Y (CArray< CString * > &argv)
tReturnCode commandSSMC (CArray< CString * > &argv)
tReturnCode commandSSMS (CArray< CString * > &argv)
tReturnCode commandSSMV (CArray< CString * > &argv)
tReturnCode commandVERSION (CArray< CString * > &argv)
 No Operation "VERSION".
tReturnCode commandWHICH (CArray< CString * > &argv)
 Query the current configuration record. "WHICH".

Private Attributes

CTaskAggregatormAggregator
CCommunicationmComm

Static Private Attributes

static tCommandMap mCommandMap []

Detailed Description

Handle user interface commands.
Author:
Michael Sharkey <mike@pikeaero.com>

Definition at line 35 of file ccommandhandler.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
rcOK 
rcWrongArgCount  Normal / Okay.
rcOutOfRange  Wrong number of arguments.
rcDataType  An argument value was out of range.
rcCommandNotFound  An argument was the wrong data type.
rcOpenFailed  An Invalid command.
rcCommitFailed  Open Failure.
rcBadCRC  Commit Failure.
rcBadSignature  CRC Mismatch.
rcMemoryFault  Bad Signature.
rcInvalidData  A Memory Fault Was Detected.
rcNotAvailable  An argument contained invalid data.

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;


Constructor & Destructor Documentation

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]

Definition at line 84 of file ccommandhandler.cpp.

00085 {
00086 }


Member Function Documentation

CTaskAggregator* PikeAero::CCommandHandler::aggregator (  )  [inline]

Definition at line 68 of file ccommandhandler.h.

References mAggregator.

Referenced by commandA(), commandOPEN(), and commandR().

00068 {return mAggregator;}

Here is the caller graph for this function:

CCommunication* PikeAero::CCommandHandler::comm (  )  [inline]

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandA ( CArray< CString * > &  argv  )  [private]

Query an Analog input. "A:c".

Firmware Version

Parameters:
rc == return code.
c == channel.
v == value.
Returns:
"A:rc:c:v"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCLOSE ( CArray< CString * > &  argv  )  [private]

Close a record. "CLOSE:n".

Open a record

Parameters:
n == record number.
rc == return code.
Returns:
"CLOSE:rc:n"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCOMMIT ( CArray< CString * > &  argv  )  [private]

Commit the currently opened record. "COMMIT".

Close a record

Parameters:
rc == return code.
Returns:
"COMMIT:rc"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandCOPY ( CArray< CString * > &  argv  )  [private]

Copy a record. "COPY:dst:src".

Erase a record

Parameters:
src == source record number.
dst == destination record number.
rc == return code.
Returns:
"COPY:dst:src"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandERASE ( CArray< CString * > &  argv  )  [private]

Erase a record. "ERASE:n".

Commit a record

Parameters:
n == record number.
rc == return code.
Returns:
"ERASE:rc:n"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandNOP ( CArray< CString * > &  argv  )  [private]

No Operation "NOP".

Parameters:
rc == return code.
Returns:
"NOP:rc"

Definition at line 139 of file ccommandhandler.cpp.

References rcOK, and replyReturn().

00140 {
00141     return replyReturn( rcOK, "NOP:%d", rcOK );
00142 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandOPEN ( CArray< CString * > &  argv  )  [private]

Open a record. "OPEN:m:n".

Which record is currently opened

Parameters:
m == mode [R|W].
n == record number.
rc == return code.
Returns:
"OPEN:rc:n"

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandR ( CArray< CString * > &  argv  )  [private]

Query RPM. "R".

Analog

Parameters:
rc == return code.
r == rpm.
Returns:
"R:rc: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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandVERSION ( CArray< CString * > &  argv  )  [private]

No Operation "VERSION".

No Operation

Parameters:
rc == return code.
Returns:
"VERSION:rc:version"

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 }

Here is the call graph for this function:

CCommandHandler::tReturnCode PikeAero::CCommandHandler::commandWHICH ( CArray< CString * > &  argv  )  [private]

Query the current configuration record. "WHICH".

RPM Records Management

Parameters:
m == mode [R|W].
n == record number.
rc == return code.
Returns:
"WHICH:rc:[R|W]:n"

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 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CCommandHandler::execute ( CArray< CString * > &  argv  ) 

Lookup the command in the mCommandMap[] table, and if found, execute the command.

Parameters:
argv Variable length argument list where index 0 is the command phrase.
Returns:
return code from executing the command or reason for failure to execute the command.

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns:
tReturnCode.

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 }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

Definition at line 120 of file ccommandhandler.h.

Referenced by aggregator().

Set Scaled Map Scale-Y Cell Value

Definition at line 119 of file ccommandhandler.h.

Referenced by comm().

Definition at line 121 of file ccommandhandler.h.

Referenced by execute().


The documentation for this class was generated from the following files:

Generated on Sun Oct 25 13:59:51 2009 for stingray3 by  doxygen 1.5.8