@yamcs/opi 1.2.18 → 1.2.20
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/dist/opi.js +21 -1
- package/dist/opi.js.map +7 -1
- package/dist/types/Display.d.ts +6 -2
- package/dist/types/Formatter.d.ts +17 -0
- package/dist/types/pv/SystemPVProvider.d.ts +13 -0
- package/dist/types/pv/formulas/parser.d.ts +11 -0
- package/dist/types/pv/sim.d.ts +6 -0
- package/dist/types/scripting/PVUtil.d.ts +6 -3
- package/dist/types/scripting/PVWrapper.d.ts +2 -1
- package/dist/types/widgets/monitors/LED.d.ts +2 -0
- package/dist/types/widgets/monitors/LinearScale.d.ts +3 -3
- package/dist/types/widgets/others/LinkingContainer.d.ts +3 -3
- package/package.json +9 -9
package/dist/types/Display.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConsoleHandler } from "./ConsoleHandler";
|
|
2
2
|
import { DialogHandler } from "./DialogHandler";
|
|
3
3
|
import { FontResolver } from "./FontResolver";
|
|
4
|
+
import { Formatter } from './Formatter';
|
|
4
5
|
import { PathResolver } from "./PathResolver";
|
|
5
6
|
import { Widget } from "./Widget";
|
|
6
7
|
import { OPIEvent, OPIEventMap } from "./events";
|
|
@@ -55,6 +56,7 @@ export declare class Display {
|
|
|
55
56
|
private fontResolver?;
|
|
56
57
|
private consoleHandler;
|
|
57
58
|
private dialogHandler;
|
|
59
|
+
formatter: Formatter;
|
|
58
60
|
private repaintRequested;
|
|
59
61
|
private _editMode;
|
|
60
62
|
private _showGrid;
|
|
@@ -96,7 +98,7 @@ export declare class Display {
|
|
|
96
98
|
*/
|
|
97
99
|
requestRepaint(): void;
|
|
98
100
|
setTooltip(tooltip: string | undefined): void;
|
|
99
|
-
createWidget(kind: string, parent: AbstractContainerWidget):
|
|
101
|
+
createWidget(kind: string, parent: AbstractContainerWidget): Table | XYGraph | ActionButton | Arc | BooleanButton | BooleanSwitch | ByteMonitor | CheckBox | ChoiceButton | Combo | Ellipse | Gauge | GroupingContainer | ImageWidget | ImageBooleanButton | ImageBooleanIndicator | IntensityGraph | Label | LED | LinkingContainer | MenuButton | Meter | Polygon | Polyline | ProgressBar | RadioBox | Rectangle | RoundedRectangle | Scrollbar | TabbedContainer | Tank | TextInput | TextUpdate | Thermometer | WebBrowser | undefined;
|
|
100
102
|
destroy(): void;
|
|
101
103
|
resolvePath(path: string, widget?: Widget): string;
|
|
102
104
|
setSource(href: string, args?: {
|
|
@@ -128,12 +130,14 @@ export declare class Display {
|
|
|
128
130
|
set scale(scale: number);
|
|
129
131
|
get transparent(): boolean;
|
|
130
132
|
set transparent(transparent: boolean);
|
|
133
|
+
get utc(): boolean;
|
|
134
|
+
set utc(utc: boolean);
|
|
131
135
|
get widgets(): Widget[];
|
|
132
136
|
clearSelection(): void;
|
|
133
137
|
findWidget(wuid: string): Widget | undefined;
|
|
134
138
|
findWidgetByName(name: string): Widget | undefined;
|
|
135
139
|
getPVNames(): string[];
|
|
136
|
-
getPV(pvName: string): import("
|
|
140
|
+
getPV(pvName: string): import(".").PV | undefined;
|
|
137
141
|
setValues(samples: Map<string, Sample>): void;
|
|
138
142
|
copyCanvas(area?: Bounds): HTMLCanvasElement;
|
|
139
143
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FormatDateOptions {
|
|
2
|
+
year: boolean;
|
|
3
|
+
month: boolean;
|
|
4
|
+
day: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface FormatTimeOptions {
|
|
7
|
+
hours: boolean;
|
|
8
|
+
minutes: boolean;
|
|
9
|
+
seconds: boolean;
|
|
10
|
+
milliseconds: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class Formatter {
|
|
13
|
+
utc: boolean;
|
|
14
|
+
constructor(utc: boolean);
|
|
15
|
+
formatDate(dt: Date, opts: FormatDateOptions): string;
|
|
16
|
+
formatTime(dt: Date, opts: FormatTimeOptions): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Formatter } from '../Formatter';
|
|
2
|
+
import { PV } from "./PV";
|
|
3
|
+
import { PVProvider } from "./PVProvider";
|
|
4
|
+
export declare class SystemPVProvider implements PVProvider {
|
|
5
|
+
private formatter;
|
|
6
|
+
private pvs;
|
|
7
|
+
constructor(formatter: Formatter);
|
|
8
|
+
canProvide(pvName: string): boolean;
|
|
9
|
+
startProviding(pvs: PV[]): void;
|
|
10
|
+
stopProviding(pvs: PV[]): void;
|
|
11
|
+
isNavigable(): boolean;
|
|
12
|
+
shutdown(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const peg$allowedStartRules: string[];
|
|
2
|
+
declare function peg$SyntaxError(message: any, expected: any, found: any, location: any): Error;
|
|
3
|
+
declare class peg$SyntaxError {
|
|
4
|
+
constructor(message: any, expected: any, found: any, location: any);
|
|
5
|
+
format(sources: any): string;
|
|
6
|
+
}
|
|
7
|
+
declare namespace peg$SyntaxError {
|
|
8
|
+
function buildMessage(expected: any, found: any): string;
|
|
9
|
+
}
|
|
10
|
+
declare function peg$parse(input: any, options: any): any;
|
|
11
|
+
export { peg$allowedStartRules as StartRules, peg$SyntaxError as SyntaxError, peg$parse as parse };
|
package/dist/types/pv/sim.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Formatter } from '../Formatter';
|
|
1
2
|
import { PV } from "./PV";
|
|
2
3
|
export declare abstract class SimGenerator {
|
|
3
4
|
readonly pv: PV;
|
|
@@ -12,6 +13,11 @@ export declare class ConstantGenerator extends SimGenerator {
|
|
|
12
13
|
constructor(pv: PV, initialValue: any);
|
|
13
14
|
generateSample(): void;
|
|
14
15
|
}
|
|
16
|
+
export declare class SysTime extends SimGenerator {
|
|
17
|
+
private formatter;
|
|
18
|
+
constructor(pv: PV, formatter: Formatter);
|
|
19
|
+
generateSample(time: Date): void;
|
|
20
|
+
}
|
|
15
21
|
/**
|
|
16
22
|
* Generates an alternating boolean value
|
|
17
23
|
*/
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Display } from '../Display';
|
|
2
2
|
import { PVWrapper } from "./PVWrapper";
|
|
3
3
|
import { WidgetWrapper } from "./WidgetWrapper";
|
|
4
4
|
export declare class PVUtil {
|
|
5
|
+
private display;
|
|
5
6
|
private pvEngine;
|
|
6
|
-
constructor(
|
|
7
|
+
constructor(display: Display);
|
|
7
8
|
private checkPVValue;
|
|
8
9
|
createPV(pvName: string, widget: WidgetWrapper): PVWrapper;
|
|
10
|
+
writePV(pvName: string, value: any, timeout?: number): void;
|
|
9
11
|
getDouble(pv: PVWrapper): number;
|
|
10
12
|
getLong(pv: PVWrapper): number;
|
|
11
13
|
getString(pv: PVWrapper): string;
|
|
12
14
|
getStringArray(pv: PVWrapper): string[];
|
|
13
15
|
getTimeInMilliseconds(pv: PVWrapper): number;
|
|
14
16
|
getTimeString(pv: PVWrapper, format?: string): string | null;
|
|
15
|
-
getSeverity(pv: PVWrapper):
|
|
17
|
+
getSeverity(pv: PVWrapper): 0 | 1 | 2 | -1;
|
|
16
18
|
getSeverityString(pv: PVWrapper): string;
|
|
17
19
|
getStatus(pv: PVWrapper): string;
|
|
20
|
+
getUnits(pv: PVWrapper): string | null;
|
|
18
21
|
private formatDate;
|
|
19
22
|
}
|
|
@@ -4,8 +4,9 @@ export declare class PVWrapper {
|
|
|
4
4
|
constructor(_pv: PV);
|
|
5
5
|
getName(): string;
|
|
6
6
|
getValue(): any;
|
|
7
|
-
setValue(value: any): void;
|
|
7
|
+
setValue(value: any, timeout?: number): void;
|
|
8
8
|
isConnected(): boolean;
|
|
9
9
|
isWriteAllowed(): boolean;
|
|
10
10
|
addListener(listener: any): void;
|
|
11
|
+
removeListener(listener: any): void;
|
|
11
12
|
}
|
|
@@ -30,8 +30,10 @@ export declare class LED extends Widget {
|
|
|
30
30
|
get bulbBorderColor(): Color;
|
|
31
31
|
get offLabel(): string;
|
|
32
32
|
get offColor(): Color;
|
|
33
|
+
get offState(): string;
|
|
33
34
|
get onLabel(): string;
|
|
34
35
|
get onColor(): Color;
|
|
36
|
+
get onState(): string;
|
|
35
37
|
get stateLabelFallback(): string;
|
|
36
38
|
get stateColorFallback(): Color;
|
|
37
39
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Color } from "../../Color";
|
|
2
2
|
import { Font } from "../../Font";
|
|
3
|
+
import { Formatter } from "../../Formatter";
|
|
3
4
|
import { Graphics } from "../../Graphics";
|
|
4
5
|
import { Range } from "../../Range";
|
|
5
6
|
export declare class LinearScale {
|
|
7
|
+
private formatter;
|
|
6
8
|
private scale;
|
|
7
9
|
private scaleFont;
|
|
8
10
|
private minimum;
|
|
@@ -24,7 +26,7 @@ export declare class LinearScale {
|
|
|
24
26
|
timeFormat: number;
|
|
25
27
|
length: number;
|
|
26
28
|
margin: number;
|
|
27
|
-
constructor(scale: number, scaleFont: Font, minimum: number, maximum: number, logScale: boolean, majorTickStepHint: number, foregroundColor: Color, showMinorTicks: boolean, showScale: boolean);
|
|
29
|
+
constructor(formatter: Formatter, scale: number, scaleFont: Font, minimum: number, maximum: number, logScale: boolean, majorTickStepHint: number, foregroundColor: Color, showMinorTicks: boolean, showScale: boolean);
|
|
28
30
|
get scaleLength(): number;
|
|
29
31
|
/** Only available post-draw */
|
|
30
32
|
getX(): number;
|
|
@@ -56,8 +58,6 @@ export declare class LinearScale {
|
|
|
56
58
|
private hasSpaceToDraw;
|
|
57
59
|
private isMajorTick;
|
|
58
60
|
private format;
|
|
59
|
-
private formatDate;
|
|
60
|
-
private formatTime;
|
|
61
61
|
get spaceBetweenMarkAndLabel(): number;
|
|
62
62
|
get majorTickLength(): number;
|
|
63
63
|
get minorTickLength(): number;
|
|
@@ -9,10 +9,10 @@ export declare class LinkingContainer extends AbstractContainerWidget {
|
|
|
9
9
|
parseNode(node: XMLNode): void;
|
|
10
10
|
init(): void;
|
|
11
11
|
draw(g: Graphics): void;
|
|
12
|
-
getLinkedWidget(): import("
|
|
13
|
-
get widgets(): import("
|
|
12
|
+
getLinkedWidget(): import("../..").Widget | undefined;
|
|
13
|
+
get widgets(): import("../..").Widget[];
|
|
14
14
|
get connections(): import("./Connection").Connection[];
|
|
15
|
-
findWidget(wuid: string): import("
|
|
15
|
+
findWidget(wuid: string): import("../..").Widget | undefined;
|
|
16
16
|
get opiFile(): string;
|
|
17
17
|
get groupName(): string;
|
|
18
18
|
get resizeBehavior(): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamcs/opi",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
4
|
"description": "OPI Display Renderer",
|
|
5
5
|
"author": "Yamcs Team <yamcs@spaceapplications.com>",
|
|
6
6
|
"repository": {
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
"homepage": "https://github.com/yamcs/opi.js",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "
|
|
13
|
+
"build": "node build.mjs",
|
|
14
|
+
"postbuild": "tsc --emitDeclarationOnly --declaration --project tsconfig.json --skipLibCheck",
|
|
14
15
|
"clean": "rm -rf dist",
|
|
15
16
|
"prepublishOnly": "npm run build",
|
|
16
|
-
"watch": "
|
|
17
|
+
"watch": "esbuild src/index.ts --outfile=dist/opi.js --sourcemap --bundle --platform=browser --format=esm --minify --watch",
|
|
17
18
|
"peggy": "cd src/pv/formulas && peggy --format es -o parser.js formula-grammar.peggy",
|
|
18
19
|
"start": "node ./demo/server.js"
|
|
19
20
|
},
|
|
@@ -23,15 +24,14 @@
|
|
|
23
24
|
"dist/"
|
|
24
25
|
],
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"
|
|
27
|
+
"@types/node": "^20.11.15",
|
|
28
|
+
"esbuild": "^0.21.4",
|
|
29
|
+
"esbuild-plugin-copy": "^2.1.1",
|
|
28
30
|
"express": "^4.18.1",
|
|
29
31
|
"morgan": "^1.10.0",
|
|
30
32
|
"nunjucks": "^3.2.2",
|
|
31
33
|
"peggy": "4.0.2",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
35
|
-
"typescript": "^5.1.3"
|
|
34
|
+
"tslib": "^2.6.3",
|
|
35
|
+
"typescript": "^5.4.5"
|
|
36
36
|
}
|
|
37
37
|
}
|