2008-10-08 22:11:27 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2008 by Peter Dahlberg *
|
|
|
|
|
* pdahlberg@gmail.com *
|
|
|
|
|
* *
|
|
|
|
|
* 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. *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LSIM_H
|
|
|
|
|
#define LSIM_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
#include <graphicsview.h>
|
|
|
|
|
|
|
|
|
|
//Hauptfenster
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@author Peter Dahlberg <pdahlberg@gmail.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class QAction;
|
|
|
|
|
class QMenu;
|
|
|
|
|
class QTextEdit;
|
|
|
|
|
class QDockWidget;
|
|
|
|
|
class SimulScene;
|
|
|
|
|
class QActionGroup;
|
|
|
|
|
|
|
|
|
|
class lsim: public QMainWindow {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
lsim();
|
|
|
|
|
~lsim();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void closeEvent (QCloseEvent *event);
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void about();
|
|
|
|
|
void actModeSwitcher(QAction *action);
|
|
|
|
|
void setSceneMode(int mode);
|
|
|
|
|
void updateDockFieldWidget();
|
2008-11-15 13:55:29 +00:00
|
|
|
void startCalculation();
|
|
|
|
|
void startTimer();
|
2008-11-16 22:18:15 +00:00
|
|
|
void handleDockLocationChange();
|
2008-10-08 22:11:27 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void createActions();
|
|
|
|
|
void createMenus();
|
|
|
|
|
void createToolBars();
|
|
|
|
|
void createStatusBar();
|
|
|
|
|
void createDocks();
|
|
|
|
|
void createScene();
|
|
|
|
|
|
|
|
|
|
GraphicsView *gview;
|
|
|
|
|
|
|
|
|
|
QMenu *fileMenu;
|
|
|
|
|
QMenu *editMenu;
|
|
|
|
|
QMenu *helpMenu;
|
2008-11-13 22:10:20 +00:00
|
|
|
QMenu *viewMenu;
|
2008-10-08 22:11:27 +00:00
|
|
|
|
|
|
|
|
QToolBar *fileToolBar;
|
|
|
|
|
QToolBar *editToolBar;
|
2008-11-16 22:18:15 +00:00
|
|
|
QToolBar *upDownToolBar;
|
2008-10-08 22:11:27 +00:00
|
|
|
|
|
|
|
|
struct Actions {
|
|
|
|
|
QAction *aboutAct;
|
|
|
|
|
QAction *exitAct;
|
|
|
|
|
QAction *aboutQtAct;
|
|
|
|
|
QAction *oglEnable;
|
|
|
|
|
QAction *oglDisable;
|
2008-11-13 22:10:20 +00:00
|
|
|
QAction *calculate;
|
2008-10-08 22:11:27 +00:00
|
|
|
QAction *timerStart;
|
2008-11-02 20:34:58 +00:00
|
|
|
QAction *timerStop;
|
2008-10-08 22:11:27 +00:00
|
|
|
|
2008-11-16 22:18:15 +00:00
|
|
|
QAction *moveItemDown;
|
|
|
|
|
QAction *moveItemUp;
|
2008-11-17 15:56:27 +00:00
|
|
|
QAction *moveItemOnTop;
|
|
|
|
|
QAction *moveItemOnBottom;
|
2008-11-16 22:18:15 +00:00
|
|
|
|
2008-10-08 22:11:27 +00:00
|
|
|
QAction *itemEditModeAct;
|
|
|
|
|
QAction *insertEFieldItemAct;
|
2008-10-14 19:31:02 +00:00
|
|
|
QAction *insertBFieldItemAct;
|
2008-11-15 13:55:29 +00:00
|
|
|
QAction *probeChargeItemPlaceAct;
|
2008-10-08 22:11:27 +00:00
|
|
|
};
|
|
|
|
|
Actions acts;
|
|
|
|
|
|
|
|
|
|
QActionGroup *modeChangeActGroup;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QDockWidget *fieldItemEditDock;
|
|
|
|
|
QDockWidget *probeItemDock;
|
2008-11-13 22:10:20 +00:00
|
|
|
QDockWidget *sceneDock;
|
2008-10-08 22:11:27 +00:00
|
|
|
|
|
|
|
|
SimulScene *simulscene;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|