src/SimulatorWindow.h
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:51:08 +0200
branchv_0
changeset 10 da93f3667a52
parent 6 f81d43b74209
permissions -rw-r--r--
fix license version: GNU GPLv3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Spacenav Simulator Qt
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
10
da93f3667a52 fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 6
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <vector>
4
a874deb6a536 tidy up includes
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    20
#include <QMainWindow>
a874deb6a536 tidy up includes
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    21
#include <QCheckBox>
a874deb6a536 tidy up includes
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    22
#include <QSlider>
a874deb6a536 tidy up includes
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    23
#include <QPushButton>
6
f81d43b74209 Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    24
#include <QTimer>
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
2
a27850958a67 emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    26
#include "MotionEvent.h"
a27850958a67 emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    27
#include "ButtonEvent.h"
a27850958a67 emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    28
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
class SimulatorWindow : public QMainWindow {
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
	Q_OBJECT
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
public:
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	SimulatorWindow();
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	SimulatorWindow(const SimulatorWindow& orig);
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	virtual ~SimulatorWindow();
2
a27850958a67 emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    35
signals:
3
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 2
diff changeset
    36
	void motionEvent(MotionEvent e);
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 2
diff changeset
    37
	void buttonEvent(ButtonEvent e);
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
private:
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	std::vector<QCheckBox*> buttons;
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
	std::vector<QSlider*> motions;
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
	std::vector<QSlider*> rotations;
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	QPushButton* centerButton;
6
f81d43b74209 Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    43
	QCheckBox* periodicButton;
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	QSlider* createSlider(QWidget* parent);
6
f81d43b74209 Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents: 4
diff changeset
    45
	QTimer* timer;
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
private slots:
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	void centerAll();
2
a27850958a67 emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    49
	void sendMotionEvent();
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
};