@yamcs/opi 1.2.3 → 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/LICENSE +23 -20
- 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/Display.d.ts +4 -0
- package/dist/types/ImageResolver.d.ts +9 -0
- package/dist/types/ScaleOptions.d.ts +6 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/scripting/GUIUtil.d.ts +8 -0
- package/dist/types/scripting/WidgetWrapper.d.ts +3 -0
- package/dist/types/widgets/graphics/ImageWidget.d.ts +1 -0
- package/dist/types/widgets/monitors/XYGraph.d.ts +19 -19
- package/package.json +7 -7
- package/dist/types/widgets/monitors/Axis.d.ts +0 -40
- package/dist/types/widgets/monitors/CommandBuffer.d.ts +0 -6
- package/dist/types/widgets/monitors/Trace.d.ts +0 -38
- package/dist/types/widgets/monitors/TraceBuffer.d.ts +0 -32
- package/dist/types/widgets/monitors/XYGraph2.d.ts +0 -46
- package/dist/types/widgets/monitors/XYGraphToolbar.d.ts +0 -51
package/dist/types/Display.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OPIEvent, OPIEventMap } from './events';
|
|
2
|
+
import { ImageResolver } from './ImageResolver';
|
|
2
3
|
import { Bounds } from './positioning';
|
|
3
4
|
import { PVEngine } from './pv/PVEngine';
|
|
4
5
|
import { PVProvider } from './pv/PVProvider';
|
|
@@ -45,6 +46,7 @@ export declare class Display {
|
|
|
45
46
|
private g;
|
|
46
47
|
private ctx;
|
|
47
48
|
pvEngine: PVEngine;
|
|
49
|
+
private imageResolver;
|
|
48
50
|
private repaintRequested;
|
|
49
51
|
private _editMode;
|
|
50
52
|
private _showGrid;
|
|
@@ -68,6 +70,8 @@ export declare class Display {
|
|
|
68
70
|
constructor(targetElement: HTMLElement);
|
|
69
71
|
addProvider(provider: PVProvider): void;
|
|
70
72
|
addScriptLibrary(name: string, library: any): void;
|
|
73
|
+
setImageResolver(imageResolver: ImageResolver): void;
|
|
74
|
+
getImageResolver(): ImageResolver;
|
|
71
75
|
private step;
|
|
72
76
|
private drawScreen;
|
|
73
77
|
/**
|
|
@@ -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/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';
|
|
@@ -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,13 @@
|
|
|
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;
|
|
10
13
|
getName(): string;
|
|
@@ -3,31 +3,31 @@ import { Display } from '../../Display';
|
|
|
3
3
|
import { Font } from '../../Font';
|
|
4
4
|
import { Graphics } from '../../Graphics';
|
|
5
5
|
import { Widget } from '../../Widget';
|
|
6
|
+
import { XMLNode } from '../../XMLNode';
|
|
6
7
|
import { AbstractContainerWidget } from '../others/AbstractContainerWidget';
|
|
7
|
-
import { Axis } from './Axis';
|
|
8
|
-
import { Trace } from './Trace';
|
|
9
8
|
export declare class XYGraph extends Widget {
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
private
|
|
9
|
+
private containerEl;
|
|
10
|
+
private containerId;
|
|
11
|
+
private styleEl;
|
|
12
|
+
private graphEl;
|
|
13
|
+
private axisDataSet;
|
|
14
|
+
private traceDataSet;
|
|
15
|
+
private initialized;
|
|
16
|
+
private graph?;
|
|
17
|
+
private scaleListener;
|
|
15
18
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
16
|
-
|
|
19
|
+
parseNode(node: XMLNode): void;
|
|
20
|
+
private updateGraph;
|
|
17
21
|
draw(g: Graphics): void;
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
getTrace(index: number): Trace;
|
|
22
|
+
private initializeDygraphs;
|
|
23
|
+
private drawPoint;
|
|
24
|
+
hide(): void;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
private destroyGraph;
|
|
24
27
|
get axisCount(): number;
|
|
25
|
-
get plotAreaBackgroundColor(): Color;
|
|
26
|
-
get showLegend(): boolean;
|
|
27
|
-
get showPlotAreaBorder(): boolean;
|
|
28
|
-
get showToolbar(): boolean;
|
|
29
28
|
get title(): string;
|
|
30
29
|
get titleFont(): Font;
|
|
31
30
|
get traceCount(): number;
|
|
32
|
-
get
|
|
31
|
+
get plotAreaBackgroundColor(): Color;
|
|
32
|
+
get showPlotAreaBorder(): boolean;
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamcs/opi",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "OPI Display Renderer",
|
|
5
5
|
"author": "Yamcs Team <yamcs@spaceapplications.com>",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rollup -c",
|
|
14
14
|
"clean": "rm -rf dist",
|
|
15
|
-
"prepublishOnly": "
|
|
15
|
+
"prepublishOnly": "npm run build",
|
|
16
16
|
"watch": "rollup -cw",
|
|
17
17
|
"peggy": "cd src/pv/formulas && peggy --format es -o parser.js formula-grammar.peggy",
|
|
18
18
|
"start": "node ./demo/server.js"
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"dist/"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@rollup/plugin-commonjs": "^
|
|
27
|
+
"@rollup/plugin-commonjs": "^21.0.2",
|
|
28
28
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
29
29
|
"@types/fontfaceobserver": "2.1.0",
|
|
30
|
-
"@types/node": "^14.
|
|
31
|
-
"express": "^4.17.
|
|
30
|
+
"@types/node": "^14.18.12",
|
|
31
|
+
"express": "^4.17.3",
|
|
32
32
|
"fontfaceobserver": "^2.0.13",
|
|
33
33
|
"morgan": "^1.10.0",
|
|
34
34
|
"nunjucks": "^3.2.2",
|
|
35
35
|
"peggy": "^1.2.0",
|
|
36
|
-
"rollup": "^2.
|
|
36
|
+
"rollup": "^2.68.0",
|
|
37
37
|
"rollup-plugin-copy": "^3.3.0",
|
|
38
38
|
"rollup-plugin-terser": "^7.0.2",
|
|
39
|
-
"rollup-plugin-typescript2": "^0.
|
|
39
|
+
"rollup-plugin-typescript2": "^0.31.2",
|
|
40
40
|
"typescript": "^4.3.5"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Color } from '../../Color';
|
|
2
|
-
import { Font } from '../../Font';
|
|
3
|
-
import { LinearScale } from './LinearScale';
|
|
4
|
-
import { XYGraph } from './XYGraph';
|
|
5
|
-
export declare class Axis {
|
|
6
|
-
private widget;
|
|
7
|
-
private i;
|
|
8
|
-
linearScale?: LinearScale;
|
|
9
|
-
private _effectiveMinimum?;
|
|
10
|
-
private _effectiveMaximum?;
|
|
11
|
-
constructor(widget: XYGraph, i: number);
|
|
12
|
-
get scale(): number;
|
|
13
|
-
private getValue;
|
|
14
|
-
isDateEnabled(): boolean;
|
|
15
|
-
isHorizontal(): boolean;
|
|
16
|
-
isVertical(): boolean;
|
|
17
|
-
isPrimary(): boolean;
|
|
18
|
-
get effectiveMinimum(): number;
|
|
19
|
-
set effectiveMinimum(effectiveMinimum: number);
|
|
20
|
-
get effectiveMaximum(): number;
|
|
21
|
-
set effectiveMaximum(effectiveMaximum: number);
|
|
22
|
-
applyZoom(center: number, ratio: number): void;
|
|
23
|
-
get autoScale(): boolean;
|
|
24
|
-
get autoScaleTreshold(): number;
|
|
25
|
-
get axisColor(): Color;
|
|
26
|
-
get axisTitle(): string;
|
|
27
|
-
get dashGridLine(): boolean;
|
|
28
|
-
get gridColor(): Color;
|
|
29
|
-
get leftBottomSide(): boolean;
|
|
30
|
-
get logScale(): boolean;
|
|
31
|
-
private get maximum();
|
|
32
|
-
private get minimum();
|
|
33
|
-
get scaleFont(): Font;
|
|
34
|
-
get scaleFormat(): string;
|
|
35
|
-
get showGrid(): boolean;
|
|
36
|
-
get timeFormat(): number;
|
|
37
|
-
get titleFont(): Font;
|
|
38
|
-
get visible(): boolean;
|
|
39
|
-
get yAxis(): boolean;
|
|
40
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Color } from '../../Color';
|
|
2
|
-
import { Graphics } from '../../Graphics';
|
|
3
|
-
import { Point } from '../../positioning';
|
|
4
|
-
import { XYGraph } from './XYGraph';
|
|
5
|
-
export declare class Trace {
|
|
6
|
-
private widget;
|
|
7
|
-
private i;
|
|
8
|
-
private traceData?;
|
|
9
|
-
private xPVInstance?;
|
|
10
|
-
private yPVInstance?;
|
|
11
|
-
private xPVListener;
|
|
12
|
-
private yPVListener;
|
|
13
|
-
constructor(widget: XYGraph, i: number);
|
|
14
|
-
init(): void;
|
|
15
|
-
snapshot(): import("./TraceBuffer").Sample[];
|
|
16
|
-
drawTrace(g: Graphics, points: Point[]): void;
|
|
17
|
-
drawPoint(g: Graphics, point: Point): void;
|
|
18
|
-
clearData(): void;
|
|
19
|
-
get scale(): number;
|
|
20
|
-
private getValue;
|
|
21
|
-
get antiAlias(): boolean;
|
|
22
|
-
get bufferSize(): number;
|
|
23
|
-
get concatenateData(): boolean;
|
|
24
|
-
get lineWidth(): number;
|
|
25
|
-
get name(): string;
|
|
26
|
-
get plotMode(): number;
|
|
27
|
-
get pointSize(): number;
|
|
28
|
-
get pointStyle(): number;
|
|
29
|
-
get traceColor(): Color;
|
|
30
|
-
get traceType(): number;
|
|
31
|
-
get updateDelay(): number;
|
|
32
|
-
get updateMode(): number;
|
|
33
|
-
get visible(): boolean;
|
|
34
|
-
get xAxisIndex(): number;
|
|
35
|
-
get xPV(): string;
|
|
36
|
-
get yAxisIndex(): number;
|
|
37
|
-
get yPV(): string;
|
|
38
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface Sample {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
}
|
|
5
|
-
export declare class TraceBuffer {
|
|
6
|
-
private bufferSize;
|
|
7
|
-
private plotMode;
|
|
8
|
-
private updateMode;
|
|
9
|
-
private concatenateData;
|
|
10
|
-
private chronological;
|
|
11
|
-
private traceData;
|
|
12
|
-
private x;
|
|
13
|
-
private xPending;
|
|
14
|
-
private y;
|
|
15
|
-
private yTimestamp?;
|
|
16
|
-
private yPending;
|
|
17
|
-
private xArray;
|
|
18
|
-
private xArrayPending;
|
|
19
|
-
private yArray;
|
|
20
|
-
private yArrayPending;
|
|
21
|
-
constructor(bufferSize: number, plotMode: number, updateMode: number, concatenateData: boolean, chronological: boolean);
|
|
22
|
-
clear(): void;
|
|
23
|
-
snapshot(): Sample[];
|
|
24
|
-
updateX(x: number): void;
|
|
25
|
-
updateY(y: number, timestamp?: number): void;
|
|
26
|
-
updateXArray(xArray: number[]): void;
|
|
27
|
-
updateYArray(yArray: number[]): void;
|
|
28
|
-
private maybeAddPoint;
|
|
29
|
-
private maybeAddArray;
|
|
30
|
-
private addPoint;
|
|
31
|
-
private addArray;
|
|
32
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Color } from '../../Color';
|
|
2
|
-
import { Display } from '../../Display';
|
|
3
|
-
import { Font } from '../../Font';
|
|
4
|
-
import { Graphics } from '../../Graphics';
|
|
5
|
-
import { Widget } from '../../Widget';
|
|
6
|
-
import { AbstractContainerWidget } from '../others/AbstractContainerWidget';
|
|
7
|
-
import { LinearScale } from './LinearScale';
|
|
8
|
-
declare class Axis {
|
|
9
|
-
private widget;
|
|
10
|
-
private i;
|
|
11
|
-
linearScale?: LinearScale;
|
|
12
|
-
constructor(widget: XYGraph2, i: number);
|
|
13
|
-
get scale(): number;
|
|
14
|
-
private getValue;
|
|
15
|
-
isDateEnabled(): boolean;
|
|
16
|
-
get autoScale(): boolean;
|
|
17
|
-
get autoScaleTreshold(): number;
|
|
18
|
-
get axisColor(): Color;
|
|
19
|
-
get axisTitle(): string;
|
|
20
|
-
get dashGridLine(): boolean;
|
|
21
|
-
get gridColor(): Color;
|
|
22
|
-
get logScale(): boolean;
|
|
23
|
-
get maximum(): number;
|
|
24
|
-
get minimum(): number;
|
|
25
|
-
get scaleFont(): Font;
|
|
26
|
-
get scaleFormat(): string;
|
|
27
|
-
get showGrid(): boolean;
|
|
28
|
-
get timeFormat(): number;
|
|
29
|
-
get titleFont(): Font;
|
|
30
|
-
get visible(): boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare class XYGraph2 extends Widget {
|
|
33
|
-
private axes;
|
|
34
|
-
private traces;
|
|
35
|
-
constructor(display: Display, parent: AbstractContainerWidget);
|
|
36
|
-
init(): void;
|
|
37
|
-
draw(g: Graphics): void;
|
|
38
|
-
private drawPlotArea;
|
|
39
|
-
getAxis(index: number): Axis;
|
|
40
|
-
get axisCount(): number;
|
|
41
|
-
get plotAreaBackgroundColor(): Color;
|
|
42
|
-
get showPlotAreaBorder(): boolean;
|
|
43
|
-
get traceCount(): number;
|
|
44
|
-
get transparent(): boolean;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Graphics } from '../../Graphics';
|
|
2
|
-
import { HitRegionSpecification } from '../../HitRegionSpecification';
|
|
3
|
-
import { Bounds } from '../../positioning';
|
|
4
|
-
import { XYGraph } from './XYGraph';
|
|
5
|
-
declare class Button {
|
|
6
|
-
private imageFile;
|
|
7
|
-
private disabledImageFile;
|
|
8
|
-
private action;
|
|
9
|
-
readonly imageElement: HTMLImageElement;
|
|
10
|
-
readonly disabledImageElement: HTMLImageElement;
|
|
11
|
-
readonly loadPromise: Promise<void>;
|
|
12
|
-
readonly disabledLoadPromise: Promise<void>;
|
|
13
|
-
toggleButton: boolean;
|
|
14
|
-
toolButton: boolean;
|
|
15
|
-
pushed: boolean;
|
|
16
|
-
disabled: boolean;
|
|
17
|
-
region: HitRegionSpecification;
|
|
18
|
-
constructor(toolbar: XYGraphToolbar, imageFile: string, disabledImageFile: string, tooltip: string, action: () => void);
|
|
19
|
-
loadImage(prefix: string): void;
|
|
20
|
-
}
|
|
21
|
-
export declare class XYGraphToolbar {
|
|
22
|
-
readonly xyGraph: XYGraph;
|
|
23
|
-
private buttons;
|
|
24
|
-
private showLegend;
|
|
25
|
-
private autoScale;
|
|
26
|
-
private rubberbandZoom;
|
|
27
|
-
private horizontalZoom;
|
|
28
|
-
private verticalZoom;
|
|
29
|
-
private zoomIn;
|
|
30
|
-
private zoomOut;
|
|
31
|
-
private panning;
|
|
32
|
-
private mouseArrow;
|
|
33
|
-
private undo;
|
|
34
|
-
private redo;
|
|
35
|
-
private camera;
|
|
36
|
-
private imagesLoaded;
|
|
37
|
-
currentTool: 'rubberband-zoom' | 'horizontal-zoom' | 'vertical-zoom' | 'zoom-in' | 'zoom-out' | 'default';
|
|
38
|
-
private commandBuffer;
|
|
39
|
-
constructor(xyGraph: XYGraph);
|
|
40
|
-
updateState(): void;
|
|
41
|
-
toggleTool(button: Button): void;
|
|
42
|
-
private createToolButton;
|
|
43
|
-
private createToggleButton;
|
|
44
|
-
private createButton;
|
|
45
|
-
draw(g: Graphics, area: Bounds): number;
|
|
46
|
-
private drawSeparator;
|
|
47
|
-
private drawButton;
|
|
48
|
-
get scale(): number;
|
|
49
|
-
get buttonSize(): number;
|
|
50
|
-
}
|
|
51
|
-
export {};
|