summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/can/sendframebox.ui
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-07-02 12:23:01 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-07-17 19:52:22 +0000
commitf152024f15eeba7da222664b79bd275755b39360 (patch)
tree75f8c8ab09a1eba7b6211f9ab79f85ea1255d161 /examples/serialbus/can/sendframebox.ui
parent41b46ae9fe32481582bf07cd48bda2d3595c90f7 (diff)
CAN-Example: Add a dedicated send frame group box
By moving the send frame logic to a separate panel, the MainWindow gets easier to understand as it only connects signals to slots. The new SendFramesBox also does more sanity check on the parameters (options that exclude each other are checked) and forbids invalid input by using QValidators. The payload input is also prettified with spaces. This was first done by InputMasks but this had strange side effects so now the input validator is used for this task also. Change-Id: Ib95605ce4bc23b52d1cf5d082b1533b2a59f7749 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialbus/can/sendframebox.ui')
-rw-r--r--examples/serialbus/can/sendframebox.ui211
1 files changed, 211 insertions, 0 deletions
diff --git a/examples/serialbus/can/sendframebox.ui b/examples/serialbus/can/sendframebox.ui
new file mode 100644
index 0000000..0abeff5
--- /dev/null
+++ b/examples/serialbus/can/sendframebox.ui
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SendFrameBox</class>
+ <widget class="QGroupBox" name="SendFrameBox">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>485</width>
+ <height>206</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QGroupBox" name="frameTypeBox">
+ <property name="title">
+ <string>Frame Type</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QRadioButton" name="dataFrame">
+ <property name="toolTip">
+ <string>Sends a CAN data frame.</string>
+ </property>
+ <property name="text">
+ <string>D&amp;ata Frame</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="remoteFrame">
+ <property name="toolTip">
+ <string>Sends a CAN remote request frame.</string>
+ </property>
+ <property name="text">
+ <string>Re&amp;mote Request Frame</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="errorFrame">
+ <property name="toolTip">
+ <string>Sends an error frame.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Error Frame</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="frameOptionsBox">
+ <property name="title">
+ <string>Frame Options</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="extendedFormatBox">
+ <property name="toolTip">
+ <string>Allows extended frames with 29 bit identifier.</string>
+ </property>
+ <property name="text">
+ <string>E&amp;xtended Format</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="flexibleDataRateBox">
+ <property name="toolTip">
+ <string>Allows up to 64 byte payload data.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Flexible Data-Rate</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="bitrateSwitchBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Sends payload at higher data rate.</string>
+ </property>
+ <property name="text">
+ <string>&amp;Bitrate Switch</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="frameIdLabel">
+ <property name="text">
+ <string>Frame &amp;ID (hex)</string>
+ </property>
+ <property name="buddy">
+ <cstring>frameIdEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="frameIdEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="placeholderText">
+ <string>123</string>
+ </property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="payloadLabel">
+ <property name="text">
+ <string>&amp;Payload (hex)</string>
+ </property>
+ <property name="buddy">
+ <cstring>payloadEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="payloadEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="placeholderText">
+ <string>12 34 AB CE</string>
+ </property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <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>
+ <widget class="QPushButton" name="sendButton">
+ <property name="text">
+ <string>&amp;Send</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>