|
|
|
@ -34,7 +34,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"tag": "scale", |
|
|
|
"stateRenderFunction": "if (!ctx.properties.scale) {\n element.hide();\n} else {\n var scaleSet = element.remember('scaleSet');\n if (!scaleSet) {\n element.remember('scaleSet', true);\n element.clear();\n \n var majorIntervals = ctx.properties.majorIntervals;\n var minorIntervals = ctx.properties.minorIntervals;\n \n var start = 265;\n var majorIntervalLength = 895 / majorIntervals;\n var minorIntervalLength = majorIntervalLength / minorIntervals;\n for (var i = 0; i < majorIntervals + 1; i++) {\n var y = start + i * majorIntervalLength;\n var line = ctx.svg.line(825, y, 857, y).stroke({ width: 3 }).attr({class: 'majorTick'});\n element.add(line);\n var majorText = (100 - i * (100/majorIntervals)).toFixed(0);\n var majorTickText = ctx.svg.text(majorText);\n majorTickText.attr({x: 815, y: y + 2, 'text-anchor': 'end', class: 'majorTickText'});\n majorTickText.first().attr({'dominant-baseline': 'middle'});\n element.add(majorTickText);\n if (i < majorIntervals) {\n drawMinorTicks(y, minorIntervals, minorIntervalLength);\n }\n }\n }\n \n var majorFont = ctx.properties.majorFont;\n var majorColor = ctx.properties.majorColor;\n var minorColor = ctx.properties.minorColor;\n if (ctx.values.critical) {\n majorColor = ctx.properties.majorCriticalColor;\n minorColor = ctx.properties.minorCriticalColor;\n } else if (ctx.values.warning) {\n majorColor = ctx.properties.minorWarningColor;\n minorColor = ctx.properties.minorWarningColor;\n }\n \n var majorTicks = element.find('line.majorTick');\n majorTicks.forEach(t => t.attr({stroke: majorColor}));\n \n var majorTicksText = element.find('text.majorTickText');\n ctx.api.font(majorTicksText, majorFont, majorColor);\n \n var minorTicks = element.find('line.minorTick');\n minorTicks.forEach(t => t.attr({stroke: minorColor}));\n \n var elementCriticalAnimation = element.remember('criticalAnimation');\n var criticalAnimation = ctx.values.critical && ctx.values.criticalAnimation;\n\n if (elementCriticalAnimation !== criticalAnimation) {\n element.remember('criticalAnimation', criticalAnimation);\n if (criticalAnimation) {\n ctx.api.cssAnimate(element, 500).attr({opacity: 0.15}).loop(0, true);\n } else {\n ctx.api.resetCssAnimation(element);\n }\n }\n}\n\nfunction drawMinorTicks(start, minorIntervals, minorIntervalLength) {\n for (var i = 1; i < minorIntervals; i++) {\n var minorY = start + i * minorIntervalLength;\n var minorLine = ctx.svg.line(837, minorY, 857, minorY).stroke({ width: 3 }).attr({class: 'minorTick'});\n element.add(minorLine);\n }\n}", |
|
|
|
"stateRenderFunction": "if (!ctx.properties.scale) {\n element.hide();\n} else {\n var scaleSet = element.remember('scaleSet');\n if (!scaleSet) {\n element.remember('scaleSet', true);\n element.clear();\n \n var majorIntervals = ctx.properties.majorIntervals;\n var minorIntervals = ctx.properties.minorIntervals;\n \n var start = 265;\n var majorIntervalLength = 895 / majorIntervals;\n var minorIntervalLength = majorIntervalLength / minorIntervals;\n var tankCapacity = ctx.properties.scaleDisplayFormat ? 100 : (ctx.values.tankCapacity || 100);\n for (var i = 0; i < majorIntervals + 1; i++) {\n var y = start + i * majorIntervalLength;\n var line = ctx.svg.line(825, y, 857, y).stroke({ width: 3 }).attr({class: 'majorTick'});\n element.add(line);\n var majorText = ctx.api.formatValue((tankCapacity - i * (tankCapacity/majorIntervals)).toFixed(0), 0, ctx.properties.majorUnits, false);\n var majorTickText = ctx.svg.text(majorText);\n majorTickText.attr({x: 815, y: y + 2, 'text-anchor': 'end', class: 'majorTickText'});\n majorTickText.first().attr({'dominant-baseline': 'middle'});\n element.add(majorTickText);\n if (i < majorIntervals) {\n drawMinorTicks(y, minorIntervals, minorIntervalLength);\n }\n }\n }\n \n var majorFont = ctx.properties.majorFont;\n var majorColor = ctx.properties.majorColor;\n var minorColor = ctx.properties.minorColor;\n if (ctx.values.critical) {\n majorColor = ctx.properties.majorCriticalColor;\n minorColor = ctx.properties.minorCriticalColor;\n } else if (ctx.values.warning) {\n majorColor = ctx.properties.minorWarningColor;\n minorColor = ctx.properties.minorWarningColor;\n }\n \n var majorTicks = element.find('line.majorTick');\n majorTicks.forEach(t => t.attr({stroke: majorColor}));\n \n var majorTicksText = element.find('text.majorTickText');\n ctx.api.font(majorTicksText, majorFont, majorColor);\n \n var minorTicks = element.find('line.minorTick');\n minorTicks.forEach(t => t.attr({stroke: minorColor}));\n \n var elementCriticalAnimation = element.remember('criticalAnimation');\n var criticalAnimation = ctx.values.critical && ctx.values.criticalAnimation;\n\n if (elementCriticalAnimation !== criticalAnimation) {\n element.remember('criticalAnimation', criticalAnimation);\n if (criticalAnimation) {\n ctx.api.cssAnimate(element, 500).attr({opacity: 0.15}).loop(0, true);\n } else {\n ctx.api.resetCssAnimation(element);\n }\n }\n}\n\nfunction drawMinorTicks(start, minorIntervals, minorIntervalLength) {\n for (var i = 1; i < minorIntervals; i++) {\n var minorY = start + i * minorIntervalLength;\n var minorLine = ctx.svg.line(837, minorY, 857, minorY).stroke({ width: 3 }).attr({class: 'minorTick'});\n element.add(minorLine);\n }\n}", |
|
|
|
"actions": null |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -274,80 +274,43 @@ |
|
|
|
"name": "{i18n:scada.symbol.tank-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#E5E5E5", |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": null, |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "fluidColor", |
|
|
|
"name": "{i18n:scada.symbol.fluid-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#1EC1F480", |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": null, |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "valueBox", |
|
|
|
"name": "{i18n:scada.symbol.value-box}", |
|
|
|
"type": "switch", |
|
|
|
"default": true, |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": null, |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "valueBoxColor", |
|
|
|
"name": "{i18n:scada.symbol.value-box}", |
|
|
|
"type": "color", |
|
|
|
"default": "#F3F3F3", |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "valueBox", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "valueUnits", |
|
|
|
"name": "{i18n:scada.symbol.value-text}", |
|
|
|
"type": "units", |
|
|
|
"default": "gal", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.units}", |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "valueBox", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "valueTextFont", |
|
|
|
@ -360,80 +323,78 @@ |
|
|
|
"weight": "500", |
|
|
|
"style": "normal" |
|
|
|
}, |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "valueBox", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "valueTextColor", |
|
|
|
"name": "{i18n:scada.symbol.value-text}", |
|
|
|
"type": "color", |
|
|
|
"default": "#0000008A", |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "valueBox", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "transparent", |
|
|
|
"name": "{i18n:scada.symbol.transparent-mode}", |
|
|
|
"type": "switch", |
|
|
|
"default": false, |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": null, |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "scale", |
|
|
|
"name": "{i18n:scada.symbol.scale}", |
|
|
|
"type": "switch", |
|
|
|
"default": false, |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "transparent", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "scaleDisplayFormat", |
|
|
|
"name": "{i18n:scada.symbol.scale}", |
|
|
|
"type": "select", |
|
|
|
"default": true, |
|
|
|
"subLabel": "{i18n:scada.symbol.display-format}", |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"items": [ |
|
|
|
{ |
|
|
|
"value": true, |
|
|
|
"label": "Percentage" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"value": false, |
|
|
|
"label": "Metric" |
|
|
|
} |
|
|
|
], |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorIntervals", |
|
|
|
"name": "{i18n:scada.symbol.major-ticks}", |
|
|
|
"type": "number", |
|
|
|
"default": 10, |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.intervals}", |
|
|
|
"divider": true, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": 1, |
|
|
|
"max": null, |
|
|
|
"step": 1 |
|
|
|
"step": 1, |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorUnits", |
|
|
|
"name": "{i18n:scada.symbol.major-ticks}", |
|
|
|
"type": "units", |
|
|
|
"subLabel": "{i18n:scada.symbol.units}", |
|
|
|
"divider": true, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorFont", |
|
|
|
@ -446,128 +407,84 @@ |
|
|
|
"weight": "500", |
|
|
|
"style": "normal" |
|
|
|
}, |
|
|
|
"required": null, |
|
|
|
"subLabel": null, |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorColor", |
|
|
|
"name": "{i18n:scada.symbol.major-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#00000061", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.normal}", |
|
|
|
"divider": true, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorWarningColor", |
|
|
|
"name": "{i18n:scada.symbol.major-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#FAA405", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.warning}", |
|
|
|
"divider": true, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "majorCriticalColor", |
|
|
|
"name": "{i18n:scada.symbol.major-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#D12730", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.critical}", |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "minorIntervals", |
|
|
|
"name": "{i18n:scada.symbol.minor-ticks}", |
|
|
|
"type": "number", |
|
|
|
"default": 5, |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.intervals}", |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": 1, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "minorColor", |
|
|
|
"name": "{i18n:scada.symbol.minor-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#0000001F", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.normal}", |
|
|
|
"divider": true, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "minorWarningColor", |
|
|
|
"name": "{i18n:scada.symbol.minor-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#FAA405", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.warning}", |
|
|
|
"divider": true, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": "minorCriticalColor", |
|
|
|
"name": "{i18n:scada.symbol.minor-ticks-color}", |
|
|
|
"type": "color", |
|
|
|
"default": "#D12730", |
|
|
|
"required": null, |
|
|
|
"subLabel": "{i18n:scada.symbol.critical}", |
|
|
|
"divider": null, |
|
|
|
"fieldSuffix": null, |
|
|
|
"disableOnProperty": "scale", |
|
|
|
"rowClass": "", |
|
|
|
"fieldClass": "", |
|
|
|
"min": null, |
|
|
|
"max": null, |
|
|
|
"step": null |
|
|
|
"disabled": false, |
|
|
|
"visible": true |
|
|
|
} |
|
|
|
] |
|
|
|
}]]></tb:metadata> |
|
|
|
|