@yamcs/opi 1.2.5 → 1.2.7
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 +0 -35
- package/dist/opi.js +1 -1
- package/dist/opi.js.map +1 -1
- package/dist/types/ColorMap.d.ts +1 -1
- package/dist/types/DialogHandler.d.ts +14 -0
- package/dist/types/Display.d.ts +58 -47
- package/dist/types/EventHandler.d.ts +3 -3
- package/dist/types/Font.d.ts +3 -1
- package/dist/types/FontResolver.d.ts +4 -0
- package/dist/types/Graphics.d.ts +11 -11
- package/dist/types/HitCanvas.d.ts +1 -1
- package/dist/types/HitRegionSpecification.d.ts +2 -2
- package/dist/types/PathResolver.d.ts +2 -2
- package/dist/types/Widget.d.ts +19 -13
- package/dist/types/XMLNode.d.ts +17 -17
- package/dist/types/actions/Action.d.ts +10 -0
- package/dist/types/actions/ExecuteCommandAction.d.ts +10 -0
- package/dist/types/actions/ExecuteJavaScriptAction.d.ts +10 -0
- package/dist/types/actions/OpenDisplayAction.d.ts +11 -0
- package/dist/types/actions/OpenFileAction.d.ts +8 -0
- package/dist/types/actions/OpenWebpageAction.d.ts +8 -0
- package/dist/types/actions/PlaySoundAction.d.ts +8 -0
- package/dist/types/actions/WritePVAction.d.ts +11 -0
- package/dist/types/actions.d.ts +1 -55
- package/dist/types/events.d.ts +6 -6
- package/dist/types/index.d.ts +11 -8
- package/dist/types/properties.d.ts +14 -14
- package/dist/types/pv/FormulaPVProvider.d.ts +2 -2
- package/dist/types/pv/LocalPV.d.ts +7 -3
- package/dist/types/pv/PV.d.ts +3 -3
- package/dist/types/pv/PVEngine.d.ts +18 -8
- package/dist/types/pv/PVProvider.d.ts +1 -1
- package/dist/types/pv/Sample.d.ts +1 -1
- package/dist/types/pv/SimulatedPVProvider.d.ts +2 -2
- package/dist/types/pv/formulas/CompiledFormula.d.ts +1 -1
- package/dist/types/pv/formulas/FormulaCompiler.d.ts +1 -1
- package/dist/types/pv/formulas/ast.d.ts +16 -16
- package/dist/types/pv/sim.d.ts +1 -1
- package/dist/types/rules.d.ts +4 -4
- package/dist/types/scripting/ActionWrapper.d.ts +12 -0
- package/dist/types/scripting/ArrayList.d.ts +5 -0
- package/dist/types/scripting/ColorFontUtil.d.ts +2 -2
- package/dist/types/scripting/ConsoleUtil.d.ts +1 -1
- package/dist/types/scripting/DisplayWrapper.d.ts +4 -2
- package/dist/types/scripting/FileUtil.d.ts +1 -1
- package/dist/types/scripting/GUIUtil.d.ts +4 -1
- package/dist/types/scripting/Java.d.ts +81 -15
- package/dist/types/scripting/MessageDialog.d.ts +3 -0
- package/dist/types/scripting/PVUtil.d.ts +6 -3
- package/dist/types/scripting/PVWrapper.d.ts +2 -1
- package/dist/types/scripting/ScriptEngine.d.ts +6 -2
- package/dist/types/scripting/ScriptUtil.d.ts +1 -1
- package/dist/types/scripting/SpreadSheetTable.d.ts +9 -2
- package/dist/types/scripting/SpreadSheetTableWrapper.d.ts +30 -0
- package/dist/types/scripting/TableWrapper.d.ts +6 -5
- package/dist/types/scripting/WidgetWrapper.d.ts +5 -2
- package/dist/types/scripting/XYGraphWrapper.d.ts +2 -2
- package/dist/types/scripting/utils.d.ts +4 -3
- package/dist/types/widgets/controls/ActionButton.d.ts +8 -6
- package/dist/types/widgets/controls/BooleanButton.d.ts +6 -6
- package/dist/types/widgets/controls/BooleanSwitch.d.ts +5 -5
- package/dist/types/widgets/controls/CheckBox.d.ts +6 -6
- package/dist/types/widgets/controls/ChoiceButton.d.ts +6 -6
- package/dist/types/widgets/controls/Combo.d.ts +5 -5
- package/dist/types/widgets/controls/ImageBooleanButton.d.ts +5 -5
- package/dist/types/widgets/controls/MenuButton.d.ts +6 -6
- package/dist/types/widgets/controls/NativeButton.d.ts +1 -1
- package/dist/types/widgets/controls/RadioBox.d.ts +6 -6
- package/dist/types/widgets/controls/Scrollbar.d.ts +5 -5
- package/dist/types/widgets/controls/TextInput.d.ts +5 -5
- package/dist/types/widgets/figures/Ramp.d.ts +3 -3
- package/dist/types/widgets/graphics/Arc.d.ts +4 -4
- package/dist/types/widgets/graphics/Ellipse.d.ts +5 -5
- package/dist/types/widgets/graphics/ImageWidget.d.ts +4 -4
- package/dist/types/widgets/graphics/Label.d.ts +5 -5
- package/dist/types/widgets/graphics/Polygon.d.ts +6 -6
- package/dist/types/widgets/graphics/Polyline.d.ts +5 -5
- package/dist/types/widgets/graphics/Rectangle.d.ts +5 -5
- package/dist/types/widgets/graphics/RoundedRectangle.d.ts +5 -5
- package/dist/types/widgets/monitors/ByteMonitor.d.ts +5 -5
- package/dist/types/widgets/monitors/Gauge.d.ts +6 -6
- package/dist/types/widgets/monitors/ImageBooleanIndicator.d.ts +5 -5
- package/dist/types/widgets/monitors/IntensityGraph.d.ts +7 -7
- package/dist/types/widgets/monitors/LED.d.ts +7 -7
- package/dist/types/widgets/monitors/LinearScale.d.ts +4 -4
- package/dist/types/widgets/monitors/Meter.d.ts +6 -6
- package/dist/types/widgets/monitors/ProgressBar.d.ts +6 -6
- package/dist/types/widgets/monitors/Tank.d.ts +6 -6
- package/dist/types/widgets/monitors/TextUpdate.d.ts +5 -5
- package/dist/types/widgets/monitors/Thermometer.d.ts +6 -6
- package/dist/types/widgets/monitors/xygraph/Axis.d.ts +4 -4
- package/dist/types/widgets/monitors/xygraph/CommandBuffer.d.ts +1 -1
- package/dist/types/widgets/monitors/xygraph/PlotAreaRegion.d.ts +4 -4
- package/dist/types/widgets/monitors/xygraph/Trace.d.ts +4 -4
- package/dist/types/widgets/monitors/xygraph/XYGraph.d.ts +10 -10
- package/dist/types/widgets/monitors/xygraph/XYGraphToolbar.d.ts +6 -6
- package/dist/types/widgets/others/AbstractContainerWidget.d.ts +4 -4
- package/dist/types/widgets/others/Connection.d.ts +6 -6
- package/dist/types/widgets/others/DisplayWidget.d.ts +6 -6
- package/dist/types/widgets/others/GroupingContainer.d.ts +3 -3
- package/dist/types/widgets/others/LinkingContainer.d.ts +4 -4
- package/dist/types/widgets/others/TabbedContainer.d.ts +5 -5
- package/dist/types/widgets/others/Table.d.ts +6 -6
- package/dist/types/widgets/others/WebBrowser.d.ts +4 -4
- package/package.json +6 -11
- package/dist/fonts/stylesheet.css +0 -83
- package/dist/opi.umd.js +0 -2
- package/dist/opi.umd.js.map +0 -1
- package/dist/types/pv/formulas/parser.d.ts +0 -10
package/dist/types/ColorMap.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DialogHandler {
|
|
2
|
+
openConfirmDialog(title: string, message: string): boolean;
|
|
3
|
+
openInformationDialog(title: string, message: string): void;
|
|
4
|
+
openWarningDialog(title: string, message: string): void;
|
|
5
|
+
openErrorDialog(title: string, message: string): void;
|
|
6
|
+
openPasswordDialog(title: string, message: string, password: string): boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class DefaultDialogHandler implements DialogHandler {
|
|
9
|
+
openConfirmDialog(title: string, message: string): boolean;
|
|
10
|
+
openInformationDialog(title: string, message: string): void;
|
|
11
|
+
openWarningDialog(title: string, message: string): void;
|
|
12
|
+
openErrorDialog(title: string, message: string): void;
|
|
13
|
+
openPasswordDialog(title: string, message: string, password: string): boolean;
|
|
14
|
+
}
|
package/dist/types/Display.d.ts
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
import { ConsoleHandler } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
1
|
+
import { ConsoleHandler } from "./ConsoleHandler";
|
|
2
|
+
import { DialogHandler } from "./DialogHandler";
|
|
3
|
+
import { OPIEvent, OPIEventMap } from "./events";
|
|
4
|
+
import { FontResolver } from "./FontResolver";
|
|
5
|
+
import { PathResolver } from "./PathResolver";
|
|
6
|
+
import { Bounds } from "./positioning";
|
|
7
|
+
import { PVEngine } from "./pv/PVEngine";
|
|
8
|
+
import { PVProvider } from "./pv/PVProvider";
|
|
9
|
+
import { Sample } from "./pv/Sample";
|
|
10
|
+
import { Widget } from "./Widget";
|
|
11
|
+
import { ActionButton } from "./widgets/controls/ActionButton";
|
|
12
|
+
import { BooleanButton } from "./widgets/controls/BooleanButton";
|
|
13
|
+
import { BooleanSwitch } from "./widgets/controls/BooleanSwitch";
|
|
14
|
+
import { CheckBox } from "./widgets/controls/CheckBox";
|
|
15
|
+
import { ChoiceButton } from "./widgets/controls/ChoiceButton";
|
|
16
|
+
import { Combo } from "./widgets/controls/Combo";
|
|
17
|
+
import { ImageBooleanButton } from "./widgets/controls/ImageBooleanButton";
|
|
18
|
+
import { MenuButton } from "./widgets/controls/MenuButton";
|
|
19
|
+
import { RadioBox } from "./widgets/controls/RadioBox";
|
|
20
|
+
import { Scrollbar } from "./widgets/controls/Scrollbar";
|
|
21
|
+
import { TextInput } from "./widgets/controls/TextInput";
|
|
22
|
+
import { Arc } from "./widgets/graphics/Arc";
|
|
23
|
+
import { Ellipse } from "./widgets/graphics/Ellipse";
|
|
24
|
+
import { ImageWidget } from "./widgets/graphics/ImageWidget";
|
|
25
|
+
import { Label } from "./widgets/graphics/Label";
|
|
26
|
+
import { Polygon } from "./widgets/graphics/Polygon";
|
|
27
|
+
import { Polyline } from "./widgets/graphics/Polyline";
|
|
28
|
+
import { Rectangle } from "./widgets/graphics/Rectangle";
|
|
29
|
+
import { RoundedRectangle } from "./widgets/graphics/RoundedRectangle";
|
|
30
|
+
import { ByteMonitor } from "./widgets/monitors/ByteMonitor";
|
|
31
|
+
import { Gauge } from "./widgets/monitors/Gauge";
|
|
32
|
+
import { ImageBooleanIndicator } from "./widgets/monitors/ImageBooleanIndicator";
|
|
33
|
+
import { IntensityGraph } from "./widgets/monitors/IntensityGraph";
|
|
34
|
+
import { LED } from "./widgets/monitors/LED";
|
|
35
|
+
import { Meter } from "./widgets/monitors/Meter";
|
|
36
|
+
import { ProgressBar } from "./widgets/monitors/ProgressBar";
|
|
37
|
+
import { Tank } from "./widgets/monitors/Tank";
|
|
38
|
+
import { TextUpdate } from "./widgets/monitors/TextUpdate";
|
|
39
|
+
import { Thermometer } from "./widgets/monitors/Thermometer";
|
|
40
|
+
import { XYGraph } from "./widgets/monitors/xygraph/XYGraph";
|
|
41
|
+
import { AbstractContainerWidget } from "./widgets/others/AbstractContainerWidget";
|
|
42
|
+
import { DisplayWidget } from "./widgets/others/DisplayWidget";
|
|
43
|
+
import { GroupingContainer } from "./widgets/others/GroupingContainer";
|
|
44
|
+
import { LinkingContainer } from "./widgets/others/LinkingContainer";
|
|
45
|
+
import { TabbedContainer } from "./widgets/others/TabbedContainer";
|
|
46
|
+
import { Table } from "./widgets/others/Table";
|
|
47
|
+
import { WebBrowser } from "./widgets/others/WebBrowser";
|
|
46
48
|
export declare class Display {
|
|
47
49
|
private readonly targetElement;
|
|
48
50
|
rootPanel: HTMLDivElement;
|
|
@@ -50,7 +52,9 @@ export declare class Display {
|
|
|
50
52
|
private ctx;
|
|
51
53
|
pvEngine: PVEngine;
|
|
52
54
|
private pathResolver;
|
|
55
|
+
private fontResolver?;
|
|
53
56
|
private consoleHandler;
|
|
57
|
+
private dialogHandler;
|
|
54
58
|
private repaintRequested;
|
|
55
59
|
private _editMode;
|
|
56
60
|
private _showGrid;
|
|
@@ -59,6 +63,7 @@ export declare class Display {
|
|
|
59
63
|
private _selection;
|
|
60
64
|
private _scale;
|
|
61
65
|
private _transparent;
|
|
66
|
+
private refreshCycle;
|
|
62
67
|
/**
|
|
63
68
|
* Prefix for images sourced during draw.
|
|
64
69
|
* (does not include workspace images)
|
|
@@ -79,6 +84,10 @@ export declare class Display {
|
|
|
79
84
|
getPathResolver(): PathResolver;
|
|
80
85
|
setConsoleHandler(consoleHandler: ConsoleHandler): void;
|
|
81
86
|
getConsoleHandler(): ConsoleHandler;
|
|
87
|
+
setDialogHandler(dialogHandler: DialogHandler): void;
|
|
88
|
+
getDialogHandler(): DialogHandler;
|
|
89
|
+
setFontResolver(fontResolver: FontResolver): void;
|
|
90
|
+
getFontResolver(): FontResolver | undefined;
|
|
82
91
|
private step;
|
|
83
92
|
private drawScreen;
|
|
84
93
|
/**
|
|
@@ -92,14 +101,16 @@ export declare class Display {
|
|
|
92
101
|
resolvePath(path: string, widget?: Widget): string;
|
|
93
102
|
setSource(href: string): Promise<void>;
|
|
94
103
|
private setSourceString;
|
|
104
|
+
getRefreshCycle(): number;
|
|
105
|
+
setRefreshCycle(refreshCycle: number): void;
|
|
95
106
|
private reset;
|
|
96
107
|
/**
|
|
97
108
|
* Bounds of this widget relative to the root
|
|
98
109
|
* of all of its parents.
|
|
99
110
|
*/
|
|
100
111
|
measureAbsoluteArea(widget: Widget): Bounds;
|
|
101
|
-
addEventListener<K extends keyof OPIEventMap>(type: K, listener: (
|
|
102
|
-
removeEventListener<K extends keyof OPIEventMap>(type: K, listener: (
|
|
112
|
+
addEventListener<K extends keyof OPIEventMap>(type: K, listener: (ev: OPIEventMap[K]) => void): void;
|
|
113
|
+
removeEventListener<K extends keyof OPIEventMap>(type: K, listener: (ev: OPIEventMap[K]) => void): void;
|
|
103
114
|
fireEvent(type: string, event: OPIEvent): void;
|
|
104
115
|
get showGrid(): boolean;
|
|
105
116
|
set showGrid(showGrid: boolean);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Display } from
|
|
2
|
-
import { HitCanvas } from
|
|
3
|
-
import { Point } from
|
|
1
|
+
import { Display } from "./Display";
|
|
2
|
+
import { HitCanvas } from "./HitCanvas";
|
|
3
|
+
import { Point } from "./positioning";
|
|
4
4
|
export interface OpiMouseEvent {
|
|
5
5
|
clientX: number;
|
|
6
6
|
clientY: number;
|
package/dist/types/Font.d.ts
CHANGED
|
@@ -9,5 +9,7 @@ export declare class Font {
|
|
|
9
9
|
constructor(name: string, height: number, style: number, pixels: boolean);
|
|
10
10
|
scale(scale: number): Font;
|
|
11
11
|
getFontString(): string;
|
|
12
|
-
|
|
12
|
+
get bold(): boolean;
|
|
13
|
+
get italic(): boolean;
|
|
14
|
+
isWebSafe(): boolean;
|
|
13
15
|
}
|
package/dist/types/Graphics.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Color } from
|
|
2
|
-
import { Font } from
|
|
3
|
-
import { HitCanvas } from
|
|
4
|
-
import { HitRegionSpecification } from
|
|
5
|
-
import { Bounds, Point } from
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { Font } from "./Font";
|
|
3
|
+
import { HitCanvas } from "./HitCanvas";
|
|
4
|
+
import { HitRegionSpecification } from "./HitRegionSpecification";
|
|
5
|
+
import { Bounds, Point } from "./positioning";
|
|
6
6
|
interface RectColorFill {
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
@@ -23,12 +23,12 @@ interface RectGradientFill {
|
|
|
23
23
|
ry?: number;
|
|
24
24
|
opacity?: number;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
type RectFill = RectColorFill | RectGradientFill;
|
|
27
27
|
interface TextFill {
|
|
28
28
|
x: number;
|
|
29
29
|
y: number;
|
|
30
|
-
baseline:
|
|
31
|
-
align:
|
|
30
|
+
baseline: "top" | "middle" | "bottom";
|
|
31
|
+
align: "left" | "right" | "center";
|
|
32
32
|
font: Font;
|
|
33
33
|
color: Color;
|
|
34
34
|
text: string;
|
|
@@ -55,7 +55,7 @@ interface EllipseGradientFill {
|
|
|
55
55
|
anticlockwise?: boolean;
|
|
56
56
|
opacity?: number;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
type EllipseFill = EllipseColorFill | EllipseGradientFill;
|
|
59
59
|
interface EllipseColorStroke {
|
|
60
60
|
cx: number;
|
|
61
61
|
cy: number;
|
|
@@ -80,7 +80,7 @@ interface EllipseGradientStroke {
|
|
|
80
80
|
anticlockwise?: boolean;
|
|
81
81
|
dash?: number[];
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
type EllipseStroke = EllipseColorStroke | EllipseGradientStroke;
|
|
84
84
|
interface RectStroke {
|
|
85
85
|
x: number;
|
|
86
86
|
y: number;
|
|
@@ -110,7 +110,7 @@ interface PathGradientFill {
|
|
|
110
110
|
gradient: CanvasGradient;
|
|
111
111
|
opacity?: number;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
type PathFill = PathColorFill | PathGradientFill;
|
|
114
114
|
export declare class Graphics {
|
|
115
115
|
readonly canvas: HTMLCanvasElement;
|
|
116
116
|
readonly ctx: CanvasRenderingContext2D;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpiGrabEvent, OpiMouseEvent } from
|
|
2
|
-
export
|
|
1
|
+
import { OpiGrabEvent, OpiMouseEvent } from "./EventHandler";
|
|
2
|
+
export type TooltipProvider = () => string | undefined;
|
|
3
3
|
export interface HitRegionSpecification {
|
|
4
4
|
id: string;
|
|
5
5
|
click?: (mouseEvent: OpiMouseEvent) => void;
|
package/dist/types/Widget.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { ActionSet } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { ActionSet } from "./actions";
|
|
2
|
+
import { Action } from "./actions/Action";
|
|
3
|
+
import { Color } from "./Color";
|
|
4
|
+
import { Display } from "./Display";
|
|
5
|
+
import { Graphics } from "./Graphics";
|
|
6
|
+
import { Bounds } from "./positioning";
|
|
7
|
+
import { PropertyListener, PropertySet } from "./properties";
|
|
8
|
+
import { PV } from "./pv/PV";
|
|
9
|
+
import { RuleSet } from "./rules";
|
|
10
|
+
import { ScaleOptions } from "./scale";
|
|
11
|
+
import { ScriptSet } from "./scripts";
|
|
12
|
+
import { AbstractContainerWidget } from "./widgets/others/AbstractContainerWidget";
|
|
13
|
+
import { XMLNode } from "./XMLNode";
|
|
13
14
|
export declare abstract class Widget {
|
|
14
15
|
readonly display: Display;
|
|
15
16
|
readonly parent?: AbstractContainerWidget | undefined;
|
|
@@ -22,11 +23,14 @@ export declare abstract class Widget {
|
|
|
22
23
|
private holderRegion?;
|
|
23
24
|
properties: PropertySet;
|
|
24
25
|
readonly vars: Map<string, any>;
|
|
26
|
+
private pvs;
|
|
25
27
|
constructor(display: Display, parent?: AbstractContainerWidget | undefined);
|
|
26
28
|
parseNode(node: XMLNode): void;
|
|
29
|
+
getHookedActions(): Action[];
|
|
27
30
|
drawHolder(g: Graphics): void;
|
|
28
31
|
beforeDrawBorder(g: Graphics): void;
|
|
29
32
|
private drawBorderStyle;
|
|
33
|
+
private isDisconnected;
|
|
30
34
|
drawDecoration(g: Graphics): void;
|
|
31
35
|
drawOverlay(g: Graphics): void;
|
|
32
36
|
drawSelection(ctx: CanvasRenderingContext2D): void;
|
|
@@ -45,8 +49,10 @@ export declare abstract class Widget {
|
|
|
45
49
|
get area(): Bounds;
|
|
46
50
|
private drawShadowBorder;
|
|
47
51
|
private drawDashedBorder;
|
|
48
|
-
|
|
52
|
+
executeActionByIndex(index: number): void;
|
|
53
|
+
executeAction(action: Action): void;
|
|
49
54
|
expandMacro(text: string): string;
|
|
55
|
+
private loadFont;
|
|
50
56
|
get pv(): PV | undefined;
|
|
51
57
|
isMinorSeverity(): boolean;
|
|
52
58
|
isMajorSeverity(): boolean;
|
package/dist/types/XMLNode.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { ActionSet } from
|
|
2
|
-
import { Color } from
|
|
3
|
-
import { ColorMap } from
|
|
4
|
-
import { Font } from
|
|
5
|
-
import { MacroSet } from
|
|
6
|
-
import { RuleSet } from
|
|
7
|
-
import { AutoScaleWidgets, ScaleOptions } from
|
|
8
|
-
import { ScriptSet } from
|
|
1
|
+
import { ActionSet } from "./actions";
|
|
2
|
+
import { Color } from "./Color";
|
|
3
|
+
import { ColorMap } from "./ColorMap";
|
|
4
|
+
import { Font } from "./Font";
|
|
5
|
+
import { MacroSet } from "./macros";
|
|
6
|
+
import { RuleSet } from "./rules";
|
|
7
|
+
import { AutoScaleWidgets, ScaleOptions } from "./scale";
|
|
8
|
+
import { ScriptSet } from "./scripts";
|
|
9
9
|
export declare class XMLNode {
|
|
10
10
|
private node;
|
|
11
11
|
constructor(node: Node);
|
|
12
12
|
get name(): string;
|
|
13
13
|
static parseFromXML(xml: string): XMLNode;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
* Searches for a direct child with the specified name.
|
|
16
|
+
*
|
|
17
|
+
* @throws when no such child was found
|
|
18
|
+
*/
|
|
19
19
|
getNode(name: string): XMLNode;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
* Searches for all direct children with the specified name.
|
|
22
|
+
* If this name is undefined, all children are returned.
|
|
23
|
+
*/
|
|
24
24
|
getNodes(name?: string): XMLNode[];
|
|
25
25
|
hasNode(name: string): boolean;
|
|
26
26
|
hasAttribute(name: string): boolean;
|
|
@@ -62,8 +62,8 @@ export declare class XMLNode {
|
|
|
62
62
|
*/
|
|
63
63
|
getColor(name: string, defaultValue?: Color): Color;
|
|
64
64
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
* Parses the child node contents as a font.
|
|
66
|
+
*/
|
|
67
67
|
getFont(name: string): Font;
|
|
68
68
|
getPoints(name: string): {
|
|
69
69
|
x: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropertySet } from "../properties";
|
|
2
|
+
import { Widget } from "../Widget";
|
|
3
|
+
import { XMLNode } from "../XMLNode";
|
|
4
|
+
export declare abstract class Action {
|
|
5
|
+
properties: PropertySet;
|
|
6
|
+
constructor();
|
|
7
|
+
parseNode(node: XMLNode): void;
|
|
8
|
+
abstract execute(widget: Widget): void;
|
|
9
|
+
get description(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Widget } from "../Widget";
|
|
2
|
+
import { Action } from "./Action";
|
|
3
|
+
export declare class ExecuteCommandAction extends Action {
|
|
4
|
+
constructor();
|
|
5
|
+
execute(widget: Widget): void;
|
|
6
|
+
get command(): string;
|
|
7
|
+
get commandDirectory(): string;
|
|
8
|
+
get waitTime(): number;
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Widget } from "../Widget";
|
|
2
|
+
import { Action } from "./Action";
|
|
3
|
+
export declare class ExecuteJavaScriptAction extends Action {
|
|
4
|
+
constructor();
|
|
5
|
+
execute(widget: Widget): void;
|
|
6
|
+
get path(): string;
|
|
7
|
+
get embedded(): boolean;
|
|
8
|
+
get scriptText(): string;
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MacroSet } from "../macros";
|
|
2
|
+
import { Widget } from "../Widget";
|
|
3
|
+
import { Action } from "./Action";
|
|
4
|
+
export declare class OpenDisplayAction extends Action {
|
|
5
|
+
constructor();
|
|
6
|
+
execute(widget: Widget): void;
|
|
7
|
+
get macros(): MacroSet;
|
|
8
|
+
get path(): string;
|
|
9
|
+
get mode(): number;
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Widget } from "../Widget";
|
|
2
|
+
import { Action } from "./Action";
|
|
3
|
+
export declare class WritePVAction extends Action {
|
|
4
|
+
constructor();
|
|
5
|
+
execute(widget: Widget): void;
|
|
6
|
+
get pvName(): string;
|
|
7
|
+
get value(): string;
|
|
8
|
+
get timeout(): number;
|
|
9
|
+
get confirmMessage(): string;
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Action } from "./actions/Action";
|
|
1
2
|
export declare class ActionSet {
|
|
2
3
|
actions: (Action | null)[];
|
|
3
4
|
hookFirstActionToClick: boolean;
|
|
@@ -5,60 +6,5 @@ export declare class ActionSet {
|
|
|
5
6
|
add(action: Action | null): void;
|
|
6
7
|
isClickable(): boolean | 0;
|
|
7
8
|
getAction(index: number): Action | null | undefined;
|
|
8
|
-
getClickActions(): number[];
|
|
9
9
|
toString(): string;
|
|
10
10
|
}
|
|
11
|
-
declare type Action = ExecuteCommandAction | ExecuteJavaScriptAction | OpenDisplayAction | OpenFileAction | OpenWebpageAction | WritePVAction | PlaySoundAction;
|
|
12
|
-
export declare class OpenDisplayAction {
|
|
13
|
-
path: string;
|
|
14
|
-
readonly type = "OPEN_DISPLAY";
|
|
15
|
-
mode?: number;
|
|
16
|
-
description?: string;
|
|
17
|
-
constructor(path: string);
|
|
18
|
-
toString(): string;
|
|
19
|
-
}
|
|
20
|
-
export declare class OpenFileAction {
|
|
21
|
-
readonly type = "OPEN_FILE";
|
|
22
|
-
path?: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
toString(): string;
|
|
25
|
-
}
|
|
26
|
-
export declare class ExecuteJavaScriptAction {
|
|
27
|
-
embedded: boolean;
|
|
28
|
-
readonly type = "EXECUTE_JAVASCRIPT";
|
|
29
|
-
text?: string;
|
|
30
|
-
path?: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
constructor(embedded: boolean);
|
|
33
|
-
toString(): string;
|
|
34
|
-
}
|
|
35
|
-
export declare class ExecuteCommandAction {
|
|
36
|
-
readonly type = "EXECUTE_CMD";
|
|
37
|
-
command?: string;
|
|
38
|
-
commandDirectory?: string;
|
|
39
|
-
waitTime?: number;
|
|
40
|
-
description?: string;
|
|
41
|
-
toString(): string;
|
|
42
|
-
}
|
|
43
|
-
export declare class WritePVAction {
|
|
44
|
-
pvName: string;
|
|
45
|
-
value: string;
|
|
46
|
-
readonly type = "WRITE_PV";
|
|
47
|
-
confirmMessage?: string;
|
|
48
|
-
description?: string;
|
|
49
|
-
constructor(pvName: string, value: string);
|
|
50
|
-
toString(): string;
|
|
51
|
-
}
|
|
52
|
-
export declare class PlaySoundAction {
|
|
53
|
-
readonly type = "PLAY_SOUND";
|
|
54
|
-
path?: string;
|
|
55
|
-
description?: string;
|
|
56
|
-
toString(): string;
|
|
57
|
-
}
|
|
58
|
-
export declare class OpenWebpageAction {
|
|
59
|
-
readonly type = "OPEN_WEBPAGE";
|
|
60
|
-
hyperlink?: string;
|
|
61
|
-
description?: string;
|
|
62
|
-
toString(): string;
|
|
63
|
-
}
|
|
64
|
-
export {};
|
package/dist/types/events.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export interface OPIEvent {
|
|
|
3
3
|
}
|
|
4
4
|
export interface OPIEventMap {
|
|
5
5
|
[index: string]: OPIEvent;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
closedisplay: CloseDisplayEvent;
|
|
7
|
+
opendisplay: OpenDisplayEvent;
|
|
8
|
+
openpv: OpenPVEvent;
|
|
9
|
+
selection: SelectionEvent;
|
|
10
|
+
scale: ScaleEvent;
|
|
11
11
|
}
|
|
12
12
|
export interface SelectionEvent extends OPIEvent {
|
|
13
13
|
selected: string[];
|
|
@@ -36,6 +36,6 @@ export interface CloseDisplayEvent extends OPIEvent {
|
|
|
36
36
|
export interface ScaleEvent extends OPIEvent {
|
|
37
37
|
scale: number;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export type OPIEventHandlers = {
|
|
40
40
|
[index: string]: Array<(ev: OPIEvent) => void>;
|
|
41
41
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export { ConsoleHandler, DefaultConsoleHandler } from
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { ConsoleHandler, DefaultConsoleHandler } from "./ConsoleHandler";
|
|
2
|
+
export { DefaultDialogHandler, DialogHandler } from "./DialogHandler";
|
|
3
|
+
export { Display } from "./Display";
|
|
4
|
+
export { Font } from "./Font";
|
|
5
|
+
export { FontResolver } from "./FontResolver";
|
|
6
|
+
export { DefaultPathResolver, PathResolver } from "./PathResolver";
|
|
7
|
+
export { CompiledFormula, DataSourceStatus, } from "./pv/formulas/CompiledFormula";
|
|
8
|
+
export { FormulaCompiler } from "./pv/formulas/FormulaCompiler";
|
|
9
|
+
export { AlarmSeverity, PV } from "./pv/PV";
|
|
10
|
+
export { PVProvider } from "./pv/PVProvider";
|
|
11
|
+
export { Sample } from "./pv/Sample";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ActionSet } from
|
|
2
|
-
import { Color } from
|
|
3
|
-
import { ColorMap } from
|
|
4
|
-
import { Font } from
|
|
5
|
-
import { MacroSet } from
|
|
6
|
-
import { Point } from
|
|
7
|
-
import { RuleSet } from
|
|
8
|
-
import { AutoScaleWidgets, ScaleOptions } from
|
|
9
|
-
import { ScriptSet } from
|
|
10
|
-
import { Widget } from
|
|
11
|
-
import { XMLNode } from
|
|
12
|
-
export
|
|
1
|
+
import { ActionSet } from "./actions";
|
|
2
|
+
import { Color } from "./Color";
|
|
3
|
+
import { ColorMap } from "./ColorMap";
|
|
4
|
+
import { Font } from "./Font";
|
|
5
|
+
import { MacroSet } from "./macros";
|
|
6
|
+
import { Point } from "./positioning";
|
|
7
|
+
import { RuleSet } from "./rules";
|
|
8
|
+
import { AutoScaleWidgets, ScaleOptions } from "./scale";
|
|
9
|
+
import { ScriptSet } from "./scripts";
|
|
10
|
+
import { Widget } from "./Widget";
|
|
11
|
+
import { XMLNode } from "./XMLNode";
|
|
12
|
+
export type PropertyGenerator = () => Property<any>[];
|
|
13
13
|
export declare class PropertySet {
|
|
14
14
|
private widget;
|
|
15
15
|
private properties;
|
|
16
16
|
private generators;
|
|
17
|
-
constructor(widget: Widget, properties?: Property<any>[]);
|
|
17
|
+
constructor(widget: Widget | null, properties?: Property<any>[]);
|
|
18
18
|
clear(): void;
|
|
19
19
|
add(property: Property<any>): void;
|
|
20
20
|
/**
|
|
@@ -42,7 +42,7 @@ export declare abstract class Property<T> {
|
|
|
42
42
|
removeListener(listener: PropertyListener<T>): void;
|
|
43
43
|
printScriptValue(value: T): string;
|
|
44
44
|
}
|
|
45
|
-
export
|
|
45
|
+
export type PropertyListener<T> = (newValue?: T, oldValue?: T) => void;
|
|
46
46
|
export declare class StringProperty extends Property<string> {
|
|
47
47
|
/**
|
|
48
48
|
* Has macros unexpanded
|