4.06.2013 - Version 0.3.4 - PIOBJECT() macro, ethernet improvement, documentation based on Doxygen
This commit is contained in:
21
piconsole.h
21
piconsole.h
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "pikbdlistener.h"
|
||||
#include "piprotocol.h"
|
||||
#include "pidiagnostics.h"
|
||||
#include "pisystemmonitor.h"
|
||||
#ifndef WINDOWS
|
||||
# include <sys/ioctl.h>
|
||||
@@ -32,8 +33,9 @@
|
||||
/// void clearVariables(bool clearScreen = true)
|
||||
/// void start(bool wait = false)
|
||||
/// void stop(bool clear = false)
|
||||
class PIConsole: public PIThread
|
||||
class PIP_EXPORT PIConsole: public PIThread
|
||||
{
|
||||
PIOBJECT(PIConsole)
|
||||
public:
|
||||
PIConsole(bool startNow = true, KBFunc slot = 0);
|
||||
~PIConsole();
|
||||
@@ -84,6 +86,7 @@ public:
|
||||
void addVariable(const PIString & name, const float * ptr, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addVariable(const PIString & name, const double * ptr, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addVariable(const PIString & name, const PIProtocol * ptr, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addVariable(const PIString & name, const PIDiagnostics * ptr, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addVariable(const PIString & name, const PISystemMonitor * ptr, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addBitVariable(const PIString & name, const void * ptr, int fromBit, int bitCount, int column = 1, PIFlags<PIConsole::Format> format = PIConsole::Normal);
|
||||
void addEmptyLine(int column = 1, uint count = 1);
|
||||
@@ -117,14 +120,14 @@ public:
|
||||
void setColumnAlignment(int col, Alignment align) {if (col < 0 || col >= columns().size_s()) return; column(col).alignment = align;}
|
||||
void setColumnAlignmentToAll(Alignment align) {piForeach (Tab & i, tabs) piForeach (Column & j, i.columns) j.alignment = align; fillLabels();}
|
||||
|
||||
EVENT_HANDLER0(PIConsole, void, clearVariables) {clearVariables(true);}
|
||||
EVENT_HANDLER1(PIConsole, void, clearVariables, bool, clearScreen) {if (clearScreen && isRunning()) {toUpperLeft(); clearScreenLower();} columns().clear();}
|
||||
EVENT_HANDLER0(void, clearVariables) {clearVariables(true);}
|
||||
EVENT_HANDLER1(void, clearVariables, bool, clearScreen) {if (clearScreen && isRunning()) {toUpperLeft(); clearScreenLower();} columns().clear();}
|
||||
|
||||
EVENT_HANDLER0(PIConsole, void, waitForFinish) {WAIT_FOR_EXIT}
|
||||
EVENT_HANDLER0(PIConsole, void, start) {start(false);}
|
||||
EVENT_HANDLER1(PIConsole, void, start, bool, wait) {PIThread::start(40); if (wait) waitForFinish();}
|
||||
EVENT_HANDLER0(PIConsole, void, stop) {stop(false);}
|
||||
EVENT_HANDLER1(PIConsole, void, stop, bool, clear);
|
||||
EVENT_HANDLER0(void, waitForFinish) {WAIT_FOR_EXIT}
|
||||
EVENT_HANDLER0(void, start) {start(false);}
|
||||
EVENT_HANDLER1(void, start, bool, wait) {PIThread::start(40); if (wait) waitForFinish();}
|
||||
EVENT_HANDLER0(void, stop) {stop(false);}
|
||||
EVENT_HANDLER1(void, stop, bool, clear);
|
||||
PIString fstr(PIFlags<PIConsole::Format> f);
|
||||
|
||||
void enableExitCapture(char key = 'Q') {listener->enableExitCapture(key);}
|
||||
@@ -273,7 +276,7 @@ private:
|
||||
Alignment def_align;
|
||||
KBFunc ret_func;
|
||||
int width, height, pwidth, pheight, ret, col_wid, num_format;
|
||||
uint my;
|
||||
uint max_y;
|
||||
uint cur_tab, col_cnt;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user