Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-spataru committed Jan 15, 2017
2 parents 618ed52 + f1fc6e9 commit 7e11d63
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/LibDS/include/LibDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
extern "C" {
#endif

#define LIB_DS_VERSION "2.0.0"

#include "DS_Timer.h"
#include "DS_Types.h"
#include "DS_Utils.h"
Expand Down
8 changes: 8 additions & 0 deletions lib/LibDS/wrappers/Qt/DriverStation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ int DriverStation::robotPacketLoss() const
return 100;
}

/**
* Returns the version of LibDS as a string
*/
QString DriverStation::libDSVersion()
{
return QString (LIB_DS_VERSION);
}

/**
* Returns the team number used by the LibDS,
* use the \c setTeamNumber() function to change it
Expand Down
5 changes: 5 additions & 0 deletions lib/LibDS/wrappers/Qt/DriverStation.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class DriverStation : public QObject
Q_PROPERTY (QStringList protocols
READ protocols
CONSTANT)
Q_PROPERTY (QString libDSVersion
READ libDSVersion
CONSTANT)
Q_PROPERTY (int fmsPacketLoss
READ fmsPacketLoss)
Q_PROPERTY (int radioPacketLoss
Expand Down Expand Up @@ -206,6 +209,8 @@ class DriverStation : public QObject
#endif
}

static QString libDSVersion();

int teamNumber() const;
int joystickCount() const;

Expand Down
3 changes: 3 additions & 0 deletions lib/LibDS/wrappers/Qt/EventLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ void DSEventLogger::init()
/* Get app info */
QString appN = qApp->applicationName();
QString appV = qApp->applicationVersion();
QString ldsV = DriverStation::libDSVersion();
QString time = GET_DATE_TIME ("MMM dd yyyy - HH:mm:ss AP");

/* Get dump directoru */
Expand Down Expand Up @@ -222,12 +223,14 @@ void DSEventLogger::init()

/* Format app info */
time.prepend ("Log created on: ");
ldsV.prepend ("LibDS version: ");
sysV.prepend ("Operating System: ");
appN.prepend ("Application name: ");
appV.prepend ("Application version: ");

/* Append app info */
fprintf (m_dump, "%s\n", PRINT (time));
fprintf (m_dump, "%s\n", PRINT (ldsV));
fprintf (m_dump, "%s\n", PRINT (sysV));
fprintf (m_dump, "%s\n", PRINT (appN));
fprintf (m_dump, "%s\n\n", PRINT (appV));
Expand Down
8 changes: 4 additions & 4 deletions qml/MainWindow/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ ColumnLayout {
}

//
// A large label displaying the application name
// A large label displaying the application name and version
//
Label {
size: large
text: appDspName
font.bold: true
text: appDspName + " " + appVersion
anchors.horizontalCenter: parent.horizontalCenter
}

//
// A medium label displaying the application version
// A medium label displaying the LibDS version
//
Label {
size: medium
text: qsTr ("Version") + " " + appVersion
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr ("Using LibDS") + " v" + DS.libDSVersion
}

//
Expand Down

0 comments on commit 7e11d63

Please sign in to comment.