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 2828extern "C" {
2929#endif
3030
31+ #define LIB_DS_VERSION "2.0.0"
32+
3133#include "DS_Timer.h"
3234#include "DS_Types.h"
3335#include "DS_Utils.h"
Original file line number Diff line number Diff line change @@ -120,6 +120,14 @@ int DriverStation::robotPacketLoss() const
120120 return 100 ;
121121}
122122
123+ /* *
124+ * Returns the version of LibDS as a string
125+ */
126+ QString DriverStation::libDSVersion ()
127+ {
128+ return QString (LIB_DS_VERSION);
129+ }
130+
123131/* *
124132 * Returns the team number used by the LibDS,
125133 * 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
141141 Q_PROPERTY (QStringList protocols
142142 READ protocols
143143 CONSTANT)
144+ Q_PROPERTY (QString libDSVersion
145+ READ libDSVersion
146+ CONSTANT)
144147 Q_PROPERTY (int fmsPacketLoss
145148 READ fmsPacketLoss)
146149 Q_PROPERTY (int radioPacketLoss
@@ -206,6 +209,8 @@ class DriverStation : public QObject
206209#endif
207210 }
208211
212+ static QString libDSVersion ();
213+
209214 int teamNumber () const ;
210215 int joystickCount () const ;
211216
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ void DSEventLogger::init()
181181 /* Get app info */
182182 QString appN = qApp->applicationName ();
183183 QString appV = qApp->applicationVersion ();
184+ QString ldsV = DriverStation::libDSVersion ();
184185 QString time = GET_DATE_TIME (" MMM dd yyyy - HH:mm:ss AP" );
185186
186187 /* Get dump directoru */
@@ -222,12 +223,14 @@ void DSEventLogger::init()
222223
223224 /* Format app info */
224225 time.prepend (" Log created on: " );
226+ ldsV.prepend (" LibDS version: " );
225227 sysV.prepend (" Operating System: " );
226228 appN.prepend (" Application name: " );
227229 appV.prepend (" Application version: " );
228230
229231 /* Append app info */
230232 fprintf (m_dump, " %s\n " , PRINT (time));
233+ fprintf (m_dump, " %s\n " , PRINT (ldsV));
231234 fprintf (m_dump, " %s\n " , PRINT (sysV));
232235 fprintf (m_dump, " %s\n " , PRINT (appN));
233236 fprintf (m_dump, " %s\n\n " , PRINT (appV));
Original file line number Diff line number Diff line change @@ -40,22 +40,22 @@ ColumnLayout {
4040 }
4141
4242 //
43- // A large label displaying the application name
43+ // A large label displaying the application name and version
4444 //
4545 Label {
4646 size: large
47- text: appDspName
4847 font .bold : true
48+ text: appDspName + " " + appVersion
4949 anchors .horizontalCenter : parent .horizontalCenter
5050 }
5151
5252 //
53- // A medium label displaying the application version
53+ // A medium label displaying the LibDS version
5454 //
5555 Label {
5656 size: medium
57- text: qsTr (" Version" ) + " " + appVersion
5857 anchors .horizontalCenter : parent .horizontalCenter
58+ text: qsTr (" Using LibDS" ) + " v" + DS .libDSVersion
5959 }
6060
6161 //
You can’t perform that action at this time.
0 commit comments