CARMA C++
RtDisplay.h
1 #ifndef CARMA_UI_RTD_RTDISPLAY_H
2 #define CARMA_UI_RTD_RTDISPLAY_H
3 
4 
5 /*
6  * @file
7  *
8  * Realtime display windows and all the elements of composition.
9  * This file is much too long and should be broken up into pieces.
10  *
11  * @author Steve Scott
12  *
13  * $CarmaCopyright$
14  *
15  */
16 
17 
18 #include <iomanip>
19 #include <string>
20 #include <sstream>
21 #include <vector>
22 #include <memory>
23 #include <cstring>
24 
25 #include <boost/shared_ptr.hpp>
26 
27 namespace rtdproto {
28  class UIMessageRequest;
29  class UIMessageReply;
30  class RtObject;
31 }
32 
33 namespace carma {
34 
35 namespace services {
36  class AstroTime;
37 } // namespace carma::services
38 
39 namespace ui {
40 namespace rtd {
41 
42 
43 class ReaderWithTimeout;
44 
45 
47 typedef enum {
48  NONE_LAYOUT,
49  UNFILLED_LAYOUT,
50  CHAIN_LAYOUT,
51  EOL_CENTERED_LAYOUT,
52  EOL_RIGHT_JUSTIFIED_LAYOUT,
53  EOL_LEFT_JUSTIFIED_LAYOUT
54 } Layout;
55 
57 typedef enum {
58  FONT_PLAIN,
59  FONT_BOLD,
60  FONT_ITALIC,
61  FONT_BOLD_ITALIC,
62 } FontType;
63 
64 
84 class RtObject {
85  public:
87  virtual ~RtObject( );
88 
97  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj) = 0;
98 
104  virtual void update( ) = 0;
105 
114  void setLayout(Layout layout);
115 
120  Layout getLayout( ) const;
121 
126  void setFontSize(int fontSize);
127 
132  void setToolTipText(const std::string & text);
133 
138  void appendToolTipText(const std::string & text);
139 
143  std::string getToolTipText() ;
144 
145  protected:
147  explicit RtObject();
148 
155  int getFontSize(int parentFontSize) const;
156 
162  int getFontSize() const;
163 
164  private:
165  Layout layout_;
166  std::string toolTipText_;
167  int fontSize_;
168 };
169 
170 typedef boost::shared_ptr<RtObject> RtObjectPtr;
171 
216 class Format {
217 public:
219  explicit Format();
220 
227  Format(int width, int indent, int len);
228 
233  Format( const Format & rhs );
234 
240  explicit Format( const char * s );
241 
245  void fmt( const char * s );
246 
248  int width;
250  int indent;
252  int len;
254  void dump();
255 private:
257  void init();
258 };
259 
261 typedef enum CellColorEnum {
262  WHITE_CELL_COLOR,
263  RED_CELL_COLOR,
264  YELLOW_CELL_COLOR,
265  GREEN_CELL_COLOR,
266  BLUE_CELL_COLOR,
267  ORANGE_CELL_COLOR,
268  CYAN_CELL_COLOR,
269  MAGENTA_CELL_COLOR,
270  BLACK_CELL_COLOR,
271  PURPLE_CELL_COLOR,
272  LIGHT_GRAY_CELL_COLOR,
273  STRIPE_LIGHT_CELL_COLOR,
274  STRIPE_DARK_CELL_COLOR,
275  LIGHT_GRAY_TEXT_CELL_COLOR, // Cell is white, text gray-ed out
276  EMPTY_CELL_COLOR,
277 } CellColor;
278 
279 class Cell;
280 typedef boost::shared_ptr<Cell> CellPtr;
281 
300 class Cell:public RtObject {
301 public:
308  Cell(int indent, int chars, int width);
317  explicit Cell(const char* fmt, int altLen=0);
318 
327  explicit Cell(const Format& fmt,int altLen=0);
328 
334  void setColor( CellColor color );
335 
337  void setNohwColor( CellColor color );
338 
339  /*
340  * Grays out the text
341  */
342  void setGrayedOut(bool state) { grayedOut_ = state; }
343 
344  bool isGrayedOut() { return grayedOut_; }
345 
346  /*
347  * Sets the cell state so that it is rendered as a white empty box.
348  * @param
349  */
350  void setEmpty(bool state);
351 
356  std::string getText();
357 
359  int getIndent( ) const;
360 
362  int getLen( ) const;
363 
368  bool isReplaceText( ) const;
369 
371  bool isPlottable( ) const;
372 
378  char getAudio();
379 
387  void setBorderTopEnabled(bool state) { borderTopEnabled_ = state; }
388  void setBorderRightEnabled(bool state) { borderRightEnabled_ = state; }
389  void setBorderBottomEnabled(bool state) { borderBottomEnabled_ = state; }
390  void setBorderLeftEnabled(bool state) { borderLeftEnabled_ = state; }
391 
400  int addAlternative( const ::std::string & text,
401  CellColor color );
402 
408  void setActiveAlternative( int index );
409 
410  void clearActiveAlternative( );
411 
412  bool alternativeIsActive( ) const;
413 
415  void setNa(bool tf);
416 
418  void setNohw(bool tf);
419 
424  void setPlottable(bool yesOrNo);
425 
435  void setAudio(char c);
436 
438  void setNoAudio();
439 
441  void setPlotLabel( const ::std::string & s );
442 
447  void setPlotLabel(int a, bool dev, const ::std::string & s);
448 
450  ::std::string getPlotLabel( ) const;
451 
459  void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
460 
464  bool isValid();
465 
470  void setValidity(bool validity);
471 
472  void setCellName(const std::string &s) {
473  cellName_ = s;
474  }
475 
476  std::string getCellName() const {
477  return cellName_;
478  }
479 
480  void setDynamicDescription(const std::string &s) {
481  dynamicDescription_ = s;
482  }
483 
484  std::string getDynamicDescription() const {
485  return dynamicDescription_;
486  }
487 
488 protected:
492  virtual void updateColor();
493 
495  ::std::string centerStringFmt( const ::std::string & s ) const;
496 
502  void updateInt(int data);
503 
505  int len;
507  int indent;
511  ::std::string text;
512 
514  ::std::ostringstream fmtOss_;
515 
517  const char* legit;
518 
520  char audio;
521 
522 private:
523  char getPlottableCode( ) const;
524 
526  CellColor getColor( );
527 
529  void init();
530 
532  ::std::string centerString( const ::std::string & s,
533  bool fmtMode ) const;
534 
535  struct Alternative {
536  ::std::string text;
537  CellColor color;
538  };
539 
541  const int maxAlternativeLength_;
542 
544  int activeAlternative_;
545 
547  ::std::vector< Alternative > alternatives_;
548 
550  ::std::string alternativesErrText_;
551 
553  const char good_;
554 
556  bool isValid_;
557 
559  CellColor color_;
560 
562  ::std::string plotLabel_;
563 
565  ::std::string invalString_;
566 
568  ::std::string overflowString_;
569 
571  bool isPlottable_;
572 
573  bool na_;
574  ::std::string naString_;
575 
576  bool noHw_;
577  ::std::string noHwString_;
578  CellColor noHwColor_;
579 
580  bool grayedOut_;
581 
582  bool emptyCell_; // When true, the cell is a just a white box
583 
584  bool borderTopEnabled_;
585  bool borderRightEnabled_;
586  bool borderBottomEnabled_;
587  bool borderLeftEnabled_;
588 
589  std::string cellName_;
590  std::string dynamicDescription_;
591 };
592 
593 //-------------------------------- EmptyCell ----------------------------------
597 class CellEmpty : public Cell {
598  public:
599  explicit CellEmpty( const char* fmt );
600 
601  explicit CellEmpty( const Format& fmt );
602 
603  virtual void update( );
604 };
605 
606 //----------------------------- CellString -------------------------------
614 class CellString : public Cell {
615 public:
622  CellString( const char* fmt,
623  const ::std::string& dataStringRef );
624 
625  CellString( const char* fmt,
626  const ::std::string& dataStringRef,
627  const CellColor& colorRef );
628 
638  CellString( const char* fmt,
639  const ::std::string& dataStringRef,
640  int altLen );
641 
648  CellString( const Format& fmt,
649  const ::std::string& dataStringRef );
650 
651  CellString( const Format& fmt,
652  const ::std::string& dataStringRef,
653  const CellColor& colorRef );
654 
664  CellString( const Format& fmt,
665  const ::std::string& dataStringRef,
666  int altLen );
667 
669  void setTruncate( bool truncate );
670 
671 protected:
672  virtual void update( );
673 
674  virtual void updateColor( );
675 
676 private:
677  void init();
678 
680  const ::std::string & dataStringRef_;
681 
682  const CellColor * const colorPtr_;
683 
685  bool truncate_;
686 };
687 
688 
689 //----------------------------- CellCharString -------------------------------
697 class CellCharString:public Cell {
698 public:
705  CellCharString(const char* fmt, const char* string);
715  CellCharString(const char* fmt, const char* string, int altLen);
716 
723  CellCharString(const Format& fmt, const char* string);
724 
734  CellCharString(const Format& fmt, const char* string, int altLen);
735 
739  virtual void update();
740  virtual void updateColor();
742  void setNotruncate() {
743  truncateFlag = 0;
744  }
745 protected:
747  std::string dataString;
748  const char* data;
751 private:
752  void init();
753 };
754 
755 
756 //-------------------------- CellCatString -------------------------------
763 class CellCatString:public Cell {
764 public:
773  CellCatString(const char* fmt, const char* legit, const char* pre,
774  const char* suf);
786  CellCatString(const char* fmt, const char* legit, const char* pre,
787  const char* suf, int altLen);
795  CellCatString(const char* fmt, const char* pre, const char* suf);
804  CellCatString(const Format& fmt, const char* legit, const char* pre,
805  const char* suf);
817  CellCatString(const Format& fmt, const char* legit, const char* pre,
818  const char* suf, int altLen);
826  CellCatString(const Format& fmt, const char* pre, const char* suf);
827 
831  virtual void update();
832  virtual void updateColor();
834  void setNotruncate() {
835  truncateFlag = 0;
836  }
837 protected:
839  const char* prefix;
841  const char* suffix;
844 private:
845  void init();
846 };
847 
848 
849 //----------------------------- CellFloat -------------------------------
855 class CellFloat:public Cell {
856 public:
865  CellFloat(const char* fmt, int rod, const char* legit, const float& data);
877  CellFloat(const char* fmt, int rod, const char* legit, const float& data,
878  int altLen);
886  CellFloat(const char* fmt, int rod, const float& data);
888  virtual void update();
889 protected:
891  const float& data;
893  const int rod;
894 };
895 
896 
897 //----------------------------- CellDble -------------------------------
903 class CellDble:public Cell {
904 public:
913  CellDble(const char* fmt, int rod, const char* legit, const double& data);
925  CellDble(const char* fmt, int rod, const char* legit, const double& data,
926  int altLen);
934  CellDble(const char* fmt, int rod, const double& data);
936  virtual void update();
937 protected:
939  const double& data;
941  const int rod;
942 };
943 
944 
945 //----------------------------- CellRA&DEC -------------------------------
946 
950 class CellRADEC:public CellDble {
951 public:
962  CellRADEC(const char* fmt, int rod, const char* legit, const double& radec,
963  const char* sourceType);
973  CellRADEC(const char* fmt, int rod, const double& radec, const char* sourceType);
974 protected:
976  const char* sourceType;
978  const double TWOPI;
979 
980  ::std::ostringstream scratchOSS_;
981 };
982 
984 class CellRA:public CellRADEC {
985 public:
996  CellRA(const char* fmt, int rod, const char* legit, const double& ra,
997  const char* sourceType);
1007  CellRA(const char* fmt, int rod, const double& ra, const char* sourceType);
1009  virtual void update();
1010 };
1012 class CellDEC:public CellRADEC {
1013 public:
1024  CellDEC(const char* fmt, int rod, const char* legit, const double& dec,
1025  const char* sourceType);
1035  CellDEC(const char* fmt, int rod, const double& dec, const char* sourceType);
1037  virtual void update();
1038 };
1039 
1040 //----------------------------- CellUT -------------------------------
1042 class CellUT:public Cell{
1043 public:
1052  CellUT(const char* fmt, int rod, const char* legit, const double& _mjd);
1061  CellUT(const char* fmt, int rod, const double& _mjd);
1063  virtual void update();
1064 protected:
1066  const double& mjd;
1068  std::string makeUTstring();
1069 private:
1071  const int rod;
1072 
1073  ::std::ostringstream scratchOSS_;
1074 };
1075 
1076 //----------------------------- CellDateUT -------------------------------
1086 class CellDateUT:public CellUT {
1087 public:
1097  CellDateUT(const char* fmt, int rod, const char* legit, const double& _mjd,
1098  int choice=0);
1108  CellDateUT(const char* fmt, int rod, const double& _mjd, int choice=0);
1110  virtual void update();
1111 private:
1113  const int choice_;
1114 };
1115 
1116 
1117 
1118 //----------------------------- CellInt's -------------------------------
1119 
1121 class CellInt:public Cell {
1122 public:
1130  CellInt(const char* fmt, const char* legit, const int& data);
1141  CellInt(const char* fmt, const char* legit, const int& data, int altLen);
1148  CellInt( const char * fmt,
1149  const int & data );
1150 
1151  CellInt( const Format & fmt,
1152  const int & data );
1153 
1155  virtual void update() {
1156  updateInt(data);
1157  }
1158 protected:
1160  const int& data;
1161 };
1162 
1164 class CellShort:public Cell {
1165 public:
1173  CellShort(const char* fmt, const char* legit, const short& data);
1184  CellShort(const char* fmt, const char* legit, const short& data, int altLen);
1191  CellShort(const char* fmt, const short& data);
1193  virtual void update() {
1194  updateInt(static_cast< int >(data));
1195  }
1196 protected:
1198  const short& data;
1199 };
1200 
1201 
1203 class CellChar:public Cell {
1204 public:
1212  CellChar(const char* fmt, const char* legit, const char& data);
1223  CellChar(const char* fmt, const char* legit, const char& data, int altLen);
1230  CellChar(const char* fmt, const char& data);
1231 
1233  virtual void update() {
1234  updateInt(static_cast< int >(data+idTranslation));
1235  }
1238  idTranslation=1;
1239  return this;
1240  }
1241 protected:
1243  const char& data;
1246 };
1247 
1248 
1250 class CellUChar:public Cell {
1251 public:
1259  CellUChar(const char* fmt, const char* legit, const unsigned char& data);
1270  CellUChar(const char* fmt, const char* legit, const unsigned char& data,
1271  int altLen);
1278  CellUChar(const char* fmt, const unsigned char& data);
1279 
1281  virtual void update() {
1282  updateInt(static_cast< int >(data+idTranslation));
1283  }
1286  idTranslation=1;
1287  return this;
1288  }
1289 protected:
1291  const unsigned char& data;
1294 };
1295 
1296 
1297 //------------------------------RtTitledObj-------------------------------
1299 class RtTitledObj : public RtObject {
1300  public:
1305  void setTitle(const std::string& title);
1306 
1308  std::string getTitle();
1310  virtual void update();
1312  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj) = 0;
1313 
1314  protected:
1315  explicit RtTitledObj();
1316 
1321  RtTitledObj(const std::string& title);
1322 
1324  std::string title_;
1325 };
1326 
1327 //-------------------------------- RtRow ---------------------------------
1328 
1329 class RtRow;
1330 typedef boost::shared_ptr<RtRow> RtRowPtr;
1331 
1336 class RtRow : public RtTitledObj {
1337  public:
1342  RtRow(const ::std::string & rowLabel);
1343  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1344  static RtRowPtr makeRow(const ::std::string & rowLabel) {
1345  return RtRowPtr(new RtRow(rowLabel));
1346  }
1347 };
1348 
1349 //-------------------------------- RtColumn ---------------------------------
1350 
1351 class RtColumn;
1352 typedef boost::shared_ptr<RtColumn> RtColPtr;
1353 typedef boost::shared_ptr<RtColumn> RtColumnPtr;
1354 
1359 class RtColumn : public RtTitledObj {
1360  public:
1365  RtColumn(const ::std::string& colLabel);
1366  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1367  static RtColPtr makeCol(const ::std::string& colLabel) {
1368  return RtColPtr(new RtColumn(colLabel));
1369  }
1370  static RtColPtr makeColumn(const ::std::string& colLabel) {
1371  return RtColPtr(new RtColumn(colLabel));
1372  }
1373 };
1374 
1375 //------------------------------ RtContainer --------------------------------
1376 
1378 typedef enum {
1379  TWO_PIXELS_ALL_SIDES_BORDER,
1380  TWO_PIXELS_LEFT_RIGHT_BOTTOM_BORDER,
1381  TWO_PIXELS_BELOW_BORDER,
1382  ONE_PIXEL_ABOVE_BORDER,
1383  ONE_PIXEL_BELOW_BORDER,
1384  ONE_PIXEL_RIGHT_BORDER,
1385  ONE_PIXEL_LEFT_BORDER,
1386  NO_BORDER
1387 } Border;
1388 
1389 
1396 class RtContainer : public RtTitledObj {
1397 public:
1399  virtual ~RtContainer( );
1400 
1402  virtual void update();
1403 
1405  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj) = 0;
1406 
1411  void setBorder(Border border);
1412  Border getBorder() const;
1413 
1415  ::size_t getNumObjects( ) const;
1416 
1421  RtObjectPtr add(RtObjectPtr rtObject);
1422 
1427  RtObjectPtr replace(unsigned int i, RtObjectPtr rtObject);
1428  RtObjectPtr replace(RtObjectPtr oldObj, RtObjectPtr newObj);
1429 
1434  RtObjectPtr getObj( ::size_t index ) const;
1435 
1436 protected:
1438  explicit RtContainer();
1439 
1444  RtContainer(const ::std::string& title);
1445 
1450  RtContainer(Border border);
1451 
1457  RtContainer(const ::std::string & title, Border border);
1458 
1459 protected:
1460  typedef ::std::vector< RtObjectPtr > ObjectContainerType;
1461  ObjectContainerType objects_;
1462  size_t numObjects_;
1463 
1464 private:
1465 
1466  std::string::size_type updateReserve_;
1467  Border border_;
1468 };
1469 
1470 //-------------------------------- RtLabel ---------------------------------
1476 class RtLabel:public RtObject {
1477 public:
1481  RtLabel();
1482 
1489  explicit RtLabel(const std::string& label);
1490 
1498  RtLabel(const std::string& label, char layoutCode);
1499 
1506  RtLabel(const std::string& label, int relFontSize);
1507 
1509  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1510 
1512  virtual void update();
1513 
1515  ::std::string getLabel() const;
1516 
1518  FontType getFontType() const;
1519 
1521  int getRelFontSize() const;
1522 
1524  void setLabel(const std::string& label);
1525 
1531  void setFontType(const FontType type);
1532 
1534  void setRelFontSize(int relFontSize);
1535 private:
1537  void init();
1539  ::std::string label_;
1541  int relFontSize_;
1543  FontType fontType;
1544 };
1545 
1546 typedef boost::shared_ptr<RtLabel> RtLabelPtr;
1547 
1548 //-------------------------------- RtArea ---------------------------------
1587 class RtArea : public RtContainer {
1588 public:
1593  explicit RtArea( const ::std::string & title );
1594 
1601  RtArea(const std::string& title, Border border);
1602 
1604  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1605 
1607  int getLabelPad();
1608 
1610  int getUnitPad();
1611 
1613  int getEndPad();
1614 
1616  void setLabelPad(int p);
1617 
1619  void setUnitPad(int p);
1620 
1622  void setEndPad(int p);
1623 
1630  CellPtr addItem(RtLabelPtr label, CellPtr cell, RtLabelPtr units);
1631 
1638  CellPtr addItem(const ::std::string & label, CellPtr cell, const char* units);
1639 
1646  CellPtr addItem(const ::std::string & label, CellPtr cell, RtLabelPtr units);
1647 
1653  CellPtr addItem(const ::std::string & label, CellPtr cell);
1654 
1661  CellPtr addCell(const char* fmt, char* legit, const char* string);
1662 
1669  CellPtr addCell(const char* fmt, const char* string);
1670 
1678  CellPtr addItem(const ::std::string & label, const char* fmt, char* legit, const char* string);
1679 
1687  CellPtr addItem(const ::std::string & label, const char* fmt, const char* string);
1688 
1696  CellPtr addItem(const ::std::string & label, const char* fmt, char* legit, short& data);
1697 
1706  CellPtr addItem(const ::std::string & label, const char* fmt, char* legit, int& data);
1715  CellPtr addItem(const ::std::string & label, const char* fmt, int rod, char* legit, double& data);
1716 
1717 private:
1722  int labelPad;
1724  int unitPad;
1726  int endPad;
1727 };
1728 
1729 typedef boost::shared_ptr<RtArea> RtAreaPtr;
1730 
1731 //-------------------------------- RtTable ---------------------------------
1756 class RtTable : public RtContainer {
1757 public:
1762  explicit RtTable( const ::std::string & title );
1763 
1767  virtual ~RtTable( );
1768 
1770  ::size_t getNumRows( ) const;
1771 
1773  ::size_t getNumCols( ) const;
1774 
1776  RtRowPtr addRow( RtRowPtr rowObj );
1777 
1779  RtColPtr addCol( RtColPtr colObj );
1780 
1782  CellPtr addCell(CellPtr cell);
1783 
1785  void addCols(int numOfCols, const char* names[]);
1786 
1788  void addOvroAntCols();
1789 
1791  static std::vector<std::string> getAntNames() ;
1792 
1794  static std::vector<std::string> getOvroAntNames() ;
1795 
1797  static std::vector<std::string> getBimaAntNames() ;
1798 
1800  static std::vector<std::string> getSzaAntNames() ;
1801 
1803  void addBimaAntCols();
1804 
1810  void setRowLabel(int rowNo, const std::string& label);
1811 
1813  void noRowLabels();
1814 
1816  void noColLabels();
1817 
1819  void setMinRows( ::size_t minRows );
1820 
1822  void setPrefRows( ::size_t prefRows );
1823 
1825  void setReverseOrder();
1826 
1828  void setLabelPrefix( const ::std::string & labelPrefix );
1829 
1831  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1832 
1834  Cell& getCell(int index);
1835 
1837  void replaceCell(int index, CellPtr cell);
1838 
1840  int getNumCells() const;
1841 
1842 private:
1843  class RawContainer;
1844 
1845  std::string::size_type tableUpdateReserve_;
1846 
1848  char displayRowLabelsCode_;
1849 
1851  char displayColLabelsCode_;
1852 
1854  ::size_t minCols_;
1855 
1857  ::size_t minRows_;
1858 
1860  ::size_t prefCols_;
1861 
1863  ::size_t prefRows_;
1864 
1867  bool reverseOrder_;
1868 
1870  ::std::string labelPrefix_;
1871 
1872  // All columns
1873  std::vector< RtColPtr > cols_;
1874 
1875  // All rows
1876  std::vector< RtRowPtr > rows_;
1877 
1878  // All cells
1879  std::vector<CellPtr> cells_;
1880 };
1881 
1882 typedef boost::shared_ptr<RtTable> RtTablePtr;
1883 
1884 //-------------------------------- RtBox ---------------------------------
1918 class RtBox : public RtContainer {
1919  public:
1920  virtual ~RtBox( );
1921 
1923  void setSpring();
1925  void setProp();
1927  void setStretchFactor(double stretchFactor);
1929  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
1930 
1931  typedef enum {
1932  BOX_HORIZONTAL,
1933  BOX_VERTICAL,
1934  BOX_FOLDER,
1935  } BoxType;
1936 
1937  typedef enum {
1938  STRETCH_PROPORTIONAL,
1939  STRETCH_SPRING,
1940  } StretchType;
1941  protected:
1947  RtBox(BoxType type, const std::string& title);
1953  RtBox(BoxType type, Border border);
1960  RtBox(BoxType type, const std::string& title, Border border);
1961 
1962  private:
1963  // Code for box type
1964  const BoxType boxType_;
1966  StretchType stretchType_;
1968  double stretchFactor_;
1970  void init();
1971 };
1972 
1973 typedef boost::shared_ptr<RtBox> RtBoxPtr;
1974 
1975 //-------------------------------- RtVBox ---------------------------------
1979 class RtVBox:public RtBox {
1980 public:
1986  explicit RtVBox(const std::string& title);
1987 
1993  explicit RtVBox(Border border);
1994 
2001  RtVBox(const std::string& title, Border border);
2002 };
2003 
2004 typedef boost::shared_ptr<RtVBox> RtVBoxPtr;
2005 
2006 //-------------------------------- RtHBox ---------------------------------
2010 class RtHBox:public RtBox {
2011 public:
2017  explicit RtHBox(const std::string& title);
2018 
2024  explicit RtHBox(Border border);
2025 
2032  RtHBox(const std::string& title, Border border);
2033 };
2034 
2035 typedef boost::shared_ptr<RtHBox> RtHBoxPtr;
2036 
2037 //-------------------------------- RtFolder ---------------------------------
2042 class RtFolder:public RtBox {
2043 public:
2049  explicit RtFolder(const std::string & title);
2050 
2056  explicit RtFolder(Border border);
2057 
2064  RtFolder(const ::std::string & title, Border border);
2065 };
2066 
2067 typedef boost::shared_ptr<RtFolder> RtFolderPtr;
2068 
2069 //------------------------------ RtStatic --------------------------------
2074 class RtStatic : public RtObject {
2075  public:
2077  virtual void update( );
2078 
2080  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj) = 0;
2081 
2082  protected:
2084  explicit RtStatic();
2085 };
2086 
2087 //-------------------------------- RtSpring ---------------------------------
2092 class RtSpring:public RtStatic {
2093 public:
2100  RtSpring(int minWidth, int prefWidth, double springiness);
2101 
2108  RtSpring(int minWidth, double springiness);
2109 
2116  RtSpring(int minWidth, int prefWidth);
2117 
2123  RtSpring(int minWidth);
2124 
2130  RtSpring(double springiness);
2131 
2136  RtSpring();
2137 
2139  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
2140 
2141 private:
2143  const int minWidth;
2145  const int prefWidth;
2147  const double springiness;
2148 };
2149 
2150 typedef boost::shared_ptr<RtSpring> RtSpringPtr;
2151 
2152 //-------------------------------- RtSpacer ---------------------------------
2157 class RtSpacer: public RtStatic {
2158 public:
2165  RtSpacer(int minWidth, int prefWidth, double weight);
2172  RtSpacer(int minWidth, int prefWidth);
2179  RtSpacer(int minWidth, double weight);
2184  RtSpacer(int minWidth);
2186  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
2187 private:
2189  const int minWidth;
2191  const int prefWidth;
2193  const double weight;
2194 };
2195 
2196 typedef boost::shared_ptr<RtSpacer> RtSpacerPtr;
2197 
2198 //------------------------------- RtTimeString --------------------------------
2203 class RtTimeString:public RtObject {
2204 public:
2210  RtTimeString(const char* ut, const char* lst);
2216  void change(const char* ut, const char* lst);
2218  virtual void update();
2220  virtual std::string getUpdate();
2222  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
2223 private:
2225  const int utWidth_;
2226 
2228  const int lstWidth_;
2229 
2231  const int localWidth_;
2232 
2233  // AstroTime object, used for LDT -> LST conversion
2234  const ::std::auto_ptr< services::AstroTime > astroTime_;
2235 
2237  const char * ut_;
2238 
2240  const char * lst_;
2241 
2243  ::std::ostringstream scratchOSS_;
2244 
2246  ::std::string output_;
2247 };
2248 
2249 //------------------------------- RtTimePanel --------------------------------
2254 class RtTimePanel:public RtObject {
2255 public:
2261  RtTimePanel(const char* ut, const char* lst);
2268  RtTimePanel(const char* ut, const char* lst, bool visible);
2275  void change(const char* ut, const char* lst, bool visible = true);
2276 
2278  virtual void update();
2279 
2281  virtual std::string getUpdate();
2282 
2284  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
2285 
2286 private:
2288  bool visible;
2290  RtTimeString* rts;
2291 };
2292 
2293 typedef boost::shared_ptr<RtTimePanel> RtTimePanelPtr;
2294 
2295 
2296 //-------------------------------- RtDisplay ---------------------------------
2315 class RtDisplay:public RtContainer {
2316 public:
2327  RtDisplay( const ::std::string & programName,
2328  const char * subtitle,
2329  const char * ut,
2330  const char * lst,
2331  bool visibleTimePanel = true );
2332 
2341  RtDisplay( const ::std::string & programName,
2342  const char * subtitle,
2343  bool visibleTimePanel = true );
2344 
2345  static void appendToFile(std::string str);
2346 
2348  std::string getTimestring();
2349 
2351  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
2352  virtual void serialize(bool initialize, int fontSize, ::rtdproto::UIMessageReply &msg);
2353 
2359  bool serveData(bool forceInit=false);
2360 
2363  void setReconfigured();
2366  virtual void checkReconfig();
2368  void setGenericHelp(const std::string& helpString);
2369 
2371  void setSpecificHelp( const ::std::string & helpString );
2373  void setSpecificHelp( const ::std::string & title,
2374  const ::std::string & helpString );
2375 
2377  void setSpecificHelpFromTextFile( const ::std::string & filePath );
2379  void setSpecificHelpFromTextFile( const ::std::string & title,
2380  const ::std::string & filePath );
2381 
2383  void setGenericHelpFromTextFile(const ::std::string& filePath);
2385  void setGenericHelpFromTextFile(const ::std::string& title,
2386  const ::std::string& filePath );
2387 
2389  void setUpdateRate(int milliSeconds);
2391  int getUpdateRate();
2393  ::std::string getUpdateRateString( ) const;
2395  int replyUpdate(int fontSize, ::rtdproto::UIMessageReply &msg);
2397  void incRequestCount();
2399  ::std::string getProgramName( ) const;
2400 
2401 protected:
2403  const char* sysName;
2405  std::string makeTitle(const std::string& subtitle);
2407  std::string genericHelpTitle;
2410  std::string genericHelp_;
2412  std::string specificHelpTitle;
2414  std::string specificHelp;
2415 private:
2417  ReaderWithTimeout* readerTMO;
2419  int replyIni(int fontSize, ::rtdproto::UIMessageReply &msg, bool reInitialize=false);
2421  void init();
2423  RtTimePanelPtr rtp;
2425  int needIni;
2427  int requestCount;
2429  char visibleTimePanel;
2431  int updateRate;
2433  ::std::string formatUpdateRate(const ::std::string &);
2434 
2441  virtual void preInternalUpdate( ) { }
2442 
2449  virtual void internalUpdate( ) { }
2450 
2451  void setUpdateRateString( const ::std::string & s );
2452 
2454  const ::std::string programName_;
2455 
2456  ::std::string updateRateString_;
2457 
2458  // Google Protocol Buffers UIMessageReply object
2459  boost::shared_ptr< ::rtdproto::UIMessageReply > legacyMessage_;
2460 };
2461 
2462 
2463 } // namespace carma::ui::rtd
2464 } // namespace carma::ui
2465 } // namespace carma
2466 
2467 #endif
int getFontSize() const
Get the absolute font size for this object.
RtFolder(const std::string &title)
Constructor.
RtSpacer(int minWidth, int prefWidth, double weight)
Constructor.
void setNotruncate()
Set cell to not truncate string, but display stars if it overflows cell.
Definition: RtDisplay.h:834
Cell(int indent, int chars, int width)
Constructor.
Base class for everything that can be put in a realtime display.
Definition: RtDisplay.h:84
void setSpecificHelp(const ::std::string &helpString)
Set help specific to this display.
virtual void update()
Updates the cell contents.
void setPrefRows(::size_t prefRows)
Set the default number of rows to display.
Time string sends over the UT, LST and local time.
Definition: RtDisplay.h:2203
A base bordered container class for RtObjects.
Definition: RtDisplay.h:1396
CellPtr addCell(CellPtr cell)
Add a cell to the table.
RtTable(const ::std::string &title)
Constructor.
RtObjectPtr add(RtObjectPtr rtObject)
Insert an object into the container.
int idTranslation
A 1 or a zero that is added to the data for output (index to id)
Definition: RtDisplay.h:1293
RtColumn(const ::std::string &colLabel)
Constructor.
void setNohwColor(CellColor color)
Sets the single character background color to use when there is no hardware.
virtual void update()
Creates a new string that is the dynamic ascii contents of this object.
std::string getTimestring()
Get the time string from the time panel.
int indent
Left indent of chars.
Definition: RtDisplay.h:507
Cell & getCell(int index)
Get cell.
void setTruncate(bool truncate)
Set cell to truncate string, but display stars if it overflows cell.
static std::vector< std::string > getBimaAntNames()
Get a vector of bima antenna labels.
CellDble(const char *fmt, int rod, const char *legit, const double &data)
Constructor.
RtTimePanel(const char *ut, const char *lst)
Constructor.
Border
Possible border styles for RtContainer objects.
Definition: RtDisplay.h:1378
void appendToolTipText(const std::string &text)
Append more text to the existing tool tip text.
void setProp()
Set stretchType to proportional.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Creates static description of container to stdout.
A vertical box that defines a folder.
Definition: RtDisplay.h:2042
const char * prefix
Pointer to the prefix data string.
Definition: RtDisplay.h:839
CellColorEnum
Cell color choices.
Definition: RtDisplay.h:261
void setLayout(Layout layout)
Set the layout for this object.
int getUpdateRate()
Get the update rate in milliseconds.
int getIndent() const
Get the indentation for the text.
void setBorderTopEnabled(bool state)
Enable/disbable an edge of the cell border.
Definition: RtDisplay.h:387
virtual void checkReconfig()
Check to see if reconfiguration has occurred and then call setReconfigured() if necessary.
std::string dataString
Data string.
Definition: RtDisplay.h:747
virtual void update()
Update cell contents.
Definition: RtDisplay.h:1155
std::string specificHelpTitle
A title bar for the specific help for this window.
Definition: RtDisplay.h:2412
void addBimaAntCols()
Add columns with bima antenna labels.
RtBox(BoxType type, const std::string &title)
Constructor.
virtual void updateColor()
Automatically called as part of the update cycle to set background color.
virtual void update()=0
Creates a new string that is the dynamic ascii contents of this object.
void setPlottable(bool yesOrNo)
Sets whether the cell data may be plotted.
std::string genericHelp_
The genric help as one long string.
Definition: RtDisplay.h:2410
CellRADEC(const char *fmt, int rod, const char *legit, const double &radec, const char *sourceType)
Constructor.
int getEndPad()
Get the padding (in pixels) at the end of the units label.
void setUpdateRate(int milliSeconds)
Set update rate in milliseconds.
FontType getFontType() const
Get the font type code.
CellRA(const char *fmt, int rod, const char *legit, const double &ra, const char *sourceType)
Constructor.
A static component that provides spacing inside of boxes (with BoxLayout).
Definition: RtDisplay.h:2092
void setBorder(Border border)
Set the border code.
A Cell with integer (long) data.
Definition: RtDisplay.h:1121
A row for a table.
Definition: RtDisplay.h:1336
virtual void updateColor()
Automatically called as part of the update cycle to set background color.
void incRequestCount()
Increment the requestCount - normally this is done internally.
void setUnitPad(int p)
Set the padding (in pixels) between the value and the units label.
bool truncateFlag
Flag (1/0) that determines whether data is truncated.
Definition: RtDisplay.h:843
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)=0
Describes the static structure of this object in ascii to stdout.
Takes an MJD and formats output as UT.
Definition: RtDisplay.h:1042
char audio
Audio cell control (&#39;E&#39;/&#39;Y&#39;/&#39;N&#39;) - enabled,y,n.
Definition: RtDisplay.h:520
const int & data
Pointer to the data.
Definition: RtDisplay.h:1160
void setReverseOrder()
Reverse the row/column order of the cells.
A column for a table.
Definition: RtDisplay.h:1359
CellString(const char *fmt, const ::std::string &dataStringRef)
Constructor.
bool truncateFlag
Flag that determines whether data is truncated.
Definition: RtDisplay.h:750
std::string specificHelp
The help for this specific window as one long string.
Definition: RtDisplay.h:2414
void setNotruncate()
Set cell to not truncate string, but display stars if it overflows cell.
Definition: RtDisplay.h:742
CellChar(const char *fmt, const char *legit, const char &data)
Constructor.
bool isValid()
Check validity of cell.
Base class for the RA and DEC Cells.
Definition: RtDisplay.h:950
RtRowPtr addRow(RtRowPtr rowObj)
Add a row title.
A Cell containing a string based on a std::string.
Definition: RtDisplay.h:614
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Create the static description of this object to stdout.
CellShort(const char *fmt, const char *legit, const short &data)
Constructor.
void setFontSize(int fontSize)
Set the absolute font size for this object.
bool serveData(bool forceInit=false)
Serve the data.
std::string getTitle()
Get title.
virtual void update()
Updates the cell contents.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Creates static description of container to stdout.
A Cell with short integer data.
Definition: RtDisplay.h:1164
virtual void update()
Update dynamic contents of this label - a null routine.
static std::vector< std::string > getOvroAntNames()
Get a vector of ovro antenna labels.
CellPtr addCell(const char *fmt, char *legit, const char *string)
Add a dynamicValue string to the layout.
CellPtr addItem(RtLabelPtr label, CellPtr cell, RtLabelPtr units)
Add a label/dynamicValue/units triplet to the layout.
virtual void update()
Update cell contents.
Definition: RtDisplay.h:1193
CellUChar(const char *fmt, const char *legit, const unsigned char &data)
Constructor.
CellCharString(const char *fmt, const char *string)
Constructor.
const char * sourceType
Code for type of source.
Definition: RtDisplay.h:976
virtual void update()
Creates a new string that is the dynamic ascii contents of this object.
void setTitle(const std::string &title)
Set title for object.
void setActiveAlternative(int index)
Select which alternate string to use.
const double TWOPI
Constant definition for 2 pi.
Definition: RtDisplay.h:978
virtual void update()
Updates the cell contents.
int getLabelPad()
Get the padding (in pixels) between the label and the value.
virtual void updateColor()
Automatically called as part of the update cycle to set background color.
void replaceCell(int index, CellPtr cell)
Replace cell.
A Cell with MJD data formatted as Date followed by the UT.
Definition: RtDisplay.h:1086
::std::string getLabel() const
Retrieve the label text.
::std::string text
Formatted text.
Definition: RtDisplay.h:511
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Describe this component to stdout.
RtBox with horizontal layout.
Definition: RtDisplay.h:2010
CellUT(const char *fmt, int rod, const char *legit, const double &_mjd)
Constructor.
::size_t getNumRows() const
Get the number of rows.
CellDEC(const char *fmt, int rod, const char *legit, const double &dec, const char *sourceType)
Constructor.
void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Describe (serialize) the static description of the cell.
const int rod
Number of characters to right of the decimal point.
Definition: RtDisplay.h:893
int idTranslation
a 1 or a zero that is added to the data for output (index to id)
Definition: RtDisplay.h:1245
RtObjectPtr replace(unsigned int i, RtObjectPtr rtObject)
Replace an object in the container.
void dump()
Debugging dump on width/indent/length.
virtual void update()
Updates the cell contents.
Container that handles layout of components with a &quot;BoxLayout&quot;.
Definition: RtDisplay.h:1918
CellChar * idTranslate()
Set the cell up to translate the ID.
Definition: RtDisplay.h:1237
void addOvroAntCols()
Add columns with ovro antenna labels.
const char * suffix
Pointer to the suffix data string.
Definition: RtDisplay.h:841
RtRow(const ::std::string &rowLabel)
Constructor.
Base class for RtObjects with titles, such as a container.
Definition: RtDisplay.h:1299
::std::string getUpdateRateString() const
Get a string representing the update rate.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Creates static description of container to stdout.
void setEndPad(int p)
Set the padding (in pixels) at the end of the units label.
int getLen() const
Get the length of the text string.
An abstract class for static components that are not updated and do not contain other components...
Definition: RtDisplay.h:2074
static std::vector< std::string > getSzaAntNames()
Get a vector of sza antenna labels.
A static label.
Definition: RtDisplay.h:1476
std::string makeUTstring()
Internal function for creating the ut string.
void setSpecificHelpFromTextFile(const ::std::string &filePath)
Set help specific to this display from a text file.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Static description of display to stdout.
Read a series of bytes with a timeout and return a raw byte string with the contents of the read...
const char * legit
Deprecated...
Definition: RtDisplay.h:517
virtual void update()
Creates a new string that is the dynamic ascii contents of this object.
CellCatString(const char *fmt, const char *legit, const char *pre, const char *suf)
Constructor.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Create the static description of this object to standard out.
Realtime display - the whole enchilada.
Definition: RtDisplay.h:2315
RtObjectPtr getObj(::size_t index) const
Get object from the container by index.
RtTimeString(const char *ut, const char *lst)
Constructor.
virtual void update()
Creates a new string that is the dynamic ascii contents for this cell.
virtual void update()
Update dynamic representation of data.
A panel with time strings.
Definition: RtDisplay.h:2254
Displays Cells in a tabular format.
Definition: RtDisplay.h:1756
std::string title_
Object title.
Definition: RtDisplay.h:1324
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)=0
Describe this component to stdout.
virtual void update()
Update cell contents.
Definition: RtDisplay.h:1281
void noColLabels()
Don&#39;t display column labels.
Format()
Constructor.
A Cell with unsigned character data treated as an int.
Definition: RtDisplay.h:1250
::size_t getNumCols() const
Get the number of columns.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Describe this component to stdout.
RtSpring()
Constructor.
const int rod
Number of characters to right of the decimal point.
Definition: RtDisplay.h:941
virtual void update()
Creates a new string that is the dynamic ascii contents of this object.
virtual void update()
Update the time string.
int indent
Left indent to the start of text in characters.
Definition: RtDisplay.h:250
A static component that provides spacing inside of boxes (with BoxLayout).
Definition: RtDisplay.h:2157
int len
Total number of chars.
Definition: RtDisplay.h:505
const float & data
Reference to the data.
Definition: RtDisplay.h:891
RtHBox(const std::string &title)
Constructor.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Create static representation of object to stdout.
virtual ~RtContainer()
Destructor.
void setFontType(const FontType type)
Set the font type code, a single character code.
virtual void update()
Creates a new string that is the dynamic ascii contents for this cell.
std::string getToolTipText()
virtual std::string getUpdate()
Get string for update.
const double & data
Reference to the data.
Definition: RtDisplay.h:939
int getRelFontSize() const
Get the relative font size.
void setRowLabel(int rowNo, const std::string &label)
Change the default label of the given row.
int getNumCells() const
Get number of cells.
const unsigned char & data
The data for the cell.
Definition: RtDisplay.h:1291
const double & mjd
Pointer to the data.
Definition: RtDisplay.h:1066
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)=0
Create the static description of this object to standard out.
::std::string getProgramName() const
Get the program name.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Create the static description of this object to standard out.
RtArea(const ::std::string &title)
Constructor, border style defaults to none.
Layout
Layout choices.
Definition: RtDisplay.h:47
A Cell that displays the contents of a double.
Definition: RtDisplay.h:903
static std::vector< std::string > getAntNames()
Get a vector of all antenna labels.
void fmt(const char *s)
Interprets a string containing the format information.
CellFloat(const char *fmt, int rod, const char *legit, const float &data)
Constructor.
RtObject()
Constructor.
Layout getLayout() const
Get the layout for this object.
A Cell for Right Ascension.
Definition: RtDisplay.h:984
void setSpring()
Set stretchType to SPRING.
void setToolTipText(const std::string &text)
Set the tool tip text for this RtObject.
void noRowLabels()
Don&#39;t display row labels.
virtual void update()
A null update routine.
std::string makeTitle(const std::string &subtitle)
Make the title. Default is to prepend the sysName to the subtitle.
void setGenericHelp(const std::string &helpString)
Set generic help string.
const char & data
The data for the cell.
Definition: RtDisplay.h:1243
RtLabel()
Default constructor.
A Cell that displays the contents of a float.
Definition: RtDisplay.h:855
void setPlotLabel(const ::std::string &s)
Sets the label for a plot.
bool isReplaceText() const
Is this the dynamically formatted text or is it a replacement string set by nohw, overflow or an altS...
void setNa(bool tf)
Set the &quot;not applicable&quot; flag to true/false.
int replyUpdate(int fontSize,::rtdproto::UIMessageReply &msg)
Reply to &quot;Upd&quot; command; returns 0 on failure.
int len
Length of formatted text in characters.
Definition: RtDisplay.h:252
A Cell containing a string composed of 2 pieces which are concatenated together.
Definition: RtDisplay.h:763
void setLabelPrefix(const ::std::string &labelPrefix)
Set a prefix for the label used for cell functions (like a plot label).
A Cell that is empty that can be used as filler in tables.
Definition: RtDisplay.h:597
An abstract realtime (dynamic) text Cell.
Definition: RtDisplay.h:300
RtDisplay(const ::std::string &programName, const char *subtitle, const char *ut, const char *lst, bool visibleTimePanel=true)
Constructor.
void setGenericHelpFromTextFile(const ::std::string &filePath)
Set help generic from a text file.
FontType
Font type choices.
Definition: RtDisplay.h:57
std::string genericHelpTitle
A title bar for the generic help.
Definition: RtDisplay.h:2407
A Cell for Declination.
Definition: RtDisplay.h:1012
RtVBox(const std::string &title)
Constructor.
void setMinRows(::size_t minRows)
Set the minimum number of rows to display.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)
Creates static description of container to stdout.
int getUnitPad()
Get the padding (in pixels) between the value and the units label.
void addCols(int numOfCols, const char *names[])
add general column headings
RtColPtr addCol(RtColPtr colObj)
Add a column title.
A Cell with character data (signed) treated as an int.
Definition: RtDisplay.h:1203
void setColor(CellColor color)
Sets the single character background color code.
CellDateUT(const char *fmt, int rod, const char *legit, const double &_mjd, int choice=0)
Constructor.
virtual void updateColor()
Automatically called as part of the update cycle to set background color.
virtual void update()
Update the object.
A Cell containing a string based on a char*.
Definition: RtDisplay.h:697
A container and an associated line oriented layout manager suitable for multiline layout of grouped o...
Definition: RtDisplay.h:1587
CellUChar * idTranslate()
Enable ID translation.
Definition: RtDisplay.h:1285
void setLabel(const std::string &label)
Set the label text.
virtual std::string getUpdate()
Get the update string.
CellInt(const char *fmt, const char *legit, const int &data)
Constructor.
void setNohw(bool tf)
Set the &quot;no hardware&quot; flag to true/false.
const char * sysName
System name (prefix to every title bar)
Definition: RtDisplay.h:2403
::std::ostringstream fmtOss_
Formatted text stream.
Definition: RtDisplay.h:514
void updateInt(int data)
Create an output string for an integer.
void setValidity(bool validity)
Set the validity of cell.
void change(const char *ut, const char *lst, bool visible=true)
Change time strings and visibility.
void setRelFontSize(int relFontSize)
Set the relative font size.
Class to describe the layout of text within a cell.
Definition: RtDisplay.h:216
void setAudio(char c)
Set audio state code.
void setReconfigured()
Set that display has been reconfigured and that the client needs to be re-initialized.
void change(const char *ut, const char *lst)
Change time strings.
virtual void update()
Update all objects contained by container.
void setNoAudio()
Turn off audio capability for the cell.
const short & data
Pointer to the data.
Definition: RtDisplay.h:1198
void setLabelPad(int p)
Set the padding (in pixels) between the label and the value.
virtual void serialize(bool initialize, int fontSize,::rtdproto::RtObject *rtobj)=0
Creates static description of container to stdout.
int width
Total width of the cell in characters.
Definition: RtDisplay.h:248
::size_t getNumObjects() const
Get the number of objects in the container.
virtual ~RtTable()
Destructor.
bool isPlottable() const
Can contents be plotted (can it be converted to a number)?
void setStretchFactor(double stretchFactor)
Set stretch factor.
enum carma::ui::rtd::CellColorEnum CellColor
Cell color choices.
const Format format_
Format for cell data.
Definition: RtDisplay.h:509
std::string getText()
Get the dynamic text.
RtBox with vertical layout.
Definition: RtDisplay.h:1979
virtual ~RtObject()
Destructor.
virtual void update()
Update cell contents.
Definition: RtDisplay.h:1233
::std::string centerStringFmt(const ::std::string &s) const
Helper to trim and center the formatted string.
char getAudio()
Get audio state code.
int addAlternative(const ::std::string &text, CellColor color)
Add an alternate text string.
RtStatic()
Constructor.
::std::string getPlotLabel() const
Get the plot label.