summaryrefslogtreecommitdiff
path: root/engineeringpage.h
diff options
context:
space:
mode:
authorJoshua Drake <joshua.drake@ditchwitch.com>2023-01-31 09:22:48 -0600
committerJoshua Drake <joshua.drake@ditchwitch.com>2023-01-31 09:22:48 -0600
commit29a63fc5f2f4f0ec5be6d9ff6a688550f48fe88e (patch)
tree8ed8f6b816c6f1bf901fea63bc131b2d7ccc6872 /engineeringpage.h
Initial Commit. :)HEADmaster
Diffstat (limited to 'engineeringpage.h')
-rw-r--r--engineeringpage.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/engineeringpage.h b/engineeringpage.h
new file mode 100644
index 0000000..506d846
--- /dev/null
+++ b/engineeringpage.h
@@ -0,0 +1,72 @@
+#ifndef ENGINEERINGPAGE_H
+#define ENGINEERINGPAGE_H
+
+#include <QWidget>
+#include <QString>
+#include <QTableWidget>
+#include <QLabel>
+#include <QHeaderView>
+#include <QDebug>
+#include <QMap>
+#include <QStringList>
+#include <QFontDatabase>
+#include <QFontMetrics>
+#include <QElapsedTimer>
+#include <QTimer>
+#include "stdlib.h"
+
+#define SCREEN_HEIGHT 240
+#define SCREEN_WIDTH 320
+
+class engineeringpage : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit engineeringpage(QWidget *parent = nullptr);
+ explicit engineeringpage(QString titletext, QStringList message_names, QWidget *parent = nullptr);
+ void configure(QString titletext, QStringList message_names);
+
+signals:
+
+public slots:
+ void update(QStringList message_data);
+ void update(int row, QString message_data);
+ void update(QList<double> message_data);
+ void update(QByteArray message_data);
+private slots:
+ void check_scroll(void);
+
+private:
+ typedef struct scrollText
+ {
+ scrollText () : fullText("")
+ {
+ position = 0;
+ scrolled = false;
+ }
+ scrollText(QString s)
+ {
+ fullText = s;
+ position = 0;
+ scrolled = false;
+ }
+ int position;
+ QString fullText;
+ bool scrolled;
+ } scrollText;
+
+ int rows;
+ QString titletext;
+ QTableWidget *table = new QTableWidget(this);
+ QLabel *title = new QLabel(this);
+ QHeaderView *verticalheader, *horizontalheader;
+ std::vector<QTableWidgetItem*> tableHeader;
+ std::vector<QTableWidgetItem*> tableData;
+ void initializestylesheet(void);
+ bool textOverhang(QTableWidgetItem *instance, QString text);
+ QMap<QTableWidgetItem*, scrollText> text_scrolling;
+ QTimer scroll_timer;
+
+};
+
+#endif // ENGINEERINGPAGE_H