source: pacpusframework/branches/2.0-beta1/src/DBITEPlayer/src/main.cpp@ 146

Last change on this file since 146 was 146, checked in by Marek Kurdej, 11 years ago

Update: refactoring in XmlConfigFile.
Added: attributes 'prefix', 'postfix', 'extension' in <parameters>.
Example: <parameters prefix="" postfix="_d" extension="dll">

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @author Elie Al Alam <firstname.surname@utc.fr>
6/// @author Gerald Dherbomez <firstname.surname@utc.fr>
7/// @author Marek Kurdej <firstname.surname@utc.fr>
8/// @date April, 2007
9/// @version $Id: main.cpp 81 2013-01-11 22:31:02Z kurdejma $
10/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
11/// @brief DbitePlayer main function.
12///
13/// Detailed description.
14/// @todo - barre de temps dans l'affichage graphique
15/// - am�liorer l'affichage ; ic�ne, emplacement des boutons...
16/// - ajouter r�pertoire racine des donn�es (fait) :
17/// ajouter affichage de ce r�pertoire
18/// - ajouter classe g�n�rique d'�change de donn�es vers
19/// d'autres applications
20/// - fen�tre de monitoring des composants : valable pour
21/// toutes les applis bas�es sur PacpusLib
22/// avec possibilit� de masquer cette partie
23/// - faire une classe GraphViewer :
24/// permet d'afficher un nombre ind�fini de courbes
25/// offre des param�tres basiques : couleurs de la courbe,
26/// types de points, reli�s ou pas
27/// les courbes sont identifi�s par des noms
28/// voir comment l'utilisateur peut interagir avec les courbes
29/// par ex recuperer la valeur d'un point
30/// - associer a chaque composant une fenetre en dock view,
31/// affichagable ou pas defini dans le fichier de config
32
33#include <Pacpus/DbitePlayer/DbtPlyEngine.h>
34#include <Pacpus/DbitePlayer/DbtPlyTrigger.h>
35#include <Pacpus/DbitePlayer/DbtPlyUserInterface.h>
36#include <Pacpus/kernel/ComponentManager.h>
37#include <Pacpus/kernel/ComponentFactory.h>
38#include <Pacpus/kernel/Log.h>
39#include <Pacpus/kernel/PacpusApplication.h>
40#include <Pacpus/kernel/PacpusPluginInterface.h>
41
42#include <cassert>
43
44using namespace pacpus;
45using namespace std;
46
47DECLARE_STATIC_LOGGER("pacpus.core.DbitePlayer");
48
49static const string kDefaultXmlConfigFilePath = "DbitePlayer.xml";
50
51int main(int argc, char * argv[])
52{
53 LogConfigurator::configureLoggerWithFile("PacpusDbitePlayer_%N.log");
54
55 PacpusApplication app(argc, argv);
56 ComponentManager * mgr = ComponentManager::getInstance();
57
58 static ComponentFactory<DbtPlyEngine> factoryDbtPlyEngine("DbtPlyEngine");
59 (void) factoryDbtPlyEngine; // unused
60 static ComponentFactory<DbtPlyTrigger> factoryDbtPlyTrigger("DbtPlyTrigger");
61 (void) factoryDbtPlyTrigger; // unused
62 static ComponentFactory<DbtPlyUserInterface> factoryDbtPlyUserInterface("DbtPlyUserInterface");
63 (void) factoryDbtPlyUserInterface; // unused
64
65 string configFilePath;
66 if (argc > 1) {
67 configFilePath = argv[1];
68 } else {
69 configFilePath = kDefaultXmlConfigFilePath;
70 LOG_WARN("no XML config file specified. Using default: " << configFilePath);
71 }
72 LOG_INFO("loading file '" << configFilePath << "'");
73 size_t componentCount = mgr->loadComponents(configFilePath.c_str());
74 if (componentCount == 0) {
75 LOG_FATAL("no components, exiting");
76 return EXIT_FAILURE;
77 }
78
79 // start all the components (engine, trigger, user interface and the DBT file managers)
80 mgr->start();
81 // save application exit status
82 int exitStatus = app.exec();
83 // stop all components before exiting app
84 mgr->stop();
85
86 mgr->destroy();
87
88 // return application exit status
89 return exitStatus;
90}
Note: See TracBrowser for help on using the repository browser.