File tree Expand file tree Collapse file tree 5 files changed +22
-4
lines changed Expand file tree Collapse file tree 5 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 28
28
extern "C" {
29
29
#endif
30
30
31
+ #define LIB_DS_VERSION "2.0.0"
32
+
31
33
#include "DS_Timer.h"
32
34
#include "DS_Types.h"
33
35
#include "DS_Utils.h"
Original file line number Diff line number Diff line change @@ -120,6 +120,14 @@ int DriverStation::robotPacketLoss() const
120
120
return 100 ;
121
121
}
122
122
123
+ /* *
124
+ * Returns the version of LibDS as a string
125
+ */
126
+ QString DriverStation::libDSVersion ()
127
+ {
128
+ return QString (LIB_DS_VERSION);
129
+ }
130
+
123
131
/* *
124
132
* Returns the team number used by the LibDS,
125
133
* use the \c setTeamNumber() function to change it
Original file line number Diff line number Diff line change @@ -141,6 +141,9 @@ class DriverStation : public QObject
141
141
Q_PROPERTY (QStringList protocols
142
142
READ protocols
143
143
CONSTANT)
144
+ Q_PROPERTY (QString libDSVersion
145
+ READ libDSVersion
146
+ CONSTANT)
144
147
Q_PROPERTY (int fmsPacketLoss
145
148
READ fmsPacketLoss)
146
149
Q_PROPERTY (int radioPacketLoss
@@ -206,6 +209,8 @@ class DriverStation : public QObject
206
209
#endif
207
210
}
208
211
212
+ static QString libDSVersion ();
213
+
209
214
int teamNumber () const ;
210
215
int joystickCount () const ;
211
216
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ void DSEventLogger::init()
181
181
/* Get app info */
182
182
QString appN = qApp->applicationName ();
183
183
QString appV = qApp->applicationVersion ();
184
+ QString ldsV = DriverStation::libDSVersion ();
184
185
QString time = GET_DATE_TIME (" MMM dd yyyy - HH:mm:ss AP" );
185
186
186
187
/* Get dump directoru */
@@ -222,12 +223,14 @@ void DSEventLogger::init()
222
223
223
224
/* Format app info */
224
225
time.prepend (" Log created on: " );
226
+ ldsV.prepend (" LibDS version: " );
225
227
sysV.prepend (" Operating System: " );
226
228
appN.prepend (" Application name: " );
227
229
appV.prepend (" Application version: " );
228
230
229
231
/* Append app info */
230
232
fprintf (m_dump, " %s\n " , PRINT (time));
233
+ fprintf (m_dump, " %s\n " , PRINT (ldsV));
231
234
fprintf (m_dump, " %s\n " , PRINT (sysV));
232
235
fprintf (m_dump, " %s\n " , PRINT (appN));
233
236
fprintf (m_dump, " %s\n\n " , PRINT (appV));
Original file line number Diff line number Diff line change @@ -40,22 +40,22 @@ ColumnLayout {
40
40
}
41
41
42
42
//
43
- // A large label displaying the application name
43
+ // A large label displaying the application name and version
44
44
//
45
45
Label {
46
46
size: large
47
- text: appDspName
48
47
font .bold : true
48
+ text: appDspName + " " + appVersion
49
49
anchors .horizontalCenter : parent .horizontalCenter
50
50
}
51
51
52
52
//
53
- // A medium label displaying the application version
53
+ // A medium label displaying the LibDS version
54
54
//
55
55
Label {
56
56
size: medium
57
- text: qsTr (" Version" ) + " " + appVersion
58
57
anchors .horizontalCenter : parent .horizontalCenter
58
+ text: qsTr (" Using LibDS" ) + " v" + DS .libDSVersion
59
59
}
60
60
61
61
//
You can’t perform that action at this time.
0 commit comments