DSRemote/mainwindow.h

380 wiersze
8.5 KiB
C
Czysty Zwykły widok Historia

/*
***************************************************************************
*
* Author: Teunis van Beelen
*
* Copyright (C) 2015 Teunis van Beelen
*
* Email: teuniz@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 3 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, see <http://www.gnu.org/licenses/>.
*
***************************************************************************
*/
#ifndef UI_VIEW_MAINFORM_H
#define UI_VIEW_MAINFORM_H
#include <QtGlobal>
#include <QApplication>
2015-06-27 14:42:01 +00:00
#include <QObject>
#include <QtGui>
#include <QWidget>
#include <QMainWindow>
#include <QMenuBar>
#include <QMenu>
#include <QFont>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QFileDialog>
#include <QAction>
#include <QActionGroup>
#include <QPixmap>
#include <QSplashScreen>
#include <QTimer>
#include <QDesktopServices>
#include <QUrl>
#include <QLibrary>
#include <QString>
#include <QVBoxLayout>
#include <QList>
#include <QDockWidget>
#include <QPalette>
#include <QGroupBox>
#include <QMessageBox>
#include <QPoint>
2015-06-01 14:22:41 +00:00
#include <QDial>
2015-06-02 07:54:41 +00:00
#include <QSettings>
2015-06-02 14:20:56 +00:00
#include <QProcess>
2015-06-07 19:34:20 +00:00
#include <QProgressDialog>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
2015-06-05 10:49:30 +00:00
#include <unistd.h>
#include "global.h"
#include "about_dialog.h"
#include "utils.h"
2015-06-27 09:04:41 +00:00
#include "connection.h"
#include "tmc_dev.h"
#include "tled.h"
#include "edflib.h"
#include "signalcurve.h"
2015-06-02 14:20:56 +00:00
#include "settings_dialog.h"
class SignalCurve;
class UI_Mainwindow : public QMainWindow
{
Q_OBJECT
public:
UI_Mainwindow();
~UI_Mainwindow();
char recent_dir[MAX_PATHLEN],
recent_savedir[MAX_PATHLEN];
void read_settings(void);
void write_settings(void);
struct device_settings devparms;
QLabel *statusLabel;
QFont *appfont,
*monofont;
2015-06-05 15:43:27 +00:00
int adjDialFunc,
navDialFunc;
2015-06-10 13:29:45 +00:00
QTimer *scrn_timer,
*label_timer;
2015-06-09 06:37:17 +00:00
private:
QMenuBar *menubar;
QMenu *devicemenu,
2015-07-10 07:42:59 +00:00
*settingsmenu,
*helpmenu;
2015-06-09 06:37:17 +00:00
QTimer *adjdial_timer,
*navDial_timer,
*test_timer;
QStatusBar *statusBar;
2015-06-13 09:51:32 +00:00
QLabel *adjDialLabel,
*horScaleLabel,
*horPosLabel,
*vertScaleLabel,
*vertOffsetLabel,
*trigLevelLabel,
*trigModeLabel,
*ch1InputLabel,
*ch2InputLabel,
*ch3InputLabel,
*ch4InputLabel;
QDockWidget *dockPanelRight;
QWidget *DPRwidget;
QGroupBox *verticalGrpBox,
*horizontalGrpBox,
*triggerGrpBox,
2015-06-03 18:16:59 +00:00
*menuGrpBox,
*quickGrpBox;
QPushButton *ch1Button,
*ch2Button,
*ch3Button,
*ch4Button,
2015-06-03 09:11:56 +00:00
*chanMenuButton,
*clearButton,
*autoButton,
*runButton,
*singleButton,
*horMenuButton,
*trigModeButton,
*trigMenuButton,
*trigForceButton,
*trig50pctButton,
*acqButton,
*cursButton,
*saveButton,
*dispButton,
*utilButton,
*helpButton,
*playpauseButton,
*stopButton,
2015-06-03 18:16:59 +00:00
*recordButton,
*measureButton;
QDial *adjDial,
*horScaleDial,
*horPosDial,
*vertScaleDial,
*vertOffsetDial,
*trigAdjustDial,
*navDial;
QString def_stylesh;
QPixmap screenXpm;
2015-06-12 10:37:47 +00:00
QAction *former_page_act,
*shift_page_left_act,
*shift_page_right_act,
2015-06-12 12:20:11 +00:00
*next_page_act,
*zoom_in_act,
2015-06-13 08:07:53 +00:00
*zoom_out_act,
*chan_scale_plus_act,
*chan_scale_minus_act;
2015-06-12 10:37:47 +00:00
struct tmcdev *device;
TLed *trigModeAutoLed,
*trigModeNormLed,
*trigModeSingLed;
SignalCurve *waveForm;
int parse_preamble(char *, int, struct waveform_preamble *, int);
int get_metric_factor(double);
void get_device_model(const char *);
2015-06-03 15:41:19 +00:00
double get_stepsize_divide_by_1000(double);
private slots:
void scrn_timer_handler();
void stat_timer_handler();
void adjdial_timer_handler();
2015-06-10 13:29:45 +00:00
void label_timer_handler();
void test_timer_handler();
void show_about_dialog();
2015-06-08 14:52:12 +00:00
void show_howto_operate();
void open_connection();
void close_connection();
2015-06-02 14:20:56 +00:00
void open_settings_dialog();
int get_device_settings();
2015-06-04 15:24:31 +00:00
void save_screen_waveform();
void save_memory_waveform();
void save_screenshot();
void adjDialChanged(int);
void trigAdjustDialChanged(int);
void horScaleDialChanged(int);
void horPosDialChanged(int);
void vertOffsetDialChanged(int);
void vertScaleDialChanged(int);
void ch1ButtonClicked();
void ch2ButtonClicked();
void ch3ButtonClicked();
void ch4ButtonClicked();
void clearButtonClicked();
void autoButtonClicked();
void runButtonClicked();
void singleButtonClicked();
void horMenuButtonClicked();
void trigModeButtonClicked();
void trigMenuButtonClicked();
void trigForceButtonClicked();
void trig50pctButtonClicked();
void acqButtonClicked();
void cursButtonClicked();
void saveButtonClicked();
void dispButtonClicked();
void utilButtonClicked();
void helpButtonClicked();
2015-06-03 18:16:59 +00:00
void measureButtonClicked();
2015-06-05 10:49:30 +00:00
void horizontal_delayed_toggle();
void horizontal_delayed_on();
void horizontal_delayed_off();
2015-06-03 18:16:59 +00:00
void counter_off();
void counter_ch1();
void counter_ch2();
void counter_ch3();
void counter_ch4();
void trigger_source_ch1();
void trigger_source_ch2();
void trigger_source_ch3();
void trigger_source_ch4();
void trigger_source_ext();
void trigger_source_ext5();
void trigger_source_acl();
void trigger_coupling_dc();
void trigger_coupling_ac();
void trigger_coupling_lfreject();
void trigger_coupling_hfreject();
void trigger_slope_pos();
void trigger_slope_neg();
void trigger_slope_rfal();
void trigger_setting_holdoff();
void horPosDialClicked(QPoint);
void vertOffsetDialClicked(QPoint);
void horScaleDialClicked(QPoint);
void vertScaleDialClicked(QPoint);
void trigAdjustDialClicked(QPoint);
void adjustDialClicked(QPoint);
void navDialReleased();
void navDial_timer_handler();
void navDialChanged(int);
2015-06-05 15:43:27 +00:00
void set_grid_type_vectors();
void set_grid_type_dots();
2015-06-02 18:43:09 +00:00
void set_grid_full();
void set_grid_half();
void set_grid_none();
void set_grading_min();
void set_grading_005();
void set_grading_01();
void set_grading_02();
void set_grading_05();
void set_grading_1();
void set_grading_2();
void set_grading_5();
void set_grading_10();
void set_grading_20();
void set_grading_inf();
void chan_coupling_ac();
void chan_coupling_dc();
void chan_coupling_gnd();
void chan_bwl_off();
void chan_bwl_20();
void chan_bwl_250();
void chan_invert_on();
void chan_invert_off();
2015-06-03 09:11:56 +00:00
void chan_menu();
2015-06-02 18:43:09 +00:00
2015-06-05 15:43:27 +00:00
void set_acq_normal();
void set_acq_average();
2015-06-11 09:46:56 +00:00
void set_acq_peak();
void set_acq_hres();
2015-06-05 15:43:27 +00:00
2015-06-14 15:38:43 +00:00
void set_memdepth(int);
2015-06-07 19:34:20 +00:00
void set_memdepth_auto();
void set_memdepth_12k();
void set_memdepth_120k();
void set_memdepth_1200k();
void set_memdepth_12m();
void set_memdepth_24m();
void set_memdepth_6k();
void set_memdepth_60k();
void set_memdepth_600k();
void set_memdepth_6m();
void set_memdepth_3k();
void set_memdepth_30k();
void set_memdepth_300k();
void set_memdepth_3m();
void set_memdepth_7k();
void set_memdepth_70k();
void set_memdepth_700k();
void set_memdepth_7m();
void set_memdepth_70m();
void set_memdepth_14k();
void set_memdepth_140k();
void set_memdepth_1400k();
void set_memdepth_14m();
void set_memdepth_140m();
2015-06-08 14:52:12 +00:00
void set_memdepth_28m();
void set_memdepth_56m();
2015-06-07 19:34:20 +00:00
2015-06-12 10:37:47 +00:00
void former_page();
void shift_page_left();
void shift_page_right();
void next_page();
2015-06-12 12:20:11 +00:00
void zoom_in();
void zoom_out();
2015-06-13 08:07:53 +00:00
void chan_scale_plus();
void chan_scale_minus();
2015-06-12 10:37:47 +00:00
2015-06-14 17:13:37 +00:00
void set_to_factory();
protected:
void closeEvent(QCloseEvent *);
};
#endif