##// END OF EJS Templates
New Plugin Manager and interface to remove all the previous crap!...
New Plugin Manager and interface to remove all the previous crap! Let's use Qt plugin API and make it much simpler.

File last commit:

r107:c459540a6dbd merge 0.6
r118:de85e8465e67 tip 1.0
Show More
main.cpp
126 lines | 4.9 KiB | text/x-c | CppLexer
Jeandet Alexis
First init of SocExplorer Repository.
r0 /*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
Jeandet Alexis
Updated lab name!
r13 -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
Jeandet Alexis
First init of SocExplorer Repository.
r0 --
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@lpp.polytechnique.fr
----------------------------------------------------------------------------*/
#include <QApplication>
#include "mainwindow.h"
#include <PythonQt.h>
#include <PythonQt_QtAll.h>
#include <gui/PythonQtScriptingConsole.h>
#include <socexplorerplugin.h>
#include <QStyle>
#include <QStyleFactory>
#include <QStringList>
#include <QFile>
WIP.
r91 #include <QCommandLineOption>
#include <QCommandLineParser>
Jeandet Alexis
First init of SocExplorer Repository.
r0
WIP.
r91
QCommandLineOption executeOption = QCommandLineOption (
QStringList() << "e" << "execute",
QCoreApplication::translate("main", "Execute given script <script>."),
QCoreApplication::translate("main", "script"));
QCommandLineOption debugLevelOption = QCommandLineOption (
QStringList() << "d" << "debug-level",
Jeandet Alexis
Fixed some cli bugs....
r98 QCoreApplication::translate("main", "Sets debug level to <level>, higher the level is more verbose the application will be."),
QCoreApplication::translate("main", "level"),
WIP.
r91 "1");
QCommandLineOption noGUIOption = QCommandLineOption (
QStringList() << "n" << "no-gui",
Jeandet Alexis
Fixed some cli bugs....
r98 QCoreApplication::translate("main", "Starts SocExplorer in batch mode[not fully implemented yet!]."));
WIP.
r91
const char* socexplorerDesc="\
SocExplorer is an open source generic System On Chip testing software/framework.\
We write this software for the development and the validation of our instrument,\
the Low Frequency Receiver(LFR) for the Solar Orbiter mission. This instrument is\
based on an actel FPGA hosting a LEON3FT processor and some peripherals. To make\
it more collaborative, we use a plugin based system, the main executable is SocExplorer\
then all the functionality are provided by plugins. Like this everybody can provide\
his set of plugins to handle a new SOC or just a new peripheral. SocExplorer uses\
PythonQt to allow user to automate some tasks such as loading some plugins, configuring\
them and talking with his device. SocExplorer is provided under the terms of the GNU\
General Public License as published by the Free Software Foundation; either version 2\
of the License, or (at your option) any later version.";
Jeandet Alexis
First init of SocExplorer Repository.
r0
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QString scriptToEval;
WIP.
r91 QApplication::setOrganizationName("LPP");
QApplication::setOrganizationDomain("lpp.fr");
QApplication::setApplicationName("SocExplorer");
QCommandLineParser parser;
parser.setApplicationDescription(socexplorerDesc);
parser.addHelpOption();
parser.addVersionOption();
Added some regs definitions for LFR instrument. Added memory size measurement.
r73 bool noGUI=false;
Jeandet Alexis
Fixed some cli bugs....
r98 parser.addPositionalArgument("file", QCoreApplication::translate("main", "The Python file to execute."));
WIP.
r91 parser.addOption(executeOption);
parser.addOption(debugLevelOption);
parser.addOption(noGUIOption);
parser.process(a);
if(parser.isSet(executeOption))
Jeandet Alexis
First init of SocExplorer Repository.
r0 {
WIP.
r91 scriptToEval = parser.value(executeOption);
if(!QFile::exists(scriptToEval))
Jeandet Alexis
First init of SocExplorer Repository.
r0 {
WIP.
r91 scriptToEval.clear();
Added some regs definitions for LFR instrument. Added memory size measurement.
r73 }
Jeandet Alexis
First init of SocExplorer Repository.
r0 }
Jeandet Alexis
Fixed some cli bugs....
r98 else
{
Jeandet Alexis
Fixed stupid mistake.
r99 QStringList posArgs = parser.positionalArguments();
if(posArgs.count())
Jeandet Alexis
Fixed some cli bugs....
r98 {
Jeandet Alexis
Fixed stupid mistake.
r99 scriptToEval = posArgs.first();
if(!QFile::exists(scriptToEval))
{
scriptToEval.clear();
}
Jeandet Alexis
Fixed some cli bugs....
r98 }
}
WIP.
r91 if(parser.isSet(debugLevelOption))
{
bool success;
int lvl;
lvl = parser.value(debugLevelOption).toInt(&success,10);
if(success)
{
SocExplorerEngine::setLogLevel(lvl);
}
}
if(parser.isSet(noGUIOption))
{
noGUI = true;
qDebug() << "CLI mode";
}
Jeandet Alexis
Updated lab name!
r13 SocExplorerMainWindow w(scriptToEval);
Added some regs definitions for LFR instrument. Added memory size measurement.
r73 if(!noGUI)
WIP.
r91 {
Added some regs definitions for LFR instrument. Added memory size measurement.
r73 w.show();
WIP.
r91 }
Added some regs definitions for LFR instrument. Added memory size measurement.
r73 else
WIP.
r91 {
Added some regs definitions for LFR instrument. Added memory size measurement.
r73
WIP.
r91 }
Jeandet Alexis
First init of SocExplorer Repository.
r0 return a.exec();
}