-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
65 lines (43 loc) · 2.13 KB
/
mainwindow.h
File metadata and controls
65 lines (43 loc) · 2.13 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QErrorMessage>
#include <QMessageBox>
#include "resval.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_band1_ColorSel_currentIndexChanged(int index);
void on_band2_ColorSel_currentIndexChanged(int index);
void on_band3_ColorSel_currentIndexChanged(int index);
void on_band4_ColorSel_currentIndexChanged(int index);
void on_band5_ColorSel_currentIndexChanged(int index);
void on_band6_ColorSel_currentIndexChanged(int index);
void on_NBand_slider_valueChanged(int value);
void on_resValDisp_editingFinished();
void on_tolValDisp_editingFinished();
void on_tCoefValDisp_editingFinished();
void on_resValDispMult_editingFinished();
private:
Ui::MainWindow *ui;
void colorChanged(int band); //Function to update the screen when colors have changed
bool isResValid(); //Function to test if a written resistance is valid
ResVal resVal;
QMessageBox* msgDialog = new QMessageBox();
QErrorMessage* errorDialog = new QErrorMessage();
const QStringList SIG_COLORS = (QStringList() << "Black" << "Brown" << "Red" << "Orange" << "Yellow" << "Green" << "Blue" << "Violet" << "Grey" << "White");
const QStringList MULT_COLORS = (QStringList() << "Silver" << "Gold" << "Black" << "Brown" << "Red" << "Orange" << "Yellow" << "Green" << "Blue" << "Violet");
const QStringList TOL_COLORS = (QStringList() << "Silver" << "Gold" << "Brown" << "Red" << "Green" << "Blue" << "Violet");
const QStringList TC_COLORS = (QStringList() << "Black" << "Brown" << "Red" << "Orange" << "Yellow" << "Green" << "Blue" << "Violet" << "Grey");
const QStringList OHM_MULT = (QStringList() << "Ohm" << "kOhm" << "MOhm" << "GOhm");
const float tolValPI[7] = {10, 5, 1, 2, 0.5, 0.25, 0.1}; //Tolerance values per index(in band selector)
const int tcValPI[9] = {250, 100, 50, 15, 25, 20, 10, 5, 1}; //Temperature coeficient values per index(in band selector)
};
#endif // MAINWINDOW_H