-
Notifications
You must be signed in to change notification settings - Fork 0
/
Label.svghmi
51 lines (48 loc) · 3.78 KB
/
Label.svghmi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:hmi-bind--xlink="http://svg.siemens.com/hmi/bind/xlink/" xmlns:hmi="http://svg.siemens.com/hmi/"
xmlns:hmi-bind="http://svg.siemens.com/hmi/bind/" xmlns:hmi-element="http://svg.siemens.com/hmi/element/"
xmlns:hmi-feature="http://svg.siemens.com/hmi/feature/" xmlns:hmi-event="http://svg.siemens.com/hmi/event/"
preserveAspectRatio="xMidYMid slice">
<hmi:self type="widget" displayName="Label" name="label" version="1.0.0" performanceClass="L">
<hmi:paramDef name="IsActive" type="boolean" default="false" />
<hmi:paramDef name="Active_BackgroundColor" type="HmiColor" default="0xFF129C40" />
<hmi:paramDef name="Active_BorderColor" type="HmiColor" default="0xFF129C40" />
<hmi:paramDef name="Active_BorderSize" type="number" default="0" />
<hmi:paramDef name="Active_Radius" type="number" default="5" />
<hmi:paramDef name="Active_Text" type="string" default="RUNNING" />
<hmi:paramDef name="Active_TextSize" type="number" default="20" />
<hmi:paramDef name="Active_TextColor" type="HmiColor" default="0xFFFFFFFF" />
<hmi:paramDef name="Inactive_BackgroundColor" type="HmiColor" default="0xFFCFCFCF" />
<hmi:paramDef name="Inactive_BorderColor" type="HmiColor" default="0xFFCFCFCF" />
<hmi:paramDef name="Inactive_BorderSize" type="number" default="0" />
<hmi:paramDef name="Inactive_Radius" type="number" default="5" />
<hmi:paramDef name="Inactive_Text" type="string" default="RUNNING" />
<hmi:paramDef name="Inactive_TextSize" type="number" default="20" />
<hmi:paramDef name="Inactive_TextColor" type="HmiColor" default="0xFFFFFFFF" />
</hmi:self>
<defs>
<hmi:localDef name="BackgroundColor" type="HmiColor" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_BackgroundColor : ParamProps.Inactive_BackgroundColor }}" />
<hmi:localDef name="BorderColor" type="HmiColor" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_BorderColor : ParamProps.Inactive_BorderColor }}" />
<hmi:localDef name="BorderSize" type="number" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_BorderSize : ParamProps.Inactive_BorderSize }}" />
<hmi:localDef name="Radius" type="number" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_Radius : ParamProps.Inactive_Radius }}" />
<hmi:localDef name="Text" type="string" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_Text : ParamProps.Inactive_Text }}" />
<hmi:localDef name="TextSize" type="number" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_TextSize : ParamProps.Inactive_TextSize }}" />
<hmi:localDef name="TextColor" type="HmiColor" hmi-bind:value="{{ ParamProps.IsActive ? ParamProps.Active_TextColor : ParamProps.Inactive_TextColor }}" />
</defs>
<g>
<rect width="100%" height="100%"
hmi-bind:fill="{{ Converter.RGBA(LocalProps.BorderColor) }}"
hmi-bind:rx="{ LocalProps.Radius }"/>
<rect hmi-bind:width="{{ (HmiProps.Width - LocalProps.BorderSize * 2) }}"
hmi-bind:height="{{ (HmiProps.Height - LocalProps.BorderSize * 2) }}"
hmi-bind:x="{ LocalProps.BorderSize }"
hmi-bind:y="{ LocalProps.BorderSize }"
hmi-bind:fill="{{ Converter.RGBA(LocalProps.BackgroundColor) }}"
hmi-bind:rx="{ LocalProps.Radius }" />
<text x="50%" y="50%" text-anchor="middle" dominant-baseline="central"
hmi-bind:font-size="{ LocalProps.TextSize }" font-family="Arial, Helvetica, sans-serif" font-weight="bold"
hmi-bind:fill="{{ Converter.RGBA(LocalProps.TextColor) }}" >
<hmi:text hmi-bind:value="{ LocalProps.Text }" />
</text>
</g>
</svg>