DSRemote/mainwindow.h

484 wiersze
12 KiB
C
Czysty Zwykły widok Historia

/*
***************************************************************************
*
* Author: Teunis van Beelen
*
2023-02-08 20:22:28 +00:00
* Copyright (C) 2015 - 2023 Teunis van Beelen
*
2019-05-28 06:36:25 +00:00
* Email: teuniz@protonmail.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 <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>
2017-07-09 12:32:25 +00:00
#include <pthread.h>
2023-02-08 20:22:28 +00:00
#include "qt_headers.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"
#include "screen_thread.h"
#include "lan_connect_thread.h"
#include "read_settings_thread.h"
#include "save_data_thread.h"
#include "decode_dialog.h"
#include "tdial.h"
2016-12-28 10:48:47 +00:00
#include "wave_dialog.h"
2017-05-14 16:16:49 +00:00
#include "playback_dialog.h"
2016-01-04 13:20:26 +00:00
#include "third_party/kiss_fft/kiss_fftr.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);
void set_cue_cmd(const char *);
2017-05-14 16:16:49 +00:00
void set_cue_cmd(const char *, char *);
2016-12-28 18:11:51 +00:00
void serial_decoder(struct device_settings *);
2017-01-07 18:19:37 +00:00
void save_wave_inspector_buffer_to_edf(struct device_settings *);
2016-12-28 18:11:51 +00:00
struct device_settings devparms;
QLabel *statusLabel;
2019-08-01 13:11:58 +00:00
QFont *appfont;
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
screen_thread *scrn_thread;
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,
*horPosDial_timer,
*trigAdjDial_timer,
*vertOffsDial_timer,
*horScaleDial_timer,
*vertScaleDial_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,
2016-01-04 13:20:26 +00:00
*measureButton,
*mathMenuButton;
TDial *adjDial,
*horScaleDial,
*horPosDial,
*vertScaleDial,
*vertOffsetDial,
*trigAdjustDial,
*navDial;
QString def_stylesh;
QImage 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_plus_all_channels_act,
*chan_scale_minus_act,
*chan_scale_minus_all_channels_act,
*shift_trace_up_act,
*shift_trace_down_act,
*select_chan1_act,
*select_chan2_act,
*select_chan3_act,
2016-02-06 13:15:44 +00:00
*select_chan4_act,
*toggle_fft_act,
2016-12-29 09:56:58 +00:00
*center_trigger_act,
*center_position_act,
*save_screenshot_act,
*save_app_screenshot_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);
2016-12-08 16:48:26 +00:00
inline unsigned char reverse_bitorder_8(unsigned char);
inline unsigned int reverse_bitorder_32(unsigned int);
int get_device_settings(int delay=0);
private slots:
void scrn_timer_handler();
void screenUpdate();
void adjdial_timer_handler();
2015-06-10 13:29:45 +00:00
void label_timer_handler();
void test_timer_handler();
void horPosDial_timer_handler();
void trigAdjDial_timer_handler();
void vertOffsDial_timer_handler();
void horScaleDial_timer_handler();
void vertScaleDial_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();
2015-06-04 15:24:31 +00:00
void save_screen_waveform();
2017-01-07 18:19:37 +00:00
void get_deep_memory_waveform();
void save_screenshot();
void save_app_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_source_la_d0(void);
void trigger_source_la_d1(void);
void trigger_source_la_d2(void);
void trigger_source_la_d3(void);
void trigger_source_la_d4(void);
void trigger_source_la_d5(void);
void trigger_source_la_d6(void);
void trigger_source_la_d7(void);
void trigger_source_la_d8(void);
void trigger_source_la_d9(void);
void trigger_source_la_d10(void);
void trigger_source_la_d11(void);
void trigger_source_la_d12(void);
void trigger_source_la_d13(void);
void trigger_source_la_d14(void);
void trigger_source_la_d15(void);
void trigger_source_la(int);
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();
2017-10-15 16:43:43 +00:00
void chan_bwl_100();
void chan_bwl_200();
2015-06-02 18:43:09 +00:00
void chan_bwl_250();
void chan_invert_on();
void chan_invert_off();
2017-10-15 16:43:43 +00:00
void chan_probe_001();
void chan_probe_002();
void chan_probe_005();
void chan_probe_01();
void chan_probe_02();
void chan_probe_05();
void chan_probe_1();
void chan_probe_2();
void chan_probe_5();
void chan_probe_10();
void chan_probe_20();
void chan_probe_50();
void chan_probe_100();
2017-10-15 16:43:43 +00:00
void chan_probe_200();
void chan_probe_500();
void chan_probe_1000();
2015-06-02 18:43:09 +00:00
2016-12-31 16:17:22 +00:00
void chan_unit_v();
void chan_unit_w();
void chan_unit_a();
void chan_unit_u();
2015-06-03 09:11:56 +00:00
void chan_menu();
2016-01-04 13:20:26 +00:00
void math_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_plus_all();
void chan_scale_minus_all();
2015-06-13 08:07:53 +00:00
void chan_scale_minus();
void shift_trace_up();
void shift_trace_down();
void center_trigger();
2015-06-12 10:37:47 +00:00
2015-06-14 17:13:37 +00:00
void set_to_factory();
2016-01-04 13:20:26 +00:00
void toggle_fft();
void toggle_fft_split();
void toggle_fft_unit();
void select_fft_ch1();
void select_fft_ch2();
void select_fft_ch3();
void select_fft_ch4();
2016-01-04 18:00:49 +00:00
void select_fft_hzdiv_20();
void select_fft_hzdiv_40();
2016-01-07 17:05:24 +00:00
void select_fft_hzdiv_80();
2016-01-04 18:00:49 +00:00
void select_fft_hzdiv_100();
void select_fft_hzdiv_200();
2016-01-12 15:56:25 +00:00
void set_fft_hzdiv(double);
2016-01-04 18:00:49 +00:00
void select_fft_ctr_5();
void select_fft_ctr_6();
void select_fft_ctr_7();
void select_fft_ctr_8();
void select_fft_ctr_9();
void select_fft_ctr_10();
void select_fft_ctr_11();
void select_fft_ctr_12();
2016-01-09 11:42:43 +00:00
void select_fft_vscale1();
2016-01-06 10:55:25 +00:00
void select_fft_vscale2();
void select_fft_vscale5();
void select_fft_vscale10();
void select_fft_vscale20();
2016-01-09 11:42:43 +00:00
void set_fft_vscale();
void select_fft_voffsetp4();
void select_fft_voffsetp3();
void select_fft_voffsetp2();
void select_fft_voffsetp1();
void select_fft_voffset0();
void select_fft_voffsetm1();
void select_fft_voffsetm2();
void select_fft_voffsetm3();
void select_fft_voffsetm4();
2016-01-09 11:42:43 +00:00
void set_fft_voffset();
2016-01-04 13:20:26 +00:00
void show_decode_window();
2017-05-14 16:16:49 +00:00
void show_playback_window();
void playpauseButtonClicked();
void stopButtonClicked();
void recordButtonClicked();
2016-03-12 17:15:30 +00:00
void updateLabels();
protected:
void closeEvent(QCloseEvent *);
};
#endif