Subversion Repositories Projects

Rev

Rev 158 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 158 Rev 162
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2008 by Manuel Schrape                                  *
2
 *   Copyright (C) 2008 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License.        *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
#include "dlg_Config.h"
19
#include "dlg_Config.h"
20
 
20
 
21
dlg_Config::dlg_Config(QWidget *parent) : QDialog(parent)
21
dlg_Config::dlg_Config(QWidget *parent) : QDialog(parent)
22
{
22
{
23
    setupUi(this);
23
    setupUi(this);
24
 
24
 
25
    cb_Plot[0]  = cb_Plot_0;
25
    cb_Plot[0]  = cb_Plot_0;
26
    cb_Plot[1]  = cb_Plot_1;
26
    cb_Plot[1]  = cb_Plot_1;
27
    cb_Plot[2]  = cb_Plot_2;
27
    cb_Plot[2]  = cb_Plot_2;
28
    cb_Plot[3]  = cb_Plot_3;
28
    cb_Plot[3]  = cb_Plot_3;
29
    cb_Plot[4]  = cb_Plot_4;
29
    cb_Plot[4]  = cb_Plot_4;
30
    cb_Plot[5]  = cb_Plot_5;
30
    cb_Plot[5]  = cb_Plot_5;
31
    cb_Plot[6]  = cb_Plot_6;
31
    cb_Plot[6]  = cb_Plot_6;
32
    cb_Plot[7]  = cb_Plot_7;
32
    cb_Plot[7]  = cb_Plot_7;
33
    cb_Plot[8]  = cb_Plot_8;
33
    cb_Plot[8]  = cb_Plot_8;
34
    cb_Plot[9]  = cb_Plot_9;
34
    cb_Plot[9]  = cb_Plot_9;
35
    cb_Plot[10] = cb_Plot_10;
35
    cb_Plot[10] = cb_Plot_10;
36
    cb_Plot[11] = cb_Plot_11;
36
    cb_Plot[11] = cb_Plot_11;
37
    cb_Plot[12] = cb_Plot_12;
37
    cb_Plot[12] = cb_Plot_12;
38
    cb_Plot[13] = cb_Plot_13;
38
    cb_Plot[13] = cb_Plot_13;
39
    cb_Plot[14] = cb_Plot_14;
39
    cb_Plot[14] = cb_Plot_14;
40
    cb_Plot[15] = cb_Plot_15;
40
    cb_Plot[15] = cb_Plot_15;
41
    cb_Plot[16] = cb_Plot_16;
41
    cb_Plot[16] = cb_Plot_16;
42
    cb_Plot[17] = cb_Plot_17;
42
    cb_Plot[17] = cb_Plot_17;
43
    cb_Plot[18] = cb_Plot_18;
43
    cb_Plot[18] = cb_Plot_18;
44
    cb_Plot[19] = cb_Plot_19;
44
    cb_Plot[19] = cb_Plot_19;
45
    cb_Plot[20] = cb_Plot_20;
45
    cb_Plot[20] = cb_Plot_20;
46
    cb_Plot[21] = cb_Plot_21;
46
    cb_Plot[21] = cb_Plot_21;
47
    cb_Plot[22] = cb_Plot_22;
47
    cb_Plot[22] = cb_Plot_22;
48
    cb_Plot[23] = cb_Plot_23;
48
    cb_Plot[23] = cb_Plot_23;
49
    cb_Plot[24] = cb_Plot_24;
49
    cb_Plot[24] = cb_Plot_24;
50
    cb_Plot[25] = cb_Plot_25;
50
    cb_Plot[25] = cb_Plot_25;
51
    cb_Plot[26] = cb_Plot_26;
51
    cb_Plot[26] = cb_Plot_26;
52
    cb_Plot[27] = cb_Plot_27;
52
    cb_Plot[27] = cb_Plot_27;
53
    cb_Plot[28] = cb_Plot_28;
53
    cb_Plot[28] = cb_Plot_28;
54
    cb_Plot[29] = cb_Plot_29;
54
    cb_Plot[29] = cb_Plot_29;
55
    cb_Plot[30] = cb_Plot_30;
55
    cb_Plot[30] = cb_Plot_30;
56
    cb_Plot[31] = cb_Plot_31;
56
    cb_Plot[31] = cb_Plot_31;
57
 
57
 
58
    cb_Log[0]  = cb_Log_0;
58
    cb_Log[0]  = cb_Log_0;
59
    cb_Log[1]  = cb_Log_1;
59
    cb_Log[1]  = cb_Log_1;
60
    cb_Log[2]  = cb_Log_2;
60
    cb_Log[2]  = cb_Log_2;
61
    cb_Log[3]  = cb_Log_3;
61
    cb_Log[3]  = cb_Log_3;
62
    cb_Log[4]  = cb_Log_4;
62
    cb_Log[4]  = cb_Log_4;
63
    cb_Log[5]  = cb_Log_5;
63
    cb_Log[5]  = cb_Log_5;
64
    cb_Log[6]  = cb_Log_6;
64
    cb_Log[6]  = cb_Log_6;
65
    cb_Log[7]  = cb_Log_7;
65
    cb_Log[7]  = cb_Log_7;
66
    cb_Log[8]  = cb_Log_8;
66
    cb_Log[8]  = cb_Log_8;
67
    cb_Log[9]  = cb_Log_9;
67
    cb_Log[9]  = cb_Log_9;
68
    cb_Log[10] = cb_Log_10;
68
    cb_Log[10] = cb_Log_10;
69
    cb_Log[11] = cb_Log_11;
69
    cb_Log[11] = cb_Log_11;
70
    cb_Log[12] = cb_Log_12;
70
    cb_Log[12] = cb_Log_12;
71
    cb_Log[13] = cb_Log_13;
71
    cb_Log[13] = cb_Log_13;
72
    cb_Log[14] = cb_Log_14;
72
    cb_Log[14] = cb_Log_14;
73
    cb_Log[15] = cb_Log_15;
73
    cb_Log[15] = cb_Log_15;
74
    cb_Log[16] = cb_Log_16;
74
    cb_Log[16] = cb_Log_16;
75
    cb_Log[17] = cb_Log_17;
75
    cb_Log[17] = cb_Log_17;
76
    cb_Log[18] = cb_Log_18;
76
    cb_Log[18] = cb_Log_18;
77
    cb_Log[19] = cb_Log_19;
77
    cb_Log[19] = cb_Log_19;
78
    cb_Log[20] = cb_Log_20;
78
    cb_Log[20] = cb_Log_20;
79
    cb_Log[21] = cb_Log_21;
79
    cb_Log[21] = cb_Log_21;
80
    cb_Log[22] = cb_Log_22;
80
    cb_Log[22] = cb_Log_22;
81
    cb_Log[23] = cb_Log_23;
81
    cb_Log[23] = cb_Log_23;
82
    cb_Log[24] = cb_Log_24;
82
    cb_Log[24] = cb_Log_24;
83
    cb_Log[25] = cb_Log_25;
83
    cb_Log[25] = cb_Log_25;
84
    cb_Log[26] = cb_Log_26;
84
    cb_Log[26] = cb_Log_26;
85
    cb_Log[27] = cb_Log_27;
85
    cb_Log[27] = cb_Log_27;
86
    cb_Log[28] = cb_Log_28;
86
    cb_Log[28] = cb_Log_28;
87
    cb_Log[29] = cb_Log_29;
87
    cb_Log[29] = cb_Log_29;
88
    cb_Log[30] = cb_Log_30;
88
    cb_Log[30] = cb_Log_30;
89
    cb_Log[31] = cb_Log_31;
89
    cb_Log[31] = cb_Log_31;
90
 
90
 
91
}
91
}
92
 
92
 
93
void dlg_Config::set_Settings(cSettings *Set)
93
void dlg_Config::set_Settings(cSettings *Set, int ID)
94
{
94
{
95
    Settings = Set;
95
    Settings = Set;
-
 
96
 
-
 
97
    lb_Hardware->setText(HardwareType[ID]);
96
 
98
 
97
    for (int a = 0; a < MaxAnalog; a++)
99
    for (int a = 0; a < MaxAnalog; a++)
98
    {
100
    {
99
        cb_Plot[a]->setText(Settings->Analog[a].Name);
101
        cb_Plot[a]->setText(Settings->Analog1.Label[a]);
100
        cb_Plot[a]->setChecked(Settings->Analog[a].Plot);
102
        cb_Plot[a]->setChecked(Settings->Analog1.PlotView[a]);
101
        cb_Log[a]->setText(Settings->Analog[a].Name);
103
        cb_Log[a]->setText(Settings->Analog1.Label[a]);
102
        cb_Log[a]->setChecked(Settings->Analog[a].Log);
104
        cb_Log[a]->setChecked(Settings->Analog1.LogView[a]);
103
    }
105
    }
104
}
106
}
105
 
107
 
106
cSettings *dlg_Config::get_Settings()
108
cSettings *dlg_Config::get_Settings()
107
{
109
{
108
    for (int a = 0; a < MaxAnalog; a++)
110
    for (int a = 0; a < MaxAnalog; a++)
109
    {
111
    {
110
        Settings->Analog[a].Plot = cb_Plot[a]->isChecked();
112
        Settings->Analog1.PlotView.setBit(a,cb_Plot[a]->isChecked());
111
    }
113
    }
112
 
114
 
113
    for (int a = 0; a < MaxAnalog; a++)
115
    for (int a = 0; a < MaxAnalog; a++)
114
    {
116
    {
115
        Settings->Analog[a].Log = cb_Log[a]->isChecked();
117
        Settings->Analog1.LogView.setBit(a,cb_Log[a]->isChecked());
116
    }
118
    }
117
 
119
 
118
    return Settings;
120
    return Settings;
119
}
121
}
120
 
122
 
121
dlg_Config::~dlg_Config()
123
dlg_Config::~dlg_Config()
122
{
124
{
123
}
125
}
124
 
126
 
125
 
127
 
126
 
128