Continuing bar updated on point added, removed and state changed
This commit is contained in:
parent
b1bae4a649
commit
6c5f8af5ed
2 changed files with 19 additions and 1 deletions
|
@ -19,6 +19,7 @@ Rectangle{
|
||||||
property alias triggerstate: trigger.state
|
property alias triggerstate: trigger.state
|
||||||
property variant parentPoint
|
property variant parentPoint
|
||||||
property int parentPointAbsoluteHour: 0
|
property int parentPointAbsoluteHour: 0
|
||||||
|
property alias deviceRow: pointRect.parent
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
//TODO useless really, still gets Cannot anchor to a null item-warning...
|
//TODO useless really, still gets Cannot anchor to a null item-warning...
|
||||||
|
@ -85,7 +86,7 @@ Rectangle{
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
pointRect.deviceRow.updateContinuingBars()
|
||||||
dialog.show(pointRect) //TODO not pointRect, but parentPoint if such exists
|
dialog.show(pointRect) //TODO not pointRect, but parentPoint if such exists
|
||||||
//var rootCoordinates = pointRect.mapToItem(pointRect.parent, mouse.x, mouse.y);
|
//var rootCoordinates = pointRect.mapToItem(pointRect.parent, mouse.x, mouse.y);
|
||||||
//var hourMinute = getTimeFromPosition(rootCoordinates.x)
|
//var hourMinute = getTimeFromPosition(rootCoordinates.x)
|
||||||
|
@ -183,21 +184,25 @@ Rectangle{
|
||||||
name: "on"
|
name: "on"
|
||||||
PropertyChanges { target: pointRect; actionTypeColor: "blue"; actionTypeOpacity: 1 }
|
PropertyChanges { target: pointRect; actionTypeColor: "blue"; actionTypeOpacity: 1 }
|
||||||
PropertyChanges { target: pointRect; actionTypeImage: imageActionOn }
|
PropertyChanges { target: pointRect; actionTypeImage: imageActionOn }
|
||||||
|
StateChangeScript{ name: "updateBars"; script: updateBars(); }
|
||||||
},
|
},
|
||||||
State{
|
State{
|
||||||
name: "off"
|
name: "off"
|
||||||
PropertyChanges { target: pointRect; actionTypeColor: "gainsboro"; actionTypeOpacity: 0 }
|
PropertyChanges { target: pointRect; actionTypeColor: "gainsboro"; actionTypeOpacity: 0 }
|
||||||
PropertyChanges { target: pointRect; actionTypeImage: imageActionOff }
|
PropertyChanges { target: pointRect; actionTypeImage: imageActionOff }
|
||||||
|
StateChangeScript{ name: "updateBars"; script: updateBars(); }
|
||||||
},
|
},
|
||||||
State{
|
State{
|
||||||
name: "dim"
|
name: "dim"
|
||||||
PropertyChanges { target: pointRect; actionTypeColor: "green"; actionTypeOpacity: dimvalue/100 }
|
PropertyChanges { target: pointRect; actionTypeColor: "green"; actionTypeOpacity: dimvalue/100 }
|
||||||
PropertyChanges { target: pointRect; actionTypeImage: imageActionDim }
|
PropertyChanges { target: pointRect; actionTypeImage: imageActionDim }
|
||||||
|
StateChangeScript{ name: "updateBars"; script: updateBars(); }
|
||||||
},
|
},
|
||||||
State{
|
State{
|
||||||
name: "bell"
|
name: "bell"
|
||||||
PropertyChanges { target: pointRect; actionTypeColor: getLastPointColor() }
|
PropertyChanges { target: pointRect; actionTypeColor: getLastPointColor() }
|
||||||
PropertyChanges { target: pointRect; actionTypeImage: imageActionBell }
|
PropertyChanges { target: pointRect; actionTypeImage: imageActionBell }
|
||||||
|
StateChangeScript{ name: "updateBars"; script: updateBars(); }
|
||||||
},
|
},
|
||||||
State{ //TODO test
|
State{ //TODO test
|
||||||
name: "test"; when: pointRect.parentPoint != undefined
|
name: "test"; when: pointRect.parentPoint != undefined
|
||||||
|
@ -220,6 +225,12 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateBars(){
|
||||||
|
if(pointRect.deviceRow != undefined){
|
||||||
|
pointRect.deviceRow.updateContinuingBars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getAbsoluteXValue(){
|
function getAbsoluteXValue(){
|
||||||
if(pointRect.parent == null){
|
if(pointRect.parent == null){
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -372,8 +383,10 @@ Rectangle{
|
||||||
var x = pointRect.x;
|
var x = pointRect.x;
|
||||||
pointRect.isPoint = "false"
|
pointRect.isPoint = "false"
|
||||||
var pointList = pointRect.parent.children;
|
var pointList = pointRect.parent.children;
|
||||||
|
var deviceRow = pointRect.deviceRow;
|
||||||
pointRect.destroy();
|
pointRect.destroy();
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
deviceRow.updateContinuingBars()
|
||||||
}
|
}
|
||||||
|
|
||||||
function minutesToTimelineUnits(minutes){
|
function minutesToTimelineUnits(minutes){
|
||||||
|
|
|
@ -284,6 +284,7 @@ import "schedulerscripts.js" as Scripts
|
||||||
*/
|
*/
|
||||||
//SLUT TEST
|
//SLUT TEST
|
||||||
|
|
||||||
|
deviceRow.updateContinuingBars();
|
||||||
dialog.show(dynamicPoint)
|
dialog.show(dynamicPoint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,6 +313,10 @@ import "schedulerscripts.js" as Scripts
|
||||||
function hasPoints(){
|
function hasPoints(){
|
||||||
return Scripts.hasPoints(deviceRow.children);
|
return Scripts.hasPoints(deviceRow.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateContinuingBars(){
|
||||||
|
Scripts.updateEndsWith();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue