-
Notifications
You must be signed in to change notification settings - Fork 3
/
mainwindow.h
111 lines (84 loc) · 2.76 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QMessageBox>
#include <QRegExpValidator>
#include <QProcess>
#include <QFileDialog>
#include <QStandardPaths>
#include <QCloseEvent>
#include <QMutex>
#include <QMimeData>
#include <QCoreApplication>
#include <QTranslator>
#include "ltfsdefine.h"
#define TAB_MOUNT_INDEX 0
#define TAB_FORMAT_INDEX 1
#define TAB_UNMOUNT_INDEX 2
#define MOUNT_TIMERTICK 5000
#define PROCESSING_TIMERTICK 1000
#define LTFSLSDEV_CMD "ltfslsdev.exe"
#define UMOUNT_CMD "/sbin/umount"
#define UMOUNT_OPT_F "-f"
#define TRANSLATE_RESOURCE_NAMEBASE ":/qm"
namespace Ui{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void postprocess_stdout_output();
void postprocess_stderr_output();
void lsdevprocess_stdout_output();
void mountprocess_stdout_output();
void process_exit(int, QProcess::ExitStatus);
void on_pushButton_Execute_clicked();
void on_tabWidget_Comannds_currentChanged(int index);
private:
Ui::MainWindow *ui;
//QApplicationインスタンス
QCoreApplication *main;
QTranslator *translater;
QLabel status_label;
QRegExp serialreg;
QValidator *serialval;
QProcess post_process;
QProcess lsdev_process;
QProcess mount_process;
QRegExp *ltfsmount_val;
QRegExp *ltfsscsiid_val;
QStringList hlabels;
int mw_TimerId;
int processing_TimerId;
QMutex umount_mutex;
QDir mount_homedir;
int dotcount;
int cur_commandindex; //Current Execute command Tab index
bool ismounted;
QString cur_translabel;
//label pattern name.
//Depending on your rules, it is information to customize.
//Reference = YYYYNNL6 or YYYYNNL7 like.
QString label_prefix; //YYYY Ex. 2017,2018
int label_min; //Start value of NN for LTFS format command batch ex. 1
int label_max; //End value of NN for LTFS format command batch ex. 8
QString label_ltogen; //L6 or L7 or L8....
bool label_redirect;
int format_index; //current format target number(Incremantal)
int format_endindex; //current format end index.
bool setArgsbyIndex(int tab_index,QString *cmdname_pt,QStringList *args_pt);
void setEnabled(bool enabled);
void getLTFSlsdevList();
void getLTFSmountList();
void setLTFSCurrentProcessing();
bool parseLabel(QString labelname);
int getSCSIDeviceInfo(struct tc_drive_info *buf, int count);
void timerEvent(QTimerEvent *timer_event);
void closeEvent(QCloseEvent *event);
};
#endif // MAINWINDOW_H