Skip to content
Snippets Groups Projects
Commit d3bb961c authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

added --xy and --fn command line switches to enable only one section of the panel

parent b3c815bd
No related branches found
No related tags found
No related merge requests found
#include <quapplication.h> #include <quapplication.h>
#include "tiptiltgcs.h" #include "tiptiltgcs.h"
#include <QCommandLineParser>
#include <QCommandLineOption>
// cumbia // cumbia
#include <cumbiapool.h> #include <cumbiapool.h>
#include <cuthreadfactoryimpl.h> #include <cuthreadfactoryimpl.h>
...@@ -22,9 +23,13 @@ int main(int argc, char *argv[]) ...@@ -22,9 +23,13 @@ int main(int argc, char *argv[])
qu_app.setProperty("office", "T2 "); qu_app.setProperty("office", "T2 ");
qu_app.setProperty("hwReferent", "R. Gobessi, A. Bogani "); /* name of the referent that provides the device server */ qu_app.setProperty("hwReferent", "R. Gobessi, A. Bogani "); /* name of the referent that provides the device server */
QCommandLineParser parser;
parser.addOption(QCommandLineOption("xy", "enable XY"));
parser.addOption(QCommandLineOption("fn", "enable FN"));
parser.parse(qu_app.arguments());
CumbiaPool *cu_p = new CumbiaPool(); CumbiaPool *cu_p = new CumbiaPool();
TipTiltGcs *w = new TipTiltGcs(cu_p, NULL); TipTiltGcs *w = new TipTiltGcs(cu_p, NULL, parser.isSet("xy"), parser.isSet("fn"));
w->show(); w->show();
// exec application loop // exec application loop
int ret = qu_app.exec(); int ret = qu_app.exec();
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// cumbia // cumbia
#include <QErrorMessage> #include <QErrorMessage>
TipTiltGcs::TipTiltGcs(CumbiaPool *cumbia_pool, QWidget *parent) : TipTiltGcs::TipTiltGcs(CumbiaPool *cumbia_pool, QWidget *parent, bool xy, bool fn) :
QWidget(parent) QWidget(parent)
{ {
// cumbia // cumbia
...@@ -19,13 +19,21 @@ TipTiltGcs::TipTiltGcs(CumbiaPool *cumbia_pool, QWidget *parent) : ...@@ -19,13 +19,21 @@ TipTiltGcs::TipTiltGcs(CumbiaPool *cumbia_pool, QWidget *parent) :
ui = new Ui::tiptiltgcs; ui = new Ui::tiptiltgcs;
ui->setupUi(this, cu_pool, m_ctrl_factory_pool); ui->setupUi(this, cu_pool, m_ctrl_factory_pool);
if (QApplication::arguments().size() >= 3){ if(xy && fn) {
QString tabsel=QApplication::arguments()[2];
if (tabsel.contains("X") || tabsel.contains("Y")) }
ui->tabWidget->setCurrentIndex(0); else if(xy)
if (tabsel.contains("F") || tabsel.contains("N")) ui->tabWidget->removeTab(1);
ui->tabWidget->setCurrentIndex(1); else if(fn)
} ui->tabWidget->removeTab(0);
// if (QApplication::arguments().size() >= 3){
// QString tabsel=QApplication::arguments()[2];
// if (tabsel.contains("X") || tabsel.contains("Y"))
// ui->tabWidget->setCurrentIndex(0);
// if (tabsel.contains("F") || tabsel.contains("N"))
// ui->tabWidget->setCurrentIndex(1);
// }
} }
......
...@@ -18,7 +18,7 @@ class TipTiltGcs : public QWidget ...@@ -18,7 +18,7 @@ class TipTiltGcs : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit TipTiltGcs(CumbiaPool *cu_p, QWidget *parent = nullptr); explicit TipTiltGcs(CumbiaPool *cu_p, QWidget *parent, bool xy, bool fn);
~TipTiltGcs(); ~TipTiltGcs();
private: private:
Ui::tiptiltgcs *ui; Ui::tiptiltgcs *ui;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment