Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 800 → Rev 801

/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Classes/cSettings.cpp
0,0 → 1,134
/***************************************************************************
* Copyright (C) 2008 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_DebugLabels(int ID)
{
QBitArray Def_View;
Def_View.fill(true,MAX_DebugData);
 
QString Hardware = HardwareType[ID];
 
QSettings Setting("QMK", "Debug-Labels");
 
Setting.beginGroup("Debug-Labels-" + Hardware);
 
DebugData.Version = Setting.value(("Version"), "0").toString();
for (int a=0; a<MAX_DebugData; a++)
{
DebugData.Label[a] = Setting.value(("Label_" + QString("%1").arg(a)), "-" + DEF_DebugNames[a]).toString();
}
DebugData.Show_Plotter = Setting.value("Show_Plotter", QBitArray(Def_View)).value<QBitArray>();
 
Setting.endGroup();
}
 
void cSettings::write_DebugLabels(int ID)
{
QString Hardware = HardwareType[ID];
 
QSettings Setting("QMK", "Debug-Labels");
 
Setting.beginGroup("Debug-Labels-" + Hardware);
 
Setting.setValue("Version", DebugData.Version);
for (int a=0; a<MAX_DebugData; a++)
{
Setting.setValue("Label_" + QString("%1").arg(a), DebugData.Label[a]);
}
Setting.setValue("Show_Plotter", QBitArray(DebugData.Show_Plotter));
 
Setting.endGroup();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("DATA");
// DATA.Debug_Intervall = Setting.value("Debug-Intervall", 500).toInt();
DATA.Plotter_Count = Setting.value("Plotter-Count", 100).toInt();
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(700, 300)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
Setting.endGroup();
/*
Setting.beginGroup("SERVER");
SERVER.Password = Setting.value("Password", QString("")).toString();
SERVER.IP_MAX = Setting.value("IP_MAX", 1).toInt();
SERVER.IP_ID = Setting.value("IP_ID", 0).toInt();
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
SERVER.IP[z] = Setting.value("IP_" + QString("%1").arg(z), QString("127.0.0.1:64400")).toString();
}
Setting.endGroup();
*/
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("DATA");
Setting.setValue("Plotter-Count", DATA.Plotter_Count);
// Setting.setValue("Debug-Intervall", DATA.Debug_Intervall);
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.endGroup();
/*
Setting.beginGroup("SERVER");
Setting.setValue("Password", SERVER.Password);
Setting.setValue("IP_MAX", SERVER.IP_MAX);
Setting.setValue("IP_ID", SERVER.IP_ID);
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
Setting.setValue("IP_" + QString("%1").arg(z), SERVER.IP[z]);
}
Setting.endGroup();
*/
}
 
 
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Classes/cSettings.h
0,0 → 1,79
/***************************************************************************
* Copyright (C) 2008 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef CSETTINGS_H
#define CSETTINGS_H
 
#include <QBitArray>
#include <QSize>
#include <QPoint>
 
#include "../../Global/Kopter.h"
#include "../Defines.h"
 
struct set_DebugData
{
QString Version;
QString Label[MAX_DebugData];
QBitArray Show_Plotter;
// QBitArray LogView;
};
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
};
 
struct set_DATA
{
int Plotter_Count;
// int Debug_Intervall;
};
/*
struct set_SERVER
{
int IP_MAX;
int IP_ID;
QString IP[10];
QString Password;
};
*/
class cSettings
{
public:
cSettings();
 
int Settings_ID;
 
set_GUI GUI;
set_DebugData DebugData;
set_DATA DATA;
// set_SERVER SERVER;
 
void read_DebugLabels(int ID);
void write_DebugLabels(int ID);
 
void read_Settings();
void write_Settings();
 
 
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Defines.h
0,0 → 1,54
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Scope";
static const QString QA_VERSION_NR = "1.2.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "28.03.2010";
static const QString QA_YEAR = "2008-2010";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Scope - Datenplotter und Debugdaten-Anzeige.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
static const QString DataFields = "VAD";
 
#endif // DEFINES_H
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Dialogs/dlg_Main.cpp
0,0 → 1,345
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
 
#include <QMessageBox>
#include <QCryptographicHash>
 
#include "dlg_Main.h"
 
// Konstruktor Main-Form
dlg_Main::dlg_Main()
{
setupUi(this);
 
 
o_Settings = new cSettings();
 
o_Settings->read_DebugLabels(0);
 
wg_Connection->set_Client(ID_SCOPE, QA_NAME + " " + QA_VERSION, DataFields);
 
init_GUI();
init_Connections();
init_Plotter();
}
 
// Grafische Oberfläche initialisieren
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
wg_Connection->set_SelectVisible(false);
wg_Connection->set_ButtonVisible(false);
 
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++)
{
 
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_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]);
}
}
 
// Signale mit Slots verbinden
void dlg_Main::init_Connections()
{
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()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
 
connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int)));
connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware)));
connect(wg_Connection, SIGNAL(sig_MK_Debug(s_MK_Debug)), this, SLOT(slot_MK_Debug(s_MK_Debug)));
connect(wg_Connection, SIGNAL(sig_MK_DebugLabels(s_MK_DebugLabels)), this, SLOT(slot_MK_DebugLabels(s_MK_DebugLabels)));
}
 
void dlg_Main::init_Plotter()
{
NextPlot = 0;
 
qwt_Plotter->setCanvasBackground(QColor(QRgb(0x00000000)));
 
qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend);
 
QwtPlotGrid *Grid = new QwtPlotGrid();
Grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
 
Grid->attach(qwt_Plotter);
 
qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0);
 
for (int a = 0; a < MAX_DebugData; a++)
{
Plot[a] = new QwtPlotCurve(o_Settings->DebugData.Label[a]);
Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a])));
Plot[a]->setRenderHint(QwtPlotItem::RenderAntialiased);
 
if (o_Settings->DebugData.Show_Plotter[a])
Plot[a]->attach(qwt_Plotter);
}
qwt_Plotter->replot();
}
 
void dlg_Main::update_Plotter()
{
pl_ID[NextPlot] = NextPlot;
 
for (int a = 0; a < MAX_DebugData; a++)
{
pl_Data[a][NextPlot] = Debug_Data[a];
Plot[a]->setData(pl_ID,pl_Data[a],NextPlot);
}
 
NextPlot++;
 
if ((NextPlot > o_Settings->DATA.Plotter_Count))
{
Plotter_Scroll->setMaximum(NextPlot - o_Settings->DATA.Plotter_Count);
}
 
if ((Plotter_Scroll->value() == NextPlot - (o_Settings->DATA.Plotter_Count + 1)))
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,NextPlot - o_Settings->DATA.Plotter_Count,NextPlot,0);
Plotter_Scroll->setValue(NextPlot - o_Settings->DATA.Plotter_Count);
}
 
qwt_Plotter->replot();
}
 
void dlg_Main::config_Plotter()
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0);
 
for (int a = 0; a < MAX_DebugData; a++)
{
Plot[a]->detach();
Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a])));
 
if (o_Settings->DebugData.Show_Plotter[a])
{
Plot[a]->setTitle(o_Settings->DebugData.Label[a]);
Plot[a]->attach(qwt_Plotter);
}
}
qwt_Plotter->replot();
}
 
void dlg_Main::slot_Plotter_Scroll(int Position)
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,Position,Position + o_Settings->DATA.Plotter_Count,0);
qwt_Plotter->replot();
}
 
///////////
// Slots //
///////////
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ConnectionStatus(int li_Status)
{
if (li_Status)
{
ac_Connect->setChecked(true);
ac_Connect->setText(tr("Trennen"));
}
else
{
ac_Connect->setChecked(false);
ac_Connect->setText(tr("Verbinden"));
}
}
 
void dlg_Main::slot_MK_Version(s_Hardware ls_Version)
{
gs_Version = ls_Version;
setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version);
 
o_Settings->read_DebugLabels(gs_Version.ID);
 
if (o_Settings->DebugData.Version != gs_Version.Version)
{
qDebug(QString("Debug-Labels unterschiedlich. Neue anforden. " + o_Settings->DebugData.Version + " <> " + gs_Version.Version).toLatin1().data());
usleep(50000);
 
slot_ac_ReadLabels();
}
else
{
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]);
}
config_Plotter();
}
}
 
void dlg_Main::slot_MK_Debug(s_MK_Debug ls_Debug)
{
gs_Debug = ls_Debug;
 
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]));
}
}
if (btn_Start->isChecked())
{
update_Plotter();
}
}
 
void dlg_Main::slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels)
{
if (MK_DebugLabels.Position < 32)
{
o_Settings->DebugData.Label[MK_DebugLabels.Position] = MK_DebugLabels.Text;
if (o_Settings->DebugData.Label[MK_DebugLabels.Position] == "")
{
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]);
 
}
if (MK_DebugLabels.Position == 31)
{
o_Settings->DebugData.Version = gs_Version.Version;
o_Settings->write_DebugLabels(gs_Version.ID);
config_Plotter();
}
}
 
void dlg_Main::slot_Plotter_Start()
{
if (btn_Start->isChecked())
{
btn_Start->setText(tr("Plotter stoppen"));
}
else
{
btn_Start->setText(tr("Plotter starten"));
}
}
 
void dlg_Main::slot_btn_ChoseOK()
{
for(int z = 0; z < MAX_DebugData; z++)
{
o_Settings->DebugData.Show_Plotter[z] = cb_Debug[z]->isChecked();
}
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;
wg_Connection->send_Data(HandlerMK::make_Frame('a', ADDRESS_ALL, c_Data, 1).toLatin1().data(), DATA_READ_LABEL);
}
 
// Programm Ende
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
 
o_Settings->write_Settings();
}
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Dialogs/dlg_Main.h
0,0 → 1,106
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DLG_MAIN_H
#define DLG_MAIN_H
 
#include <QtGui/QMainWindow>
#include <QtGui/QLineEdit>
#include <QtGui/QCheckBox>
#include <QtGui/QLabel>
#include <QtGui/QFont>
 
#include <QTcpServer>
#include <QTcpSocket>
 
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_legend.h>
#include <qwt_plot.h>
 
#include "ui_dlg_Main.h"
 
#include "../Defines.h"
#include "../TypeDefs.h"
 
#include "../Classes/cSettings.h"
 
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
Q_OBJECT
 
public:
dlg_Main();
~dlg_Main();
 
private:
// Settings-Object
cSettings *o_Settings;
 
QLabel *lb_Debug[MAX_DebugData];
QLineEdit *le_Debug[MAX_DebugData];
QCheckBox *cb_Debug[MAX_DebugData];
QFont Font_1;
 
// Info über die Hardware
s_Hardware gs_Version;
 
// Datenspeicher zum Senden.
char c_Data[150];
 
s_MK_Debug gs_Debug;
 
int Debug_Data[MAX_DebugData];
 
// Plots für die Analogwerte
QwtPlotCurve *Plot[MAX_DebugData];
 
// Datenspeicher für die Plots
double pl_Data[MAX_DebugData][50000];
double pl_ID[50000];
int NextPlot;
 
// Programm-Initialisirungen
void init_GUI();
void init_Connections();
void init_Plotter();
 
void update_Plotter();
void config_Plotter();
 
private slots:
void slot_ac_About();
 
void slot_ConnectionStatus(int li_Status);
void slot_MK_Version(s_Hardware ls_Version);
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_ReadLabels();
 
void slot_btn_ChoseOK();
 
void slot_Plotter_Start();
void slot_Plotter_Scroll(int Position);
};
 
#endif // DLG_MAIN_H
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/Dialogs/dlg_Main.ui
0,0 → 1,362
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>719</width>
<height>314</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK-Scope</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</iconset>
</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>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>4</number>
</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>
<property name="spacing">
<number>0</number>
</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>
</item>
<item row="0" column="0">
<widget class="wgt_Connection" name="wg_Connection" native="true"/>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>719</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Quit"/>
<addaction name="ac_Connect"/>
</widget>
<widget class="QMenu" name="menu_Preferences">
<property name="title">
<string>Einstellungen</string>
</property>
<addaction name="ac_ReadLabels"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<addaction name="menu_Program"/>
<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">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<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="text">
<string>Über QMK-Scope</string>
</property>
</action>
<action name="ac_Connect">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="text">
<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>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QwtPlot</class>
<extends>QFrame</extends>
<header>qwt_plot.h</header>
</customwidget>
<customwidget>
<class>wgt_Connection</class>
<extends>QWidget</extends>
<header>wgt_Connection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../QMK-Scope.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/QMK-Scope.pro
0,0 → 1,51
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
 
include(../Global/Widget_Connection.pri)
 
QT += network
TARGET = QMK-Scope
TEMPLATE = app
DESTDIR = ../Binary
OBJECTS_DIR = ../Binary/.build/QMK-Scope
UI_DIR = ../Binary/.build/QMK-Scope
MOC_DIR = ../Binary/.build/QMK-Scope
RCC_DIR = ../Binary/.build/QMK-Scope
 
debug {
DEFINES += _BETA_
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include /usr/include/qwt
}
 
Suse {
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include /usr/include/qwt
}
 
Debian {
LIBS += -lqwt-qt4
INCLUDEPATH += $(HOME)/include /usr/include/qwt-qt4
}
 
Gentoo {
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include /usr/include/qwt5
}
 
OSX {
LIBS += -L/opt/local/lib -lqwt
INCLUDEPATH += /opt/local/include
}
RESOURCES += QMK-Scope.qrc
 
SOURCES += main.cpp \
Dialogs/dlg_Main.cpp \
Classes/cSettings.cpp
HEADERS += Defines.h \
../Global/Global.h \
Dialogs/dlg_Main.h \
Classes/cSettings.h \
TypeDefs.h
FORMS += Dialogs/dlg_Main.ui
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/QMK-Scope.qrc
0,0 → 1,14
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Scope.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Plotter-NO.png</file>
<file>../Global/Images/Actions/Plotter-OK.png</file>
<file>../Global/Images/Actions/Preferences-Data.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
<file>../Global/Images/Actions/Debug.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
</qresource>
</RCC>
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/TypeDefs.h
0,0 → 1,27
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
#include <QRgb>
 
static const QRgb DEF_DebugColors[] = {0x00FF0000, 0x0000FF00, 0x00FFFF00, 0x000000FF, 0x00FF00FF, 0x0000FFFF, 0x00FFFFFF, 0x00660000, 0x00006600, 0x00666600, 0x00000066, 0x00660066, 0x000066, 0x00666666, 0x00990000, 0x00009900, 0x00999900, 0x00000099, 0x00990099, 0x00009999, 0x00999999, 0x00CC0000, 0x0000CC00, 0x00CCCC00, 0x000000CC, 0x00CC00CC, 0x0000CCCC, 0x00CCCCCC, 0x0066FF99, 0x009966FF, 0x00FF9966, 0x0099FF66};
 
#endif // TYPEDEFS_H
/QMK-Groundstation/tags/QMK-Tools v1.2.0/QMK-Scope/main.cpp
0,0 → 1,36
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->show();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}