Skip to content

Commit

Permalink
initWnd, StandbyWnd UI 기본 구성 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
coreanq committed Aug 24, 2016
1 parent 25b98a8 commit b688487
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 89 deletions.
Binary file modified lib/firmata/qmlfirmataplugin.dll
Binary file not shown.
45 changes: 6 additions & 39 deletions qml/InitWnd.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Rectangle{
Rectangle{
anchors.fill: parent
color: "black"
opacity: 0.6
opacity: 0.8
}
Rectangle {
id: focus
Expand All @@ -53,14 +53,14 @@ Rectangle{
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
easing.type: Easing.InOutQuad
}
}
Behavior on y {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
easing.type: Easing.InOutQuad
}
}

Expand All @@ -72,56 +72,23 @@ Rectangle{
Row {
Image {
id: computer
source:"../image/computer.png"
Behavior on scale {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
}
}

source: "../image/computer.png"
}
Image {
id: add
source:"../image/add.png"
scale: 0.5
Behavior on scale {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
}

}

}
}
Image {
id: wired
source: "../image/wired.png"
Behavior on scale {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
}

}

}
}
Image {
id: click
anchors.horizontalCenter: parent.horizontalCenter
source: "../image/click.png"
Behavior on scale {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutBounce
}
}
}
}
}
}
Label {
Expand Down
23 changes: 1 addition & 22 deletions qml/ProcessingWnd.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,13 @@ import "firmata"

Rectangle{
id: main
PortSelector {
id: port
anchors.top: main.top
height:40
width: main.width
Rectangle {
visible: false
anchors.fill: parent
color: "black"
opacity: 0.5
}

Component.onCompleted: {

}
onDataReceived: {
dataUpdate(rawValue)
}



}
QChartGallery{
id: gallery
anchors.left: main.left
anchors.top: port.bottom
width: main.width
height: main.height - port.height
height: main.height

Rectangle{
visible: false
Expand Down
115 changes: 91 additions & 24 deletions qml/StandbyWnd.qml
Original file line number Diff line number Diff line change
@@ -1,30 +1,97 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQml.StateMachine 1.0 as DSM

Rectangle{
id: flashingblob
width: 75; height: 75
color: "blue"
opacity: 1.0

MouseArea {
anchors.fill: parent
onClicked: {
animateColor.start()
animateOpacity.start()
}
}

PropertyAnimation {id: animateColor; target: flashingblob; properties: "color"; to: "green"; duration: 100}

NumberAnimation {
id: animateOpacity
target: flashingblob
properties: "opacity"
from: 0.99
to: 1.0
loops: Animation.Infinite
easing {type: Easing.OutBack; overshoot: 500}
}
id: standbyWnd
color: "yellow"
opacity: 0.5
clip: true
Item {
id: container
width: parent.width
height: parent.height - label.height

Image {
id: switchOn
visible: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source:"../image/switch.png"
scale: 1.5
Behavior on y {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutQuad
}
}
}
Image {
id: click
x: parent.x
y: parent.height - click.paintedHeight * 1.5
source: "../image/click.png"
scale: 1.5
Behavior on y {
NumberAnimation {
duration: 1000
loops: Animation.Infinite
easing.type: Easing.InOutQuad
}
}
}

}

Label {
id: label
anchors.top: container.bottom
width: parent.width
height: 30
text: "장비의 전원을 켜주세요"
font.pixelSize: 20
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
DSM.StateMachine {
id: stateMachine
initialState: initState
running: true
DSM.State {
id: initState
DSM.TimeoutTransition{
targetState: clickedState
timeout: 2000
}
onEntered: {
switchOn.visible = true
click.x = switchOn.x + 15
click.y = switchOn.y + (switchOn.paintedWidth * 1.5 ) / 2
}
onExited: {
}
}
DSM.State {
id: clickedState
DSM.TimeoutTransition{
targetState: initState
timeout: 2000
}
onEntered: {
click.x = switchOn.x + 15
click.y = container.y + container.height + 200
}
onExited: {
}
}

}


// easing {type: Easing.OutBack; overshoot: 500}
// }
}

17 changes: 13 additions & 4 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ ApplicationWindow{
target: initWnd
onComPortOpened:{
console.log("open")
sgStandby()
while(1)
{
if( pathView.currentIndex == 1)
break;
pathView.incrementCurrentIndex()
}
}

onComPortClosed:{
console.log("close")
sgInit()
while(1)
{
if( pathView.currentIndex == 0)
break;
pathView.incrementCurrentIndex()
}
}

}
Expand Down Expand Up @@ -65,6 +74,7 @@ ApplicationWindow{
id: pathView
anchors.fill: parent
model: itemModel
interactive: false
path: Path {
startX: main.width /2
startY: main.height /2
Expand All @@ -83,7 +93,6 @@ ApplicationWindow{
signal: main.sgStandby
}
onEntered: {
pathView.incrementCurrentIndex()
}
onExited: {
}
Expand Down

0 comments on commit b688487

Please sign in to comment.