Rev 750 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 750 | Rev 801 | ||
---|---|---|---|
1 | /*************************************************************************** |
1 | /*************************************************************************** |
2 | * Copyright (C) 2009 by Manuel Schrape * |
2 | * Copyright (C) 2009 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 | 19 | ||
20 | #include <QMessageBox> |
20 | #include <QMessageBox> |
21 | #include <QCryptographicHash> |
21 | #include <QCryptographicHash> |
22 | 22 | ||
23 | #include "dlg_Main.h" |
23 | #include "dlg_Main.h" |
24 | 24 | ||
25 | // Konstruktor Main-Form |
25 | // Konstruktor Main-Form |
26 | dlg_Main::dlg_Main() |
26 | dlg_Main::dlg_Main() |
27 | { |
27 | { |
28 | setupUi(this); |
28 | setupUi(this); |
29 | 29 | ||
30 | 30 | ||
31 | o_Settings = new cSettings(); |
31 | o_Settings = new cSettings(); |
32 | 32 | ||
33 | o_Settings->read_DebugLabels(0); |
33 | o_Settings->read_DebugLabels(0); |
34 | 34 | ||
35 | wg_Connection->set_Client(ID_SCOPE, QA_NAME + " " + QA_VERSION, DataFields); |
35 | wg_Connection->set_Client(ID_SCOPE, QA_NAME + " " + QA_VERSION, DataFields); |
36 | 36 | ||
37 | init_GUI(); |
37 | init_GUI(); |
38 | init_Connections(); |
38 | init_Connections(); |
39 | init_Plotter(); |
39 | init_Plotter(); |
40 | } |
40 | } |
41 | 41 | ||
42 | // Grafische Oberfläche initialisieren |
42 | // Grafische Oberfläche initialisieren |
43 | void dlg_Main::init_GUI() |
43 | void dlg_Main::init_GUI() |
44 | { |
44 | { |
45 | setWindowTitle(QA_NAME + " " + QA_VERSION); |
45 | setWindowTitle(QA_NAME + " " + QA_VERSION); |
46 | 46 | ||
47 | resize(o_Settings->GUI.Size); |
47 | resize(o_Settings->GUI.Size); |
48 | move(o_Settings->GUI.Point); |
48 | move(o_Settings->GUI.Point); |
49 | 49 | ||
50 | if (o_Settings->GUI.isMax) |
50 | if (o_Settings->GUI.isMax) |
51 | { |
51 | { |
52 | showMaximized(); |
52 | showMaximized(); |
53 | } |
53 | } |
54 | 54 | ||
55 | wg_Connection->set_SelectVisible(false); |
55 | wg_Connection->set_SelectVisible(true); |
56 | wg_Connection->set_ButtonVisible(false); |
56 | wg_Connection->set_ButtonVisible(true); |
57 | 57 | ||
58 | btn_Start->setCheckable(true); |
58 | btn_Start->setCheckable(true); |
59 | - | ||
60 | ac_Plotter->setChecked(true); |
- | |
61 | - | ||
62 | Font_1.setFamily(QString::fromUtf8("Adobe Courier")); |
- | |
63 | Font_1.setBold(true); |
- | |
64 | Font_1.setWeight(75); |
- | |
65 | 59 | ||
66 | for(int z = 0; z < MAX_DebugData; z++) |
60 | for(int z = 0; z < MAX_DebugData; z++) |
- | 61 | { |
|
- | 62 | wg_Index[z] = new wgt_Index(); |
|
67 | { |
- | |
68 | - | ||
69 | lb_Debug[z] = new QLabel(wg_Debug); |
- | |
70 | le_Debug[z] = new QLineEdit(wg_Debug); |
- | |
71 | cb_Debug[z] = new QCheckBox(wg_Config); |
- | |
72 | le_Debug[z]->setFont(Font_1); |
- | |
73 | le_Debug[z]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
- | |
74 | le_Debug[z]->setReadOnly(true); |
- | |
75 | - | ||
76 | wg_Grid->addWidget(lb_Debug[z], (z % 8), z / 8 * 2, 0); |
- | |
77 | wg_Grid->addWidget(le_Debug[z], (z % 8), z / 8 * 2 + 1 , 0); |
- | |
78 | - | ||
79 | wg_Grid_2->addWidget(cb_Debug[z], (z % 8), z / 8, 0); |
63 | verticalLayout->addWidget(wg_Index[z]); |
80 | 64 | ||
81 | lb_Debug[z]->setText(o_Settings->DebugData.Label[z]); |
65 | wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]); |
82 | cb_Debug[z]->setText(o_Settings->DebugData.Label[z]); |
66 | wg_Index[z]->set_StyleSheet("color: " + QColor(DEF_DebugColors[z]).name() + ";"); |
83 | 67 | ||
84 | cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]); |
68 | connect(wg_Index[z], SIGNAL(sig_Clicked()), this, SLOT(slot_btn_ChoseOK())); |
85 | } |
69 | } |
86 | } |
70 | } |
87 | 71 | ||
88 | // Signale mit Slots verbinden |
72 | // Signale mit Slots verbinden |
89 | void dlg_Main::init_Connections() |
73 | void dlg_Main::init_Connections() |
90 | { |
74 | { |
91 | connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect())); |
75 | connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect())); |
92 | - | ||
93 | connect(ac_Plotter, SIGNAL(triggered()), this, SLOT(slot_ac_Plotter())); |
- | |
94 | connect(ac_Debug, SIGNAL(triggered()), this, SLOT(slot_ac_Debug())); |
- | |
95 | connect(ac_Chose, SIGNAL(triggered()), this, SLOT(slot_ac_Chose())); |
- | |
96 | 76 | ||
97 | connect(ac_ReadLabels, SIGNAL(triggered()), this, SLOT(slot_ac_ReadLabels())); |
77 | connect(ac_ReadLabels, SIGNAL(triggered()), this, SLOT(slot_ac_ReadLabels())); |
98 | 78 | ||
99 | connect(Plotter_Scroll, SIGNAL(valueChanged(int)), this, SLOT(slot_Plotter_Scroll(int))); |
79 | connect(Plotter_Scroll, SIGNAL(valueChanged(int)), this, SLOT(slot_Plotter_Scroll(int))); |
100 | 80 | ||
101 | connect(btn_Start, SIGNAL(clicked()), this, SLOT(slot_Plotter_Start())); |
81 | connect(btn_Start, SIGNAL(clicked()), this, SLOT(slot_Plotter_Start())); |
102 | connect(btn_ChoseOK, SIGNAL(clicked()), this, SLOT(slot_btn_ChoseOK())); |
82 | // connect(btn_ChoseOK, SIGNAL(clicked()), this, SLOT(slot_btn_ChoseOK())); |
103 | 83 | ||
104 | // About QMK-Kernel & About-QT Dialog einfĂĽgen |
84 | // About QMK-Kernel & About-QT Dialog einfĂĽgen |
105 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
85 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
106 | menu_Help->addAction(trUtf8("Ăśber &Qt"), qApp, SLOT(aboutQt())); |
86 | menu_Help->addAction(trUtf8("Ăśber &Qt"), qApp, SLOT(aboutQt())); |
107 | 87 | ||
108 | connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int))); |
88 | connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int))); |
109 | connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware))); |
89 | connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware))); |
110 | connect(wg_Connection, SIGNAL(sig_MK_Debug(s_MK_Debug)), this, SLOT(slot_MK_Debug(s_MK_Debug))); |
90 | connect(wg_Connection, SIGNAL(sig_MK_Debug(s_MK_Debug)), this, SLOT(slot_MK_Debug(s_MK_Debug))); |
111 | connect(wg_Connection, SIGNAL(sig_MK_DebugLabels(s_MK_DebugLabels)), this, SLOT(slot_MK_DebugLabels(s_MK_DebugLabels))); |
91 | connect(wg_Connection, SIGNAL(sig_MK_DebugLabels(s_MK_DebugLabels)), this, SLOT(slot_MK_DebugLabels(s_MK_DebugLabels))); |
112 | } |
92 | } |
113 | 93 | ||
114 | void dlg_Main::init_Plotter() |
94 | void dlg_Main::init_Plotter() |
115 | { |
95 | { |
116 | NextPlot = 0; |
96 | NextPlot = 0; |
117 | 97 | ||
118 | qwt_Plotter->setCanvasBackground(QColor(QRgb(0x00000000))); |
98 | qwt_Plotter->setCanvasBackground(QColor(QRgb(0x00000000))); |
119 | 99 | ||
120 | qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend); |
100 | // qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend); |
121 | 101 | ||
122 | QwtPlotGrid *Grid = new QwtPlotGrid(); |
102 | QwtPlotGrid *Grid = new QwtPlotGrid(); |
123 | Grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine)); |
103 | Grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine)); |
124 | 104 | ||
125 | Grid->attach(qwt_Plotter); |
105 | Grid->attach(qwt_Plotter); |
126 | 106 | ||
127 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0); |
107 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0); |
128 | 108 | ||
129 | for (int a = 0; a < MAX_DebugData; a++) |
109 | for (int a = 0; a < MAX_DebugData; a++) |
130 | { |
110 | { |
131 | Plot[a] = new QwtPlotCurve(o_Settings->DebugData.Label[a]); |
111 | Plot[a] = new QwtPlotCurve(o_Settings->DebugData.Label[a]); |
132 | Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a]))); |
112 | Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a]))); |
133 | Plot[a]->setRenderHint(QwtPlotItem::RenderAntialiased); |
113 | Plot[a]->setRenderHint(QwtPlotItem::RenderAntialiased); |
134 | 114 | ||
135 | if (o_Settings->DebugData.Show_Plotter[a]) |
115 | if (o_Settings->DebugData.Show_Plotter[a]) |
136 | Plot[a]->attach(qwt_Plotter); |
116 | Plot[a]->attach(qwt_Plotter); |
137 | } |
117 | } |
138 | qwt_Plotter->replot(); |
118 | qwt_Plotter->replot(); |
- | 119 | ||
- | 120 | ||
139 | } |
121 | } |
140 | 122 | ||
141 | void dlg_Main::update_Plotter() |
123 | void dlg_Main::update_Plotter() |
142 | { |
124 | { |
143 | pl_ID[NextPlot] = NextPlot; |
125 | pl_ID[NextPlot] = NextPlot; |
144 | 126 | ||
145 | for (int a = 0; a < MAX_DebugData; a++) |
127 | for (int a = 0; a < MAX_DebugData; a++) |
146 | { |
128 | { |
147 | pl_Data[a][NextPlot] = Debug_Data[a]; |
129 | pl_Data[a][NextPlot] = Debug_Data[a]; |
148 | Plot[a]->setData(pl_ID,pl_Data[a],NextPlot); |
130 | Plot[a]->setData(pl_ID,pl_Data[a],NextPlot); |
149 | } |
131 | } |
150 | 132 | ||
151 | NextPlot++; |
133 | NextPlot++; |
152 | 134 | ||
153 | if ((NextPlot > o_Settings->DATA.Plotter_Count)) |
135 | if ((NextPlot > o_Settings->DATA.Plotter_Count)) |
154 | { |
136 | { |
155 | Plotter_Scroll->setMaximum(NextPlot - o_Settings->DATA.Plotter_Count); |
137 | Plotter_Scroll->setMaximum(NextPlot - o_Settings->DATA.Plotter_Count); |
156 | } |
138 | } |
157 | 139 | ||
158 | if ((Plotter_Scroll->value() == NextPlot - (o_Settings->DATA.Plotter_Count + 1))) |
140 | if ((Plotter_Scroll->value() == NextPlot - (o_Settings->DATA.Plotter_Count + 1))) |
159 | { |
141 | { |
160 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,NextPlot - o_Settings->DATA.Plotter_Count,NextPlot,0); |
142 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,NextPlot - o_Settings->DATA.Plotter_Count,NextPlot,0); |
161 | Plotter_Scroll->setValue(NextPlot - o_Settings->DATA.Plotter_Count); |
143 | Plotter_Scroll->setValue(NextPlot - o_Settings->DATA.Plotter_Count); |
162 | } |
144 | } |
163 | 145 | ||
164 | qwt_Plotter->replot(); |
146 | qwt_Plotter->replot(); |
165 | } |
147 | } |
166 | 148 | ||
167 | void dlg_Main::config_Plotter() |
149 | void dlg_Main::config_Plotter() |
168 | { |
150 | { |
169 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0); |
151 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0); |
170 | 152 | ||
171 | for (int a = 0; a < MAX_DebugData; a++) |
153 | for (int a = 0; a < MAX_DebugData; a++) |
172 | { |
154 | { |
173 | Plot[a]->detach(); |
155 | Plot[a]->detach(); |
174 | Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a]))); |
156 | Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a]))); |
175 | 157 | ||
176 | if (o_Settings->DebugData.Show_Plotter[a]) |
158 | if (o_Settings->DebugData.Show_Plotter[a]) |
177 | { |
159 | { |
178 | Plot[a]->setTitle(o_Settings->DebugData.Label[a]); |
160 | // Plot[a]->setTitle(o_Settings->DebugData.Label[a]); |
179 | Plot[a]->attach(qwt_Plotter); |
161 | Plot[a]->attach(qwt_Plotter); |
180 | } |
162 | } |
181 | } |
163 | } |
182 | qwt_Plotter->replot(); |
164 | qwt_Plotter->replot(); |
183 | } |
165 | } |
184 | 166 | ||
185 | void dlg_Main::slot_Plotter_Scroll(int Position) |
167 | void dlg_Main::slot_Plotter_Scroll(int Position) |
186 | { |
168 | { |
187 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,Position,Position + o_Settings->DATA.Plotter_Count,0); |
169 | qwt_Plotter->setAxisScale(QwtPlot::xBottom,Position,Position + o_Settings->DATA.Plotter_Count,0); |
188 | qwt_Plotter->replot(); |
170 | qwt_Plotter->replot(); |
189 | } |
171 | } |
190 | 172 | ||
191 | /////////// |
173 | /////////// |
192 | // Slots // |
174 | // Slots // |
193 | /////////// |
175 | /////////// |
194 | 176 | ||
195 | // About-Dialog |
177 | // About-Dialog |
196 | void dlg_Main::slot_ac_About() |
178 | void dlg_Main::slot_ac_About() |
197 | { |
179 | { |
198 | QMessageBox::about(this, trUtf8(("Ăśber ")) + QA_NAME, QA_ABOUT); |
180 | QMessageBox::about(this, trUtf8(("Ăśber ")) + QA_NAME, QA_ABOUT); |
199 | } |
181 | } |
200 | 182 | ||
201 | void dlg_Main::slot_ConnectionStatus(int li_Status) |
183 | void dlg_Main::slot_ConnectionStatus(int li_Status) |
202 | { |
184 | { |
203 | if (li_Status) |
185 | if (li_Status) |
204 | { |
186 | { |
205 | ac_Connect->setChecked(true); |
187 | ac_Connect->setChecked(true); |
206 | ac_Connect->setText(tr("Trennen")); |
188 | ac_Connect->setText(tr("Trennen")); |
207 | } |
189 | } |
208 | else |
190 | else |
209 | { |
191 | { |
210 | ac_Connect->setChecked(false); |
192 | ac_Connect->setChecked(false); |
211 | ac_Connect->setText(tr("Verbinden")); |
193 | ac_Connect->setText(tr("Verbinden")); |
212 | } |
194 | } |
213 | } |
195 | } |
214 | 196 | ||
215 | void dlg_Main::slot_MK_Version(s_Hardware ls_Version) |
197 | void dlg_Main::slot_MK_Version(s_Hardware ls_Version) |
216 | { |
198 | { |
217 | gs_Version = ls_Version; |
199 | gs_Version = ls_Version; |
218 | setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version); |
200 | setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version); |
219 | 201 | ||
220 | o_Settings->read_DebugLabels(gs_Version.ID); |
202 | o_Settings->read_DebugLabels(gs_Version.ID); |
221 | 203 | ||
222 | if (o_Settings->DebugData.Version != gs_Version.Version) |
204 | if (o_Settings->DebugData.Version != gs_Version.Version) |
223 | { |
205 | { |
224 | qDebug(QString("Debug-Labels unterschiedlich. Neue anforden. " + o_Settings->DebugData.Version + " <> " + gs_Version.Version).toLatin1().data()); |
206 | qDebug(QString("Debug-Labels unterschiedlich. Neue anforden. " + o_Settings->DebugData.Version + " <> " + gs_Version.Version).toLatin1().data()); |
225 | usleep(50000); |
207 | usleep(50000); |
226 | 208 | ||
227 | slot_ac_ReadLabels(); |
209 | slot_ac_ReadLabels(); |
228 | } |
210 | } |
229 | else |
211 | else |
230 | { |
212 | { |
231 | for(int z = 0; z < MAX_DebugData; z++) |
213 | for(int z = 0; z < MAX_DebugData; z++) |
232 | { |
214 | { |
233 | lb_Debug[z]->setText(o_Settings->DebugData.Label[z]); |
- | |
234 | cb_Debug[z]->setText(o_Settings->DebugData.Label[z]); |
215 | wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]); |
235 | cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]); |
216 | wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]); |
- | 217 | ||
236 | } |
218 | } |
237 | config_Plotter(); |
219 | config_Plotter(); |
238 | } |
220 | } |
239 | } |
221 | } |
240 | 222 | ||
241 | void dlg_Main::slot_MK_Debug(s_MK_Debug ls_Debug) |
223 | void dlg_Main::slot_MK_Debug(s_MK_Debug ls_Debug) |
242 | { |
224 | { |
243 | gs_Debug = ls_Debug; |
225 | gs_Debug = ls_Debug; |
244 | 226 | ||
245 | for (int z = 0; z < MAX_DebugData; z++) |
227 | for (int z = 0; z < MAX_DebugData; z++) |
246 | { |
228 | { |
247 | Debug_Data[z] = ls_Debug.Analog[z]; |
229 | Debug_Data[z] = ls_Debug.Analog[z]; |
248 | if (ac_Debug->isChecked()) |
- | |
249 | { |
230 | |
250 | le_Debug[z]->setText(QString("%1").arg(Debug_Data[z])); |
231 | wg_Index[z]->set_Wert(QString("%1").arg(Debug_Data[z])); |
251 | } |
- | |
252 | } |
232 | } |
253 | if (btn_Start->isChecked()) |
233 | if (btn_Start->isChecked()) |
254 | { |
234 | { |
255 | update_Plotter(); |
235 | update_Plotter(); |
256 | } |
236 | } |
257 | } |
237 | } |
258 | 238 | ||
259 | void dlg_Main::slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels) |
239 | void dlg_Main::slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels) |
260 | { |
240 | { |
261 | if (MK_DebugLabels.Position < 32) |
241 | if (MK_DebugLabels.Position < 32) |
262 | { |
242 | { |
263 | o_Settings->DebugData.Label[MK_DebugLabels.Position] = MK_DebugLabels.Text; |
243 | o_Settings->DebugData.Label[MK_DebugLabels.Position] = MK_DebugLabels.Text; |
264 | if (o_Settings->DebugData.Label[MK_DebugLabels.Position] == "") |
244 | if (o_Settings->DebugData.Label[MK_DebugLabels.Position] == "") |
265 | { |
245 | { |
266 | o_Settings->DebugData.Label[MK_DebugLabels.Position] = "Debug-" + QString("%1").arg(MK_DebugLabels.Position); |
246 | o_Settings->DebugData.Label[MK_DebugLabels.Position] = "Debug-" + QString("%1").arg(MK_DebugLabels.Position); |
267 | } |
247 | } |
268 | lb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]); |
248 | // cb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]); |
269 | cb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]); |
249 | wg_Index[MK_DebugLabels.Position]->set_Name("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]); |
- | 250 | // wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]); |
|
- | 251 | ||
270 | 252 | ||
271 | } |
253 | } |
272 | if (MK_DebugLabels.Position == 31) |
254 | if (MK_DebugLabels.Position == 31) |
273 | { |
255 | { |
274 | o_Settings->DebugData.Version = gs_Version.Version; |
256 | o_Settings->DebugData.Version = gs_Version.Version; |
275 | o_Settings->write_DebugLabels(gs_Version.ID); |
257 | o_Settings->write_DebugLabels(gs_Version.ID); |
276 | config_Plotter(); |
258 | config_Plotter(); |
277 | } |
259 | } |
278 | } |
260 | } |
279 | 261 | ||
280 | void dlg_Main::slot_Plotter_Start() |
262 | void dlg_Main::slot_Plotter_Start() |
281 | { |
263 | { |
282 | if (btn_Start->isChecked()) |
264 | if (btn_Start->isChecked()) |
283 | { |
265 | { |
284 | btn_Start->setText(tr("Plotter stoppen")); |
266 | btn_Start->setText(tr("Plotter stoppen")); |
285 | } |
267 | } |
286 | else |
268 | else |
287 | { |
269 | { |
288 | btn_Start->setText(tr("Plotter starten")); |
270 | btn_Start->setText(tr("Plotter starten")); |
289 | } |
271 | } |
290 | } |
272 | } |
291 | 273 | ||
292 | void dlg_Main::slot_btn_ChoseOK() |
274 | void dlg_Main::slot_btn_ChoseOK() |
293 | { |
275 | { |
294 | for(int z = 0; z < MAX_DebugData; z++) |
276 | for(int z = 0; z < MAX_DebugData; z++) |
295 | { |
277 | { |
296 | o_Settings->DebugData.Show_Plotter[z] = cb_Debug[z]->isChecked(); |
278 | o_Settings->DebugData.Show_Plotter[z] = wg_Index[z]->get_Checked(); |
297 | } |
279 | } |
298 | config_Plotter(); |
280 | config_Plotter(); |
299 | o_Settings->write_DebugLabels(gs_Version.ID); |
281 | o_Settings->write_DebugLabels(gs_Version.ID); |
300 | } |
282 | } |
301 | - | ||
302 | void dlg_Main::slot_ac_Chose() |
- | |
303 | { |
- | |
304 | for(int z = 0; z < MAX_DebugData; z++) |
- | |
305 | { |
- | |
306 | cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]); |
- | |
307 | } |
- | |
308 | - | ||
309 | ac_Chose->setChecked(true); |
- | |
310 | ac_Debug->setChecked(false); |
- | |
311 | ac_Plotter->setChecked(false); |
- | |
312 | wg_Pages->setCurrentIndex(2); |
- | |
313 | } |
- | |
314 | - | ||
315 | void dlg_Main::slot_ac_Debug() |
- | |
316 | { |
- | |
317 | ac_Debug->setChecked(true); |
- | |
318 | ac_Chose->setChecked(false); |
- | |
319 | ac_Plotter->setChecked(false); |
- | |
320 | wg_Pages->setCurrentIndex(1); |
- | |
321 | } |
- | |
322 | - | ||
323 | void dlg_Main::slot_ac_Plotter() |
- | |
324 | { |
- | |
325 | ac_Plotter->setChecked(true); |
- | |
326 | ac_Debug->setChecked(false); |
- | |
327 | ac_Chose->setChecked(false); |
- | |
328 | wg_Pages->setCurrentIndex(0); |
- | |
329 | } |
- | |
330 | 283 | ||
331 | void dlg_Main::slot_ac_ReadLabels() |
284 | void dlg_Main::slot_ac_ReadLabels() |
332 | { |
285 | { |
333 | c_Data[0] = 0; |
286 | c_Data[0] = 0; |
334 | wg_Connection->send_Data(HandlerMK::make_Frame('a', ADDRESS_ALL, c_Data, 1).toLatin1().data(), DATA_READ_LABEL); |
287 | wg_Connection->send_Data(HandlerMK::make_Frame('a', ADDRESS_ALL, c_Data, 1).toLatin1().data(), DATA_READ_LABEL); |
335 | } |
288 | } |
336 | 289 | ||
337 | // Programm Ende |
290 | // Programm Ende |
338 | dlg_Main::~dlg_Main() |
291 | dlg_Main::~dlg_Main() |
339 | { |
292 | { |
340 | o_Settings->GUI.isMax = isMaximized(); |
293 | o_Settings->GUI.isMax = isMaximized(); |
341 | o_Settings->GUI.Size = size(); |
294 | o_Settings->GUI.Size = size(); |
342 | o_Settings->GUI.Point = pos(); |
295 | o_Settings->GUI.Point = pos(); |
343 | 296 | ||
344 | o_Settings->write_Settings(); |
297 | o_Settings->write_Settings(); |
345 | } |
298 | } |
346 | 299 |