grenton-ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/analog-din/fv02_01/analog-in.ts +271 -0
- package/dist/clu/calendar/v1/calendar.ts +308 -0
- package/dist/clu/clu-zwave-2/fv515_03/clu-zwave-2.ts +1302 -0
- package/dist/clu/event-scheduler/v1/event-scheduler.ts +537 -0
- package/dist/clu/multi-fan-ac-thermostat/v1/multi-fan-ac-thermostat.ts +1163 -0
- package/dist/clu/pid-controller/v1/pid-controller.ts +536 -0
- package/dist/clu/presence-sensor/v1/presence-sensor.ts +313 -0
- package/dist/clu/presence-sensor/v2/presence-sensor.ts +470 -0
- package/dist/clu/push/v1/push.ts +261 -0
- package/dist/clu/scheduler/v1/scheduler.ts +304 -0
- package/dist/clu/statistics/v1/statistics.ts +413 -0
- package/dist/clu/statistics-pulse/v1/statistics-pulse.ts +218 -0
- package/dist/clu/sunrise-sunset-calendar/v1/sunrise-sunset-calendar.ts +389 -0
- package/dist/clu/sunrise-sunset-calendar/v2/sunrise-sunset-calendar.ts +659 -0
- package/dist/clu/sunrise-sunset-calendar/v3/sunrise-sunset-calendar.ts +659 -0
- package/dist/clu/thermostat/v1/thermostat.ts +768 -0
- package/dist/clu/thermostat/v2/thermostat.ts +861 -0
- package/dist/clu/timer/v1/timer.ts +369 -0
- package/dist/core/execution-builder.ts +55 -0
- package/dist/core/remote-gate.ts +17 -0
- package/dist/digital-in-din/fv02_01/din.ts +310 -0
- package/dist/examples/light_turned_on_by_calendar/Clu_OnInit.ts +26 -0
- package/dist/examples/light_turned_on_by_presence_sensor/Clu_OnInit.ts +35 -0
- package/dist/examples/light_turned_on_by_switch/Clu_OnInit.ts +16 -0
- package/dist/gate/cool-master/v1/cool-master.ts +782 -0
- package/dist/gate/cool-master-net/v1/cool-master-net.ts +334 -0
- package/dist/gate/denon-marantz-avr/v1/denon-marantz-avr.ts +724 -0
- package/dist/gate/heos/v1/heos.ts +1224 -0
- package/dist/gate/http/fv1000_03/clu-gate-http.ts +405 -0
- package/dist/gate/http/fv1000_03_hv1/clu-gate-http.ts +352 -0
- package/dist/gate/http/fv1100_03/clu-gate-http.ts +589 -0
- package/dist/gate/http/fv1110_03/clu-gate-http.ts +589 -0
- package/dist/gate/http/fv1300_03/clu-gate-http.ts +589 -0
- package/dist/gate/http/fv1400_03/clu-gate-http.ts +677 -0
- package/dist/gate/http-listener/v1/http-listener.ts +299 -0
- package/dist/gate/http-listener/v2/http-listener.ts +325 -0
- package/dist/gate/http-request/v1/http-request.ts +645 -0
- package/dist/gate/http-request/v2/http-request.ts +709 -0
- package/dist/gate/input/v1/input.ts +171 -0
- package/dist/gate/jablotron/v1/jablotron.ts +100 -0
- package/dist/gate/jablotron-device/v1/jablotron-device.ts +171 -0
- package/dist/gate/jablotron-output/v1/jablotron-output.ts +240 -0
- package/dist/gate/jablotron-section/v1/jablotron-section.ts +260 -0
- package/dist/gate/modbus/v1/modbus.ts +609 -0
- package/dist/gate/modbus/v2/modbus.ts +690 -0
- package/dist/gate/modbus-client/v1/modbus-client.ts +827 -0
- package/dist/gate/modbus-rtu/v1/modbus-rtu.ts +911 -0
- package/dist/gate/modbus-server/v1/modbus-server.ts +405 -0
- package/dist/gate/modbus-slave-config-rtu/v1/modbus-slave-config-rtu.ts +160 -0
- package/dist/gate/modbus-slave-rtu/v1/modbus-slave-rtu.ts +371 -0
- package/dist/gate/modbus-value/v1/modbus-value.ts +856 -0
- package/dist/gate/music-cast/v1/music-cast.ts +1298 -0
- package/dist/gate/output/v1/output.ts +240 -0
- package/dist/gate/satel/v1/satel.ts +359 -0
- package/dist/gate/satel-input/v1/satel-input.ts +171 -0
- package/dist/gate/satel-output/v1/satel-output.ts +240 -0
- package/dist/gate/satel-zone/v1/satel-zone.ts +235 -0
- package/dist/gate/sonos/v1/sonos.ts +934 -0
- package/dist/gate/timer/v2/timer.ts +253 -0
- package/dist/gate/zone/v1/zone.ts +235 -0
- package/dist/io-module-din-8/fv02_02/din.ts +354 -0
- package/dist/io-module-din-8/fv02_02/dout.ts +360 -0
- package/dist/one-wire/fv01_10/onew-sensor.ts +269 -0
- package/dist/one-wire/fv01_28/onew-sensor.ts +269 -0
- package/dist/one-wire/fv02_28/onew-sensor.ts +350 -0
- package/dist/one-wire/fv03_28/onew-sensor.ts +435 -0
- package/dist/relay-din-2/fv02_02/dout.ts +544 -0
- package/dist/relay-din-4/fv01_02/dout.ts +340 -0
- package/dist/relay-din-4/fv02_02/dout.ts +368 -0
- package/dist/roller-shutter-din-3/fv03_02/roller-shutter.ts +1078 -0
- package/dist/smart-panel-fm-4/fv03_03/panel-button.ts +550 -0
- package/dist/smart-panel-fm-4/fv03_03/panel-sens-light.ts +238 -0
- package/dist/smart-panel-fm-4/fv03_03/panel-sens-temp.ts +239 -0
- package/dist/smart-panel-fm-4/fv03_03/panel.ts +700 -0
- package/dist/smart-panel-fm-4/fv04_03/panel-button.ts +567 -0
- package/dist/smart-panel-fm-4/fv04_03/panel-page.ts +516 -0
- package/dist/smart-panel-fm-4/fv04_03/panel-sens-light.ts +238 -0
- package/dist/smart-panel-fm-4/fv04_03/panel-sens-temp.ts +239 -0
- package/dist/smart-panel-fm-4/fv04_03/panel.ts +1026 -0
- package/dist/smart-panel-fm-4/fv05_03/panel-button.ts +567 -0
- package/dist/smart-panel-fm-4/fv05_03/panel-page.ts +620 -0
- package/dist/smart-panel-fm-4/fv05_03/panel-sens-light.ts +238 -0
- package/dist/smart-panel-fm-4/fv05_03/panel-sens-temp.ts +266 -0
- package/dist/smart-panel-fm-4/fv05_03/panel.ts +1109 -0
- package/dist/smart-panel-fm-4/fv06_03/panel-button.ts +567 -0
- package/dist/smart-panel-fm-4/fv06_03/panel-page.ts +877 -0
- package/dist/smart-panel-fm-4/fv06_03/panel-sens-light.ts +238 -0
- package/dist/smart-panel-fm-4/fv06_03/panel-sens-temp.ts +297 -0
- package/dist/smart-panel-fm-4/fv06_03/panel.ts +1138 -0
- package/dist/smart-panel-fm-4/fv07_03/panel-button.ts +567 -0
- package/dist/smart-panel-fm-4/fv07_03/panel-page.ts +864 -0
- package/dist/smart-panel-fm-4/fv07_03/panel-sens-light.ts +238 -0
- package/dist/smart-panel-fm-4/fv07_03/panel-sens-temp.ts +297 -0
- package/dist/smart-panel-fm-4/fv07_03/panel.ts +1135 -0
- package/dist/touch-panel-fm-4/fv01_02/panel-button.ts +418 -0
- package/dist/touch-panel-fm-4/fv01_02/panel-sens-light.ts +238 -0
- package/dist/touch-panel-fm-4/fv01_02/panel-sens-temp.ts +257 -0
- package/dist/touch-panel-fm-4/fv01_02/panel.ts +75 -0
- package/dist/touch-panel-fm-4/fv01_02/power-supply-voltage.ts +322 -0
- package/dist/touch-panel-fm-8/fv01_02/panel-button.ts +418 -0
- package/dist/touch-panel-fm-8/fv01_02/panel-sens-light.ts +238 -0
- package/dist/touch-panel-fm-8/fv01_02/panel-sens-temp.ts +270 -0
- package/dist/touch-panel-fm-8/fv01_02/panel.ts +75 -0
- package/dist/touch-panel-fm-8/fv01_02/power-supply-voltage.ts +322 -0
- package/package.json +16 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// Created from: packages/grenton-api/interfaces/module_SMART_PANEL_FM_4_fv06_03.xml, object name="PANELSENSLIGHT" version="06.03"
|
|
2
|
+
|
|
3
|
+
import { rawExecutionBuilderFactory } from "../../core/execution-builder"
|
|
4
|
+
import { RemoteGate } from "../../core/remote-gate"
|
|
5
|
+
|
|
6
|
+
enum EventType {
|
|
7
|
+
OnValueChange = 0,
|
|
8
|
+
OnValueRise = 1,
|
|
9
|
+
OnValueLower = 2,
|
|
10
|
+
OnOutOfRange = 3,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
enum PropertyType {
|
|
14
|
+
Value = 0,
|
|
15
|
+
Threshold = 1,
|
|
16
|
+
Sensitivity = 2,
|
|
17
|
+
MinValue = 3,
|
|
18
|
+
MaxValue = 4,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare class PanelSensLightRaw {
|
|
22
|
+
add_event(event: EventType, callback: () => void): void;
|
|
23
|
+
get(property: PropertyType): any;
|
|
24
|
+
set(property: PropertyType, value: any): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface IPanelSensLight {
|
|
28
|
+
/**
|
|
29
|
+
* Zdarzenie wywoływane w przypadku zmiany wartości cechy Value
|
|
30
|
+
* @param callback
|
|
31
|
+
*/
|
|
32
|
+
addOnValueChange: (callback: () => void) => void
|
|
33
|
+
/**
|
|
34
|
+
* Zdarzenie wywoływane przy zmianie wartości na wyższą (zbocze narastające)
|
|
35
|
+
* @param callback
|
|
36
|
+
*/
|
|
37
|
+
addOnValueRise: (callback: () => void) => void
|
|
38
|
+
/**
|
|
39
|
+
* Zdarzenie wywoływane przy zmianie wartości na niższą (zbocze opadające)
|
|
40
|
+
* @param callback
|
|
41
|
+
*/
|
|
42
|
+
addOnValueLower: (callback: () => void) => void
|
|
43
|
+
/**
|
|
44
|
+
* Zdarzenie wywoływane, gdy wartość na wejściu znajduje się poza wyznaczonym zakresem (MinValue - MaxValue)
|
|
45
|
+
* @param callback
|
|
46
|
+
*/
|
|
47
|
+
addOnOutOfRange: (callback: () => void) => void
|
|
48
|
+
/** Wartość wejścia w zakresie od 0 do 100 % */
|
|
49
|
+
readonly value: number
|
|
50
|
+
/** Wielkość histerezy (dokładność 0.1%) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
51
|
+
threshold: number
|
|
52
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
53
|
+
sensitivity: number
|
|
54
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
55
|
+
minValue: number
|
|
56
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
57
|
+
maxValue: number
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class PanelSensLightRemote implements IPanelSensLight {
|
|
61
|
+
constructor(private objectName: string, private gate: RemoteGate) {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
addOnValueChange(_callback: () => void): void {
|
|
65
|
+
// Remote events are not supported
|
|
66
|
+
}
|
|
67
|
+
addOnValueRise(_callback: () => void): void {
|
|
68
|
+
// Remote events are not supported
|
|
69
|
+
}
|
|
70
|
+
addOnValueLower(_callback: () => void): void {
|
|
71
|
+
// Remote events are not supported
|
|
72
|
+
}
|
|
73
|
+
addOnOutOfRange(_callback: () => void): void {
|
|
74
|
+
// Remote events are not supported
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Wartość wejścia w zakresie od 0 do 100 % */
|
|
78
|
+
get value(): number {
|
|
79
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
80
|
+
.get()
|
|
81
|
+
.addParameter(PropertyType.Value)
|
|
82
|
+
.build();
|
|
83
|
+
return this.gate.runScript(cmd!);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Wielkość histerezy (dokładność 0.1%) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
87
|
+
get threshold(): number {
|
|
88
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
89
|
+
.get()
|
|
90
|
+
.addParameter(PropertyType.Threshold)
|
|
91
|
+
.build();
|
|
92
|
+
return this.gate.runScript(cmd!);
|
|
93
|
+
}
|
|
94
|
+
set threshold(value: number) {
|
|
95
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
96
|
+
.set()
|
|
97
|
+
.addParameter(PropertyType.Threshold)
|
|
98
|
+
.addParameter(value)
|
|
99
|
+
.build();
|
|
100
|
+
this.gate.runScript(cmd!);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
104
|
+
get sensitivity(): number {
|
|
105
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
106
|
+
.get()
|
|
107
|
+
.addParameter(PropertyType.Sensitivity)
|
|
108
|
+
.build();
|
|
109
|
+
return this.gate.runScript(cmd!);
|
|
110
|
+
}
|
|
111
|
+
set sensitivity(value: number) {
|
|
112
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
113
|
+
.set()
|
|
114
|
+
.addParameter(PropertyType.Sensitivity)
|
|
115
|
+
.addParameter(value)
|
|
116
|
+
.build();
|
|
117
|
+
this.gate.runScript(cmd!);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
121
|
+
get minValue(): number {
|
|
122
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
123
|
+
.get()
|
|
124
|
+
.addParameter(PropertyType.MinValue)
|
|
125
|
+
.build();
|
|
126
|
+
return this.gate.runScript(cmd!);
|
|
127
|
+
}
|
|
128
|
+
set minValue(value: number) {
|
|
129
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
130
|
+
.set()
|
|
131
|
+
.addParameter(PropertyType.MinValue)
|
|
132
|
+
.addParameter(value)
|
|
133
|
+
.build();
|
|
134
|
+
this.gate.runScript(cmd!);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
138
|
+
get maxValue(): number {
|
|
139
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
140
|
+
.get()
|
|
141
|
+
.addParameter(PropertyType.MaxValue)
|
|
142
|
+
.build();
|
|
143
|
+
return this.gate.runScript(cmd!);
|
|
144
|
+
}
|
|
145
|
+
set maxValue(value: number) {
|
|
146
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
147
|
+
.set()
|
|
148
|
+
.addParameter(PropertyType.MaxValue)
|
|
149
|
+
.addParameter(value)
|
|
150
|
+
.build();
|
|
151
|
+
this.gate.runScript(cmd!);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
class PanelSensLight implements IPanelSensLight {
|
|
156
|
+
private onValueChangeCallbacks: Array<() => void> = [];
|
|
157
|
+
private onValueRiseCallbacks: Array<() => void> = [];
|
|
158
|
+
private onValueLowerCallbacks: Array<() => void> = [];
|
|
159
|
+
private onOutOfRangeCallbacks: Array<() => void> = [];
|
|
160
|
+
|
|
161
|
+
constructor(private raw: PanelSensLightRaw) {
|
|
162
|
+
this.raw.add_event(EventType.OnValueChange, () => {
|
|
163
|
+
this.onValueChangeCallbacks.forEach(callback => { callback(); });
|
|
164
|
+
});
|
|
165
|
+
this.raw.add_event(EventType.OnValueRise, () => {
|
|
166
|
+
this.onValueRiseCallbacks.forEach(callback => { callback(); });
|
|
167
|
+
});
|
|
168
|
+
this.raw.add_event(EventType.OnValueLower, () => {
|
|
169
|
+
this.onValueLowerCallbacks.forEach(callback => { callback(); });
|
|
170
|
+
});
|
|
171
|
+
this.raw.add_event(EventType.OnOutOfRange, () => {
|
|
172
|
+
this.onOutOfRangeCallbacks.forEach(callback => { callback(); });
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Zdarzenie wywoływane w przypadku zmiany wartości cechy Value
|
|
178
|
+
* @param callback
|
|
179
|
+
*/
|
|
180
|
+
addOnValueChange(callback: () => void): void {
|
|
181
|
+
this.onValueChangeCallbacks.push(callback);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Zdarzenie wywoływane przy zmianie wartości na wyższą (zbocze narastające)
|
|
185
|
+
* @param callback
|
|
186
|
+
*/
|
|
187
|
+
addOnValueRise(callback: () => void): void {
|
|
188
|
+
this.onValueRiseCallbacks.push(callback);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Zdarzenie wywoływane przy zmianie wartości na niższą (zbocze opadające)
|
|
192
|
+
* @param callback
|
|
193
|
+
*/
|
|
194
|
+
addOnValueLower(callback: () => void): void {
|
|
195
|
+
this.onValueLowerCallbacks.push(callback);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Zdarzenie wywoływane, gdy wartość na wejściu znajduje się poza wyznaczonym zakresem (MinValue - MaxValue)
|
|
199
|
+
* @param callback
|
|
200
|
+
*/
|
|
201
|
+
addOnOutOfRange(callback: () => void): void {
|
|
202
|
+
this.onOutOfRangeCallbacks.push(callback);
|
|
203
|
+
}
|
|
204
|
+
/** Wartość wejścia w zakresie od 0 do 100 % */
|
|
205
|
+
get value(): number {
|
|
206
|
+
return this.raw.get(PropertyType.Value);
|
|
207
|
+
}
|
|
208
|
+
/** Wielkość histerezy (dokładność 0.1%) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
209
|
+
get threshold(): number {
|
|
210
|
+
return this.raw.get(PropertyType.Threshold);
|
|
211
|
+
}
|
|
212
|
+
set threshold(value: number) {
|
|
213
|
+
this.raw.set(PropertyType.Threshold, value);
|
|
214
|
+
}
|
|
215
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
216
|
+
get sensitivity(): number {
|
|
217
|
+
return this.raw.get(PropertyType.Sensitivity);
|
|
218
|
+
}
|
|
219
|
+
set sensitivity(value: number) {
|
|
220
|
+
this.raw.set(PropertyType.Sensitivity, value);
|
|
221
|
+
}
|
|
222
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
223
|
+
get minValue(): number {
|
|
224
|
+
return this.raw.get(PropertyType.MinValue);
|
|
225
|
+
}
|
|
226
|
+
set minValue(value: number) {
|
|
227
|
+
this.raw.set(PropertyType.MinValue, value);
|
|
228
|
+
}
|
|
229
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
230
|
+
get maxValue(): number {
|
|
231
|
+
return this.raw.get(PropertyType.MaxValue);
|
|
232
|
+
}
|
|
233
|
+
set maxValue(value: number) {
|
|
234
|
+
this.raw.set(PropertyType.MaxValue, value);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export { PanelSensLight, PanelSensLightRaw, PanelSensLightRemote }
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
// Created from: packages/grenton-api/interfaces/module_SMART_PANEL_FM_4_fv06_03.xml, object name="PANELSENSTEMP" version="06.03"
|
|
2
|
+
|
|
3
|
+
import { rawExecutionBuilderFactory } from "../../core/execution-builder"
|
|
4
|
+
import { RemoteGate } from "../../core/remote-gate"
|
|
5
|
+
|
|
6
|
+
enum EventType {
|
|
7
|
+
OnValueChange = 0,
|
|
8
|
+
OnValueRise = 1,
|
|
9
|
+
OnValueLower = 2,
|
|
10
|
+
OnOutOfRange = 3,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
enum PropertyType {
|
|
14
|
+
Value = 0,
|
|
15
|
+
Threshold = 1,
|
|
16
|
+
Sensitivity = 2,
|
|
17
|
+
MinValue = 3,
|
|
18
|
+
MaxValue = 4,
|
|
19
|
+
Calibration = 6,
|
|
20
|
+
StatisticState = 9,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
enum StatisticState {
|
|
24
|
+
Off = 0,
|
|
25
|
+
On = 1,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class PanelSensTempRaw {
|
|
29
|
+
add_event(event: EventType, callback: () => void): void;
|
|
30
|
+
get(property: PropertyType): any;
|
|
31
|
+
set(property: PropertyType, value: any): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface IPanelSensTemp {
|
|
35
|
+
/**
|
|
36
|
+
* Zdarzenie wywoływane w przypadku zmiany wartości cechy Value
|
|
37
|
+
* @param callback
|
|
38
|
+
*/
|
|
39
|
+
addOnValueChange: (callback: () => void) => void
|
|
40
|
+
/**
|
|
41
|
+
* Zdarzenie wywoływane przy zmianie wartości na wyższą (zbocze narastające)
|
|
42
|
+
* @param callback
|
|
43
|
+
*/
|
|
44
|
+
addOnValueRise: (callback: () => void) => void
|
|
45
|
+
/**
|
|
46
|
+
* Zdarzenie wywoływane przy zmianie wartości na niższą (zbocze opadające)
|
|
47
|
+
* @param callback
|
|
48
|
+
*/
|
|
49
|
+
addOnValueLower: (callback: () => void) => void
|
|
50
|
+
/**
|
|
51
|
+
* Zdarzenie wywoływane, gdy wartość na wejściu znajduje się poza wyznaczonym zakresem (MinValue - MaxValue)
|
|
52
|
+
* @param callback
|
|
53
|
+
*/
|
|
54
|
+
addOnOutOfRange: (callback: () => void) => void
|
|
55
|
+
/** Wartość wejścia czujnika temperatury w zakresie od 0.0 do 45.0 (°C) */
|
|
56
|
+
readonly value: number
|
|
57
|
+
/** Wielkość histerezy (dokładność 0.1°C) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
58
|
+
threshold: number
|
|
59
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
60
|
+
sensitivity: number
|
|
61
|
+
/** Kalibracja temperatury w zakresie od -10°C do +10°C */
|
|
62
|
+
calibration: number
|
|
63
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
64
|
+
minValue: number
|
|
65
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
66
|
+
maxValue: number
|
|
67
|
+
/** Włącza raportowanie pomiaru do modułu statystyk */
|
|
68
|
+
statisticState: StatisticState
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class PanelSensTempRemote implements IPanelSensTemp {
|
|
72
|
+
constructor(private objectName: string, private gate: RemoteGate) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
addOnValueChange(_callback: () => void): void {
|
|
76
|
+
// Remote events are not supported
|
|
77
|
+
}
|
|
78
|
+
addOnValueRise(_callback: () => void): void {
|
|
79
|
+
// Remote events are not supported
|
|
80
|
+
}
|
|
81
|
+
addOnValueLower(_callback: () => void): void {
|
|
82
|
+
// Remote events are not supported
|
|
83
|
+
}
|
|
84
|
+
addOnOutOfRange(_callback: () => void): void {
|
|
85
|
+
// Remote events are not supported
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Wartość wejścia czujnika temperatury w zakresie od 0.0 do 45.0 (°C) */
|
|
89
|
+
get value(): number {
|
|
90
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
91
|
+
.get()
|
|
92
|
+
.addParameter(PropertyType.Value)
|
|
93
|
+
.build();
|
|
94
|
+
return this.gate.runScript(cmd!);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Wielkość histerezy (dokładność 0.1°C) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
98
|
+
get threshold(): number {
|
|
99
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
100
|
+
.get()
|
|
101
|
+
.addParameter(PropertyType.Threshold)
|
|
102
|
+
.build();
|
|
103
|
+
return this.gate.runScript(cmd!);
|
|
104
|
+
}
|
|
105
|
+
set threshold(value: number) {
|
|
106
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
107
|
+
.set()
|
|
108
|
+
.addParameter(PropertyType.Threshold)
|
|
109
|
+
.addParameter(value)
|
|
110
|
+
.build();
|
|
111
|
+
this.gate.runScript(cmd!);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
115
|
+
get sensitivity(): number {
|
|
116
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
117
|
+
.get()
|
|
118
|
+
.addParameter(PropertyType.Sensitivity)
|
|
119
|
+
.build();
|
|
120
|
+
return this.gate.runScript(cmd!);
|
|
121
|
+
}
|
|
122
|
+
set sensitivity(value: number) {
|
|
123
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
124
|
+
.set()
|
|
125
|
+
.addParameter(PropertyType.Sensitivity)
|
|
126
|
+
.addParameter(value)
|
|
127
|
+
.build();
|
|
128
|
+
this.gate.runScript(cmd!);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Kalibracja temperatury w zakresie od -10°C do +10°C */
|
|
132
|
+
get calibration(): number {
|
|
133
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
134
|
+
.get()
|
|
135
|
+
.addParameter(PropertyType.Calibration)
|
|
136
|
+
.build();
|
|
137
|
+
return this.gate.runScript(cmd!);
|
|
138
|
+
}
|
|
139
|
+
set calibration(value: number) {
|
|
140
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
141
|
+
.set()
|
|
142
|
+
.addParameter(PropertyType.Calibration)
|
|
143
|
+
.addParameter(value)
|
|
144
|
+
.build();
|
|
145
|
+
this.gate.runScript(cmd!);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
149
|
+
get minValue(): number {
|
|
150
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
151
|
+
.get()
|
|
152
|
+
.addParameter(PropertyType.MinValue)
|
|
153
|
+
.build();
|
|
154
|
+
return this.gate.runScript(cmd!);
|
|
155
|
+
}
|
|
156
|
+
set minValue(value: number) {
|
|
157
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
158
|
+
.set()
|
|
159
|
+
.addParameter(PropertyType.MinValue)
|
|
160
|
+
.addParameter(value)
|
|
161
|
+
.build();
|
|
162
|
+
this.gate.runScript(cmd!);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
166
|
+
get maxValue(): number {
|
|
167
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
168
|
+
.get()
|
|
169
|
+
.addParameter(PropertyType.MaxValue)
|
|
170
|
+
.build();
|
|
171
|
+
return this.gate.runScript(cmd!);
|
|
172
|
+
}
|
|
173
|
+
set maxValue(value: number) {
|
|
174
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
175
|
+
.set()
|
|
176
|
+
.addParameter(PropertyType.MaxValue)
|
|
177
|
+
.addParameter(value)
|
|
178
|
+
.build();
|
|
179
|
+
this.gate.runScript(cmd!);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Włącza raportowanie pomiaru do modułu statystyk */
|
|
183
|
+
get statisticState(): StatisticState {
|
|
184
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
185
|
+
.get()
|
|
186
|
+
.addParameter(PropertyType.StatisticState)
|
|
187
|
+
.build();
|
|
188
|
+
return this.gate.runScript(cmd!);
|
|
189
|
+
}
|
|
190
|
+
set statisticState(value: StatisticState) {
|
|
191
|
+
const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
|
|
192
|
+
.set()
|
|
193
|
+
.addParameter(PropertyType.StatisticState)
|
|
194
|
+
.addParameter(value)
|
|
195
|
+
.build();
|
|
196
|
+
this.gate.runScript(cmd!);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
class PanelSensTemp implements IPanelSensTemp {
|
|
201
|
+
private onValueChangeCallbacks: Array<() => void> = [];
|
|
202
|
+
private onValueRiseCallbacks: Array<() => void> = [];
|
|
203
|
+
private onValueLowerCallbacks: Array<() => void> = [];
|
|
204
|
+
private onOutOfRangeCallbacks: Array<() => void> = [];
|
|
205
|
+
|
|
206
|
+
constructor(private raw: PanelSensTempRaw) {
|
|
207
|
+
this.raw.add_event(EventType.OnValueChange, () => {
|
|
208
|
+
this.onValueChangeCallbacks.forEach(callback => { callback(); });
|
|
209
|
+
});
|
|
210
|
+
this.raw.add_event(EventType.OnValueRise, () => {
|
|
211
|
+
this.onValueRiseCallbacks.forEach(callback => { callback(); });
|
|
212
|
+
});
|
|
213
|
+
this.raw.add_event(EventType.OnValueLower, () => {
|
|
214
|
+
this.onValueLowerCallbacks.forEach(callback => { callback(); });
|
|
215
|
+
});
|
|
216
|
+
this.raw.add_event(EventType.OnOutOfRange, () => {
|
|
217
|
+
this.onOutOfRangeCallbacks.forEach(callback => { callback(); });
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Zdarzenie wywoływane w przypadku zmiany wartości cechy Value
|
|
223
|
+
* @param callback
|
|
224
|
+
*/
|
|
225
|
+
addOnValueChange(callback: () => void): void {
|
|
226
|
+
this.onValueChangeCallbacks.push(callback);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Zdarzenie wywoływane przy zmianie wartości na wyższą (zbocze narastające)
|
|
230
|
+
* @param callback
|
|
231
|
+
*/
|
|
232
|
+
addOnValueRise(callback: () => void): void {
|
|
233
|
+
this.onValueRiseCallbacks.push(callback);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Zdarzenie wywoływane przy zmianie wartości na niższą (zbocze opadające)
|
|
237
|
+
* @param callback
|
|
238
|
+
*/
|
|
239
|
+
addOnValueLower(callback: () => void): void {
|
|
240
|
+
this.onValueLowerCallbacks.push(callback);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Zdarzenie wywoływane, gdy wartość na wejściu znajduje się poza wyznaczonym zakresem (MinValue - MaxValue)
|
|
244
|
+
* @param callback
|
|
245
|
+
*/
|
|
246
|
+
addOnOutOfRange(callback: () => void): void {
|
|
247
|
+
this.onOutOfRangeCallbacks.push(callback);
|
|
248
|
+
}
|
|
249
|
+
/** Wartość wejścia czujnika temperatury w zakresie od 0.0 do 45.0 (°C) */
|
|
250
|
+
get value(): number {
|
|
251
|
+
return this.raw.get(PropertyType.Value);
|
|
252
|
+
}
|
|
253
|
+
/** Wielkość histerezy (dokładność 0.1°C) określająca czułość, przy której następuje wygenerowanie zdarzeń: OnValueChange, OnValueLower, OnValueRise */
|
|
254
|
+
get threshold(): number {
|
|
255
|
+
return this.raw.get(PropertyType.Threshold);
|
|
256
|
+
}
|
|
257
|
+
set threshold(value: number) {
|
|
258
|
+
this.raw.set(PropertyType.Threshold, value);
|
|
259
|
+
}
|
|
260
|
+
/** Okres (w ms), w którym próbkowane wartości są uśredniane */
|
|
261
|
+
get sensitivity(): number {
|
|
262
|
+
return this.raw.get(PropertyType.Sensitivity);
|
|
263
|
+
}
|
|
264
|
+
set sensitivity(value: number) {
|
|
265
|
+
this.raw.set(PropertyType.Sensitivity, value);
|
|
266
|
+
}
|
|
267
|
+
/** Kalibracja temperatury w zakresie od -10°C do +10°C */
|
|
268
|
+
get calibration(): number {
|
|
269
|
+
return this.raw.get(PropertyType.Calibration);
|
|
270
|
+
}
|
|
271
|
+
set calibration(value: number) {
|
|
272
|
+
this.raw.set(PropertyType.Calibration, value);
|
|
273
|
+
}
|
|
274
|
+
/** Minimalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
275
|
+
get minValue(): number {
|
|
276
|
+
return this.raw.get(PropertyType.MinValue);
|
|
277
|
+
}
|
|
278
|
+
set minValue(value: number) {
|
|
279
|
+
this.raw.set(PropertyType.MinValue, value);
|
|
280
|
+
}
|
|
281
|
+
/** Maksymalna wartość cechy Value, której przekroczenie wywołuje zdarzenie OnOutOfRange */
|
|
282
|
+
get maxValue(): number {
|
|
283
|
+
return this.raw.get(PropertyType.MaxValue);
|
|
284
|
+
}
|
|
285
|
+
set maxValue(value: number) {
|
|
286
|
+
this.raw.set(PropertyType.MaxValue, value);
|
|
287
|
+
}
|
|
288
|
+
/** Włącza raportowanie pomiaru do modułu statystyk */
|
|
289
|
+
get statisticState(): StatisticState {
|
|
290
|
+
return this.raw.get(PropertyType.StatisticState);
|
|
291
|
+
}
|
|
292
|
+
set statisticState(value: StatisticState) {
|
|
293
|
+
this.raw.set(PropertyType.StatisticState, value);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export { PanelSensTemp, PanelSensTempRaw, PanelSensTempRemote, StatisticState }
|