Browse Source

UI: Add completion for new scada api

pull/13292/head
Artem Dzhereleiko 1 year ago
parent
commit
b7081eed03
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
  2. 64
      ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts
  3. 1
      ui-ngx/src/app/shared/models/constants.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts

@ -84,7 +84,7 @@ export interface ScadaSymbolApi {
resetCssAnimation: (element: Element) => void;
finishCssAnimation: (element: Element) => void;
connectorAnimation:(element: Element) => ConnectorScadaSymbolAnimation | undefined;
connectorAnimate:(element: Element) => ConnectorScadaSymbolAnimation;
connectorAnimate:(element: Element, path: string, reversedPath: string) => ConnectorScadaSymbolAnimation;
resetConnectorAnimation: (element: Element) => void;
finishConnectorAnimation: (element: Element) => void;
disable: (element: Element | Element[]) => void;

64
ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts

@ -1129,6 +1129,8 @@ export const scadaSymbolContextCompletion = (metadata: ScadaSymbolMetadata, tags
const scadaSymbolAnimationLink = HelpLinks.linksMap.scadaSymbolDevAnimation;
const scadaSymbolAnimation = `<a href="${scadaSymbolAnimationLink}" target="_blank">ScadaSymbolAnimation</a>`;
const connectorScadaSymbolAnimationLink = HelpLinks.linksMap.scadaSymbolDevConnectorAnimation;
const connectorScadaSymbolAnimation = `<a href="${connectorScadaSymbolAnimationLink}" target="_blank">ConnectorScadaSymbolAnimation</a>`;
const properties: TbEditorCompletion = {
meta: 'object',
@ -1229,6 +1231,68 @@ export const scadaSymbolContextCompletion = (metadata: ScadaSymbolMetadata, tags
},
]
},
connectorAnimate: {
meta: 'function',
description: 'Finishes any previous connector animation and starts a new connector animation for the SVG element along the specified path.',
args: [
{
name: 'element',
description: 'SVG element',
type: 'Element'
},
{
name: 'path',
description: 'Path defining the animation trajectory',
type: 'string'
},
{
name: 'reversedPath',
description: 'Path for the reversed animation trajectory',
type: 'string'
}
],
return: {
description: `Instance of ${connectorScadaSymbolAnimation} class with API to setup and control the connector animation.`,
type: connectorScadaSymbolAnimation
}
},
connectorAnimation: {
meta: 'function',
description: 'Gets the current connector animation applied to the SVG element.',
args: [
{
name: 'element',
description: 'SVG element',
type: 'Element'
}
],
return: {
description: `Instance of ${connectorScadaSymbolAnimation} class with API to setup and control the connector animation, or undefined if no animation is applied.`,
type: 'ConnectorScadaSymbolAnimation | undefined'
}
},
resetConnectorAnimation: {
meta: 'function',
description: 'Stops the connector animation if any and restores the SVG element to its initial state, removes the connector animation instance.',
args: [
{
name: 'element',
description: 'SVG element',
type: 'Element'
}
]
},
finishConnectorAnimation: {
meta: 'function',
description: 'Finishes the connector animation if any, updates the SVG element state according to the end animation values, removes the connector animation instance.',
args: [
{
name: 'element',
description: 'SVG element',
type: 'Element'
}
]
},
generateElementId: {
meta: 'function',
description: 'Generates new unique element id.',

1
ui-ngx/src/app/shared/models/constants.ts

@ -194,6 +194,7 @@ export const HelpLinks = {
scada: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada`,
scadaSymbolDev: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/`,
scadaSymbolDevAnimation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/#scadasymbolanimation`,
scadaSymbolDevConnectorAnimation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/#connectorscadasymbolanimation`,
domains: `${helpBaseUrl}/docs${docPlatformPrefix}/domains`,
mobileApplication: `${helpBaseUrl}/docs${docPlatformPrefix}/mobile-center/applications/`,
mobileBundle: `${helpBaseUrl}/docs${docPlatformPrefix}/mobile-center/mobile-center/`,

Loading…
Cancel
Save