UI: SCADA - Remove old animation methods.
This commit is contained in:
		
							parent
							
								
									bb96c12662
								
							
						
					
					
						commit
						aa3f8b757f
					
				@ -72,9 +72,6 @@ export interface ScadaSymbolApi {
 | 
			
		||||
  text: (element: Element | Element[], text: string) => void;
 | 
			
		||||
  font: (element: Element | Element[], font: Font, color: string) => void;
 | 
			
		||||
  icon: (element: Element | Element[], icon: string, size?: number, color?: string, center?: boolean) => void;
 | 
			
		||||
  animate: (element: Element, duration: number) => Runner;
 | 
			
		||||
  resetAnimation: (element: Element) => void;
 | 
			
		||||
  finishAnimation: (element: Element) => void;
 | 
			
		||||
  cssAnimate: (element: Element, duration: number) => ScadaSymbolAnimation;
 | 
			
		||||
  cssAnimation: (element: Element) => ScadaSymbolAnimation | undefined;
 | 
			
		||||
  resetCssAnimation: (element: Element) => void;
 | 
			
		||||
@ -657,9 +654,6 @@ export class ScadaSymbolObject {
 | 
			
		||||
        text: this.setElementText.bind(this),
 | 
			
		||||
        font: this.setElementFont.bind(this),
 | 
			
		||||
        icon: this.setElementIcon.bind(this),
 | 
			
		||||
        animate: this.animate.bind(this),
 | 
			
		||||
        resetAnimation: this.resetAnimation.bind(this),
 | 
			
		||||
        finishAnimation: this.finishAnimation.bind(this),
 | 
			
		||||
        cssAnimate: this.cssAnimate.bind(this),
 | 
			
		||||
        cssAnimation: this.cssAnimation.bind(this),
 | 
			
		||||
        resetCssAnimation: this.resetCssAnimation.bind(this),
 | 
			
		||||
@ -731,8 +725,6 @@ export class ScadaSymbolObject {
 | 
			
		||||
        const valueSetter = ValueSetter.fromSettings<any>(this.ctx, setValueSettings, this.simulated);
 | 
			
		||||
        this.valueSetters[setBehavior.id] = valueSetter;
 | 
			
		||||
        this.valueActions.push(valueSetter);
 | 
			
		||||
      } else if (behavior.type === ScadaSymbolBehaviorType.widgetAction) {
 | 
			
		||||
        // TODO:
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    this.renderState();
 | 
			
		||||
@ -992,21 +984,6 @@ export class ScadaSymbolObject {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private animate(element: Element, duration: number): Runner {
 | 
			
		||||
    this.finishAnimation(element);
 | 
			
		||||
    return element.animate(duration, 0, 'now');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private resetAnimation(element: Element) {
 | 
			
		||||
    element.timeline().stop();
 | 
			
		||||
    element.timeline(new Timeline());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private finishAnimation(element: Element) {
 | 
			
		||||
    element.timeline().finish();
 | 
			
		||||
    element.timeline(new Timeline());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private cssAnimate(element: Element, duration: number): ScadaSymbolAnimation {
 | 
			
		||||
    return this.cssAnimations.animate(element, duration);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -1235,49 +1235,6 @@ export const scadaSymbolContextCompletion = (metadata: ScadaSymbolMetadata, tags
 | 
			
		||||
              },
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          animate: {
 | 
			
		||||
            meta: 'function',
 | 
			
		||||
            description: 'Finishes any previous animation and starts new animation for SVG element.',
 | 
			
		||||
            args: [
 | 
			
		||||
              {
 | 
			
		||||
                name: 'element',
 | 
			
		||||
                description: 'SVG element',
 | 
			
		||||
                type: 'Element'
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                name: 'duration',
 | 
			
		||||
                description: 'Animation duration in milliseconds',
 | 
			
		||||
                type: 'number'
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            return: {
 | 
			
		||||
              description: 'Instance of SVG.Runner which has the same methods as any element and additional methods to control the runner.',
 | 
			
		||||
              type: '<a href="https://svgjs.dev/docs/3.2/animating/#svg-runner">SVG.Runner</a>'
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          resetAnimation: {
 | 
			
		||||
            meta: 'function',
 | 
			
		||||
            description: 'Stops animation if any and restore SVG element initial state, resets animation timeline.',
 | 
			
		||||
            args: [
 | 
			
		||||
              {
 | 
			
		||||
                name: 'element',
 | 
			
		||||
                description: 'SVG element',
 | 
			
		||||
                type: 'Element'
 | 
			
		||||
              },
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          finishAnimation: {
 | 
			
		||||
            meta: 'function',
 | 
			
		||||
            description: 'Finishes animation if any, SVG element state updated according to the end animation values, ' +
 | 
			
		||||
              'resets animation timeline.',
 | 
			
		||||
            args: [
 | 
			
		||||
              {
 | 
			
		||||
                name: 'element',
 | 
			
		||||
                description: 'SVG element',
 | 
			
		||||
                type: 'Element'
 | 
			
		||||
              },
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          generateElementId: {
 | 
			
		||||
            meta: 'function',
 | 
			
		||||
            description: 'Generates new unique element id.',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user