Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 750 → Rev 801

/QMK-Groundstation/trunk/QMK-Scope/Dialogs/dlg_Main.cpp
52,36 → 52,20
showMaximized();
}
 
wg_Connection->set_SelectVisible(false);
wg_Connection->set_ButtonVisible(false);
wg_Connection->set_SelectVisible(true);
wg_Connection->set_ButtonVisible(true);
 
btn_Start->setCheckable(true);
 
ac_Plotter->setChecked(true);
 
Font_1.setFamily(QString::fromUtf8("Adobe Courier"));
Font_1.setBold(true);
Font_1.setWeight(75);
 
for(int z = 0; z < MAX_DebugData; z++)
{
wg_Index[z] = new wgt_Index();
verticalLayout->addWidget(wg_Index[z]);
 
lb_Debug[z] = new QLabel(wg_Debug);
le_Debug[z] = new QLineEdit(wg_Debug);
cb_Debug[z] = new QCheckBox(wg_Config);
le_Debug[z]->setFont(Font_1);
le_Debug[z]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
le_Debug[z]->setReadOnly(true);
wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]);
wg_Index[z]->set_StyleSheet("color: " + QColor(DEF_DebugColors[z]).name() + ";");
 
wg_Grid->addWidget(lb_Debug[z], (z % 8), z / 8 * 2, 0);
wg_Grid->addWidget(le_Debug[z], (z % 8), z / 8 * 2 + 1 , 0);
 
wg_Grid_2->addWidget(cb_Debug[z], (z % 8), z / 8, 0);
 
lb_Debug[z]->setText(o_Settings->DebugData.Label[z]);
cb_Debug[z]->setText(o_Settings->DebugData.Label[z]);
 
cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]);
connect(wg_Index[z], SIGNAL(sig_Clicked()), this, SLOT(slot_btn_ChoseOK()));
}
}
 
90,16 → 74,12
{
connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect()));
 
connect(ac_Plotter, SIGNAL(triggered()), this, SLOT(slot_ac_Plotter()));
connect(ac_Debug, SIGNAL(triggered()), this, SLOT(slot_ac_Debug()));
connect(ac_Chose, SIGNAL(triggered()), this, SLOT(slot_ac_Chose()));
 
connect(ac_ReadLabels, SIGNAL(triggered()), this, SLOT(slot_ac_ReadLabels()));
 
connect(Plotter_Scroll, SIGNAL(valueChanged(int)), this, SLOT(slot_Plotter_Scroll(int)));
 
connect(btn_Start, SIGNAL(clicked()), this, SLOT(slot_Plotter_Start()));
connect(btn_ChoseOK, SIGNAL(clicked()), this, SLOT(slot_btn_ChoseOK()));
// connect(btn_ChoseOK, SIGNAL(clicked()), this, SLOT(slot_btn_ChoseOK()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
117,7 → 97,7
 
qwt_Plotter->setCanvasBackground(QColor(QRgb(0x00000000)));
 
qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend);
// qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend);
 
QwtPlotGrid *Grid = new QwtPlotGrid();
Grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
136,6 → 116,8
Plot[a]->attach(qwt_Plotter);
}
qwt_Plotter->replot();
 
 
}
 
void dlg_Main::update_Plotter()
175,7 → 157,7
 
if (o_Settings->DebugData.Show_Plotter[a])
{
Plot[a]->setTitle(o_Settings->DebugData.Label[a]);
// Plot[a]->setTitle(o_Settings->DebugData.Label[a]);
Plot[a]->attach(qwt_Plotter);
}
}
230,9 → 212,9
{
for(int z = 0; z < MAX_DebugData; z++)
{
lb_Debug[z]->setText(o_Settings->DebugData.Label[z]);
cb_Debug[z]->setText(o_Settings->DebugData.Label[z]);
cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]);
wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]);
wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]);
 
}
config_Plotter();
}
245,10 → 227,8
for (int z = 0; z < MAX_DebugData; z++)
{
Debug_Data[z] = ls_Debug.Analog[z];
if (ac_Debug->isChecked())
{
le_Debug[z]->setText(QString("%1").arg(Debug_Data[z]));
}
 
wg_Index[z]->set_Wert(QString("%1").arg(Debug_Data[z]));
}
if (btn_Start->isChecked())
{
265,9 → 245,11
{
o_Settings->DebugData.Label[MK_DebugLabels.Position] = "Debug-" + QString("%1").arg(MK_DebugLabels.Position);
}
lb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
cb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
// cb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
wg_Index[MK_DebugLabels.Position]->set_Name("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
// wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]);
 
 
}
if (MK_DebugLabels.Position == 31)
{
293,41 → 275,12
{
for(int z = 0; z < MAX_DebugData; z++)
{
o_Settings->DebugData.Show_Plotter[z] = cb_Debug[z]->isChecked();
o_Settings->DebugData.Show_Plotter[z] = wg_Index[z]->get_Checked();
}
config_Plotter();
o_Settings->write_DebugLabels(gs_Version.ID);
}
 
void dlg_Main::slot_ac_Chose()
{
for(int z = 0; z < MAX_DebugData; z++)
{
cb_Debug[z]->setChecked(o_Settings->DebugData.Show_Plotter[z]);
}
 
ac_Chose->setChecked(true);
ac_Debug->setChecked(false);
ac_Plotter->setChecked(false);
wg_Pages->setCurrentIndex(2);
}
 
void dlg_Main::slot_ac_Debug()
{
ac_Debug->setChecked(true);
ac_Chose->setChecked(false);
ac_Plotter->setChecked(false);
wg_Pages->setCurrentIndex(1);
}
 
void dlg_Main::slot_ac_Plotter()
{
ac_Plotter->setChecked(true);
ac_Debug->setChecked(false);
ac_Chose->setChecked(false);
wg_Pages->setCurrentIndex(0);
}
 
void dlg_Main::slot_ac_ReadLabels()
{
c_Data[0] = 0;
/QMK-Groundstation/trunk/QMK-Scope/Dialogs/dlg_Main.h
35,11 → 35,14
 
#include "ui_dlg_Main.h"
 
#include "wgt_Index.h"
 
#include "../Defines.h"
#include "../TypeDefs.h"
 
#include "../Classes/cSettings.h"
 
 
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
Q_OBJECT
52,10 → 55,7
// Settings-Object
cSettings *o_Settings;
 
QLabel *lb_Debug[MAX_DebugData];
QLineEdit *le_Debug[MAX_DebugData];
QCheckBox *cb_Debug[MAX_DebugData];
QFont Font_1;
wgt_Index *wg_Index[MAX_DebugData];
 
// Info über die Hardware
s_Hardware gs_Version;
91,9 → 91,9
void slot_MK_Debug(s_MK_Debug ls_Debug);
void slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels);
 
void slot_ac_Plotter();
void slot_ac_Debug();
void slot_ac_Chose();
// void slot_ac_Plotter();
// void slot_ac_Debug();
// void slot_ac_Chose();
 
void slot_ac_ReadLabels();
 
/QMK-Groundstation/trunk/QMK-Scope/Dialogs/dlg_Main.ui
6,8 → 6,8
<rect>
<x>0</x>
<y>0</y>
<width>719</width>
<height>314</height>
<width>794</width>
<height>366</height>
</rect>
</property>
<property name="windowTitle">
17,166 → 17,152
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</iconset>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="1" column="0">
<widget class="QStackedWidget" name="wg_Pages">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="wg_Plotter">
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>4</number>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QScrollBar" name="Plotter_Scroll">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="verticalSpacing">
<number>2</number>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="margin">
<number>4</number>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_Start">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="0" column="0" colspan="2">
<widget class="QwtPlot" name="qwt_Plotter"/>
</item>
<item row="2" column="0">
<widget class="QScrollBar" name="Plotter_Scroll">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="btn_Start">
<property name="text">
<string>Plotter starten</string>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Plotter-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Plotter-OK.png</normalon>:/Actions/Global/Images/Actions/Plotter-NO.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="wg_Debug">
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>0</number>
<property name="text">
<string>Plotter starten</string>
</property>
<property name="spacing">
<number>0</number>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Plotter-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Plotter-OK.png</normalon>:/Actions/Global/Images/Actions/Plotter-NO.png</iconset>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="wg_Grid">
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>4</number>
</property>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="wg_Config">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="wg_Grid_2">
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>4</number>
</property>
</layout>
</item>
<item row="1" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="btn_ChoseOK">
<property name="text">
<string>Übernehmen</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Datenauswahl für den Plotter.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="wgt_Connection" name="wg_Connection" native="true"/>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>582</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QwtPlot" name="qwt_Plotter"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="frame_Index">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="minimumSize">
<size>
<width>170</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>170</width>
<height>274</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: #000000;
</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
<zorder>wg_Connection</zorder>
<zorder></zorder>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
183,8 → 169,8
<rect>
<x>0</x>
<y>0</y>
<width>719</width>
<height>21</height>
<width>794</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
210,44 → 196,6
<addaction name="menu_Preferences"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="ToolBar">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="ac_Connect"/>
<addaction name="separator"/>
<addaction name="ac_Plotter"/>
<addaction name="ac_Debug"/>
<addaction name="separator"/>
<addaction name="ac_Chose"/>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
282,42 → 230,6
<string>Verbinden</string>
</property>
</action>
<action name="ac_Plotter">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Plotter-NO.png</normaloff>:/Actions/Global/Images/Actions/Plotter-NO.png</iconset>
</property>
<property name="text">
<string>Plotter</string>
</property>
</action>
<action name="ac_Debug">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Debug.png</normaloff>:/Actions/Global/Images/Actions/Debug.png</iconset>
</property>
<property name="text">
<string>Debug</string>
</property>
</action>
<action name="ac_Chose">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Preferences-Data.png</normaloff>:/Actions/Global/Images/Actions/Preferences-Data.png</iconset>
</property>
<property name="text">
<string>Auswahl</string>
</property>
</action>
<action name="ac_ReadLabels">
<property name="text">
<string>Analoglabels auslesen</string>