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