summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrunal Bhargav2022-04-27 09:01:49 -0500
committerKrunal Bhargav2022-05-04 16:33:33 -0500
commitc0d638776e7a3eb2d3d190ff8ac883622760cf23 (patch)
tree59b73f2c2e8449dbc7b66e6c9fe35a4433f38c13
downloadhmi-demo-c0d638776e7a3eb2d3d190ff8ac883622760cf23.tar.gz
hmi-demo-c0d638776e7a3eb2d3d190ff8ac883622760cf23.tar.xz
hmi-demo-c0d638776e7a3eb2d3d190ff8ac883622760cf23.zip
AM62 HMI demo: Inital Commit
Signed-off-by: Krunal Bhargav <k-bhargav@ti.com>
-rw-r--r--LICENSE206
-rw-r--r--hmi_demo.pro30
-rw-r--r--images/3D_with_text.pngbin0 -> 1072 bytes
-rw-r--r--images/Analytics_with_text.pngbin0 -> 1984 bytes
-rw-r--r--images/Background.pngbin0 -> 248121 bytes
-rw-r--r--images/Bottom_Right_Box.pngbin0 -> 6659 bytes
-rw-r--r--images/Center_Box.pngbin0 -> 17769 bytes
-rw-r--r--images/Control_Panel_with_text.pngbin0 -> 2350 bytes
-rw-r--r--images/Minux_Box.pngbin0 -> 737 bytes
-rw-r--r--images/Motor_Temp.pngbin0 -> 6769 bytes
-rw-r--r--images/Off_Button.pngbin0 -> 6014 bytes
-rw-r--r--images/On_Button.pngbin0 -> 6032 bytes
-rw-r--r--images/Plus_Box.pngbin0 -> 823 bytes
-rw-r--r--images/Rectangle.pngbin0 -> 879 bytes
-rw-r--r--images/Repeat_Grid.pngbin0 -> 3596 bytes
-rw-r--r--images/Status_Message.pngbin0 -> 7571 bytes
-rw-r--r--images/Texas_Instrument.pngbin0 -> 5308 bytes
-rw-r--r--images/Top_Righ_Box.pngbin0 -> 6520 bytes
-rw-r--r--images/servo-drives-icon.pngbin0 -> 3497 bytes
-rw-r--r--main.cpp20
-rw-r--r--main.qml721
-rw-r--r--qml.qrc22
22 files changed, 999 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fd87c2a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,206 @@
1Texas Instruments Incorporated
2Technology and Software Publicly Available
3Software License Agreement
4
5
6Important - Please read the following license agreement carefully. This is
7a legally binding agreement. Do not click "i have read and agree" or use
8(as applicable) the Licensed Materials unless: (1) you are authorized to
9accept and agree to the terms of this license agreement on behalf of
10yourself or your company (as applicable) and (2) you intend to be bound by
11the terms of this license agreement on behalf of yourself or your company
12(as applicable).
13
14This Software License Agreement ("Agreement") is a legal agreement between
15you (either an individual or entity) and Texas Instruments Incorporated
16("TI"), 12500 TI Boulevard, Dallas, Texas 75243. The "Licensed Materials"
17subject to this Agreement include the software programs (in whole or in
18part), that accompany this Agreement and set forth in the applicable
19software manifest and which you access "on-line" and/or electronic
20documentation (in whole or in part) associated and provided with these
21software programs. By installing, copying or otherwise using the Licensed
22Materials you agree to abide by the terms of this Agreement. If you choose
23not to accept or agree with these terms, do not download or install the
24Licensed Materials.
25
26Note Regarding Possible Access to Open Source Software: The Licensed
27Materials may be bundled with Open Source Software. "Open Source Software"
28means any software licensed under terms requiring that (A) other software
29("Proprietary Software") incorporated, combined or distributed with such
30software or developed using such software: (i) be disclosed or distributed
31in source code form; or (ii) otherwise be licensed on terms inconsistent
32with the terms of this Agreement, including but not limited to permitting
33use of the Proprietary Software on or with devices other than TI Devices, or
34(B) require the owner of Proprietary Software to license any of its patents
35to users of the Open Source Software and/or Proprietary Software
36incorporated, combined or distributed with such Open Source Software or
37developed using such Open Source Software.
38
39You may gain access to Open Source Software, in which case such Open Source
40Software will be listed in the applicable software manifest (in whole or in
41part, the "Open Source Materials"). Your use of the Open Source Materials
42is subject to the separate licensing terms applicable to such Open Source
43Materials as specified in the applicable software manifest. For
44clarification, this Agreement does not limit your rights under, or grant you
45rights that supersede, the license terms of any applicable Open Source
46Materials license agreement. If any of the Open Source Materials have been
47provided to you in object code only, TI will provide to you or show you
48where can access the source code versions of such Open Source Materials if
49you contact TI at Texas Instruments Incorporated, 12500 TI Boulevard, Mail
50Station 8638, Dallas, Texas 75243, Attention: Contracts Manager. You may
51terminate this Agreement in the event you choose not to accept or agree with
52the terms in any applicable Open Source Materials license agreement,
53provided that such termination occurs within five (5) calendar days of
54acceptance of this Agreement and you abide by all applicable license terms
55in this Agreement until such termination.
56
571. License.
58
59a. Source Code License. For the Licensed Materials provided in source code
60format, TI hereby grants to you a limited, non-exclusive license to
61reproduce, use, and create modified or derivative works of the Licensed
62Materials provided to you in source code format and to distribute an
63unlimited number of copies of such source code Licensed Materials, or any
64derivatives thereof, in any format.
65
66b. Object Code License. For the Licensed Materials provided in object code
67format, TI hereby grants to you a limited, non-exclusive license to
68reproduce and use the Licensed Materials provided to you in object code
69format and to distribute an unlimited number of object or executable copies
70of such object code Licensed Materials.
71
722. Termination. This Agreement is effective until terminated. Without
73prejudice to any other rights, TI may terminate your right to use the
74Licensed Materials under this Agreement if you fail to comply with the terms
75of this Agreement. In such event, you shall destroy all copies of the
76Licensed Materials, including all portions and derivatives thereof.
77
783. Intellectual Property Rights.
79
80a. The Licensed Materials being provided to you hereunder are being made
81publicly available by TI, even though they contain copyrighted material of
82TI and its licensors, if applicable. In no event may you alter, remove or
83destroy any copyright notice included in the Licensed Materials. To the
84extent that any of the Licensed Materials are provided in binary or object
85code only, you may not unlock, decompile, reverse engineer, disassemble or
86otherwise translate such binary or object code to human-perceivable form.
87The source code of such reverse engineered code may contain TI trade secret
88and other proprietary information. TI reserves all rights not specifically
89granted under this Agreement.
90
91b. Certain Licensed Materials may (i) require patent licenses from third
92parties claiming patent rights covering implementation of the Licensed
93Materials or (ii) be based on industry recognized standards or software
94programs published by industry recognized standards bodies and certain third
95parties may claim to own patents or copyrights that cover implementation of
96those standards. You acknowledge and agree that this Agreement does not
97convey a license to any such third party patents and copyrights.
98
99c. YOU ACKNOWLEDGE AND AGREE THAT TI SHALL NOT BE LIABLE FOR AND SHALL NOT
100DEFEND OR INDEMNIFY YOU AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT
101RELATES TO OR IS BASED ON YOUR MANUFACTURE, USE, OR DISTRIBUTION OF THE
102LICENSED MATERIALS OR YOUR MANUFACTURE, USE, OFFER FOR SALE, SALE,
103IMPORTATION OR DISTRIBUTION OF YOUR PRODUCTS THAT INCLUDE OR INCORPORATE THE
104LICENSED MATERIALS.
105
106d. You acknowledge and agree that you are responsible for any fees or
107royalties that may be payable to any third party based on such third party's
108interests in the Licensed Materials described in Section 3(b) above (the
109"Third Party Payment Obligations"). You agree to indemnify TI against any
110Third Party Payment Obligations and will defend any claim, suit or
111proceeding brought against TI insofar as such claim, suit or proceeding is
112based on your failure to pay any Third Party Payment Obligations.
113
1144. Warranties and Limitations. THE LICENSED MATERIALS ARE PROVIDED "AS IS".
115TI AND ITS LICENSORS MAKE NO WARRANTY OR REPRESENTATION, EXPRESS, IMPLIED OR
116STATUTORY, INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTIBILITY, FITNESS FOR
117A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS OF
118RESPONSES, RESULTS AND LACK OF NEGLIGENCE. TI DISCLAIMS ANY WARRANTY OF
119TITLE, QUIET ENJOYMENT, QUIET POSESSION, AND NON-INFRINGEMENT OF ANY THIRD
120PARTY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE LICENSED MATERIALS OR
121USE OF THOSE MATERIALS.
122
123YOU ACKNOWLEDGE AND AGREE THAT THE LICENSED MATERIALS MAY NOT BE INTENDED
124FOR PRODUCTION APPLICATIONS AND MAY CONTAIN IRREGULARITIES AND DEFECTS NOT
125FOUND IN PRODUCTION SOFTWARE. FURTHERMORE, YOU ACKNOWLEDGE AND AGREE THAT
126THE LICENSED MATERIALS HAVE NOT BEEN TESTED OR CERTIFIED BY ANY GOVERNMENT
127AGENCY OR INDUSTRY REGULATORY ORGANIZATION OR ANY OTHER THIRD PARTY
128ORGANIZATION. YOU AGREE THAT PRIOR TO USING, INCORPORATING OR DISTRIBUTING
129THE LICENSED MATERIALS IN OR WITH ANY COMMERCIAL PRODUCT THAT YOU WILL
130THOROUGHLY TEST THE PRODUCT AND THE FUNCTIONALITY OF THE LICENSED MATERIALS
131IN OR WITH THAT PRODUCT AND BE SOLELY RESPONSIBLE FOR ANY PROBLEMS OR
132FAILURES.
133
134IN NO EVENT SHALL TI OR ITS LICENSORS BE LIABLE FOR ANY SPECIAL, INDIRECT,
135INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED ON ANY THEORY
136OF LIABILITY, ARISING IN ANY WAY OUT OF THIS AGREEMENT, OR YOUR USE OF THE
137LICENSED MATERIALS, WHETHER OR NOT TI HAS BEEN ADVISED OF THE POSSIBILITY OF
138SUCH DAMAGES. EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF
139REMOVAL OR REINSTALLATION, OUTSIDE COMPUTER TIME, LABOR COSTS, LOSS OR
140CORRUPTION OF DATA, LOSS OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR
141LOSS OF USE OR INTERRUPTION OF BUSINESS OR ANY OTHER ECONOMIC LOSS. IN NO
142EVENT WILL TI'S AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF
143YOUR USE OF THE LICENSED MATERIALS EXCEED FIVE HUNDRED U.S. DOLLARS
144(US$500).
145
146Because some jurisdictions do not allow the exclusion or limitation of
147incidental or consequential damages or limitation on how long an implied
148warranty lasts, the above limitations or exclusions may not apply to you.
149
1505. Export Control. The Licensed Materials may be subject to the export or
151import regulations of certain countries. You agree to comply with all such
152regulations and acknowledge that you have the responsibility to obtain any
153licenses or other authorizations that may be required to export, re-export
154or import the Licensed Materials.
155
1566. Governing Law, Jurisdiction and Severability. This Agreement will be
157governed by and interpreted in accordance with the laws of the State of
158Texas, without reference to conflict of laws principles. If for any reason
159a court of competent jurisdiction finds any provision of the Agreement to be
160unenforceable, that provision will be enforced to the maximum extent
161possible to effectuate the intent of the parties and the remainder of the
162Agreement shall continue in full force and effect. This Agreement shall not
163be governed by the United Nations Convention on Contracts for the
164International Sale of Goods, or by the Uniform Computer Information
165Transactions Act (UCITA). The parties agree that non-exclusive jurisdiction
166for any dispute arising out of or relating to this Agreement lies within the
167courts located in the State of Texas. Notwithstanding the foregoing, any
168judgment may be enforced in any United States or foreign court, and either
169party may seek injunctive relief in any United States or foreign court.
170Failure by TI to enforce any provision of this Agreement shall not be deemed
171a waiver of future enforcement of that or any other provision in this
172Agreement or any other agreement that may be in place between the parties.
173
1747. PRC Provisions. If you are located in the People's Republic of China
175("PRC") or if the Licensed Materials will be sent to the PRC, the following
176provisions shall apply:
177
178a. Registration Requirements. You shall be solely responsible for
179performing all acts and obtaining all approvals that may be required in
180connection with this Agreement by the government of the PRC, including but
181not limited to registering pursuant to, and otherwise complying with, the
182PRC Measures on the Administration of Software Products, Management
183Regulations on Technology Import-Export, and Technology Import and Export
184Contract Registration Management Rules. Upon receipt of such approvals from
185the government authorities, you shall forward evidence of all such approvals
186to TI for its records. In the event that you fail to obtain any such
187approval or registration, you shall be solely responsible for any and all
188losses, damages or costs resulting therefrom, and shall indemnify TI for all
189such losses, damages or costs.
190
191b. Governing Language. This Agreement is written and executed in the
192English language. If a translation of this Agreement is required for any
193purpose, including but not limited to registration of the Agreement pursuant
194to any governmental laws, regulations or rules, you shall be solely
195responsible for creating such translation. Any translation of this
196Agreement into a language other than English is intended solely in order to
197comply with such laws or for reference purposes, and the English language
198version shall be authoritative and controlling.
199
2008. Entire Agreement. This is the entire agreement between you and TI and
201supersedes any prior agreement between the parties related to the subject
202matter of this Agreement. No amendment or modification of this Agreement
203will be effective unless in writing and signed by a duly authorized
204representative of TI. You hereby warrant and represent that you have
205obtained all authorizations and other applicable consents required
206empowering you to enter into this Agreement.
diff --git a/hmi_demo.pro b/hmi_demo.pro
new file mode 100644
index 0000000..879b4d1
--- /dev/null
+++ b/hmi_demo.pro
@@ -0,0 +1,30 @@
1QT += quick
2
3CONFIG += c++11
4
5# The following define makes your compiler emit warnings if you use
6# any Qt feature that has been marked deprecated (the exact warnings
7# depend on your compiler). Refer to the documentation for the
8# deprecated API to know how to port your code away from it.
9DEFINES += QT_DEPRECATED_WARNINGS
10
11# You can also make your code fail to compile if it uses deprecated APIs.
12# In order to do so, uncomment the following line.
13# You can also select to disable deprecated APIs only up to a certain version of Qt.
14#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
15
16SOURCES += \
17 main.cpp
18
19RESOURCES += qml.qrc
20
21# Additional import path used to resolve QML modules in Qt Creator's code model
22QML_IMPORT_PATH =
23
24# Additional import path used to resolve QML modules just for Qt Quick Designer
25QML_DESIGNER_IMPORT_PATH =
26
27# Default rules for deployment.
28qnx: target.path = /tmp/$${TARGET}/bin
29else: unix:!android: target.path = /opt/$${TARGET}/bin
30!isEmpty(target.path): INSTALLS += target
diff --git a/images/3D_with_text.png b/images/3D_with_text.png
new file mode 100644
index 0000000..cbe10bb
--- /dev/null
+++ b/images/3D_with_text.png
Binary files differ
diff --git a/images/Analytics_with_text.png b/images/Analytics_with_text.png
new file mode 100644
index 0000000..30f67b9
--- /dev/null
+++ b/images/Analytics_with_text.png
Binary files differ
diff --git a/images/Background.png b/images/Background.png
new file mode 100644
index 0000000..fb0ea53
--- /dev/null
+++ b/images/Background.png
Binary files differ
diff --git a/images/Bottom_Right_Box.png b/images/Bottom_Right_Box.png
new file mode 100644
index 0000000..3272477
--- /dev/null
+++ b/images/Bottom_Right_Box.png
Binary files differ
diff --git a/images/Center_Box.png b/images/Center_Box.png
new file mode 100644
index 0000000..c05bb7f
--- /dev/null
+++ b/images/Center_Box.png
Binary files differ
diff --git a/images/Control_Panel_with_text.png b/images/Control_Panel_with_text.png
new file mode 100644
index 0000000..ce0523e
--- /dev/null
+++ b/images/Control_Panel_with_text.png
Binary files differ
diff --git a/images/Minux_Box.png b/images/Minux_Box.png
new file mode 100644
index 0000000..c114a8f
--- /dev/null
+++ b/images/Minux_Box.png
Binary files differ
diff --git a/images/Motor_Temp.png b/images/Motor_Temp.png
new file mode 100644
index 0000000..e1f6b01
--- /dev/null
+++ b/images/Motor_Temp.png
Binary files differ
diff --git a/images/Off_Button.png b/images/Off_Button.png
new file mode 100644
index 0000000..8c74ee2
--- /dev/null
+++ b/images/Off_Button.png
Binary files differ
diff --git a/images/On_Button.png b/images/On_Button.png
new file mode 100644
index 0000000..4500f3d
--- /dev/null
+++ b/images/On_Button.png
Binary files differ
diff --git a/images/Plus_Box.png b/images/Plus_Box.png
new file mode 100644
index 0000000..49f951f
--- /dev/null
+++ b/images/Plus_Box.png
Binary files differ
diff --git a/images/Rectangle.png b/images/Rectangle.png
new file mode 100644
index 0000000..c6fa740
--- /dev/null
+++ b/images/Rectangle.png
Binary files differ
diff --git a/images/Repeat_Grid.png b/images/Repeat_Grid.png
new file mode 100644
index 0000000..78665b0
--- /dev/null
+++ b/images/Repeat_Grid.png
Binary files differ
diff --git a/images/Status_Message.png b/images/Status_Message.png
new file mode 100644
index 0000000..229be0c
--- /dev/null
+++ b/images/Status_Message.png
Binary files differ
diff --git a/images/Texas_Instrument.png b/images/Texas_Instrument.png
new file mode 100644
index 0000000..6949679
--- /dev/null
+++ b/images/Texas_Instrument.png
Binary files differ
diff --git a/images/Top_Righ_Box.png b/images/Top_Righ_Box.png
new file mode 100644
index 0000000..aa6baf2
--- /dev/null
+++ b/images/Top_Righ_Box.png
Binary files differ
diff --git a/images/servo-drives-icon.png b/images/servo-drives-icon.png
new file mode 100644
index 0000000..f765f1e
--- /dev/null
+++ b/images/servo-drives-icon.png
Binary files differ
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..db8d3b8
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,20 @@
1#include <QGuiApplication>
2#include <QQmlApplicationEngine>
3
4int main(int argc, char *argv[])
5{
6 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
7
8 QGuiApplication app(argc, argv);
9
10 QQmlApplicationEngine engine;
11 const QUrl url(QStringLiteral("qrc:/main.qml"));
12 QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
13 &app, [url](QObject *obj, const QUrl &objUrl) {
14 if (!obj && url == objUrl)
15 QCoreApplication::exit(-1);
16 }, Qt::QueuedConnection);
17 engine.load(url);
18
19 return app.exec();
20}
diff --git a/main.qml b/main.qml
new file mode 100644
index 0000000..5b9757b
--- /dev/null
+++ b/main.qml
@@ -0,0 +1,721 @@
1import QtQuick 2.14
2import QtQuick.Window 2.14
3import QtQuick.Controls.Styles 1.4
4import QtQuick.Extras 1.4
5import QtQuick.Layouts 1.3
6
7Window {
8 id: window
9 visible: true
10 visibility: "FullScreen"
11 title: qsTr("AM62 HMI Demo")
12
13 Rectangle {
14 id: backgroundrect
15 width: window.width
16 height: window.height
17 property int count: 0
18 Image {
19 id: backgroundimage
20 source:"images/Background.png"
21 fillMode: Image.PreserveAspectFit
22 }
23 Image {
24 id: motorimage
25 source: "images/servo-drives-icon.png"
26 fillMode: Image.PreserveAspectFit
27 anchors.left: parent.left
28 anchors.leftMargin: window.width * 0.02
29 anchors.right: parent.right
30 anchors.rightMargin: window.width * 0.87
31 anchors.top: parent.top
32 anchors.topMargin: window.height * 0.01
33 anchors.bottom: parent.bottom
34 anchors.bottomMargin: window.height * 0.80
35
36 }
37 Image {
38 id: tilogoimage
39 source: "images/Texas_Instrument.png"
40 fillMode: Image.PreserveAspectFit
41 anchors.left: parent.left
42 anchors.leftMargin: window.width * 0.70
43 anchors.right: parent.right
44 anchors.rightMargin: window.width * 0.10
45 anchors.top: parent.top
46 anchors.topMargin: window.height * 0.04
47 anchors.bottom: parent.bottom
48 anchors.bottomMargin: window.height * 0.80
49 }
50
51 Image {
52 id: toprb
53 source: "images/Top_Righ_Box.png"
54 anchors.top: parent.top
55 anchors.topMargin: window.height * 0.15
56 anchors.bottom: parent.bottom
57 anchors.bottomMargin: window.height * 0.47
58 anchors.right: parent.right
59 anchors.rightMargin: window.width * 0.09
60 anchors.left: parent.left
61 anchors.leftMargin: window.width * 0.62
62
63 Text {
64 text: qsTr("Motor-1 RPM Control")
65 color: "#FFFFFF"
66 anchors.top: parent.top
67 anchors.topMargin: window.height * 0.02
68 anchors.left: parent.left
69 anchors.leftMargin: window.width * 0.075
70 font.pixelSize: parent.width * 0.05
71 }
72
73 CircularGauge {
74 id: motorspeed1
75 maximumValue: 130
76 anchors.top: parent.top
77 anchors.topMargin: window.height * 0.07
78 anchors.left: parent.left
79 anchors.leftMargin: window.width * 0.03
80 width: window.width * 0.22
81 height: window.height * 0.22
82 property int count1: 0
83 value: count1
84 Behavior on value {
85 NumberAnimation {
86 duration: 200
87 }
88 }
89 Component.onCompleted: forceActiveFocus()
90
91 style: CircularGaugeStyle {
92 needle: Rectangle {
93 implicitWidth: outerRadius * 0.02
94 implicitHeight: outerRadius * 0.60
95 antialiasing: true
96 color: "#D0001C"
97 }
98 foreground: Item {
99 Rectangle {
100 width: outerRadius * 0.1
101 height: width
102 radius: width / 2
103 color: "#FFFFFF"
104 anchors.centerIn: parent
105 }
106 }
107 tickmarkLabel: Text {
108 visible: false
109 }
110
111 tickmark: Rectangle {
112 visible: false
113 }
114
115 minorTickmark: Rectangle {
116 visible: false
117 }
118
119 function degreesToRadians(degrees) {
120 return degrees * (Math.PI / 180);
121 }
122 background: Canvas {
123 onPaint: {
124 var ctx = getContext("2d");
125 ctx.reset();
126
127 ctx.beginPath();
128 ctx.strokeStyle = "#C6C6C6";
129 ctx.lineWidth = outerRadius * 0.04;
130
131 ctx.arc(outerRadius, outerRadius, outerRadius - ctx.lineWidth / 2,
132 degreesToRadians(valueToAngle(0) - 90), degreesToRadians(valueToAngle(130) - 90));
133 ctx.stroke();
134 }
135 }
136 }
137 }
138
139
140 Image {
141 id: rectbox1
142 source: "images/Rectangle.png"
143 anchors.top: parent.top
144 anchors.topMargin: parent.height * 0.75
145 anchors.left: parent.left
146 anchors.leftMargin: parent.width * 0.36
147 width: parent.width * 0.26
148 height: parent.height * 0.12
149 Text {
150 id: motor1text
151 text: qsTr("0")
152 color: "#FFFFFF"
153 font.pixelSize: parent.width * 0.20
154 anchors.centerIn: parent
155 }
156 Image {
157 id: minusbox1
158 source: "images/Minux_Box.png"
159 fillMode: Image.PreserveAspectFit
160 width: parent.height
161 height: parent.height
162 x: 0
163 MouseArea {
164 anchors.fill: parent
165 onClicked: {
166 if (backgroundrect.count == 1) {
167 motorspeed1.count1 -=10
168 if ( motorspeed1.count1 == 10) {
169 motor1bar.width = window.width * 0.01
170 motor1text.text = motorspeed1.count1
171 }
172 else if (motorspeed1.count1 >= 10 && motorspeed1.count1 < 50) {
173 motor1bar.width -= window.width * 0.025
174 motor1text.text = motorspeed1.count1
175 }
176 else if (motorspeed1.count1 >= 50 && motorspeed1.count1 < 70) {
177 motor1bar.width -= window.width * 0.03
178 motor1text.text = motorspeed1.count1
179 }
180 else if (motorspeed1.count1 >= 70 && motorspeed1.count1 < 100) {
181 motor1bar.width -= window.width * 0.025
182 motor1text.text = motorspeed1.count1
183 }
184 else if (motorspeed1.count1 >= 100 && motorspeed1.count1 < 130) {
185 motor1bar.width -= window.width * 0.03
186 motor1text.text = motorspeed1.count1
187 }
188 else if (motorspeed1.count1 >= 130) {
189 motor1bar.width = window.width * 0.34
190 motorspeed1.count1 = 130
191 motor1text.text = motorspeed1.count1
192 }
193 else {
194 motor1bar.width = 0
195 motorspeed1.count1 = 0
196 motor1text.text = motorspeed1.count1
197 }
198 }
199
200 }
201 }
202 }
203 Image {
204 id: plusbox1
205 source: "images/Plus_Box.png"
206 fillMode: Image.PreserveAspectFit
207 width: parent.height
208 height: parent.height
209 x: parent.width * 0.68
210 MouseArea {
211 anchors.fill: parent
212 onClicked: {
213 if (backgroundrect.count == 1) {
214 motorspeed1.count1 +=10
215 if ( motorspeed1.count1 == 10) {
216 motor1bar.width = window.width * 0.01
217 motor1text.text = motorspeed1.count1
218 }
219 else if (motorspeed1.count1 >= 10 && motorspeed1.count1 < 50) {
220 motor1bar.width += window.width * 0.025
221 motor1text.text = motorspeed1.count1
222 }
223 else if (motorspeed1.count1 >= 50 && motorspeed1.count1 < 70) {
224 motor1bar.width += window.width * 0.03
225 motor1text.text = motorspeed1.count1
226 }
227 else if (motorspeed1.count1 >= 70 && motorspeed1.count1 < 100) {
228 motor1bar.width += window.width * 0.025
229 motor1text.text = motorspeed1.count1
230 }
231 else if (motorspeed1.count1 >= 100 && motorspeed1.count1 < 130) {
232 motor1bar.width += window.width * 0.03
233 motor1text.text = motorspeed1.count1
234 }
235 else if (motorspeed1.count1 >= 130) {
236 motor1bar.width = window.width * 0.34
237 motorspeed1.count1 = 130
238 motor1text.text = motorspeed1.count1
239 }
240
241 else {
242 motor1bar.width = 0
243 motorspeed1.count1 = 0
244 motor1text.text = motorspeed1.count1
245 }
246 }
247 else {
248 textupdate.text = "Press the ON button to start Motor-1 control"
249 }
250 }
251 }
252 }
253
254 }
255 }
256 Image {
257 id: bottomrb
258 source: "images/Bottom_Right_Box.png"
259 anchors.top: parent.top
260 anchors.topMargin: window.height * 0.53
261 anchors.bottom: parent.bottom
262 anchors.bottomMargin: window.height * 0.09
263 anchors.right: parent.right
264 anchors.rightMargin: window.width * 0.09
265 anchors.left: parent.left
266 anchors.leftMargin: window.width * 0.62
267
268 Text {
269 text: qsTr("Motor-2 RPM Control")
270 color: "#FFFFFF"
271 anchors.top: parent.top
272 anchors.topMargin: window.height * 0.02
273 anchors.left: parent.left
274 anchors.leftMargin: window.width * 0.075
275 font.pixelSize: parent.width * 0.05
276 }
277 CircularGauge {
278 id: motorspeed2
279 maximumValue: 130
280 anchors.top: parent.top
281 anchors.topMargin: window.height * 0.07
282 anchors.left: parent.left
283 anchors.leftMargin: window.width * 0.03
284 width: window.width * 0.22
285 height: window.height * 0.22
286 property int count2: 0
287 value: count2
288 Behavior on value {
289 NumberAnimation {
290 duration: 200
291 }
292 }
293 style: CircularGaugeStyle {
294 needle: Rectangle {
295 implicitWidth: outerRadius * 0.02
296 implicitHeight: outerRadius * 0.60
297 antialiasing: true
298 color: "#D0001C"
299 }
300 foreground: Item {
301 Rectangle {
302 width: outerRadius * 0.1
303 height: width
304 radius: width / 2
305 color: "#FFFFFF"
306 anchors.centerIn: parent
307 }
308 }
309 tickmarkLabel: Text {
310 visible: false
311 }
312
313 tickmark: Rectangle {
314 visible: false
315 }
316
317 minorTickmark: Rectangle {
318 visible: false
319 }
320
321 function degreesToRadians(degrees) {
322 return degrees * (Math.PI / 180);
323 }
324 background: Canvas {
325 onPaint: {
326 var ctx = getContext("2d");
327 ctx.reset();
328
329 ctx.beginPath();
330 ctx.strokeStyle = "#C6C6C6";
331 ctx.lineWidth = outerRadius * 0.04;
332
333 ctx.arc(outerRadius, outerRadius, outerRadius - ctx.lineWidth / 2,
334 degreesToRadians(valueToAngle(0) - 90), degreesToRadians(valueToAngle(130) - 90));
335 ctx.stroke();
336 }
337 }
338 }
339 }
340 Image {
341 id: rectbox2
342 source: "images/Rectangle.png"
343 anchors.top: parent.top
344 anchors.topMargin: parent.height * 0.75
345 anchors.left: parent.left
346 anchors.leftMargin: parent.width * 0.36
347 width: parent.width * 0.26
348 height: parent.height * 0.12
349 Text {
350 id: motor2text
351 text: qsTr("0")
352 color: "#FFFFFF"
353 font.pixelSize: parent.width * 0.20
354 anchors.centerIn: parent
355 }
356 Image {
357 id: minusbox2
358 source: "images/Minux_Box.png"
359 fillMode: Image.PreserveAspectFit
360 width: parent.height
361 height: parent.height
362 x: 0
363 MouseArea {
364 anchors.fill: parent
365 onClicked: {
366 if (backgroundrect.count == 1) {
367 motorspeed2.count2 -=10
368 if ( motorspeed2.count2 == 10) {
369 motor2bar.width = window.width * 0.01
370 motor2text.text = motorspeed2.count2
371 }
372 else if (motorspeed2.count2 >= 10 && motorspeed2.count2 < 50) {
373 motor2bar.width -= window.width * 0.025
374 motor2text.text = motorspeed2.count2
375 }
376 else if (motorspeed2.count2 >= 50 && motorspeed2.count2 < 70) {
377 motor2bar.width -= window.width * 0.03
378 motor2text.text = motorspeed2.count2
379 }
380 else if (motorspeed2.count2 >= 70 && motorspeed2.count2 < 100) {
381 motor2bar.width -= window.width * 0.025
382 motor2text.text = motorspeed2.count2
383 }
384 else if (motorspeed2.count2 >= 100 && motorspeed2.count2 < 130) {
385 motor2bar.width -= window.width * 0.03
386 motor2text.text = motorspeed2.count2
387 }
388 else if (motorspeed2.count2 >= 130) {
389 motor2bar.width = window.width * 0.34
390 motorspeed2.count2 = 130
391 motor2text.text = motorspeed2.count2
392 }
393 else {
394 motor2bar.width = 0
395 motorspeed2.count2 = 0
396 motor2text.text = motorspeed2.count2
397 }
398 }
399 }
400 }
401 }
402 Image {
403 id: plusbox2
404 source: "images/Plus_Box.png"
405 fillMode: Image.PreserveAspectFit
406 width: parent.height
407 height: parent.height
408 x: parent.width * 0.68
409 MouseArea {
410 anchors.fill: parent
411 onClicked: {
412 if (backgroundrect.count == 1) {
413 motorspeed2.count2 +=10
414 if ( motorspeed2.count2 == 10) {
415 motor2bar.width = window.width * 0.01
416 motor2text.text = motorspeed2.count2
417 }
418 else if (motorspeed2.count2 >= 10 && motorspeed2.count2 < 50) {
419 motor2bar.width += window.width * 0.025
420 motor2text.text = motorspeed2.count2
421 }
422 else if (motorspeed2.count2 >= 50 && motorspeed2.count2 < 70) {
423 motor2bar.width += window.width * 0.03
424 motor2text.text = motorspeed2.count2
425 }
426 else if (motorspeed2.count2 >= 70 && motorspeed2.count2 < 100) {
427 motor2bar.width += window.width * 0.025
428 motor2text.text = motorspeed2.count2
429 }
430 else if (motorspeed2.count2 >= 100 && motorspeed2.count2 < 130) {
431 motor2bar.width += window.width * 0.03
432 motor2text.text = motorspeed2.count2
433 }
434 else if (motorspeed2.count2 >= 130) {
435 motor2bar.width = window.width * 0.34
436 motorspeed2.count2 = 130
437 motor2text.text = motorspeed2.count2
438 }
439 else {
440 motor2bar.width = 0
441 motorspeed2.count2 = 0
442 motor2text.text = motorspeed2.count2
443 }
444 }
445 else {
446 textupdate.text = "Press the ON button to start Motor-2 control"
447 }
448 }
449 }
450 }
451
452 }
453 }
454 Image {
455 id: centreb
456 source: "images/Center_Box.png"
457 anchors.top: parent.top
458 anchors.topMargin: window.height * 0.15
459 anchors.bottom: parent.bottom
460 anchors.bottomMargin: window.height * 0.09
461 anchors.right: parent.right
462 anchors.rightMargin: window.width * 0.38
463 anchors.left: parent.left
464 anchors.leftMargin: window.width * 0.15
465
466 Image {
467 source: "images/Motor_Temp.png"
468 fillMode: Image.PreserveAspectFit
469 anchors.top: parent.top
470 anchors.topMargin: window.height * 0.03
471 anchors.left: parent.left
472 anchors.leftMargin: window.width * 0.06
473 anchors.right: parent.right
474 anchors.rightMargin: window.width * 0.22
475 anchors.bottom: parent.bottom
476 anchors.bottomMargin: window.height * 0.65
477 }
478 Image {
479 id: motor1image
480 Text {
481 id: motor1
482 text: qsTr("Motor 1")
483 y: -1 * parent.height * 1.2
484 color: "#FFFFFF"
485 font.pixelSize: parent.width * 0.04
486 }
487 source: "images/Repeat_Grid.png"
488 fillMode: Image.PreserveAspectFit
489 anchors.top: parent.top
490 anchors.topMargin: window.height * 0.25
491 anchors.left: parent.left
492 anchors.leftMargin: window.width * 0.06
493 anchors.right: parent.right
494 anchors.rightMargin: window.width * 0.07
495 anchors.bottom: parent.bottom
496 anchors.bottomMargin: window.height * 0.45
497 Rectangle {
498
499 id: motor1tempbar
500 width: motor1image.width
501 height: motor1image.width * 0.05
502 color: "#A0A0A0"
503 anchors.top: motor1.bottom
504 anchors.topMargin: window.height * 0.02
505 Rectangle {
506 id: motor1bar
507 color: "#FFFFFF"
508 width: 0
509 height: parent.height
510 }
511 }
512 }
513 Image {
514 id: motor2image
515 Text {
516 id: motor2
517 text: qsTr("Motor 2")
518 y: -1 * parent.height * 1.2
519 color: "#FFFFFF"
520 font.pixelSize: parent.width * 0.04
521 }
522 source: "images/Repeat_Grid.png"
523 fillMode: Image.PreserveAspectFit
524 anchors.top: parent.top
525 anchors.topMargin: window.height * 0.50
526 anchors.left: parent.left
527 anchors.leftMargin: window.width * 0.06
528 anchors.right: parent.right
529 anchors.rightMargin: window.width * 0.07
530 anchors.bottom: parent.bottom
531 anchors.bottomMargin: window.height * 0.20
532 Rectangle {
533 id: motor2tempbar
534 width: motor2image.width
535 height: motor2image.width * 0.05
536 color: "#A0A0A0"
537 anchors.top: motor2.bottom
538 anchors.topMargin: window.height * 0.02
539 Rectangle {
540 id: motor2bar
541 color: "#FFFFFF"
542 width: 0
543 height: parent.height
544 }
545 }
546 }
547 }
548 Image {
549 id: controlimage
550 source: "images/Control_Panel_with_text.png"
551 fillMode: Image.PreserveAspectFit
552 anchors.top: parent.top
553 anchors.topMargin: window.height * 0.20
554 anchors.bottom: parent.bottom
555 anchors.bottomMargin: window.height * 0.77
556 anchors.right: parent.right
557 anchors.rightMargin: window.width * 0.89
558 anchors.left: parent.left
559 anchors.leftMargin: window.width * 0.03
560 Rectangle{
561 id:controlfill
562 color: "transparent"
563 z: -1
564 x: -1 * (parent.width)
565 width: parent.width * 2.56
566 height: parent.height * 1.5
567 MouseArea {
568 anchors.fill: parent
569 hoverEnabled: true
570 onEntered: {
571 controlfill.color = "#C6C6C6"
572 }
573 onExited: {
574 controlfill.color = "transparent"
575 }
576 onClicked: {
577 controlfill.color = "#C6C6C6"
578 textupdate.text = "Control Panel Selected"
579 }
580 onReleased: {
581 controlfill.color = "transparent"
582 }
583 }
584 }
585 }
586 Image {
587 id: renderimage
588 source: "images/3D_with_text.png"
589 fillMode: Image.PreserveAspectFit
590 anchors.top: parent.top
591 anchors.topMargin: window.height * 0.29
592 anchors.bottom: parent.bottom
593 anchors.bottomMargin: window.height * 0.68
594 anchors.right: parent.right
595 anchors.rightMargin: window.width * 0.94
596 anchors.left: parent.left
597 anchors.leftMargin: window.width * 0.03
598 Rectangle{
599 id:renderfill
600 color: "transparent"
601 z: -1
602 x: -1 * (parent.width)
603 width: parent.width * 5.2
604 height: parent.height * 1.5
605 MouseArea {
606 anchors.fill: parent
607 hoverEnabled: true
608 onEntered: {
609 renderfill.color = "#C6C6C6"
610 }
611 onExited: {
612 renderfill.color = "transparent"
613 }
614 onClicked: {
615 renderfill.color = "#C6C6C6"
616 textupdate.text = "3D Demo Selected (Coming Soon)"
617 }
618 onReleased: {
619 renderfill.color = "transparent"
620 }
621 }
622 }
623 }
624 Image {
625 id: analyticsimage
626 source: "images/Analytics_with_text.png"
627 fillMode: Image.PreserveAspectFit
628 anchors.top: parent.top
629 anchors.topMargin: window.height * 0.38
630 anchors.bottom: parent.bottom
631 anchors.bottomMargin: window.height * 0.59
632 anchors.right: parent.right
633 anchors.rightMargin: window.width * 0.91
634 anchors.left: parent.left
635 anchors.leftMargin: window.width * 0.03
636 Rectangle{
637 id:analyticsill
638 color: "transparent"
639 z: -1
640 x: -1 * (parent.width)
641 width: parent.width * 3.1
642 height: parent.height * 1.5
643 MouseArea {
644 anchors.fill: parent
645 hoverEnabled: true
646 onEntered: {
647 analyticsill.color = "#C6C6C6"
648 }
649 onExited: {
650 analyticsill.color = "transparent"
651 }
652 onClicked: {
653 analyticsill.color = "#C6C6C6"
654 textupdate.text = "Analytics Demo Selected (Coming Soon)"
655 }
656 onReleased: {
657 analyticsill.color = "transparent"
658 }
659 }
660 }
661 }
662 Image {
663 id: statusheader
664 source: "images/Status_Message.png"
665 fillMode: Image.PreserveAspectFit
666 anchors.top: parent.top
667 anchors.topMargin: window.height * 0.06
668 anchors.bottom: parent.bottom
669 anchors.bottomMargin: window.height * 0.90
670 anchors.right: parent.right
671 anchors.rightMargin: window.width * 0.70
672 anchors.left: parent.left
673 anchors.leftMargin: window.width * 0.15
674 Text {
675 id: textupdate
676 text: qsTr("Press the ON button.")
677 anchors.top: parent.top
678 anchors.topMargin: parent.height * 1.2
679 anchors.left: parent.left
680 anchors.leftMargin: parent.width * 0.03
681 color: "#14AFC0"
682 font.pixelSize: parent.width * 0.12
683 }
684 }
685 Image {
686 id: powerimage
687 source: "images/On_Button.png"
688 fillMode: Image.PreserveAspectFit
689 anchors.top: parent.top
690 anchors.topMargin: window.height * 0.70
691 anchors.bottom: parent.bottom
692 anchors.bottomMargin: window.height * 0.16
693 anchors.right: parent.right
694 anchors.rightMargin: window.width * 0.90
695 anchors.left: parent.left
696 anchors.leftMargin: window.width * 0.04
697
698 MouseArea {
699 anchors.fill: parent
700 onClicked: {
701 if(backgroundrect.count == 1) {
702 powerimage.source = "images/On_Button.png"
703 backgroundrect.count = 0
704 textupdate.text = "Off Button Pressed"
705 motorspeed1.count1 = 0
706 motor1text.text = motorspeed1.count1
707 motor1bar.width = 0
708 motorspeed2.count2 = 0
709 motor2text.text = motorspeed2.count2
710 motor2bar.width = 0
711 }
712 else {
713 powerimage.source = "images/Off_Button.png"
714 backgroundrect.count = 1
715 textupdate.text = "On Button Pressed"
716 }
717 }
718 }
719 }
720 }
721}
diff --git a/qml.qrc b/qml.qrc
new file mode 100644
index 0000000..ffac04d
--- /dev/null
+++ b/qml.qrc
@@ -0,0 +1,22 @@
1<RCC>
2 <qresource prefix="/">
3 <file>main.qml</file>
4 <file>images/Top_Righ_Box.png</file>
5 <file>images/Texas_Instrument.png</file>
6 <file>images/Status_Message.png</file>
7 <file>images/Control_Panel_with_text.png</file>
8 <file>images/Center_Box.png</file>
9 <file>images/Bottom_Right_Box.png</file>
10 <file>images/Background.png</file>
11 <file>images/Rectangle.png</file>
12 <file>images/Analytics_with_text.png</file>
13 <file>images/Minux_Box.png</file>
14 <file>images/Motor_Temp.png</file>
15 <file>images/3D_with_text.png</file>
16 <file>images/On_Button.png</file>
17 <file>images/Off_Button.png</file>
18 <file>images/Repeat_Grid.png</file>
19 <file>images/servo-drives-icon.png</file>
20 <file>images/Plus_Box.png</file>
21 </qresource>
22</RCC>