@yamcs/opi 1.3.14 → 1.4.1
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 +0 -66
- package/dist/opi.js +20 -19
- package/dist/opi.js.map +4 -4
- package/dist/opi.standalone.js +19 -18
- package/dist/types/Bevel.d.ts +16 -0
- package/dist/types/DecimalFormat.d.ts +8 -0
- package/dist/types/Display.d.ts +84 -2
- package/dist/types/EventHandler.d.ts +10 -0
- package/dist/types/Font.d.ts +2 -0
- package/dist/types/Graphics.d.ts +69 -6
- package/dist/types/HitRegionSpecification.d.ts +1 -0
- package/dist/types/Widget.d.ts +11 -0
- package/dist/types/XMLNode.d.ts +12 -0
- package/dist/types/actions/Action.d.ts +2 -0
- package/dist/types/actions/ExecuteCommandAction.d.ts +1 -1
- package/dist/types/actions/ExecuteJavaScriptAction.d.ts +1 -1
- package/dist/types/actions/OpenDisplayAction.d.ts +1 -1
- package/dist/types/actions/OpenFileAction.d.ts +1 -1
- package/dist/types/actions/OpenWebpageAction.d.ts +1 -1
- package/dist/types/actions/PlaySoundAction.d.ts +1 -1
- package/dist/types/actions/RunCommandAction.d.ts +1 -1
- package/dist/types/actions/RunProcedureAction.d.ts +1 -1
- package/dist/types/actions/RunStackAction.d.ts +1 -1
- package/dist/types/actions/WritePVAction.d.ts +1 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/positioning.d.ts +14 -0
- package/dist/types/properties.d.ts +2 -0
- package/dist/types/pv/LocalPV.d.ts +2 -2
- package/dist/types/pv/PVEngine.d.ts +23 -1
- package/dist/types/pv/formulas/parser.d.ts +3 -3
- package/dist/types/scale.d.ts +22 -0
- package/dist/types/scripting/ArrayWrapper.d.ts +21 -0
- package/dist/types/scripting/Java.d.ts +1 -1
- package/dist/types/scripting/PVUtil.d.ts +1 -1
- package/dist/types/scripting/PVWrapper.d.ts +1 -0
- package/dist/types/scripting/WidgetWrapper.d.ts +2 -0
- package/dist/types/widgets/controls/ActionButton.d.ts +7 -0
- package/dist/types/widgets/controls/BooleanButton.d.ts +4 -0
- package/dist/types/widgets/controls/BooleanSwitch.d.ts +4 -0
- package/dist/types/widgets/controls/CheckBox.d.ts +2 -0
- package/dist/types/widgets/controls/ImageBooleanButton.d.ts +16 -0
- package/dist/types/widgets/controls/Knob.d.ts +64 -0
- package/dist/types/widgets/controls/ScaledSlider.d.ts +81 -0
- package/dist/types/widgets/controls/Spinner.d.ts +49 -0
- package/dist/types/widgets/controls/TextInput.d.ts +17 -2
- package/dist/types/widgets/controls/ThumbWheel.d.ts +42 -0
- package/dist/types/widgets/figures/Ramp.d.ts +1 -1
- package/dist/types/widgets/figures/Scale.d.ts +64 -0
- package/dist/types/widgets/graphics/ImageWidget.d.ts +56 -0
- package/dist/types/widgets/graphics/Label.d.ts +36 -0
- package/dist/types/widgets/graphics/Polygon.d.ts +30 -0
- package/dist/types/widgets/graphics/Polyline.d.ts +36 -0
- package/dist/types/widgets/monitors/Gauge.d.ts +6 -0
- package/dist/types/widgets/monitors/ImageBooleanIndicator.d.ts +18 -0
- package/dist/types/widgets/monitors/IntensityGraph.d.ts +46 -0
- package/dist/types/widgets/monitors/IntensityGraphRegion.d.ts +15 -0
- package/dist/types/widgets/monitors/Meter.d.ts +9 -0
- package/dist/types/widgets/monitors/TextUpdate.d.ts +10 -0
- package/dist/types/widgets/monitors/xygraph/Axis.d.ts +1 -1
- package/dist/types/widgets/others/AbstractContainerWidget.d.ts +8 -0
- package/dist/types/widgets/others/ArrayWidget.d.ts +97 -0
- package/dist/types/widgets/others/Connection.d.ts +58 -0
- package/dist/types/widgets/others/DisplayWidget.d.ts +3 -1
- package/dist/types/widgets/others/GridLayout.d.ts +25 -0
- package/dist/types/widgets/others/GroupingContainer.d.ts +60 -0
- package/dist/types/widgets/others/LinkingContainer.d.ts +25 -3
- package/dist/types/widgets/others/SashContainer.d.ts +29 -0
- package/package.json +2 -2
- package/dist/types/widgets/graphics/ImageHelper.d.ts +0 -3
|
@@ -4,16 +4,52 @@ import { Point } from "../../positioning";
|
|
|
4
4
|
import { Widget } from "../../Widget";
|
|
5
5
|
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
6
6
|
export declare class Polyline extends Widget {
|
|
7
|
+
private zeroDegreePoints;
|
|
8
|
+
private originPoints?;
|
|
7
9
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
10
|
+
init(): void;
|
|
11
|
+
private updateZeroDegreePoints;
|
|
12
|
+
/**
|
|
13
|
+
* Mirrors AbstractPolyModel#doScale() in the Java reference, which is a
|
|
14
|
+
* two-step process, not a single uniform scale of each point:
|
|
15
|
+
*
|
|
16
|
+
* 1. The shape's bounding-box anchor (its own top-left corner) moves by
|
|
17
|
+
* the FULL, unclamped widthRatio/heightRatio - same as any other
|
|
18
|
+
* widget's x/y always does, regardless of its own ScaleOptions - so
|
|
19
|
+
* the shape's position keeps up with the rest of the layout even when
|
|
20
|
+
* the display auto-scales non-uniformly.
|
|
21
|
+
* 2. Only the points' offsets *relative to that already-repositioned
|
|
22
|
+
* anchor* are then scaled by the ratio clamped against ScaleOptions
|
|
23
|
+
* (e.g. keep_wh_ratio, which defaults to true for polylines) - so
|
|
24
|
+
* it's just the shape's own internal proportions that stay locked,
|
|
25
|
+
* not its position. Collapsing both steps into one clamped scale of
|
|
26
|
+
* the absolute points (as an earlier version of this method did)
|
|
27
|
+
* makes a keep_wh_ratio polyline barely move at all under
|
|
28
|
+
* non-uniform scaling, clustering near its design position instead
|
|
29
|
+
* of tracking the layout.
|
|
30
|
+
*/
|
|
31
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
8
32
|
draw(g: Graphics): void;
|
|
9
33
|
private drawFill;
|
|
34
|
+
/**
|
|
35
|
+
* Bounds of the shaft points plus any arrowhead wings, expanded by half
|
|
36
|
+
* the line width. Arrowheads can extend past the raw points' bounding
|
|
37
|
+
* box, so the fill-level clip needs to account for them too, or an
|
|
38
|
+
* arrowhead sitting outside the shaft's bounds never gets painted with
|
|
39
|
+
* the foreground (fill) color and is stuck showing the background color.
|
|
40
|
+
* Mirrors PolylineFigure#getBounds()/getPointsBoundsWithArrows() in
|
|
41
|
+
* Yamcs Studio.
|
|
42
|
+
*/
|
|
43
|
+
private getFillBounds;
|
|
10
44
|
private drawShape;
|
|
45
|
+
private drawArrowhead;
|
|
11
46
|
private calculateArrowPoints;
|
|
12
47
|
get alpha(): number;
|
|
13
48
|
get lineWidth(): number;
|
|
14
49
|
get fillLevel(): number;
|
|
15
50
|
get horizontalFill(): boolean;
|
|
16
51
|
get points(): Point[];
|
|
52
|
+
get rotationAngle(): number;
|
|
17
53
|
get arrows(): number;
|
|
18
54
|
get fillArrow(): boolean;
|
|
19
55
|
get arrowLength(): number;
|
|
@@ -9,6 +9,7 @@ export declare class Gauge extends Widget {
|
|
|
9
9
|
draw(g: Graphics): void;
|
|
10
10
|
private drawBackground;
|
|
11
11
|
private drawRamp;
|
|
12
|
+
private drawScale;
|
|
12
13
|
private drawLabel;
|
|
13
14
|
private drawNeedle;
|
|
14
15
|
private drawNeedleCenter;
|
|
@@ -31,10 +32,15 @@ export declare class Gauge extends Widget {
|
|
|
31
32
|
get levelHiHi(): number;
|
|
32
33
|
get limitsFromPv(): boolean;
|
|
33
34
|
get logScale(): boolean;
|
|
35
|
+
get majorTickStepHint(): number;
|
|
34
36
|
get minimum(): number;
|
|
35
37
|
get maximum(): number;
|
|
36
38
|
get needleColor(): Color;
|
|
37
39
|
get rampGradient(): boolean;
|
|
40
|
+
get scaleFont(): Font;
|
|
41
|
+
get scaleFormat(): string;
|
|
42
|
+
get showMinorTicks(): boolean;
|
|
38
43
|
get showRamp(): boolean;
|
|
44
|
+
get showScale(): boolean;
|
|
39
45
|
get valueLabelFormat(): string;
|
|
40
46
|
}
|
|
@@ -13,7 +13,25 @@ export declare class ImageBooleanIndicator extends Widget {
|
|
|
13
13
|
get booleanValue(): boolean;
|
|
14
14
|
get image(): string;
|
|
15
15
|
get label(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Mirrors ImageBoolIndicatorEditPart#autoSizeWidget(): once the
|
|
18
|
+
* currently-shown (on/off) image has loaded, snap the widget's own
|
|
19
|
+
* width/height to that image's natural size - unless stretch_to_fit is
|
|
20
|
+
* set, in which case the image follows the widget's declared bounds
|
|
21
|
+
* instead, so there's nothing to auto-size to.
|
|
22
|
+
*/
|
|
23
|
+
private applyAutoSize;
|
|
24
|
+
/**
|
|
25
|
+
* Position always follows the auto-scale ratio (set unconditionally by
|
|
26
|
+
* the base autoScale). Size only follows the ratio when stretch_to_fit
|
|
27
|
+
* is set; otherwise it's snapped back to the shown image's natural size,
|
|
28
|
+
* mirroring ImageBoolIndicatorEditPart's PROP_WIDTH/PROP_HEIGHT change
|
|
29
|
+
* handlers re-invoking autoSizeWidget() on every resize.
|
|
30
|
+
*/
|
|
31
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
16
32
|
draw(g: Graphics): void;
|
|
33
|
+
get autoSize(): boolean;
|
|
34
|
+
get stretchToFit(): boolean;
|
|
17
35
|
get bit(): number;
|
|
18
36
|
get dataType(): number;
|
|
19
37
|
get showBooleanLabel(): boolean;
|
|
@@ -3,12 +3,53 @@ import { ColorMap } from "../../ColorMap";
|
|
|
3
3
|
import { Display } from "../../Display";
|
|
4
4
|
import { Font } from "../../Font";
|
|
5
5
|
import { Graphics } from "../../Graphics";
|
|
6
|
+
import { Bounds } from "../../positioning";
|
|
6
7
|
import { Widget } from "../../Widget";
|
|
7
8
|
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
8
9
|
export declare class IntensityGraph extends Widget {
|
|
10
|
+
private region?;
|
|
11
|
+
private xScale?;
|
|
12
|
+
private yScale?;
|
|
13
|
+
private graphAreaX;
|
|
14
|
+
private graphAreaY;
|
|
15
|
+
private renderedGraphAreaWidth;
|
|
16
|
+
private renderedGraphAreaHeight;
|
|
17
|
+
private _effectiveCropLeft?;
|
|
18
|
+
private _effectiveCropRight?;
|
|
19
|
+
private _effectiveCropTop?;
|
|
20
|
+
private _effectiveCropBottom?;
|
|
21
|
+
private _effectiveXAxisMinimum?;
|
|
22
|
+
private _effectiveXAxisMaximum?;
|
|
23
|
+
private _effectiveYAxisMinimum?;
|
|
24
|
+
private _effectiveYAxisMaximum?;
|
|
25
|
+
private originalState?;
|
|
9
26
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
27
|
+
init(): void;
|
|
10
28
|
draw(g: Graphics): void;
|
|
29
|
+
applyRubberBandZoom(selection: Bounds): void;
|
|
30
|
+
/** Ports IntensityGraphFigure.java's mouseDoubleClicked() zoom reset. */
|
|
31
|
+
resetZoom(): void;
|
|
32
|
+
private pushProfilePV;
|
|
33
|
+
private applyColorDepth;
|
|
34
|
+
private pixelValueAt;
|
|
35
|
+
get effectiveCropLeft(): number;
|
|
36
|
+
set effectiveCropLeft(v: number);
|
|
37
|
+
get effectiveCropRight(): number;
|
|
38
|
+
set effectiveCropRight(v: number);
|
|
39
|
+
get effectiveCropTop(): number;
|
|
40
|
+
set effectiveCropTop(v: number);
|
|
41
|
+
get effectiveCropBottom(): number;
|
|
42
|
+
set effectiveCropBottom(v: number);
|
|
43
|
+
get effectiveXAxisMinimum(): number;
|
|
44
|
+
set effectiveXAxisMinimum(v: number);
|
|
45
|
+
get effectiveXAxisMaximum(): number;
|
|
46
|
+
set effectiveXAxisMaximum(v: number);
|
|
47
|
+
get effectiveYAxisMinimum(): number;
|
|
48
|
+
set effectiveYAxisMinimum(v: number);
|
|
49
|
+
get effectiveYAxisMaximum(): number;
|
|
50
|
+
set effectiveYAxisMaximum(v: number);
|
|
11
51
|
get gap(): number;
|
|
52
|
+
get colorDepth(): number;
|
|
12
53
|
get colorMap(): ColorMap;
|
|
13
54
|
get cropBottom(): number;
|
|
14
55
|
get cropLeft(): number;
|
|
@@ -19,8 +60,13 @@ export declare class IntensityGraph extends Widget {
|
|
|
19
60
|
get font(): Font;
|
|
20
61
|
get graphAreaHeight(): number;
|
|
21
62
|
get graphAreaWidth(): number;
|
|
63
|
+
get horizonProfileXPvName(): string;
|
|
64
|
+
get horizonProfileYPvName(): string;
|
|
65
|
+
get verticalProfileXPvName(): string;
|
|
66
|
+
get verticalProfileYPvName(): string;
|
|
22
67
|
get maximum(): number;
|
|
23
68
|
get minimum(): number;
|
|
69
|
+
get rgbMode(): boolean;
|
|
24
70
|
get showRamp(): boolean;
|
|
25
71
|
get xAxisAxisColor(): Color;
|
|
26
72
|
get xAxisAxisTitle(): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpiGrabEvent, OpiMouseEvent } from "../../EventHandler";
|
|
2
|
+
import { HitRegionSpecification } from "../../HitRegionSpecification";
|
|
3
|
+
import { Bounds } from "../../positioning";
|
|
4
|
+
import { IntensityGraph } from "./IntensityGraph";
|
|
5
|
+
export declare class IntensityGraphRegion implements HitRegionSpecification {
|
|
6
|
+
private widget;
|
|
7
|
+
id: string;
|
|
8
|
+
selection?: Bounds;
|
|
9
|
+
private grabStart?;
|
|
10
|
+
constructor(id: string, widget: IntensityGraph);
|
|
11
|
+
mouseDown(evt: OpiMouseEvent): void;
|
|
12
|
+
grab(evt: OpiGrabEvent): void;
|
|
13
|
+
grabEnd(): void;
|
|
14
|
+
dblclick(): void;
|
|
15
|
+
}
|
|
@@ -9,6 +9,7 @@ export declare class Meter extends Widget {
|
|
|
9
9
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
10
10
|
init(): void;
|
|
11
11
|
draw(g: Graphics): void;
|
|
12
|
+
private computeLimits;
|
|
12
13
|
private drawRamp;
|
|
13
14
|
private drawNeedle;
|
|
14
15
|
get needleWidth(): number;
|
|
@@ -24,16 +25,24 @@ export declare class Meter extends Widget {
|
|
|
24
25
|
get levelLoLo(): number;
|
|
25
26
|
get levelHi(): number;
|
|
26
27
|
get levelHiHi(): number;
|
|
28
|
+
get limitsFromPv(): boolean;
|
|
27
29
|
get logScale(): boolean;
|
|
30
|
+
get majorTickStepHint(): number;
|
|
31
|
+
get majorTickLength(): number;
|
|
32
|
+
get minorTickLength(): number;
|
|
28
33
|
get minimum(): number;
|
|
29
34
|
get maximum(): number;
|
|
30
35
|
get needleColor(): Color;
|
|
31
36
|
get rampGradient(): boolean;
|
|
32
37
|
get scaleFont(): Font;
|
|
38
|
+
get scaleFormat(): string;
|
|
33
39
|
get showLo(): boolean;
|
|
34
40
|
get showLoLo(): boolean;
|
|
35
41
|
get showHi(): boolean;
|
|
36
42
|
get showHiHi(): boolean;
|
|
43
|
+
get showMinorTicks(): boolean;
|
|
37
44
|
get showRamp(): boolean;
|
|
45
|
+
get showScale(): boolean;
|
|
46
|
+
get showValueLabel(): boolean;
|
|
38
47
|
get valueLabelFormat(): string;
|
|
39
48
|
}
|
|
@@ -8,13 +8,23 @@ export declare class TextUpdate extends Widget {
|
|
|
8
8
|
private tooltipRegion?;
|
|
9
9
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
10
10
|
init(): void;
|
|
11
|
+
drawHolder(g: Graphics): void;
|
|
12
|
+
private computeDisplayText;
|
|
11
13
|
draw(g: Graphics): void;
|
|
14
|
+
private drawSingleLine;
|
|
15
|
+
private drawRotated;
|
|
16
|
+
private drawWrapped;
|
|
17
|
+
private wrapText;
|
|
18
|
+
private wrapLine;
|
|
19
|
+
get autoSize(): boolean;
|
|
12
20
|
get font(): Font;
|
|
13
21
|
get formatType(): number;
|
|
14
22
|
get horizAlignment(): number;
|
|
15
23
|
get precision(): number;
|
|
16
24
|
get precisionFromPV(): boolean;
|
|
25
|
+
get rotationAngle(): number;
|
|
17
26
|
get showLohi(): boolean;
|
|
18
27
|
get showUnits(): boolean;
|
|
19
28
|
get vertAlignment(): number;
|
|
29
|
+
get wrapWords(): boolean;
|
|
20
30
|
}
|
|
@@ -22,7 +22,7 @@ export declare class Axis {
|
|
|
22
22
|
performAutoScale(): void;
|
|
23
23
|
applyZoom(center: number, ratio: number): void;
|
|
24
24
|
get autoScale(): boolean;
|
|
25
|
-
get
|
|
25
|
+
get autoScaleThreshold(): number;
|
|
26
26
|
get axisColor(): Color;
|
|
27
27
|
get axisTitle(): string;
|
|
28
28
|
get dashGridLine(): boolean;
|
|
@@ -14,6 +14,14 @@ export declare abstract class AbstractContainerWidget extends Widget {
|
|
|
14
14
|
findWidget(wuid: string): Widget | undefined;
|
|
15
15
|
findWidgetByName(name: string): Widget | undefined;
|
|
16
16
|
hide(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Repositions/resizes this container itself, then recurses into its
|
|
19
|
+
* direct children. Containers whose children are laid out by their own
|
|
20
|
+
* bespoke mechanism (SashContainer panels, ArrayWidget slots, a
|
|
21
|
+
* LinkingContainer's embedded display) override this to scale only
|
|
22
|
+
* themselves, not their children.
|
|
23
|
+
*/
|
|
24
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
17
25
|
destroy(): void;
|
|
18
26
|
get widgets(): Widget[];
|
|
19
27
|
get connections(): Connection[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Display } from "../../Display";
|
|
2
|
+
import { Graphics } from "../../Graphics";
|
|
3
|
+
import { XMLNode } from "../../XMLNode";
|
|
4
|
+
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
5
|
+
/**
|
|
6
|
+
* Container that clones a single authored child widget (or child subtree)
|
|
7
|
+
* `vec` times and lays the clones out edge-to-edge, binding each clone to
|
|
8
|
+
* one element of an array-valued PV. An index spinner and scrollbar allow
|
|
9
|
+
* scrolling a window of `vec` visible clones over a possibly-larger array.
|
|
10
|
+
*
|
|
11
|
+
* Ported from org.csstudio.opibuilder.widgets.array (ArrayModel/ArrayFigure/
|
|
12
|
+
* ArrayEditPart). Unlike the Java original, clones are not literal sibling
|
|
13
|
+
* widgets sharing the array's own PV - each clone (and, for a grouped
|
|
14
|
+
* template, every PV-bound descendant of a clone) is given its own unique
|
|
15
|
+
* synthetic loc:// PV. This lets ordinary control widgets (TextInput,
|
|
16
|
+
* ScaledSlider, ...) work as writable per-element controls with zero
|
|
17
|
+
* Array-specific code in those widgets.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ArrayWidget extends AbstractContainerWidget {
|
|
20
|
+
private templateNode?;
|
|
21
|
+
private templateWidgetType;
|
|
22
|
+
private elementWidth;
|
|
23
|
+
private elementHeight;
|
|
24
|
+
private originalEnabled;
|
|
25
|
+
private scrollIndex;
|
|
26
|
+
private fullValue;
|
|
27
|
+
private redistributing;
|
|
28
|
+
private spinnerUpRegion?;
|
|
29
|
+
private spinnerUpPressed;
|
|
30
|
+
private spinnerDownRegion?;
|
|
31
|
+
private spinnerDownPressed;
|
|
32
|
+
private spinnerRepeatTimeout?;
|
|
33
|
+
private spinnerLabelRegion?;
|
|
34
|
+
private spinnerLabelBounds?;
|
|
35
|
+
private editingIndex;
|
|
36
|
+
private indexInputEl?;
|
|
37
|
+
private scrollDecreaseRegion?;
|
|
38
|
+
private scrollDecreasePressed;
|
|
39
|
+
private scrollIncreaseRegion?;
|
|
40
|
+
private scrollIncreasePressed;
|
|
41
|
+
private scrollPageDecreaseRegion?;
|
|
42
|
+
private scrollPageIncreaseRegion?;
|
|
43
|
+
private scrollThumbRegion?;
|
|
44
|
+
private scrollGrabStartIndex;
|
|
45
|
+
private scrollDragRange;
|
|
46
|
+
private scrollRepeatTimeout?;
|
|
47
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
48
|
+
parseNode(node: XMLNode): Promise<void>;
|
|
49
|
+
init(): void;
|
|
50
|
+
destroy(): void;
|
|
51
|
+
private forEachDescendant;
|
|
52
|
+
private startEditingIndex;
|
|
53
|
+
private commitEditingIndex;
|
|
54
|
+
private cancelEditingIndex;
|
|
55
|
+
private slotPvName;
|
|
56
|
+
private hookSlotWriteBack;
|
|
57
|
+
private coerceElement;
|
|
58
|
+
private defaultElementValue;
|
|
59
|
+
get value(): any;
|
|
60
|
+
set value(value: any);
|
|
61
|
+
get effectiveArrayLength(): number;
|
|
62
|
+
private redistribute;
|
|
63
|
+
private clampSpinnerIndex;
|
|
64
|
+
private clampScrollbarIndex;
|
|
65
|
+
private setSpinnerIndex;
|
|
66
|
+
private setScrollbarIndex;
|
|
67
|
+
/**
|
|
68
|
+
* Scripting entry point (ArrayWrapper#getArrayFigure().setIndex()).
|
|
69
|
+
* Matches ArrayFigure.setIndex()'s [0, arrayLength-1] range.
|
|
70
|
+
*/
|
|
71
|
+
setScrollIndex(index: number): void;
|
|
72
|
+
getScrollIndex(): number;
|
|
73
|
+
private stopSpinnerRepeating;
|
|
74
|
+
private stepSpinnerRepeatedly;
|
|
75
|
+
private stopScrollbarRepeating;
|
|
76
|
+
private stepScrollbarRepeatedly;
|
|
77
|
+
private computeRegions;
|
|
78
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
79
|
+
private layoutSlots;
|
|
80
|
+
beforeDrawBorder(g: Graphics): void;
|
|
81
|
+
draw(g: Graphics): void;
|
|
82
|
+
private drawGrayOverlay;
|
|
83
|
+
private drawSpinner;
|
|
84
|
+
private drawSpinnerLabel;
|
|
85
|
+
private drawScrollbar;
|
|
86
|
+
private registerPageRegion;
|
|
87
|
+
private drawThumb;
|
|
88
|
+
private drawBevelBorder;
|
|
89
|
+
private drawArrowButton;
|
|
90
|
+
get arrayLength(): number;
|
|
91
|
+
get spinnerWidth(): number;
|
|
92
|
+
get horizontal(): boolean;
|
|
93
|
+
get showSpinner(): boolean;
|
|
94
|
+
get showScrollbar(): boolean;
|
|
95
|
+
get vec(): number;
|
|
96
|
+
get dataType(): number;
|
|
97
|
+
}
|
|
@@ -12,7 +12,62 @@ export declare class Connection extends Widget {
|
|
|
12
12
|
draw(g: Graphics): void;
|
|
13
13
|
private drawPath;
|
|
14
14
|
private drawManhattanConnection;
|
|
15
|
+
/**
|
|
16
|
+
* When an arrowhead is filled, its endpoint is pulled back to the
|
|
17
|
+
* arrowhead's base so the (butt-capped) shaft stroke doesn't poke out
|
|
18
|
+
* past the narrower triangle tip. Mirrors Polyline's shaftPoints
|
|
19
|
+
* handling, and Yamcs Studio's PolylineFigure#drawPolyLineWithArrow(),
|
|
20
|
+
* which only performs this pullback for the filled (PolygonDecoration)
|
|
21
|
+
* case, not the unfilled line-arrow case.
|
|
22
|
+
*/
|
|
23
|
+
private getShaftEnd;
|
|
15
24
|
private getDashArray;
|
|
25
|
+
/**
|
|
26
|
+
* Ordered vertex list of this connection's own line, in whichever mode
|
|
27
|
+
* (manual points / Manhattan / direct) is currently active. Used both for
|
|
28
|
+
* this connection's own rendering, and so that other Connection widgets
|
|
29
|
+
* can query this connection's line when checking for crossings (see
|
|
30
|
+
* `strokeJumpAwarePath`). Deliberately excludes arrow shaft trimming and
|
|
31
|
+
* the drawPath half-pixel nudge, since those only affect the polyline's
|
|
32
|
+
* own first/last point and are irrelevant to mid-line crossings.
|
|
33
|
+
*/
|
|
34
|
+
private getVertices;
|
|
35
|
+
/**
|
|
36
|
+
* Strokes a connection's polyline, inserting a "jump" indicator
|
|
37
|
+
* (arc/gap/square/2-slides) wherever it crosses another connection's line,
|
|
38
|
+
* per `line_jump_add`/`line_jump_style`/`line_jump_size`. Falls back to a
|
|
39
|
+
* single continuous stroke (today's behavior, pixel-identical) when
|
|
40
|
+
* `line_jump_add` is NONE, which is the common case.
|
|
41
|
+
*
|
|
42
|
+
* Every non-gap style is folded into the SAME continuous `Path` as the
|
|
43
|
+
* surrounding plain line (extra `lineTo`s for the arc/square/slides
|
|
44
|
+
* shape, rather than a separate stroke call per shape) and stroked with
|
|
45
|
+
* one `strokePath` call per run. Two adjoining strokes of the same line
|
|
46
|
+
* never agree on anti-aliased sub-pixel coverage at their shared
|
|
47
|
+
* endpoint, which shows up as a hairline seam right at the jump — a
|
|
48
|
+
* single path has no such seam, since the canvas joins its interior
|
|
49
|
+
* vertices itself. A run only ends where the line should genuinely be
|
|
50
|
+
* interrupted (a GAP-style jump).
|
|
51
|
+
*/
|
|
52
|
+
private strokeJumpAwarePath;
|
|
53
|
+
/**
|
|
54
|
+
* Splits `vertices` into one or more runs of points to stroke as
|
|
55
|
+
* continuous paths, substituting the arc/square/2-slides jump shape's own
|
|
56
|
+
* vertices in-line wherever this connection's line crosses another
|
|
57
|
+
* connection's line, or (for the gap style) ending one run and starting
|
|
58
|
+
* the next past the crossing. Ported from Yamcs Studio's
|
|
59
|
+
* WidgetConnectionEditPart#getIntersectionPoints.
|
|
60
|
+
*/
|
|
61
|
+
private buildJumpAwareRuns;
|
|
62
|
+
/**
|
|
63
|
+
* Finds where the (axis-aligned) segment `x1y1`-`x2y2` of this
|
|
64
|
+
* connection's own line crosses any segment of any other connection,
|
|
65
|
+
* returning the intersection plus the two "notch" points on THIS segment
|
|
66
|
+
* offset `lineJumpSize` either side of it, sorted by distance from
|
|
67
|
+
* `x1y1`. Segments whose orientation doesn't match `line_jump_add` (or
|
|
68
|
+
* that are diagonal) are left alone, matching Yamcs Studio.
|
|
69
|
+
*/
|
|
70
|
+
private findCrossings;
|
|
16
71
|
private drawDirectConnection;
|
|
17
72
|
private getManhattanAnchor;
|
|
18
73
|
private getPosition;
|
|
@@ -28,6 +83,9 @@ export declare class Connection extends Widget {
|
|
|
28
83
|
get fillArrow(): boolean;
|
|
29
84
|
get arrowLength(): number;
|
|
30
85
|
get lineColor(): Color;
|
|
86
|
+
get lineJumpAdd(): number;
|
|
87
|
+
get lineJumpSize(): number;
|
|
88
|
+
get lineJumpStyle(): number;
|
|
31
89
|
get lineStyle(): number;
|
|
32
90
|
get lineWidth(): number;
|
|
33
91
|
get router(): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Display } from "../../Display";
|
|
2
2
|
import { Graphics } from "../../Graphics";
|
|
3
|
-
import { Bounds } from "../../positioning";
|
|
3
|
+
import { Bounds, Dimension } from "../../positioning";
|
|
4
4
|
import { AutoScaleWidgets } from "../../scale";
|
|
5
5
|
import { XMLNode } from "../../XMLNode";
|
|
6
6
|
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
@@ -13,4 +13,6 @@ export declare class DisplayWidget extends AbstractContainerWidget {
|
|
|
13
13
|
draw(g: Graphics): void;
|
|
14
14
|
measureContentBounds(scaled: boolean): Bounds;
|
|
15
15
|
get autoScaleWidgets(): AutoScaleWidgets;
|
|
16
|
+
/** The display's authored (design-time) size, unaffected by later autoScale() calls. */
|
|
17
|
+
get designSize(): Dimension;
|
|
16
18
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Display } from "../../Display";
|
|
2
|
+
import { Graphics } from "../../Graphics";
|
|
3
|
+
import { Widget } from "../../Widget";
|
|
4
|
+
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
5
|
+
/**
|
|
6
|
+
* A "virtual" widget that never renders itself. When present among a
|
|
7
|
+
* container's children, it repositions (and optionally resizes) its
|
|
8
|
+
* siblings into a grid, once, at parse time. See applyGridLayout().
|
|
9
|
+
*/
|
|
10
|
+
export declare class GridLayout extends Widget {
|
|
11
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
12
|
+
get numberOfColumns(): number;
|
|
13
|
+
get fillGrids(): boolean;
|
|
14
|
+
get gridGap(): number;
|
|
15
|
+
draw(g: Graphics): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* If `widgets` contains a GridLayout, repositions (and, if fill_grids is
|
|
19
|
+
* set, resizes) all of its siblings into a grid, in place. Mirrors
|
|
20
|
+
* GridLayoutEditpart#getNewBounds from the Java reference: row-major
|
|
21
|
+
* placement, column/row size driven by the widest/tallest sibling in that
|
|
22
|
+
* column/row, computed once from each sibling's own declared width/height
|
|
23
|
+
* (not the container's size, which is never consulted).
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyGridLayout(widgets: Widget[]): void;
|
|
@@ -1,8 +1,68 @@
|
|
|
1
|
+
import { Display } from "../../Display";
|
|
1
2
|
import { Graphics } from "../../Graphics";
|
|
2
3
|
import { XMLNode } from "../../XMLNode";
|
|
3
4
|
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
4
5
|
export declare class GroupingContainer extends AbstractContainerWidget {
|
|
6
|
+
private scrollX;
|
|
7
|
+
private scrollY;
|
|
8
|
+
private maxScrollX;
|
|
9
|
+
private maxScrollY;
|
|
10
|
+
private contentWidth;
|
|
11
|
+
private contentHeight;
|
|
12
|
+
private dragRangeX?;
|
|
13
|
+
private dragRangeY?;
|
|
14
|
+
private grabStartX?;
|
|
15
|
+
private grabStartY?;
|
|
16
|
+
private actionTimeout?;
|
|
17
|
+
private xDecPressed;
|
|
18
|
+
private xIncPressed;
|
|
19
|
+
private yDecPressed;
|
|
20
|
+
private yIncPressed;
|
|
21
|
+
private thumbXRegion?;
|
|
22
|
+
private thumbYRegion?;
|
|
23
|
+
private xDecRegion?;
|
|
24
|
+
private xIncRegion?;
|
|
25
|
+
private yDecRegion?;
|
|
26
|
+
private yIncRegion?;
|
|
27
|
+
private trackXBeforeRegion?;
|
|
28
|
+
private trackXAfterRegion?;
|
|
29
|
+
private trackYBeforeRegion?;
|
|
30
|
+
private trackYAfterRegion?;
|
|
31
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
5
32
|
parseNode(node: XMLNode): Promise<void>;
|
|
33
|
+
init(): void;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
private makeThumbRegion;
|
|
36
|
+
private makeStepRegion;
|
|
37
|
+
private makePageRegion;
|
|
38
|
+
private setScrollOffset;
|
|
39
|
+
private stepScrollRepeatedly;
|
|
40
|
+
private pageScrollRepeatedly;
|
|
41
|
+
private endScrollAction;
|
|
42
|
+
get forwardColors(): boolean;
|
|
43
|
+
get showScrollbar(): boolean;
|
|
6
44
|
beforeDrawBorder(g: Graphics): void;
|
|
45
|
+
/**
|
|
46
|
+
* Union of all visible children's bounds, unioned with this container's
|
|
47
|
+
* own viewport (never smaller than the visible area), matching draw2d's
|
|
48
|
+
* FreeformViewport#readjustScrollBars.
|
|
49
|
+
*/
|
|
50
|
+
private measureContentExtent;
|
|
51
|
+
/**
|
|
52
|
+
* Resolves scrollbar visibility one level deep, matching draw2d's
|
|
53
|
+
* ScrollPaneSolver: check overflow against the full (unreserved) viewport
|
|
54
|
+
* first, then check whether reserving one axis's thickness pushes the
|
|
55
|
+
* other axis into overflow too. Not a true iterative fixed-point solve -
|
|
56
|
+
* draw2d doesn't do that either.
|
|
57
|
+
*/
|
|
58
|
+
private resolveScrollbars;
|
|
7
59
|
draw(g: Graphics): void;
|
|
60
|
+
/**
|
|
61
|
+
* One drawing routine for both axes, matching draw2d's stock ScrollBar
|
|
62
|
+
* look: up/down (or left/right) bevel buttons plus a draggable thumb.
|
|
63
|
+
* Unlike Yamcs Studio, does not support mouse wheel, since neither does
|
|
64
|
+
* GroupingContainerFigure/ScrollPane there.
|
|
65
|
+
*/
|
|
66
|
+
private drawScrollbar;
|
|
67
|
+
private drawScrollButton;
|
|
8
68
|
}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
import { Display } from "../../Display";
|
|
2
2
|
import { Graphics } from "../../Graphics";
|
|
3
|
+
import { Widget } from "../../Widget";
|
|
3
4
|
import { XMLNode } from "../../XMLNode";
|
|
4
5
|
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
5
6
|
export declare class LinkingContainer extends AbstractContainerWidget {
|
|
6
7
|
private linkedDisplay?;
|
|
7
8
|
resolvedOpiFile?: string;
|
|
9
|
+
private reloadGeneration;
|
|
8
10
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
9
11
|
parseNode(node: XMLNode): Promise<void>;
|
|
10
12
|
init(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* (Re)loads the linked display from the current `opi_file` property.
|
|
15
|
+
* Called once during init(), and again whenever a Rule or script changes
|
|
16
|
+
* `opi_file` at runtime (mirrors Java's
|
|
17
|
+
* LinkingContainerEditpart#configureDisplayModel).
|
|
18
|
+
*/
|
|
19
|
+
private reload;
|
|
11
20
|
draw(g: Graphics): void;
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Content bounds to use for fitting/cropping. When `group_name` resolves to
|
|
23
|
+
* a specific named sub-widget (e.g. one "frame" of a dynamic symbol), use
|
|
24
|
+
* that widget's own bounds instead of the union of the whole linked
|
|
25
|
+
* display, so that sibling frames don't affect sizing/scaling.
|
|
26
|
+
*/
|
|
27
|
+
private measureFrameBounds;
|
|
28
|
+
/**
|
|
29
|
+
* Draws either the single named sub-widget matching `group_name`, or (when
|
|
30
|
+
* no group is selected) the entire linked display.
|
|
31
|
+
*/
|
|
32
|
+
private drawLinkedContent;
|
|
33
|
+
getLinkedWidget(): Widget | undefined;
|
|
34
|
+
get widgets(): Widget[];
|
|
14
35
|
get connections(): import("./Connection").Connection[];
|
|
15
|
-
|
|
36
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
37
|
+
findWidget(wuid: string): Widget | undefined;
|
|
16
38
|
get opiFile(): string;
|
|
17
39
|
get groupName(): string;
|
|
18
40
|
get resizeBehavior(): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Display } from "../../Display";
|
|
2
|
+
import { Graphics } from "../../Graphics";
|
|
3
|
+
import { XMLNode } from "../../XMLNode";
|
|
4
|
+
import { AbstractContainerWidget } from "./AbstractContainerWidget";
|
|
5
|
+
export declare class SashContainer extends AbstractContainerWidget {
|
|
6
|
+
private sashRegion?;
|
|
7
|
+
private grabStartPosition?;
|
|
8
|
+
private grabClientSize?;
|
|
9
|
+
private panelOriginSizes;
|
|
10
|
+
private childOriginBounds;
|
|
11
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
12
|
+
parseNode(node: XMLNode): Promise<void>;
|
|
13
|
+
init(): void;
|
|
14
|
+
beforeDrawBorder(g: Graphics): void;
|
|
15
|
+
draw(g: Graphics): void;
|
|
16
|
+
private measureLayout;
|
|
17
|
+
private applyPanelBounds;
|
|
18
|
+
private scalePanelChildren;
|
|
19
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
20
|
+
private drawSash;
|
|
21
|
+
private drawSashEdge;
|
|
22
|
+
get horizontal(): boolean;
|
|
23
|
+
get minPaneSize(): number;
|
|
24
|
+
get panel1AutoScaleChildren(): boolean;
|
|
25
|
+
get panel2AutoScaleChildren(): boolean;
|
|
26
|
+
get sashPosition(): number;
|
|
27
|
+
get sashStyle(): number;
|
|
28
|
+
get sashWidth(): number;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamcs/opi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "OPI Display Renderer",
|
|
5
5
|
"author": "Yamcs Team <yamcs@spaceapplications.com>",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"peggy": "5.1.0",
|
|
36
36
|
"prettier": "^3.5.3",
|
|
37
37
|
"tslib": "^2.6.3",
|
|
38
|
-
"typescript": "^
|
|
38
|
+
"typescript": "^7.0.2"
|
|
39
39
|
},
|
|
40
40
|
"allowScripts": {
|
|
41
41
|
"esbuild": true,
|