Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrGuiModel_H_
00010 #define lgrGuiModel_H_
00011
00012 #include "lgrGui.h"
00013
00014 #include <QtCore/QString>
00015 #include <map>
00016 #include <set>
00017 #include "vlutil/vlFilename.h"
00018
00019 class DtString;
00020 class QAction;
00021 class QDialog;
00022 class QObject;
00023 class QStyle;
00024 class QTimer;
00025 class QWidget;
00026 class QProcess;
00027
00028 namespace MAKLogger
00029 {
00030 class DtAbsoluteTime;
00031 class DtBoundsSlider;
00032 class DtLgrEditorInterface;
00033 class DtLgrFullInterface;
00034 class DtLgrGuiComponent;
00035 class DtLgrMainWindow;
00036 class DtLgrMainWindow;
00037 class DtLgrMenu;
00038 class DtLgrPlaybackInterface;
00039 class DtLgrRecordInterface;
00040 class DtLgrSimInterface;
00041 class DtLgrSystemInterface;
00042 class DtLgrTimeInterface;
00043 class DtLgrToolBar;
00044 class DtTimeComponent;
00045 class DtLgrExportDialog;
00046
00048 class DT_DLL_LGRGUI DtLgrGuiModel
00049 {
00050 public:
00051 typedef std::map<QString,bool> DtComponentVisibilityMap;
00052
00053 public:
00054
00059 DtLgrGuiModel(DtLgrFullInterface* fullInterface);
00060
00062 virtual ~DtLgrGuiModel();
00063
00069 virtual void initialize(DtLgrMainWindow* mainWindow,QObject* eventHandler);
00070
00071 void addExportType( QString exportName, int exportType);
00072
00074 void addNewMenu( DtLgrMenu* menu, QString previousMenuName = QString() );
00075
00077 void addNewToolbar( QWidget* toolBar, QString toolBarName );
00078
00080 virtual void addGuiComponent( DtLgrGuiComponent* component);
00081
00083 void changeGuiComponentVisibility(QString componentName, bool visible);
00084
00086 void setGuiComponentInitialVisibility(QString componentName, bool visible);
00087
00089 void updateLgrComponent(QString componentName,bool visible);
00090
00092 void showLgrComponent( QString componentName );
00093
00095 void hideLgrComponent( QString componentName );
00096
00098 void getComponentsVisibility(DtComponentVisibilityMap& visibilityMap) const;
00099
00101 void addNewStatusWidget( QWidget* widget );
00102
00104 void connectMenuItemToAction(QString menuName,QString menuItemName,
00105 QAction* action);
00106
00107 typedef DtLgrExportDialog* (*ExportDialogCreator)(DtLgrGuiModel*,QWidget* parent);
00108
00110 void addExportDialog(QString exportType,ExportDialogCreator creator);
00111
00112
00114
00118 virtual bool exit();
00119
00121 virtual void startLongOperation();
00122
00124 virtual void finishLongOperation();
00125
00127 virtual void updateLongOperation();
00128
00130 virtual void cancelLongOperation();
00131
00133
00134
00136
00138 virtual QString getLoggerFileFilter() const;
00139
00141 virtual QString getDefaultLoggerFileDirectory() const;
00142
00144 QString getSaveLoggerFileName(QWidget* parentWindow,QString title);
00145
00147 virtual bool openFile();
00148
00150 bool openFile( QString &filename );
00151
00153 virtual bool saveFileAs();
00154
00156 virtual bool saveFile();
00157
00161 virtual bool fileSaved() const;
00162
00164 virtual bool closeFile();
00165
00167 virtual void exportSection(const DtString& fileFormat);
00168
00170 virtual void exportFile(const DtString& fileFormat);
00171
00172
00174
00177 virtual void recordAs();
00178
00181 void recordFile(QString filename,bool overwrite);
00182
00184 void recordToMultipleFiles(QString filename);
00185
00187 void queryUserOfEmptyFile();
00188
00190 void saveRecordingData();
00191
00194 void setZoom();
00195
00197 void setZoom(const DtAbsoluteTime& start,const DtAbsoluteTime& end);
00198
00200
00202 virtual QString fileNameForDisplay() const;
00203
00205 void upgradeFile();
00206
00208 void repairFile(const QString& filename);
00209
00211 void exportCompleted();
00212
00214 virtual void revert();
00215
00217
00218
00220
00222 virtual void setSpeed();
00223
00225 virtual void setStartStopTimes();
00226
00228 void setStartStopTimes(const DtAbsoluteTime& start,
00229 const DtAbsoluteTime& stop);
00230
00232 virtual void stop();
00233
00235
00236
00238
00240 virtual void clearSelection();
00241
00243 virtual void cutSelection();
00244
00246 virtual void mergeInFile();
00247
00249 virtual void appendFile();
00250
00252 virtual void prefixFile();
00253
00255 virtual void offsetTime();
00256
00258
00260 const DtLgrFullInterface* fullInterface() const;
00261 DtLgrFullInterface* fullInterface();
00262
00264 const DtLgrEditorInterface* editorInterface() const;
00265
00267 const DtLgrPlaybackInterface* playbackInterface() const;
00268
00270 const DtLgrRecordInterface* recordInterface() const;
00271
00273 const DtLgrSimInterface* simulationInterface() const;
00274
00276 const DtLgrSystemInterface* systemInterface() const;
00277
00280 const DtLgrTimeInterface* timeInterface() const;
00281
00283 void updateInterfaces();
00284
00286 void deleteAssistant();
00287
00289 void toggleConnection();
00290
00292 QObject* eventHandler();
00293
00295 DtLgrMainWindow* mainWindow();
00296
00298 void crippleGui(bool disableAndMinimize);
00299
00301 void openUrl(const QString& urlText);
00302
00304 void showHelp(const char* filename = 0);
00305
00307 void showUserGuide();
00308
00310 void showReleaseNotes();
00311
00313 void showClassDocs();
00314
00316 void showAboutBox();
00317
00319 void launchVersionWebsite();
00320
00322 void launchProductWebsite();
00323
00326 const DtTimeComponent& displayTime() const;
00327
00329 void playbackFileEvent(const QString& filename);
00330
00332 void recordFileEvent(const QString& filename);
00333
00335 bool isZoomEnabled() const;
00336
00337 protected:
00338
00339 void longOperationChangedCallback(const bool& state);
00340 void longOperationMessageChangedCallback(const DtString& message);
00341 void longOperationProgressChangedCallback(const int& percent);
00342
00343 QString showExportDialog(QString fileFormat,QString filter, QString dialogName);
00344 QString browseOpenLoggerFile(QString title);
00345
00346 protected:
00347 DtLgrMainWindow* myMainWindow;
00348 QObject* myEventHandler;
00349 DtLgrFullInterface* myFullInterface;
00350 DtBoundsSlider* myTimeControl;
00351 DtBoundsSlider* myZoomControl;
00352 QProcess* myHelpAssistant;
00353 DtTimeComponent* myTimeComponent;
00354
00355 typedef std::map<QString,DtLgrGuiComponent*> GuiComponentMap;
00356 GuiComponentMap myComponents;
00357 DtComponentVisibilityMap myComponentsInitialVisibility;
00358
00359 typedef std::map<QString,ExportDialogCreator> ExportDialogMap;
00360 ExportDialogMap myExportDialogMap;
00361
00362 typedef std::set<QString> ExportTypes;
00363 ExportTypes myExportTypes;
00364
00365 QStyle* myNewDockStyle;
00366
00367 bool myExitingFlag;
00368
00369 DtFilename myRepairedFilename;
00370
00371 QString myDataViewName;
00372 };
00373 }
00374
00375 #endif