Skip to content

Commit 8c0e655

Browse files
authored
Add files via upload
1 parent 6033313 commit 8c0e655

31 files changed

+3427
-0
lines changed

src/ComSettingsWidget.ui

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>ComSettingsWidget</class>
4+
<widget class="QWidget" name="ComSettingsWidget">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>299</width>
10+
<height>182</height>
11+
</rect>
12+
</property>
13+
<property name="sizePolicy">
14+
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
15+
<horstretch>0</horstretch>
16+
<verstretch>0</verstretch>
17+
</sizepolicy>
18+
</property>
19+
<property name="windowTitle">
20+
<string>ComSettingsWidget</string>
21+
</property>
22+
<layout class="QHBoxLayout" name="horizontalLayout_2">
23+
<property name="spacing">
24+
<number>3</number>
25+
</property>
26+
<property name="leftMargin">
27+
<number>3</number>
28+
</property>
29+
<property name="topMargin">
30+
<number>0</number>
31+
</property>
32+
<property name="rightMargin">
33+
<number>3</number>
34+
</property>
35+
<property name="bottomMargin">
36+
<number>3</number>
37+
</property>
38+
<item>
39+
<layout class="QVBoxLayout" name="verticalLayout_2">
40+
<property name="spacing">
41+
<number>3</number>
42+
</property>
43+
<item>
44+
<widget class="QComboBox" name="serialPortInfoListBox">
45+
<property name="sizePolicy">
46+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
47+
<horstretch>0</horstretch>
48+
<verstretch>0</verstretch>
49+
</sizepolicy>
50+
</property>
51+
</widget>
52+
</item>
53+
<item>
54+
<widget class="QScrollArea" name="scrollArea">
55+
<property name="sizePolicy">
56+
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
57+
<horstretch>0</horstretch>
58+
<verstretch>0</verstretch>
59+
</sizepolicy>
60+
</property>
61+
<property name="minimumSize">
62+
<size>
63+
<width>0</width>
64+
<height>120</height>
65+
</size>
66+
</property>
67+
<property name="maximumSize">
68+
<size>
69+
<width>330</width>
70+
<height>16777215</height>
71+
</size>
72+
</property>
73+
<property name="sizeAdjustPolicy">
74+
<enum>QAbstractScrollArea::AdjustIgnored</enum>
75+
</property>
76+
<property name="widgetResizable">
77+
<bool>true</bool>
78+
</property>
79+
<widget class="QWidget" name="scrollAreaWidgetContents">
80+
<property name="geometry">
81+
<rect>
82+
<x>0</x>
83+
<y>0</y>
84+
<width>119</width>
85+
<height>152</height>
86+
</rect>
87+
</property>
88+
<layout class="QVBoxLayout" name="verticalLayout">
89+
<property name="spacing">
90+
<number>0</number>
91+
</property>
92+
<property name="leftMargin">
93+
<number>3</number>
94+
</property>
95+
<property name="topMargin">
96+
<number>3</number>
97+
</property>
98+
<property name="rightMargin">
99+
<number>3</number>
100+
</property>
101+
<property name="bottomMargin">
102+
<number>3</number>
103+
</property>
104+
<item>
105+
<widget class="QLabel" name="descriptionLabel">
106+
<property name="text">
107+
<string>Description:</string>
108+
</property>
109+
</widget>
110+
</item>
111+
<item>
112+
<widget class="QLabel" name="manufacturerLabel">
113+
<property name="text">
114+
<string>Manufacturer:</string>
115+
</property>
116+
</widget>
117+
</item>
118+
<item>
119+
<widget class="QLabel" name="serialNumberLabel">
120+
<property name="text">
121+
<string>Serial number:</string>
122+
</property>
123+
</widget>
124+
</item>
125+
<item>
126+
<widget class="QLabel" name="locationLabel">
127+
<property name="text">
128+
<string>Location:</string>
129+
</property>
130+
</widget>
131+
</item>
132+
<item>
133+
<widget class="QLabel" name="vidLabel">
134+
<property name="text">
135+
<string>Vendor ID:</string>
136+
</property>
137+
</widget>
138+
</item>
139+
<item>
140+
<widget class="QLabel" name="pidLabel">
141+
<property name="text">
142+
<string>Product ID:</string>
143+
</property>
144+
</widget>
145+
</item>
146+
</layout>
147+
</widget>
148+
</widget>
149+
</item>
150+
</layout>
151+
</item>
152+
<item>
153+
<layout class="QVBoxLayout" name="verticalLayout_3">
154+
<property name="spacing">
155+
<number>3</number>
156+
</property>
157+
<property name="leftMargin">
158+
<number>0</number>
159+
</property>
160+
<item>
161+
<layout class="QHBoxLayout" name="horizontalLayout_3">
162+
<property name="spacing">
163+
<number>0</number>
164+
</property>
165+
<item>
166+
<widget class="QLabel" name="baudRateLabel">
167+
<property name="text">
168+
<string>BaudRate:</string>
169+
</property>
170+
</widget>
171+
</item>
172+
<item>
173+
<widget class="QComboBox" name="baudRateBox"/>
174+
</item>
175+
</layout>
176+
</item>
177+
<item>
178+
<layout class="QHBoxLayout" name="horizontalLayout_4">
179+
<property name="spacing">
180+
<number>0</number>
181+
</property>
182+
<property name="topMargin">
183+
<number>0</number>
184+
</property>
185+
<item>
186+
<widget class="QLabel" name="dataBitsLabel">
187+
<property name="text">
188+
<string>Data bits:</string>
189+
</property>
190+
</widget>
191+
</item>
192+
<item>
193+
<widget class="QComboBox" name="dataBitsBox"/>
194+
</item>
195+
</layout>
196+
</item>
197+
<item>
198+
<layout class="QHBoxLayout" name="horizontalLayout_6">
199+
<property name="spacing">
200+
<number>0</number>
201+
</property>
202+
<item>
203+
<widget class="QLabel" name="stopBitsLabel">
204+
<property name="text">
205+
<string>Stop bits:</string>
206+
</property>
207+
</widget>
208+
</item>
209+
<item>
210+
<widget class="QComboBox" name="stopBitsBox"/>
211+
</item>
212+
</layout>
213+
</item>
214+
<item>
215+
<layout class="QHBoxLayout" name="horizontalLayout_7">
216+
<property name="spacing">
217+
<number>0</number>
218+
</property>
219+
<item>
220+
<widget class="QLabel" name="flowControlLabel">
221+
<property name="text">
222+
<string>Flow control:</string>
223+
</property>
224+
</widget>
225+
</item>
226+
<item>
227+
<widget class="QComboBox" name="flowControlBox"/>
228+
</item>
229+
</layout>
230+
</item>
231+
<item>
232+
<layout class="QHBoxLayout" name="horizontalLayout_5">
233+
<property name="spacing">
234+
<number>0</number>
235+
</property>
236+
<item>
237+
<widget class="QLabel" name="parityLabel">
238+
<property name="text">
239+
<string>Parity:</string>
240+
</property>
241+
</widget>
242+
</item>
243+
<item>
244+
<widget class="QComboBox" name="parityBox"/>
245+
</item>
246+
</layout>
247+
</item>
248+
<item>
249+
<layout class="QHBoxLayout" name="horizontalLayout">
250+
<property name="spacing">
251+
<number>6</number>
252+
</property>
253+
<item>
254+
<spacer name="horizontalSpacer">
255+
<property name="orientation">
256+
<enum>Qt::Horizontal</enum>
257+
</property>
258+
<property name="sizeType">
259+
<enum>QSizePolicy::Expanding</enum>
260+
</property>
261+
<property name="sizeHint" stdset="0">
262+
<size>
263+
<width>1</width>
264+
<height>20</height>
265+
</size>
266+
</property>
267+
</spacer>
268+
</item>
269+
<item>
270+
<widget class="QPushButton" name="pushButton_disconnect">
271+
<property name="sizePolicy">
272+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
273+
<horstretch>0</horstretch>
274+
<verstretch>0</verstretch>
275+
</sizepolicy>
276+
</property>
277+
<property name="text">
278+
<string>Disconnect</string>
279+
</property>
280+
</widget>
281+
</item>
282+
<item>
283+
<widget class="QPushButton" name="pushButton_connect">
284+
<property name="text">
285+
<string>Connect</string>
286+
</property>
287+
</widget>
288+
</item>
289+
</layout>
290+
</item>
291+
</layout>
292+
</item>
293+
</layout>
294+
</widget>
295+
<layoutdefault spacing="6" margin="11"/>
296+
<resources/>
297+
<connections/>
298+
</ui>

src/ConsoleWidget.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/***************************************************************************
2+
** **
3+
** This file is part of FDMLControl. **
4+
** FDMLControl enables the control of the Optores FDML laser via a **
5+
** serial connection. **
6+
** Copyright (C) 2019 Miroslav Zabic **
7+
** **
8+
** FDMLControl is free software: you can redistribute it and/or modify **
9+
** it under the terms of the GNU General Public License as published by **
10+
** the Free Software Foundation, either version 3 of the License, or **
11+
** (at your option) any later version. **
12+
** **
13+
** This program is distributed in the hope that it will be useful, **
14+
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
15+
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
16+
** GNU General Public License for more details. **
17+
** **
18+
** You should have received a copy of the GNU General Public License **
19+
** along with this program. If not, see http://www.gnu.org/licenses/. **
20+
** **
21+
****************************************************************************
22+
** Author: Miroslav Zabic **
23+
** Contact: zabic **
24+
** at **
25+
** iqo.uni-hannover.de **
26+
** **
27+
** Date: 12 June 2019 **
28+
** Version: 1.0.0 **
29+
****************************************************************************/
30+
31+
#include "consolewidget.h"
32+
33+
ConsoleWidget::ConsoleWidget(QWidget *parent)
34+
: QueryWidget(parent)
35+
{
36+
ui.setupUi(this);
37+
connect(this->ui.lineEdit, &QLineEdit::returnPressed, this, &ConsoleWidget::slot_commandSent);
38+
connect(this->ui.pushButton_send, &QPushButton::clicked, this, &ConsoleWidget::slot_commandSent);
39+
}
40+
41+
ConsoleWidget::~ConsoleWidget()
42+
{
43+
}
44+
45+
void ConsoleWidget::slot_commandSent() {
46+
QString command = this->ui.lineEdit->text();
47+
emit query(this, command);
48+
}
49+
50+
void ConsoleWidget::slot_addText(QString text) {
51+
this->ui.plainTextEdit->appendPlainText(text);
52+
}
53+
54+
void ConsoleWidget::handleResponse(QString initialQuery, QString response) {
55+
this->slot_addText(initialQuery.remove(QRegExp("[\\r\\n]")) + "> " + response.remove(QRegExp("[\\r\\n]")));
56+
}

0 commit comments

Comments
 (0)