diff options
| author | Niklas | 2011-07-11 16:51:30 +0200 |
|---|---|---|
| committer | Niklas | 2011-07-11 16:51:30 +0200 |
| commit | fdae19c238de3a66c3aeaca45ce2e96ceda7cbf2 (patch) | |
| tree | 22252d5050b8a1cab99f5571ef8b0a73bb94fa01 /workspace/LogReceiver | |
| parent | added the two tryout with a qt LogReceiver and a c code client (diff) | |
| download | fbgui-fdae19c238de3a66c3aeaca45ce2e96ceda7cbf2.tar.gz fbgui-fdae19c238de3a66c3aeaca45ce2e96ceda7cbf2.tar.xz fbgui-fdae19c238de3a66c3aeaca45ce2e96ceda7cbf2.zip | |
updated the LogReceiver and LogWriter. we are now able to send and receive Status SubStatus and msg messages.
Diffstat (limited to 'workspace/LogReceiver')
| -rwxr-xr-x | workspace/LogReceiver/LogReceiver | bin | 30954 -> 35241 bytes | |||
| -rw-r--r-- | workspace/LogReceiver/LogReceiver.pro | 17 | ||||
| -rw-r--r-- | workspace/LogReceiver/logreceiver.cpp | 29 | ||||
| -rw-r--r-- | workspace/LogReceiver/logreceiver.ui | 99 |
4 files changed, 132 insertions, 13 deletions
diff --git a/workspace/LogReceiver/LogReceiver b/workspace/LogReceiver/LogReceiver Binary files differindex 16bcf4b..0a4b640 100755 --- a/workspace/LogReceiver/LogReceiver +++ b/workspace/LogReceiver/LogReceiver diff --git a/workspace/LogReceiver/LogReceiver.pro b/workspace/LogReceiver/LogReceiver.pro index 3a2d3f9..1be2ccd 100644 --- a/workspace/LogReceiver/LogReceiver.pro +++ b/workspace/LogReceiver/LogReceiver.pro @@ -1,10 +1,11 @@ TEMPLATE = app -TARGET = LogReceiver - -QT += core gui network - -HEADERS += logreceiver.h -SOURCES += main.cpp \ +TARGET = LogReceiver +QT += core \ + gui \ + network +HEADERS += status.h \ + logreceiver.h +SOURCES += main.cpp \ logreceiver.cpp -FORMS += logreceiver.ui -RESOURCES += +FORMS += logreceiver.ui +RESOURCES += diff --git a/workspace/LogReceiver/logreceiver.cpp b/workspace/LogReceiver/logreceiver.cpp index 9bca304..6988463 100644 --- a/workspace/LogReceiver/logreceiver.cpp +++ b/workspace/LogReceiver/logreceiver.cpp @@ -1,11 +1,14 @@ #include <QtGui> #include <QtNetwork> + #include <stdio.h> + #include <string.h> #include <stdlib.h> #include "logreceiver.h" #include <qlocalserver.h> #include <qlocalsocket.h> + #include "status.h" LogReceiver::LogReceiver(QWidget *parent) : @@ -61,8 +64,34 @@ LogReceiver::~LogReceiver() { void LogReceiver::handleNewInput() { QByteArray data = clientSocket->readAll(); + char * cdata = new char[data.size() +1]; + qDebug() << data.size(); + qDebug() << strlen(cdata); + strcpy(cdata, data.data()); + qDebug() << strlen(cdata); + qDebug() << cdata; + int st, sst; + char str[40]; + sscanf(cdata, "%d;%d;%s",&st,&sst,str); + + switch (st) { + case STAT_OK: + qDebug() << "received stat_ok"; + break; + case STAT_ERROR: + qDebug() << "received stat_error"; + break; + default: + qDebug() << "undefined status"; + } + qDebug() << st; QString logMsg(data); + + /** + * verarbeite den string + */ + qDebug() << logMsg; statusLabel->setText(logMsg); diff --git a/workspace/LogReceiver/logreceiver.ui b/workspace/LogReceiver/logreceiver.ui index 9143194..500f418 100644 --- a/workspace/LogReceiver/logreceiver.ui +++ b/workspace/LogReceiver/logreceiver.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>LogReceiverClass</class> - <widget class="QWidget" name="LogReceiverClass" > - <property name="geometry" > + <widget class="QWidget" name="LogReceiverClass"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,11 +10,99 @@ <height>300</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>LogReceiver</string> </property> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>131</width> + <height>17</height> + </rect> + </property> + <property name="text"> + <string>NetworkDiscovery</string> + </property> + </widget> + <widget class="QLabel" name="label_2"> + <property name="geometry"> + <rect> + <x>30</x> + <y>60</y> + <width>151</width> + <height>17</height> + </rect> + </property> + <property name="text"> + <string>verfügbare Interfaces</string> + </property> + </widget> + <widget class="QListView" name="listView_2"> + <property name="geometry"> + <rect> + <x>40</x> + <y>190</y> + <width>311</width> + <height>81</height> + </rect> + </property> + </widget> + <widget class="QLabel" name="label_3"> + <property name="geometry"> + <rect> + <x>10</x> + <y>150</y> + <width>71</width> + <height>17</height> + </rect> + </property> + <property name="text"> + <string>StatusLog</string> + </property> + </widget> + <widget class="Line" name="line"> + <property name="geometry"> + <rect> + <x>10</x> + <y>140</y> + <width>371</width> + <height>16</height> + </rect> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + <widget class="QLabel" name="label_4"> + <property name="geometry"> + <rect> + <x>40</x> + <y>90</y> + <width>67</width> + <height>17</height> + </rect> + </property> + <property name="text"> + <string>i_Name</string> + </property> + </widget> + <widget class="QLabel" name="label_5"> + <property name="geometry"> + <rect> + <x>230</x> + <y>90</y> + <width>67</width> + <height>17</height> + </rect> + </property> + <property name="text"> + <string>status</string> + </property> + </widget> </widget> - <layoutdefault spacing="6" margin="11" /> + <layoutdefault spacing="6" margin="11"/> <resources/> <connections/> </ui> |
