@yamcs/opi 1.2.1 → 1.2.4
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/README.md +4 -6
- package/dist/images/Add_Annotation.png +0 -0
- package/dist/images/AutoScale.png +0 -0
- package/dist/images/Configure.png +0 -0
- package/dist/images/Del_Annotation.png +0 -0
- package/dist/images/HorizontalZoom.png +0 -0
- package/dist/images/MouseArrow.png +0 -0
- package/dist/images/Panning.png +0 -0
- package/dist/images/Redo.png +0 -0
- package/dist/images/Redo_Gray.png +0 -0
- package/dist/images/RubberbandZoom.png +0 -0
- package/dist/images/ShowLegend.png +0 -0
- package/dist/images/Undo.png +0 -0
- package/dist/images/Undo_Gray.png +0 -0
- package/dist/images/VerticalZoom.png +0 -0
- package/dist/images/ZoomIn.png +0 -0
- package/dist/images/ZoomOut.png +0 -0
- package/dist/images/camera.png +0 -0
- package/dist/opi.js +1 -1
- package/dist/opi.js.map +1 -1
- package/dist/opi.umd.js +1 -1
- package/dist/opi.umd.js.map +1 -1
- package/dist/types/AutoScaleWidgets.d.ts +6 -0
- package/dist/types/Color.d.ts +5 -0
- package/dist/types/ColorMap.d.ts +23 -0
- package/dist/types/DecimalFormat.d.ts +36 -0
- package/dist/types/Display.d.ts +23 -6
- package/dist/types/EventHandler.d.ts +10 -0
- package/dist/types/Graphics.d.ts +4 -1
- package/dist/types/HitCanvas.d.ts +1 -11
- package/dist/types/HitRegionSpecification.d.ts +15 -0
- package/dist/types/ImageResolver.d.ts +9 -0
- package/dist/types/Range.d.ts +4 -0
- package/dist/types/ScaleOptions.d.ts +6 -0
- package/dist/types/Widget.d.ts +15 -1
- package/dist/types/XMLNode.d.ts +2 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/positioning.d.ts +1 -0
- package/dist/types/properties.d.ts +18 -0
- package/dist/types/pv/LocalPV.d.ts +2 -2
- package/dist/types/pv/PV.d.ts +1 -0
- package/dist/types/pv/PVEngine.d.ts +2 -0
- package/dist/types/scripting/ColorFontUtil.d.ts +13 -13
- package/dist/types/scripting/DataUtil.d.ts +6 -0
- package/dist/types/scripting/DisplayWrapper.d.ts +1 -2
- package/dist/types/scripting/GUIUtil.d.ts +8 -0
- package/dist/types/scripting/WidgetWrapper.d.ts +12 -0
- package/dist/types/scripting/XYGraphWrapper.d.ts +9 -0
- package/dist/types/scripting/utils.d.ts +3 -0
- package/dist/types/scripts.d.ts +2 -1
- package/dist/types/widgets/graphics/ImageWidget.d.ts +1 -0
- package/dist/types/widgets/monitors/IntensityGraph.d.ts +43 -0
- package/dist/types/widgets/monitors/LinearScale.d.ts +20 -1
- package/dist/types/widgets/monitors/Meter.d.ts +1 -0
- package/dist/types/widgets/monitors/ProgressBar.d.ts +3 -1
- package/dist/types/widgets/monitors/Tank.d.ts +2 -1
- package/dist/types/widgets/monitors/Thermometer.d.ts +3 -1
- package/dist/types/widgets/monitors/xygraph/Axis.d.ts +41 -0
- package/dist/types/widgets/monitors/xygraph/CommandBuffer.d.ts +26 -0
- package/dist/types/widgets/monitors/xygraph/PlotAreaRegion.d.ts +22 -0
- package/dist/types/widgets/monitors/xygraph/Trace.d.ts +38 -0
- package/dist/types/widgets/monitors/xygraph/TraceBuffer.d.ts +32 -0
- package/dist/types/widgets/monitors/xygraph/XYGraph.d.ts +44 -0
- package/dist/types/widgets/monitors/xygraph/XYGraphToolbar.d.ts +54 -0
- package/dist/types/widgets/others/LinkingContainer.d.ts +2 -0
- package/package.json +6 -8
package/dist/types/Color.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare type rgb = [number, number, number];
|
|
2
|
+
export declare class ColorMap {
|
|
3
|
+
readonly code: number;
|
|
4
|
+
private interpolate;
|
|
5
|
+
readonly autoscale: boolean;
|
|
6
|
+
private values;
|
|
7
|
+
private colors;
|
|
8
|
+
private entries;
|
|
9
|
+
private dirty;
|
|
10
|
+
constructor(code: number, interpolate: boolean, autoscale: boolean);
|
|
11
|
+
addMapping(value: number, red: number, green: number, blue: number): void;
|
|
12
|
+
private compile;
|
|
13
|
+
lookup(value: number): rgb;
|
|
14
|
+
getMinMax(): number[];
|
|
15
|
+
/**
|
|
16
|
+
* Returns the index of the value in the sorted entry list.
|
|
17
|
+
* If the value is not found, returns a negative number
|
|
18
|
+
* describing which (when negated), tells the insert
|
|
19
|
+
* position of the provide value.
|
|
20
|
+
*/
|
|
21
|
+
private binarySearch;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare class DecimalFormat {
|
|
2
|
+
private prefix;
|
|
3
|
+
private suffix;
|
|
4
|
+
/**
|
|
5
|
+
* Grouping size
|
|
6
|
+
*/
|
|
7
|
+
private comma;
|
|
8
|
+
/**
|
|
9
|
+
* Minimum integer digits to be displayed
|
|
10
|
+
*/
|
|
11
|
+
private minInt;
|
|
12
|
+
/**
|
|
13
|
+
* Minimum fractional digits to be displayed
|
|
14
|
+
*/
|
|
15
|
+
private minFrac;
|
|
16
|
+
/**
|
|
17
|
+
* Maximum fractional digits to be displayed
|
|
18
|
+
*/
|
|
19
|
+
private maxFrac;
|
|
20
|
+
constructor(formatStr: string);
|
|
21
|
+
/**
|
|
22
|
+
* 1223.06 --> $1,223.06
|
|
23
|
+
*/
|
|
24
|
+
format(numStr: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* Converts formatted value back to non-formatted value
|
|
27
|
+
*/
|
|
28
|
+
private formatBack;
|
|
29
|
+
/**
|
|
30
|
+
* We shouldn't return strings like 1.000 in formatBack method.
|
|
31
|
+
* However, using only Number(str) is not enough, because it omits . in big numbers
|
|
32
|
+
* like 23423423423342234.34 => 23423423423342236 . There's a conflict in cases
|
|
33
|
+
* 6143 and 6541.
|
|
34
|
+
*/
|
|
35
|
+
private getNumericString;
|
|
36
|
+
}
|
package/dist/types/Display.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OPIEvent, OPIEventMap } from './events';
|
|
2
|
-
import {
|
|
2
|
+
import { ImageResolver } from './ImageResolver';
|
|
3
|
+
import { Bounds } from './positioning';
|
|
3
4
|
import { PVEngine } from './pv/PVEngine';
|
|
4
5
|
import { PVProvider } from './pv/PVProvider';
|
|
5
6
|
import { Sample } from './pv/Sample';
|
|
@@ -25,13 +26,14 @@ import { RoundedRectangle } from './widgets/graphics/RoundedRectangle';
|
|
|
25
26
|
import { ByteMonitor } from './widgets/monitors/ByteMonitor';
|
|
26
27
|
import { Gauge } from './widgets/monitors/Gauge';
|
|
27
28
|
import { ImageBooleanIndicator } from './widgets/monitors/ImageBooleanIndicator';
|
|
29
|
+
import { IntensityGraph } from './widgets/monitors/IntensityGraph';
|
|
28
30
|
import { LED } from './widgets/monitors/LED';
|
|
29
31
|
import { Meter } from './widgets/monitors/Meter';
|
|
30
32
|
import { ProgressBar } from './widgets/monitors/ProgressBar';
|
|
31
33
|
import { Tank } from './widgets/monitors/Tank';
|
|
32
34
|
import { TextUpdate } from './widgets/monitors/TextUpdate';
|
|
33
35
|
import { Thermometer } from './widgets/monitors/Thermometer';
|
|
34
|
-
import { XYGraph } from './widgets/monitors/XYGraph';
|
|
36
|
+
import { XYGraph } from './widgets/monitors/xygraph/XYGraph';
|
|
35
37
|
import { AbstractContainerWidget } from './widgets/others/AbstractContainerWidget';
|
|
36
38
|
import { DisplayWidget } from './widgets/others/DisplayWidget';
|
|
37
39
|
import { GroupingContainer } from './widgets/others/GroupingContainer';
|
|
@@ -44,6 +46,7 @@ export declare class Display {
|
|
|
44
46
|
private g;
|
|
45
47
|
private ctx;
|
|
46
48
|
pvEngine: PVEngine;
|
|
49
|
+
private imageResolver;
|
|
47
50
|
private repaintRequested;
|
|
48
51
|
private _editMode;
|
|
49
52
|
private _showGrid;
|
|
@@ -53,7 +56,12 @@ export declare class Display {
|
|
|
53
56
|
private _scale;
|
|
54
57
|
private _transparent;
|
|
55
58
|
/**
|
|
56
|
-
* Prefix for
|
|
59
|
+
* Prefix for images sourced during draw.
|
|
60
|
+
* (does not include workspace images)
|
|
61
|
+
*/
|
|
62
|
+
imagesPrefix: string;
|
|
63
|
+
/**
|
|
64
|
+
* Prefix for workspace references (images, scripts, displays)
|
|
57
65
|
*/
|
|
58
66
|
baseUrl: string;
|
|
59
67
|
instance?: DisplayWidget;
|
|
@@ -62,6 +70,8 @@ export declare class Display {
|
|
|
62
70
|
constructor(targetElement: HTMLElement);
|
|
63
71
|
addProvider(provider: PVProvider): void;
|
|
64
72
|
addScriptLibrary(name: string, library: any): void;
|
|
73
|
+
setImageResolver(imageResolver: ImageResolver): void;
|
|
74
|
+
getImageResolver(): ImageResolver;
|
|
65
75
|
private step;
|
|
66
76
|
private drawScreen;
|
|
67
77
|
/**
|
|
@@ -69,19 +79,21 @@ export declare class Display {
|
|
|
69
79
|
* UI render loop.
|
|
70
80
|
*/
|
|
71
81
|
requestRepaint(): void;
|
|
82
|
+
setTooltip(tooltip: string | undefined): void;
|
|
72
83
|
/**
|
|
73
84
|
* Closes the currently active menu (if any)
|
|
74
85
|
*/
|
|
75
86
|
closeMenu(): void;
|
|
76
|
-
createWidget(kind: string, parent: AbstractContainerWidget): ActionButton | Arc | BooleanButton | BooleanSwitch | ByteMonitor | CheckBox | ChoiceButton | Combo | Ellipse | Gauge | GroupingContainer | ImageWidget | ImageBooleanButton | ImageBooleanIndicator | Label | LED | LinkingContainer | Meter | Polygon | Polyline | ProgressBar | RadioBox | Rectangle | RoundedRectangle | Scrollbar | TabbedContainer | Tank | TextInput | TextUpdate | Thermometer | WebBrowser | XYGraph | undefined;
|
|
87
|
+
createWidget(kind: string, parent: AbstractContainerWidget): ActionButton | Arc | BooleanButton | BooleanSwitch | ByteMonitor | CheckBox | ChoiceButton | Combo | Ellipse | Gauge | GroupingContainer | ImageWidget | ImageBooleanButton | ImageBooleanIndicator | IntensityGraph | Label | LED | LinkingContainer | Meter | Polygon | Polyline | ProgressBar | RadioBox | Rectangle | RoundedRectangle | Scrollbar | TabbedContainer | Tank | TextInput | TextUpdate | Thermometer | WebBrowser | XYGraph | undefined;
|
|
77
88
|
destroy(): void;
|
|
78
89
|
setSource(href: string): Promise<void>;
|
|
79
90
|
setSourceString(source: string): void;
|
|
91
|
+
private reset;
|
|
80
92
|
/**
|
|
81
93
|
* Bounds of this widget relative to the root
|
|
82
94
|
* of all of its parents.
|
|
83
95
|
*/
|
|
84
|
-
measureAbsoluteArea(
|
|
96
|
+
measureAbsoluteArea(widget: Widget): Bounds;
|
|
85
97
|
addEventListener<K extends keyof OPIEventMap>(type: K, listener: ((ev: OPIEventMap[K]) => void)): void;
|
|
86
98
|
removeEventListener<K extends keyof OPIEventMap>(type: K, listener: ((ev: OPIEventMap[K]) => void)): void;
|
|
87
99
|
fireEvent(type: string, event: OPIEvent): void;
|
|
@@ -103,7 +115,12 @@ export declare class Display {
|
|
|
103
115
|
clearSelection(): void;
|
|
104
116
|
findWidget(wuid: string): Widget | undefined;
|
|
105
117
|
findWidgetByName(name: string): Widget | undefined;
|
|
106
|
-
getPVNames():
|
|
118
|
+
getPVNames(): string[];
|
|
107
119
|
getPV(pvName: string): import(".").PV | undefined;
|
|
108
120
|
setValues(samples: Map<string, Sample>): void;
|
|
121
|
+
copyCanvas(area?: Bounds): HTMLCanvasElement;
|
|
122
|
+
/**
|
|
123
|
+
* Returns this display as an image.
|
|
124
|
+
*/
|
|
125
|
+
toDataURL(type?: string, quality?: any): string;
|
|
109
126
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Display } from './Display';
|
|
2
2
|
import { HitCanvas } from './HitCanvas';
|
|
3
|
+
import { Point } from './positioning';
|
|
4
|
+
export interface OpiMouseEvent {
|
|
5
|
+
clientX: number;
|
|
6
|
+
clientY: number;
|
|
7
|
+
point: Point;
|
|
8
|
+
}
|
|
9
|
+
export interface OpiGrabEvent extends OpiMouseEvent {
|
|
10
|
+
dx: number;
|
|
11
|
+
dy: number;
|
|
12
|
+
}
|
|
3
13
|
export declare class EventHandler {
|
|
4
14
|
private display;
|
|
5
15
|
private canvas;
|
package/dist/types/Graphics.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Color } from './Color';
|
|
2
2
|
import { Font } from './Font';
|
|
3
|
-
import { HitCanvas
|
|
3
|
+
import { HitCanvas } from './HitCanvas';
|
|
4
|
+
import { HitRegionSpecification } from './HitRegionSpecification';
|
|
4
5
|
import { Bounds, Point } from './positioning';
|
|
5
6
|
interface RectColorFill {
|
|
6
7
|
x: number;
|
|
@@ -102,10 +103,12 @@ interface PathStroke {
|
|
|
102
103
|
interface PathColorFill {
|
|
103
104
|
path: Path;
|
|
104
105
|
color: Color;
|
|
106
|
+
opacity?: number;
|
|
105
107
|
}
|
|
106
108
|
interface PathGradientFill {
|
|
107
109
|
path: Path;
|
|
108
110
|
gradient: CanvasGradient;
|
|
111
|
+
opacity?: number;
|
|
109
112
|
}
|
|
110
113
|
declare type PathFill = PathColorFill | PathGradientFill;
|
|
111
114
|
export declare class Graphics {
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
id: string;
|
|
3
|
-
click?: () => void;
|
|
4
|
-
mouseEnter?: () => void;
|
|
5
|
-
mouseMove?: () => void;
|
|
6
|
-
mouseOut?: () => void;
|
|
7
|
-
mouseDown?: () => void;
|
|
8
|
-
mouseUp?: () => void;
|
|
9
|
-
grab?: (dx: number, dy: number) => void;
|
|
10
|
-
cursor?: string;
|
|
11
|
-
}
|
|
1
|
+
import { HitRegionSpecification } from './HitRegionSpecification';
|
|
12
2
|
export declare class HitCanvas {
|
|
13
3
|
private parent?;
|
|
14
4
|
readonly ctx: CanvasRenderingContext2D;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpiGrabEvent, OpiMouseEvent } from './EventHandler';
|
|
2
|
+
export declare type TooltipProvider = () => string | undefined;
|
|
3
|
+
export interface HitRegionSpecification {
|
|
4
|
+
id: string;
|
|
5
|
+
click?: (mouseEvent: OpiMouseEvent) => void;
|
|
6
|
+
mouseEnter?: () => void;
|
|
7
|
+
mouseMove?: () => void;
|
|
8
|
+
mouseOut?: () => void;
|
|
9
|
+
mouseDown?: (mouseEvent: OpiMouseEvent) => void;
|
|
10
|
+
mouseUp?: () => void;
|
|
11
|
+
grab?: (grabEvent: OpiGrabEvent) => void;
|
|
12
|
+
grabEnd?: () => void;
|
|
13
|
+
cursor?: string;
|
|
14
|
+
tooltip?: TooltipProvider;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Display } from './Display';
|
|
2
|
+
export interface ImageResolver {
|
|
3
|
+
resolve(file: string): string;
|
|
4
|
+
}
|
|
5
|
+
export declare class DefaultImageResolver implements ImageResolver {
|
|
6
|
+
private display;
|
|
7
|
+
constructor(display: Display);
|
|
8
|
+
resolve(file: string): string;
|
|
9
|
+
}
|
package/dist/types/Widget.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Color } from './Color';
|
|
|
3
3
|
import { Display } from './Display';
|
|
4
4
|
import { Graphics } from './Graphics';
|
|
5
5
|
import { Bounds } from './positioning';
|
|
6
|
-
import { PropertySet } from './properties';
|
|
6
|
+
import { PropertyListener, PropertySet } from './properties';
|
|
7
7
|
import { PV } from './pv/PV';
|
|
8
8
|
import { RuleSet } from './rules';
|
|
9
9
|
import { ScaleOptions } from './scale';
|
|
@@ -17,7 +17,9 @@ export declare abstract class Widget {
|
|
|
17
17
|
y: number;
|
|
18
18
|
width: number;
|
|
19
19
|
height: number;
|
|
20
|
+
private _value;
|
|
20
21
|
protected fillRoundRectangleBackgroundBorder: boolean;
|
|
22
|
+
private holderRegion?;
|
|
21
23
|
properties: PropertySet;
|
|
22
24
|
constructor(display: Display, parent?: AbstractContainerWidget | undefined);
|
|
23
25
|
parseNode(node: XMLNode): void;
|
|
@@ -54,6 +56,14 @@ export declare abstract class Widget {
|
|
|
54
56
|
get alarmSensitiveBackgroundColor(): Color;
|
|
55
57
|
get alarmSensitiveForegroundColor(): Color;
|
|
56
58
|
get scale(): number;
|
|
59
|
+
get value(): any;
|
|
60
|
+
set value(value: any);
|
|
61
|
+
addPropertyListener(propertyName: string, listener: PropertyListener<any>): void;
|
|
62
|
+
removePropertyListener(propertyName: string, listener: PropertyListener<any>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Returns this widget as an image.
|
|
65
|
+
*/
|
|
66
|
+
toDataURL(type?: string, quality?: any): string;
|
|
57
67
|
get wuid(): string;
|
|
58
68
|
get name(): string;
|
|
59
69
|
get holderX(): number;
|
|
@@ -64,17 +74,21 @@ export declare abstract class Widget {
|
|
|
64
74
|
get backgroundAlarmSensitive(): boolean;
|
|
65
75
|
get foregroundAlarmSensitive(): boolean;
|
|
66
76
|
get pvName(): string | undefined;
|
|
77
|
+
get pvValue(): any;
|
|
67
78
|
get borderColor(): Color;
|
|
68
79
|
get borderStyle(): number;
|
|
69
80
|
get borderWidth(): number;
|
|
70
81
|
get backgroundColor(): Color;
|
|
82
|
+
get enabled(): boolean;
|
|
71
83
|
get foregroundColor(): Color;
|
|
84
|
+
get tooltip(): string | undefined;
|
|
72
85
|
get transparent(): boolean;
|
|
73
86
|
get visible(): boolean;
|
|
74
87
|
get actions(): ActionSet;
|
|
75
88
|
get scripts(): ScriptSet;
|
|
76
89
|
get rules(): RuleSet;
|
|
77
90
|
get scaleOptions(): ScaleOptions;
|
|
91
|
+
get widgetType(): string | undefined;
|
|
78
92
|
get text(): string;
|
|
79
93
|
/**
|
|
80
94
|
* Called exactly once post-construct. A destroyed widget will
|
package/dist/types/XMLNode.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionSet } from './actions';
|
|
2
2
|
import { Color } from './Color';
|
|
3
|
+
import { ColorMap } from './ColorMap';
|
|
3
4
|
import { Font } from './Font';
|
|
4
5
|
import { MacroSet } from './macros';
|
|
5
6
|
import { RuleSet } from './rules';
|
|
@@ -72,6 +73,7 @@ export declare class XMLNode {
|
|
|
72
73
|
getScripts(name: string): ScriptSet;
|
|
73
74
|
getScaleOptions(name: string): ScaleOptions;
|
|
74
75
|
getAutoScaleWidgets(name: string): AutoScaleWidgets;
|
|
76
|
+
getColorMap(name: string): ColorMap | undefined;
|
|
75
77
|
getRules(name: string): RuleSet;
|
|
76
78
|
getMacros(name: string): MacroSet;
|
|
77
79
|
getActions(name: string): ActionSet;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Display } from './Display';
|
|
2
|
+
export { DefaultImageResolver, ImageResolver } from './ImageResolver';
|
|
3
|
+
export { CompiledFormula, DataSourceStatus } from './pv/formulas/CompiledFormula';
|
|
4
|
+
export { FormulaCompiler } from './pv/formulas/FormulaCompiler';
|
|
2
5
|
export { AlarmSeverity, PV } from './pv/PV';
|
|
3
6
|
export { PVProvider } from './pv/PVProvider';
|
|
4
7
|
export { Sample } from './pv/Sample';
|
|
5
|
-
export { FormulaCompiler } from './pv/formulas/FormulaCompiler';
|
|
6
|
-
export { DataSourceStatus, CompiledFormula } from './pv/formulas/CompiledFormula';
|
|
@@ -21,6 +21,7 @@ export declare function rotatePoint(x: number, y: number, cx: number, cy: number
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function shrink(original: Bounds, v: number, h?: number): Bounds;
|
|
23
23
|
export declare function crispen(original: Bounds): Bounds;
|
|
24
|
+
export declare function intersect(area1: Bounds, area2: Bounds): Bounds;
|
|
24
25
|
export declare function translatePoint(point: Point, dx: number, dy: number): {
|
|
25
26
|
x: number;
|
|
26
27
|
y: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionSet } from './actions';
|
|
2
2
|
import { Color } from './Color';
|
|
3
|
+
import { ColorMap } from './ColorMap';
|
|
3
4
|
import { Font } from './Font';
|
|
4
5
|
import { MacroSet } from './macros';
|
|
5
6
|
import { Point } from './positioning';
|
|
@@ -8,14 +9,23 @@ import { AutoScaleWidgets, ScaleOptions } from './scale';
|
|
|
8
9
|
import { ScriptSet } from './scripts';
|
|
9
10
|
import { Widget } from './Widget';
|
|
10
11
|
import { XMLNode } from './XMLNode';
|
|
12
|
+
export declare type PropertyGenerator = () => Property<any>[];
|
|
11
13
|
export declare class PropertySet {
|
|
12
14
|
private widget;
|
|
13
15
|
private properties;
|
|
16
|
+
private generators;
|
|
14
17
|
constructor(widget: Widget, properties?: Property<any>[]);
|
|
15
18
|
clear(): void;
|
|
16
19
|
add(property: Property<any>): void;
|
|
20
|
+
/**
|
|
21
|
+
* Add a property generator. Generators can access the effective
|
|
22
|
+
* value of static properties to determine property names.
|
|
23
|
+
*/
|
|
24
|
+
addGenerator(generator: PropertyGenerator): void;
|
|
17
25
|
all(): IterableIterator<Property<any>>;
|
|
26
|
+
private loadProperty;
|
|
18
27
|
loadXMLValues(node: XMLNode): void;
|
|
28
|
+
private resolveStringProperties;
|
|
19
29
|
getProperty(propertyName: string): Property<any> | undefined;
|
|
20
30
|
getValue(propertyName: string, optional?: boolean): any;
|
|
21
31
|
setValue(propertyName: string, value: any): void;
|
|
@@ -29,6 +39,7 @@ export declare abstract class Property<T> {
|
|
|
29
39
|
get value(): T | undefined;
|
|
30
40
|
set value(value: T | undefined);
|
|
31
41
|
addListener(listener: PropertyListener<T>): void;
|
|
42
|
+
removeListener(listener: PropertyListener<T>): void;
|
|
32
43
|
printScriptValue(value: T): string;
|
|
33
44
|
}
|
|
34
45
|
export declare type PropertyListener<T> = (newValue?: T, oldValue?: T) => void;
|
|
@@ -39,6 +50,10 @@ export declare class StringProperty extends Property<string> {
|
|
|
39
50
|
rawValue?: string;
|
|
40
51
|
printScriptValue(value: String): string;
|
|
41
52
|
}
|
|
53
|
+
export declare class PVValueProperty extends Property<any> {
|
|
54
|
+
readonly pvPropertyName: string;
|
|
55
|
+
constructor(name: string, pvPropertyName: string);
|
|
56
|
+
}
|
|
42
57
|
export declare class IntProperty extends Property<number> {
|
|
43
58
|
}
|
|
44
59
|
export declare class FloatProperty extends Property<number> {
|
|
@@ -51,6 +66,9 @@ export declare class ColorProperty extends Property<Color> {
|
|
|
51
66
|
export declare class FontProperty extends Property<Font> {
|
|
52
67
|
printScriptValue(value: Font): string;
|
|
53
68
|
}
|
|
69
|
+
export declare class ColorMapProperty extends Property<ColorMap> {
|
|
70
|
+
printScriptValue(value: ColorMap): string;
|
|
71
|
+
}
|
|
54
72
|
export declare class PointsProperty extends Property<Point[]> {
|
|
55
73
|
}
|
|
56
74
|
export declare class ActionsProperty extends Property<ActionSet> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PV } from './PV';
|
|
2
2
|
import { PVEngine } from './PVEngine';
|
|
3
3
|
export declare class LocalPV extends PV {
|
|
4
|
-
readonly initializer?:
|
|
5
|
-
constructor(name: string, pvEngine: PVEngine, initializer?:
|
|
4
|
+
readonly initializer?: any;
|
|
5
|
+
constructor(name: string, pvEngine: PVEngine, initializer?: any);
|
|
6
6
|
}
|
package/dist/types/pv/PV.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare class PV {
|
|
|
48
48
|
private formatNumber;
|
|
49
49
|
setSample(sample: Sample): void;
|
|
50
50
|
addListener(listener: PVListener): void;
|
|
51
|
+
removeListener(listener: PVListener): void;
|
|
51
52
|
toString(): string | undefined;
|
|
52
53
|
}
|
|
53
54
|
export declare type PVListener = () => void;
|
|
@@ -24,6 +24,7 @@ export declare class PVEngine {
|
|
|
24
24
|
createPV(pvName: string): PV;
|
|
25
25
|
requestRepaint(): void;
|
|
26
26
|
private createLocalPV;
|
|
27
|
+
private initializerEquals;
|
|
27
28
|
getValue(pvName: string): any;
|
|
28
29
|
setValue(time: Date, pvName: string, value: any, severity?: AlarmSeverity): void;
|
|
29
30
|
setValues(samples: Map<string, Sample>): void;
|
|
@@ -32,4 +33,5 @@ export declare class PVEngine {
|
|
|
32
33
|
addProvider(provider: PVProvider): void;
|
|
33
34
|
addScriptLibrary(name: string, library: any): void;
|
|
34
35
|
addListener(pvName: string, listener: PVListener): void;
|
|
36
|
+
removeListener(pvName: string, listener: PVListener): void;
|
|
35
37
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Color } from '../Color';
|
|
2
2
|
import { Font } from '../Font';
|
|
3
3
|
export declare class ColorFontUtil {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
BLACK: Color;
|
|
5
|
+
BLUE: Color;
|
|
6
|
+
CYAN: Color;
|
|
7
|
+
DARK_GRAY: Color;
|
|
8
|
+
GRAY: Color;
|
|
9
|
+
GREEN: Color;
|
|
10
|
+
LIGHT_BLUE: Color;
|
|
11
|
+
ORANGE: Color;
|
|
12
|
+
PINK: Color;
|
|
13
|
+
PURPLE: Color;
|
|
14
|
+
RED: Color;
|
|
15
|
+
WHITE: Color;
|
|
16
|
+
YELLOW: Color;
|
|
17
17
|
getColorFromRGB(red: number, green: number, blue: number): Color;
|
|
18
18
|
getFont(name: string, height: number, style: number): Font;
|
|
19
19
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Display } from '../Display';
|
|
2
|
-
import { WidgetWrapper } from './WidgetWrapper';
|
|
3
2
|
export declare class DisplayWrapper {
|
|
4
3
|
private display;
|
|
5
4
|
constructor(display: Display);
|
|
6
|
-
getWidget(name: string): WidgetWrapper | undefined;
|
|
5
|
+
getWidget(name: string): import("./WidgetWrapper").WidgetWrapper | undefined;
|
|
7
6
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class GUIUtil {
|
|
2
|
+
fullScreen(): void;
|
|
3
|
+
openConfirmDialog(message: string): boolean;
|
|
4
|
+
openInformationDialog(message: string): void;
|
|
5
|
+
openWarningDialog(message: string): void;
|
|
6
|
+
openErrorDialog(message: string): void;
|
|
7
|
+
openPasswordDialog(message: string, password: string): boolean | undefined;
|
|
8
|
+
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { Widget } from '../Widget';
|
|
2
|
+
import { PVWrapper } from './PVWrapper';
|
|
2
3
|
/**
|
|
3
4
|
* Exposes the API for the variable "widget" as used in display scripts.
|
|
4
5
|
*/
|
|
5
6
|
export declare class WidgetWrapper {
|
|
6
7
|
private widget;
|
|
7
8
|
constructor(widget: Widget);
|
|
9
|
+
getPVByName(name: string): PVWrapper | null;
|
|
10
|
+
getPV(propertyName?: string): PVWrapper | null;
|
|
8
11
|
getPropertyValue(propertyName: string): any;
|
|
9
12
|
setPropertyValue(propertyName: string, value: any): void;
|
|
13
|
+
getName(): string;
|
|
14
|
+
setX(x: number): void;
|
|
15
|
+
setY(y: number): void;
|
|
16
|
+
setWidth(width: number): void;
|
|
17
|
+
setHeight(height: number): void;
|
|
18
|
+
setVisible(visible: boolean): void;
|
|
19
|
+
getValue(): any;
|
|
20
|
+
setValue(value: any): void;
|
|
21
|
+
setValueInUIThread(value: any): void;
|
|
10
22
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { XYGraph } from '../widgets/monitors/xygraph/XYGraph';
|
|
2
|
+
import { WidgetWrapper } from './WidgetWrapper';
|
|
3
|
+
export declare class XYGraphWrapper extends WidgetWrapper {
|
|
4
|
+
private xyGraph;
|
|
5
|
+
constructor(widget: XYGraph);
|
|
6
|
+
clearGraph(): void;
|
|
7
|
+
getXBuffer(index: number): number[];
|
|
8
|
+
getYBuffer(index: number): number[];
|
|
9
|
+
}
|
package/dist/types/scripts.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export interface Script {
|
|
|
6
6
|
path?: string;
|
|
7
7
|
text?: string;
|
|
8
8
|
/**
|
|
9
|
-
* If true, the script may only run if all PVs are connected
|
|
9
|
+
* If true, the script may only run if all PVs are connected, and
|
|
10
|
+
* have a non-null value.
|
|
10
11
|
*/
|
|
11
12
|
checkConnect: boolean;
|
|
12
13
|
skipFirstExecution: boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Color } from '../../Color';
|
|
2
|
+
import { ColorMap } from '../../ColorMap';
|
|
3
|
+
import { Display } from '../../Display';
|
|
4
|
+
import { Font } from '../../Font';
|
|
5
|
+
import { Graphics } from '../../Graphics';
|
|
6
|
+
import { Widget } from '../../Widget';
|
|
7
|
+
import { AbstractContainerWidget } from '../others/AbstractContainerWidget';
|
|
8
|
+
export declare class IntensityGraph extends Widget {
|
|
9
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
10
|
+
draw(g: Graphics): void;
|
|
11
|
+
get gap(): number;
|
|
12
|
+
get colorMap(): ColorMap;
|
|
13
|
+
get cropBottom(): number;
|
|
14
|
+
get cropLeft(): number;
|
|
15
|
+
get cropRight(): number;
|
|
16
|
+
get cropTop(): number;
|
|
17
|
+
get dataHeight(): number;
|
|
18
|
+
get dataWidth(): number;
|
|
19
|
+
get font(): Font;
|
|
20
|
+
get graphAreaHeight(): number;
|
|
21
|
+
get graphAreaWidth(): number;
|
|
22
|
+
get maximum(): number;
|
|
23
|
+
get minimum(): number;
|
|
24
|
+
get showRamp(): boolean;
|
|
25
|
+
get xAxisAxisColor(): Color;
|
|
26
|
+
get xAxisAxisTitle(): string;
|
|
27
|
+
get xAxisMajorTickStepHint(): number;
|
|
28
|
+
get xAxisMaximum(): number;
|
|
29
|
+
get xAxisMinimum(): number;
|
|
30
|
+
get xAxisScaleFont(): Font;
|
|
31
|
+
get xAxisShowMinorTicks(): boolean;
|
|
32
|
+
get xAxisTitleFont(): Font;
|
|
33
|
+
get xAxisVisible(): boolean;
|
|
34
|
+
get yAxisAxisColor(): Color;
|
|
35
|
+
get yAxisAxisTitle(): string;
|
|
36
|
+
get yAxisMajorTickStepHint(): number;
|
|
37
|
+
get yAxisMaximum(): number;
|
|
38
|
+
get yAxisMinimum(): number;
|
|
39
|
+
get yAxisScaleFont(): Font;
|
|
40
|
+
get yAxisShowMinorTicks(): boolean;
|
|
41
|
+
get yAxisTitleFont(): Font;
|
|
42
|
+
get yAxisVisible(): boolean;
|
|
43
|
+
}
|