PikeAero::CTaskTerminal Class Reference

#include <ctaskterminal.h>

Inheritance diagram for PikeAero::CTaskTerminal:

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

Collaboration graph
[legend]

Public Member Functions

virtual void clearAttributes ()
CCommunicationcomm ()
 CTaskTerminal (CCommunication *comm)
virtual void cursorMoveAbsolute (CMachine::ubit32 x, CMachine::ubit32 y)
virtual void cursorMoveBackward (CMachine::ubit32 n)
virtual void cursorMoveDown (CMachine::ubit32 n)
virtual void cursorMoveForward (CMachine::ubit32 n)
virtual void cursorMoveUp (CMachine::ubit32 n)
virtual void eraseDisplay ()
virtual void eraseLine ()
virtual CMachine::bit32 fault ()
bool fullDuplex ()
virtual CMachine::bit32 init ()
virtual bool iowait ()
virtual CMachine::bit32 run ()
virtual void setAttributeReverseVideo ()
virtual CMachine::bit32 start ()
virtual CMachine::bit32 stop ()
virtual ~CTaskTerminal ()

Protected Member Functions

CMachine::bit8CSI ()

Private Attributes

CCommunicationmComm
bool mFullDuplex

Detailed Description

Implements the Terminal Task

Author:
Michael Sharkey <mike@pikeaero.com>

Definition at line 199 of file ctaskterminal.h.


Constructor & Destructor Documentation

PikeAero::CTaskTerminal::CTaskTerminal ( CCommunication comm  ) 

Definition at line 25 of file ctaskterminal.cpp.

00026  : ITask()
00027  , mComm(comm)
00028  , mFullDuplex(true)
00029 {
00030 }

PikeAero::CTaskTerminal::~CTaskTerminal (  )  [virtual]

Definition at line 33 of file ctaskterminal.cpp.

00034 {
00035 }


Member Function Documentation

void PikeAero::CTaskTerminal::clearAttributes (  )  [virtual]

Clear text attributes.

Definition at line 178 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

Referenced by PikeAero::CTaskConsole::monitor().

00179 {
00180     CString s;
00181     comm()->tx(s.sprintf( "%s0m", CSI() ));
00182 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

CMachine::bit8* PikeAero::CTaskTerminal::CSI (  )  [inline, protected]

Definition at line 295 of file ctaskterminal.h.

Referenced by clearAttributes(), cursorMoveAbsolute(), cursorMoveBackward(), cursorMoveDown(), cursorMoveForward(), cursorMoveUp(), eraseDisplay(), eraseLine(), and setAttributeReverseVideo().

00295 {return "\033[";}

Here is the caller graph for this function:

void PikeAero::CTaskTerminal::cursorMoveAbsolute ( CMachine::ubit32  x,
CMachine::ubit32  y 
) [virtual]

Moves the cursor to the specified position (coordinates). If you do not specify a position, the cursor moves to the home position at the upper-left corner of the screen (line 0, column 0). This escape sequence works the same way as the following Cursor Position escape sequence.

Definition at line 101 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

Referenced by PikeAero::CTaskConsole::drawStatusBar(), and PikeAero::CTaskConsole::monitor().

00102 {
00103     CString s;
00104     comm()->tx(s.sprintf( "%s%d;%dH", CSI(), y, x ));
00105 }

Here is the call graph for this function:

Here is the caller graph for this function:

void PikeAero::CTaskTerminal::cursorMoveBackward ( CMachine::ubit32  n  )  [virtual]

Moves the cursor back by the specified number of columns without changing lines. If the cursor is already in the leftmost column, ANSI.SYS ignores this sequence.

Definition at line 141 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

00142 {
00143     CString s;
00144     comm()->tx(s.sprintf( "%s%dD", CSI(), n ));
00145 }

Here is the call graph for this function:

void PikeAero::CTaskTerminal::cursorMoveDown ( CMachine::ubit32  n  )  [virtual]

Moves the cursor down by the specified number of lines without changing columns. If the cursor is already on the bottom line, ANSI.SYS ignores this sequence.

Definition at line 121 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

00122 {
00123     CString s;
00124     comm()->tx(s.sprintf( "%s%dB", CSI(), n ));
00125 }

Here is the call graph for this function:

void PikeAero::CTaskTerminal::cursorMoveForward ( CMachine::ubit32  n  )  [virtual]

Moves the cursor forward by the specified number of columns without changing lines. If the cursor is already in the rightmost column, ANSI.SYS ignores this sequence.

Definition at line 131 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

00132 {
00133     CString s;
00134     comm()->tx(s.sprintf( "%s%dC", CSI(), n ));
00135 }

Here is the call graph for this function:

void PikeAero::CTaskTerminal::cursorMoveUp ( CMachine::ubit32  n  )  [virtual]

Moves the cursor up by the specified number of lines without changing columns. If the cursor is already on the top line, ANSI.SYS ignores this sequence.

Definition at line 111 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

00112 {
00113     CString s;
00114     comm()->tx(s.sprintf( "%s%dA", CSI(), n ));
00115 }

Here is the call graph for this function:

void PikeAero::CTaskTerminal::eraseDisplay (  )  [virtual]

Clears the screen and moves the cursor to the home position (line 0, column 0).

Definition at line 150 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

Referenced by PikeAero::CTaskConsole::commandTop().

00151 {
00152     CString s;
00153     comm()->tx(s.sprintf( "%s2J", CSI() ));
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:

void PikeAero::CTaskTerminal::eraseLine (  )  [virtual]

Clears all characters from the cursor position to the end of the line (including the character at the cursor position).

Definition at line 160 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

Referenced by PikeAero::CTaskConsole::drawCommandPrompt(), PikeAero::CTaskConsole::drawStatusBar(), and PikeAero::CTaskConsole::monitor().

00161 {
00162     CString s;
00163     comm()->tx(s.sprintf( "%sK", CSI() ));
00164 }

Here is the call graph for this function:

Here is the caller graph for this function:

CMachine::bit32 PikeAero::CTaskTerminal::fault (  )  [virtual]

The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, PikeAero::CTaskConsoleBase, and PikeAero::CTaskConsolePacket.

Definition at line 80 of file ctaskterminal.cpp.

00081 {
00082     return 0;
00083 }

bool PikeAero::CTaskTerminal::fullDuplex (  )  [inline]

Definition at line 293 of file ctaskterminal.h.

References mFullDuplex.

00293 {return mFullDuplex;}

CMachine::bit32 PikeAero::CTaskTerminal::init (  )  [virtual]

called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, PikeAero::CTaskConsoleBase, and PikeAero::CTaskConsolePacket.

Definition at line 42 of file ctaskterminal.cpp.

References PikeAero::ITask::PriorityLow, and PikeAero::ITask::setPriority().

00043 {
00044     setPriority( ITask::PriorityLow );
00045     return 0;
00046 } 

Here is the call graph for this function:

bool PikeAero::CTaskTerminal::iowait (  )  [virtual]

The CTaskScheduler::iowait() method will call the task's iowait method periodically to test if the task is still in an I/O wait state.

Returns:
true if still waiting on I/O, false otherwise.

Reimplemented from PikeAero::ITask.

Definition at line 90 of file ctaskterminal.cpp.

00091 {
00092     return false;
00093 }

CMachine::bit32 PikeAero::CTaskTerminal::run (  )  [virtual]

called periodically by CTaskScheduler to do a piece of work.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, PikeAero::CTaskConsoleBase, and PikeAero::CTaskConsolePacket.

Definition at line 61 of file ctaskterminal.cpp.

00062 {
00063     return 0;
00064 }

void PikeAero::CTaskTerminal::setAttributeReverseVideo (  )  [virtual]

Set reverse video.

Definition at line 169 of file ctaskterminal.cpp.

References comm(), CSI(), PikeAero::CString::sprintf(), and PikeAero::CCommunication::tx().

Referenced by PikeAero::CTaskConsole::monitor().

00170 {
00171     CString s;
00172     comm()->tx(s.sprintf( "%s7m", CSI() ));
00173 }

Here is the call graph for this function:

Here is the caller graph for this function:

CMachine::bit32 PikeAero::CTaskTerminal::start (  )  [virtual]

called exactly once. all tasks are initialized at this point. called just prior to first call to run()

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, PikeAero::CTaskConsoleBase, and PikeAero::CTaskConsolePacket.

Definition at line 52 of file ctaskterminal.cpp.

00053 {
00054     return 0;
00055 }

CMachine::bit32 PikeAero::CTaskTerminal::stop (  )  [virtual]

The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, PikeAero::CTaskConsoleBase, and PikeAero::CTaskConsolePacket.

Definition at line 70 of file ctaskterminal.cpp.

00071 {
00072     return 0;
00073 }


Field Documentation

Definition at line 297 of file ctaskterminal.h.

Referenced by comm().

Definition at line 298 of file ctaskterminal.h.

Referenced by fullDuplex().


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

Generated on Sun Oct 25 14:00:30 2009 for stingray3 by  doxygen 1.5.8