Skip to content

Commit

Permalink
Add better handling of version number labelling. Version number is no…
Browse files Browse the repository at this point in the history
…w defined in main.cpp
  • Loading branch information
daharoni committed Feb 26, 2020
1 parent 555a9e4 commit b0cbad3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions source/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

backEnd::backEnd(QObject *parent) :
QObject(parent),
m_versionNumber(""),
m_userConfigFileName(""),
m_userConfigOK(false),
behavTracker(nullptr)
Expand Down
7 changes: 7 additions & 0 deletions source/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class backEnd : public QObject
Q_PROPERTY(QString userConfigDisplay READ userConfigDisplay WRITE setUserConfigDisplay NOTIFY userConfigDisplayChanged)
Q_PROPERTY(bool userConfigOK READ userConfigOK WRITE setUserConfigOK NOTIFY userConfigOKChanged)
Q_PROPERTY(QString availableCodecList READ availableCodecList WRITE setAvailableCodecList NOTIFY availableCodecListChanged)
Q_PROPERTY(QString versionNumber READ versionNumber WRITE setVersionNumber NOTIFY versionNumberChanged)
public:
explicit backEnd(QObject *parent = nullptr);

Expand All @@ -37,6 +38,9 @@ class backEnd : public QObject
QString availableCodecList(){ return m_availableCodecList; }
void setAvailableCodecList(const QString &input);

QString versionNumber() { return m_versionNumber; }
void setVersionNumber(const QString &input) { m_versionNumber = input; }

void loadUserConfigFile();
bool checkUserConfigForIssues();
void constructUserConfigGUI();
Expand All @@ -52,6 +56,8 @@ class backEnd : public QObject
void userConfigDisplayChanged();
void userConfigOKChanged();
void availableCodecListChanged();
void versionNumberChanged();

void closeAll();
void showErrorMessage();
void showErrorMessageCompression();
Expand All @@ -70,6 +76,7 @@ public slots:

void testCodecSupport();

QString m_versionNumber;
QString m_userConfigFileName;
QString m_userConfigDisplay;
bool m_userConfigOK;
Expand Down
2 changes: 2 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "backend.h"

#define VERSION_NUMBER "0.162"
// TODO: have exit button close everything

// For Window's deployment
Expand Down Expand Up @@ -40,6 +41,7 @@ int main(int argc, char *argv[])

engine.load(url);

backend.setVersionNumber(VERSION_NUMBER);
QObject::connect(&backend, &backEnd::closeAll, &engine, &QQmlApplicationEngine::quit);
return app.exec();
}
2 changes: 1 addition & 1 deletion source/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Window {
anchors.fill: parent

TextArea {
text: "Miniscope DAQ Software version 0.161 <br/>" +
text: "Miniscope DAQ Software version " + backend.versionNumber + "<br/>" +
"Your OpenGL verions: " + OpenGLInfo.majorVersion + "." + OpenGLInfo.minorVersion + "<br/>" +
"Developed by the <a href='https://aharoni-lab.github.io/'>Aharoni Lab</a>, UCLA <br/> " +
"Overview of the UCLA Miniscope project: <a href='http://www.miniscope.org'>click here</a> <br/>" +
Expand Down
2 changes: 1 addition & 1 deletion userConfigs/UserConfigExample_V4_BNO_Miniscope.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"deviceType": "Miniscope_V4_BNO",
"imageRegistration": "Off",
"streamHeadOrientation": true,
"deviceID": 1,
"deviceID": 2,
"showSaturation": true,
"compressionOptions": ["MJPG","MJ2C","XVID","FFV1"],
"compression": "FFV1",
Expand Down
4 changes: 2 additions & 2 deletions userConfigs/UserConfigExample_V4_BNO_Plus_BehavCam.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"miniscopes": [
{
"deviceName": "Miniscope 2",
"deviceType": "Miniscope_V4_BNO",
"deviceType": "Miniscope_V4",
"imageRegistration": "Off",
"streamHeadOrientation": true,
"deviceID": 1,
"deviceID": 2,
"showSaturation": true,
"compressionOptions": ["MJPG","MJ2C","XVID","FFV1"],
"compression": "FFV1",
Expand Down

0 comments on commit b0cbad3

Please sign in to comment.