Source code for /engineering/SERIAL-TEST/WINDOWS.HOriginal file WINDOWS.H
   1 // --------------------------------------------------------------------------
   2 // --
   3 // -- WINDOWS -- All the window handlers.
   4 // --
   5 // --
   6 // --------------------------------------------------------------------------
   7 
   8 // --------------------------------------------------------------------------
   9 // -- Definitions
  10 // --------------------------------------------------------------------------
  11 
  12 // -- Basic types ----
  13 
  14 
  15 
  16 // -- Absolutes ------
  17 
  18 
  19 // -- Frame display format strings --
  20 #define WIN_F_COLOR		'&'
  21 
  22 
  23 // -- Errors ---------
  24 
  25 
  26 // --------------------------------------------------------------------------
  27 // -- Classes
  28 // --------------------------------------------------------------------------
  29 
  30 // --- Status window -------------------------------------------------------
  31 class  WinStatus {
  32 
  33    ConFreeWindow  *view;
  34 
  35    LogFileName    *rxLogName;
  36    LogFileName    *txLogName;
  37    LogFileName    *frameLogName;
  38 
  39    LoggingStyle   rxStyle;
  40    LoggingStyle   txStyle;
  41    LoggingStyle   frameStyle;
  42 
  43    unsigned long  rxCount;
  44    unsigned long  txCount;
  45    unsigned long  frameRXCount;
  46    unsigned long  frameTXCount;
  47 
  48    Boolean		  go;
  49 
  50    char			  *alarmText;
  51 
  52  public:
  53 
  54    WinStatus( int yStart);
  55   ~WinStatus();
  56 
  57    void reset(void);
  58    void refresh(void);
  59    void moveTo( int yStart );
  60 
  61    void setLogRX(   LogFileName *rx   );
  62    void setLogTX(   LogFileName *tx   );
  63    void setLogFRAME(LogFileName *frame);
  64 
  65    void showGo(   void );  // Indicator
  66    void showStop( void );
  67 
  68    void incRX(void);       // Counts
  69    void incTX(void);
  70    void incRXFrame( void);
  71    void incTXFrame( void);
  72    void clearAll(   void);
  73    void clearChars( void);
  74    void clearFrames(void);
  75 
  76    void showRXStyle(   LoggingStyle rx   );
  77    void showTXStyle(   LoggingStyle tx   );
  78    void showFrameStyle(LoggingStyle frame);
  79 
  80    void portAlarm( char *text );
  81 
  82 };
  83 
  84 
  85 // --- Frame window ---------------------------------------------------
  86 class  WinFrame {
  87 
  88    int    ySize;
  89 
  90    char	 *lines;               // line buffer
  91    int    startLine;
  92    int    firstVisibleLine;
  93    int    nextLine;
  94 
  95    ConLBSWindow  *view;
  96 
  97  public:
  98 
  99    WinFrame(int  startY, int  sizeY, int  lineBuffers );
 100   ~WinFrame();
 101 
 102    void flush(void);
 103    void refresh(void);
 104    void moveTo(int startY, int  sizeY);
 105 
 106    void post( char  *line);
 107 
 108    void scrollUp(  void);
 109    void scrollDown(void);
 110 
 111 };