Subversion Repositories Projects

Rev

Rev 750 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 750 Rev 801
Line 50... Line 50...
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
 
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
 
-
 
66
    for(int z = 0; z < MAX_DebugData; z++)
60
    for(int z = 0; z < MAX_DebugData; z++)
67
    {
61
    {
-
 
62
        wg_Index[z] = new wgt_Index();
-
 
63
        verticalLayout->addWidget(wg_Index[z]);
68
 
64
 
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);
-
 
80
 
-
 
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
 
76
 
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
 
-
 
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
 
Line 115... Line 95...
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);
Line 134... Line 114...
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;
Line 173... Line 155...
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
}
Line 228... Line 210...
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
 
Line 243... Line 225...
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
    }
Line 263... Line 243...
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;
Line 291... Line 273...
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
 
283
 
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
 
-
 
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
}