ZT/sources/main.cpp
jfmartel 9fcceea4f0 Bug Fix
-Correction du fichier ZT.cfg pour qu'il fonctionne mieux sur le proto
-Ajout du paramètre -version pour imprimer la version de la ZT
2017-09-26 14:44:07 -04:00

102 lines
2.7 KiB
C++

/*******************************************************************************
* *
* Société de Transports de Montréal. *
* 2012 *
* *
* Projet Zones Tests *
* *
* *
* *
*******************************************************************************/
/*
Description:
Le main.
*/
/* ************************************************************************** */
/* Revision:
### 20121210 JFM
Verision d'origine.
### YYYYMMDD Description du besoin ou du bug
Description du changement.
*/
/* ************************************************************************** */
#include <QApplication>
#include "Zonetest.h"
#include "MainPanel.h"
#include "ZTVersion.h"
#include <qobject.h>
int main(int argc, char *argv[])
{
QApplication::setGraphicsSystem("raster");
//Qt Mainframe application instance.
QApplication a(argc, argv);
QFont serifFont("Times", 10, QFont::Bold);
QApplication::setFont(serifFont);
bool FullScreen = true;
bool SimulLazerProbes = false;
bool IgnoreStationKey = false;
bool DisablePassword = false;
bool UseWatchdog = true;
for ( int i = 1 ; i < argc ; i ++ )
{
// qDebug("%d %s",i,argv[i]);
if ( strcmp(argv[i],"-windowed") == 0 )
{
FullScreen = false;
}
else if ( strcmp(argv[i],"-simullazer") == 0 )
{
SimulLazerProbes = true;
}
else if ( strcmp(argv[i],"-ignorekey") == 0 )
{
IgnoreStationKey = true;
}
else if ( strcmp(argv[i],"-disablepassword") == 0 )
{
DisablePassword = true;
}
else if ( strcmp(argv[i],"-disablewatchdog") == 0 )
{
UseWatchdog = false;
}
else if ( strcmp(argv[i],"-version") == 0 )
{
qDebug("ZoneTest version: %s",ZT_SOFT_VERSION);
return 99;
}
}
//Create program instance
CZoneTest ZoneTest;
ZoneTest.mFullScreen = FullScreen;
ZoneTest.mSimulateLazerProbes = SimulLazerProbes;
ZoneTest.mIgnoreStationPhysicalKey = IgnoreStationKey;
ZoneTest.mDisablePassword = DisablePassword;
ZoneTest.mUseWatchdog = UseWatchdog;
//setup stdout for screen printing.
setvbuf(stdout, NULL, _IONBF, 0 );
//Run Zone Tests
ZoneTest.Start();
return a.exec();
}