1 /*
2 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
35 import QtQuick 2.9
36 import QtQuick.Window 2.2
38 Window{
39 id:mainWindow
40 visible: true
41 width: 1920
42 height: 1080
43 title: qsTr("mmWave + Sitara Gesture Control Demo")
44 color: "black"
45 property string mysource
46 property bool mypaused : true
47 property bool myvisibility: false
49 Text {
50 text: "Enter 4 digits password 6843 to open the lock. " +
51 "Use up->down gesture to increment the counter of current highlighted digit. " +
52 "Use right->left gesture to move to next right digit index.\n"
53 font.family: "Helvetica"
54 font.pointSize: 20
55 fontSizeMode: Text.Fit
56 width: parent.width*0.7
57 wrapMode: Text.Wrap
58 color: "yellow"
59 x: parent.width*0.15
60 y: parent.height*0.85
61 }
63 Digit { id: digit1; visible: myvisibility; objectName: "myDigit1"; x:parent.width*0.275; y:parent.height * 0.65; size:parent.width*0.09}
64 Digit { id: digit2; visible: myvisibility; objectName: "myDigit2"; anchors.left:digit1.right; anchors.leftMargin:0.033*parent.width; y:digit1.y; size:digit1.size}
65 Digit { id: digit3; visible: myvisibility; objectName: "myDigit3"; anchors.left:digit2.right; anchors.leftMargin:0.033*parent.width; y:digit1.y; size:digit1.size}
66 Digit { id: digit4; visible: myvisibility; objectName: "myDigit4"; anchors.left:digit3.right; anchors.leftMargin:0.033*parent.width; y:digit1.y; size:digit1.size}
68 property int activeid: 0
70 AnimatedImage{
71 id:lock
72 visible: myvisibility
73 source: mainWindow.mysource
74 width:parent.width/2; height: parent.height/2
75 property int idx: 1
76 x:(parent.width-width)/2
77 y: parent.height*0.095// (parent.height-height)/4
78 paused: mainWindow.mypaused
79 onFrameChanged: if(currentFrame==frameCount-1) { mainWindow.mypaused = true; }
80 }
81 }