1 line
117 KiB
JavaScript
1 line
117 KiB
JavaScript
var __runInitializers=this&&this.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0},__esDecorate=this&&this.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(void 0!==f&&"function"!=typeof f)throw new TypeError("Function expected");return f}for(var _,kind=contextIn.kind,key="getter"===kind?"get":"setter"===kind?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]="access"===p?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])("accessor"===kind?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if("accessor"===kind){if(void 0===result)continue;if(null===result||"object"!=typeof result)throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&("field"===kind?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0};import{TcHmiControl}from"Beckhoff.TwinCAT.HMI.Framework/index.esm.js";import{ValueBuffer,InputProcessingPoint}from"../Helpers/TcHmiValueBuffer/ValueBuffer.js";let TcHmiRadialGauge=(()=>{var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s;let ___onResized_decorators,___onMove_decorators,___fetchKnob_decorators,___onMouseDownKnob_decorators,___onMouseDownControl_decorators,___onMouseMove_decorators,___onMouseUp_decorators,___onTouchStartKnob_decorators,___onTouchStartControl_decorators,___onTouchMove_decorators,___onTouchEnd_decorators,___onTouchCancel_decorators,___onResolverForValueFormatWatchCallback_decorators,___onResolverForRangeWatchCallback_decorators,___onResolverForTickDefinitionWatchCallback_decorators,___onResolverForLabelFormatWatchCallback_decorators,___onResolverForValueColorWatchCallback_decorators,___onResolverForLabelColorWatchCallback_decorators,___onResolverForUnitColorWatchCallback_decorators,___onResolverForTickColorWatchCallback_decorators,___onResolverForGaugeBackgroundColorWatchCallback_decorators,___onResolverForProgressForegroundColorWatchCallback_decorators,___onResolverForProgressBackgroundColorWatchCallback_decorators,___onResolverForKnobColorWatchCallback_decorators,___onResolverForKnobArrowsColorWatchCallback_decorators,___onResolverForSetPointMarkerColorWatchCallback_decorators,___onResolverForMarkersWatchCallback_decorators,___onResolverForLegendLabelColorWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiRadialGauge extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onResized_decorators=[TcHmi.EventHandler()],___onMove_decorators=[TcHmi.EventHandler()],___fetchKnob_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onMouseDownKnob_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onMouseDownControl_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onMouseMove_decorators=[TcHmi.EventHandler()],___onMouseUp_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchStartKnob_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchStartControl_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchMove_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchEnd_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchCancel_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onResolverForValueFormatWatchCallback_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],___onResolverForRangeWatchCallback_decorators=[(_c=TcHmi).CallbackMethod.bind(_c)],___onResolverForTickDefinitionWatchCallback_decorators=[(_d=TcHmi).CallbackMethod.bind(_d)],___onResolverForLabelFormatWatchCallback_decorators=[(_e=TcHmi).CallbackMethod.bind(_e)],___onResolverForValueColorWatchCallback_decorators=[(_f=TcHmi).CallbackMethod.bind(_f)],___onResolverForLabelColorWatchCallback_decorators=[(_g=TcHmi).CallbackMethod.bind(_g)],___onResolverForUnitColorWatchCallback_decorators=[(_h=TcHmi).CallbackMethod.bind(_h)],___onResolverForTickColorWatchCallback_decorators=[(_j=TcHmi).CallbackMethod.bind(_j)],___onResolverForGaugeBackgroundColorWatchCallback_decorators=[(_k=TcHmi).CallbackMethod.bind(_k)],___onResolverForProgressForegroundColorWatchCallback_decorators=[(_l=TcHmi).CallbackMethod.bind(_l)],___onResolverForProgressBackgroundColorWatchCallback_decorators=[(_m=TcHmi).CallbackMethod.bind(_m)],___onResolverForKnobColorWatchCallback_decorators=[(_o=TcHmi).CallbackMethod.bind(_o)],___onResolverForKnobArrowsColorWatchCallback_decorators=[(_p=TcHmi).CallbackMethod.bind(_p)],___onResolverForSetPointMarkerColorWatchCallback_decorators=[(_q=TcHmi).CallbackMethod.bind(_q)],___onResolverForMarkersWatchCallback_decorators=[(_r=TcHmi).CallbackMethod.bind(_r)],___onResolverForLegendLabelColorWatchCallback_decorators=[(_s=TcHmi).CallbackMethod.bind(_s)],__esDecorate(this,null,___onResized_decorators,{kind:"method",name:"__onResized",static:!1,private:!1,access:{has:obj=>"__onResized"in obj,get:obj=>obj.__onResized},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMove_decorators,{kind:"method",name:"__onMove",static:!1,private:!1,access:{has:obj=>"__onMove"in obj,get:obj=>obj.__onMove},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___fetchKnob_decorators,{kind:"method",name:"__fetchKnob",static:!1,private:!1,access:{has:obj=>"__fetchKnob"in obj,get:obj=>obj.__fetchKnob},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseDownKnob_decorators,{kind:"method",name:"__onMouseDownKnob",static:!1,private:!1,access:{has:obj=>"__onMouseDownKnob"in obj,get:obj=>obj.__onMouseDownKnob},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseDownControl_decorators,{kind:"method",name:"__onMouseDownControl",static:!1,private:!1,access:{has:obj=>"__onMouseDownControl"in obj,get:obj=>obj.__onMouseDownControl},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseMove_decorators,{kind:"method",name:"__onMouseMove",static:!1,private:!1,access:{has:obj=>"__onMouseMove"in obj,get:obj=>obj.__onMouseMove},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseUp_decorators,{kind:"method",name:"__onMouseUp",static:!1,private:!1,access:{has:obj=>"__onMouseUp"in obj,get:obj=>obj.__onMouseUp},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchStartKnob_decorators,{kind:"method",name:"__onTouchStartKnob",static:!1,private:!1,access:{has:obj=>"__onTouchStartKnob"in obj,get:obj=>obj.__onTouchStartKnob},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchStartControl_decorators,{kind:"method",name:"__onTouchStartControl",static:!1,private:!1,access:{has:obj=>"__onTouchStartControl"in obj,get:obj=>obj.__onTouchStartControl},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchMove_decorators,{kind:"method",name:"__onTouchMove",static:!1,private:!1,access:{has:obj=>"__onTouchMove"in obj,get:obj=>obj.__onTouchMove},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchEnd_decorators,{kind:"method",name:"__onTouchEnd",static:!1,private:!1,access:{has:obj=>"__onTouchEnd"in obj,get:obj=>obj.__onTouchEnd},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchCancel_decorators,{kind:"method",name:"__onTouchCancel",static:!1,private:!1,access:{has:obj=>"__onTouchCancel"in obj,get:obj=>obj.__onTouchCancel},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForValueFormatWatchCallback_decorators,{kind:"method",name:"__onResolverForValueFormatWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForValueFormatWatchCallback"in obj,get:obj=>obj.__onResolverForValueFormatWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForRangeWatchCallback_decorators,{kind:"method",name:"__onResolverForRangeWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForRangeWatchCallback"in obj,get:obj=>obj.__onResolverForRangeWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForTickDefinitionWatchCallback_decorators,{kind:"method",name:"__onResolverForTickDefinitionWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForTickDefinitionWatchCallback"in obj,get:obj=>obj.__onResolverForTickDefinitionWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForLabelFormatWatchCallback_decorators,{kind:"method",name:"__onResolverForLabelFormatWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForLabelFormatWatchCallback"in obj,get:obj=>obj.__onResolverForLabelFormatWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForValueColorWatchCallback_decorators,{kind:"method",name:"__onResolverForValueColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForValueColorWatchCallback"in obj,get:obj=>obj.__onResolverForValueColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForLabelColorWatchCallback_decorators,{kind:"method",name:"__onResolverForLabelColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForLabelColorWatchCallback"in obj,get:obj=>obj.__onResolverForLabelColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForUnitColorWatchCallback_decorators,{kind:"method",name:"__onResolverForUnitColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForUnitColorWatchCallback"in obj,get:obj=>obj.__onResolverForUnitColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForTickColorWatchCallback_decorators,{kind:"method",name:"__onResolverForTickColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForTickColorWatchCallback"in obj,get:obj=>obj.__onResolverForTickColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForGaugeBackgroundColorWatchCallback_decorators,{kind:"method",name:"__onResolverForGaugeBackgroundColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForGaugeBackgroundColorWatchCallback"in obj,get:obj=>obj.__onResolverForGaugeBackgroundColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForProgressForegroundColorWatchCallback_decorators,{kind:"method",name:"__onResolverForProgressForegroundColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForProgressForegroundColorWatchCallback"in obj,get:obj=>obj.__onResolverForProgressForegroundColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForProgressBackgroundColorWatchCallback_decorators,{kind:"method",name:"__onResolverForProgressBackgroundColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForProgressBackgroundColorWatchCallback"in obj,get:obj=>obj.__onResolverForProgressBackgroundColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForKnobColorWatchCallback_decorators,{kind:"method",name:"__onResolverForKnobColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForKnobColorWatchCallback"in obj,get:obj=>obj.__onResolverForKnobColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForKnobArrowsColorWatchCallback_decorators,{kind:"method",name:"__onResolverForKnobArrowsColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForKnobArrowsColorWatchCallback"in obj,get:obj=>obj.__onResolverForKnobArrowsColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForSetPointMarkerColorWatchCallback_decorators,{kind:"method",name:"__onResolverForSetPointMarkerColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForSetPointMarkerColorWatchCallback"in obj,get:obj=>obj.__onResolverForSetPointMarkerColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForMarkersWatchCallback_decorators,{kind:"method",name:"__onResolverForMarkersWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForMarkersWatchCallback"in obj,get:obj=>obj.__onResolverForMarkersWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForLegendLabelColorWatchCallback_decorators,{kind:"method",name:"__onResolverForLegendLabelColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForLegendLabelColorWatchCallback"in obj,get:obj=>obj.__onResolverForLegendLabelColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),_metadata&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static#tchmiFQN="TcHmi.Controls.Beckhoff."+this.name;constructor(element,pcElement,attrs){super(element,pcElement,attrs)}__elementTemplateRoot=__runInitializers(this,_instanceExtraInitializers);__elementSvg;__elementBackgroundCircle;__elementMainTickContainer;__elementSubTickContainer;__elementLabelContainer;__elementRangeContainer;__elementProgressBackgroundCircle;__elementProgressForegroundCircle;__elementValueText;__elementUnitText;__elementKnob;__elementKnobG;static __svgKnobMap=new Map;__knobSvgString=null;__elementSetPointContainer;__elementMarkersContainer;__elementSetPoint;__startPosition;__endPosition;__minValue;__maxValue;__step;__stepOffset=0;__range;__showLabels;__startFromZero;__editable;__ignoreInvalidValues;__valueBuffer;__clickAnywhereToEdit;__showValueText;__showTicks;__labelPosition;__tickDefinition;__labelRange;__subTickPosition;__value;__lastReportedValue;__setPoint;__valueFormat;__decimalDigits;__unit;__markers;__legendFontFamily;__legendFontSize;__legendFontStyle;__legendFontWeight;__elementLegend;__labelFontSize;__labelFontSizeUnit;__labelFontFamily;__labelFontStyle;__labelFontWeight;__labelFormat;__valueFontSize;__valueFontSizeUnit;__valueFontFamily;__valueFontStyle;__valueFontWeight;__unitFontSize;__unitFontSizeUnit;__unitFontFamily;__unitFontStyle;__unitFontWeight;__valueColor;__labelColor;__unitColor;__tickColor;__progressForegroundColor;__progressBackgroundColor;__gaugeBackgroundColor;__knobColor;__knobArrowsColor;__setPointMarkerColor;__legendLabelColor;__numberFormatter=new Intl.NumberFormat("en-US",{maximumFractionDigits:15,minimumFractionDigits:0});__baseAnimationTime;__gaugeAlignment;__oldProgressValue=null;__oldSetPoint;__draggingInfo={isDragging:!1,offset:0,touchIdentifier:null,originalValue:null};__knobConfig={imagePath:"",height:0,width:0,offsetX:0,offsetY:0};__proportions={mainTickLength:0,subTickLength:0,rangeThickness:0,valueThickness:0,labelRadius:0,tickRadius:0,valueRadius:0,rangeRadius:0,outerRadius:0,startAngle:220,endAngle:-40,markerRadius:0};__labels=[];__internalValue=0;__internalMinValue=0;__internalMaxValue=100;__internalSetPoint=void 0;__elementInvalidNotification;__updateInvalidNotificationTimer=0;__localizationReader=void 0;__triggerAsyncLayout=!1;__progressAnimation=null;__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template"),0===this.__elementTemplateRoot.length&&(this.__elementTemplateRoot=this.__element.find(".tchmi-radial-gauge-template")),this.__elementSvg=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-svg"),0===this.__elementSvg.length&&(this.__elementSvg=this.__elementTemplateRoot.find(".tchmi-radial-gauge-template-svg")),this.__elementBackgroundCircle=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-circle-outside"),0===this.__elementBackgroundCircle.length&&(this.__elementBackgroundCircle=this.__elementSvg.find(".tchmi-radial-gauge-template-circle-outside")),this.__elementMainTickContainer=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-main-tick-container"),0===this.__elementMainTickContainer.length&&(this.__elementMainTickContainer=this.__elementSvg.find(".tchmi-radial-gauge-template")),this.__elementSubTickContainer=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-sub-tick-container"),0===this.__elementSubTickContainer.length&&(this.__elementSubTickContainer=this.__elementSvg.find(".tchmi-radial-gauge-template-sub-tick-container")),this.__elementLabelContainer=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-label-container"),0===this.__elementLabelContainer.length&&(this.__elementLabelContainer=this.__elementSvg.find(".tchmi-radial-gauge-template-label-container")),this.__elementRangeContainer=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-range-container"),0===this.__elementRangeContainer.length&&(this.__elementRangeContainer=this.__elementSvg.find(".tchmi-radial-gauge-template-range-container")),this.__elementProgressBackgroundCircle=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-circle-under"),0===this.__elementProgressBackgroundCircle.length&&(this.__elementProgressBackgroundCircle=this.__elementSvg.find(".tchmi-radial-gauge-template-circle-under")),this.__elementProgressForegroundCircle=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-circle-over"),0===this.__elementProgressForegroundCircle.length&&(this.__elementProgressForegroundCircle=this.__elementSvg.find(".tchmi-radial-gauge-template-circle-over")),this.__elementValueText=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-display-value"),0===this.__elementValueText.length&&(this.__elementValueText=this.__elementSvg.find(".tchmi-radial-gauge-template-display-value")),this.__elementUnitText=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-display-unit"),0===this.__elementUnitText.length&&(this.__elementUnitText=this.__elementSvg.find(".tchmi-radial-gauge-template-display-unit")),this.__elementKnob=this.__elementSvg.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-knob"),0===this.__elementKnob.length&&(this.__elementKnob=this.__elementSvg.find(".tchmi-radial-gauge-template-knob")),this.__elementKnobG=this.__elementKnob[0],this.__elementInvalidNotification=document.createElement("div"),this.__elementInvalidNotification.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-invalid-notification"),0===this.__elementTemplateRoot.length||0===this.__elementSvg.length||0===this.__elementBackgroundCircle.length||0===this.__elementMainTickContainer.length||0===this.__elementSubTickContainer.length||0===this.__elementLabelContainer.length||0===this.__elementRangeContainer.length||0===this.__elementProgressBackgroundCircle.length||0===this.__elementProgressForegroundCircle.length||0===this.__elementValueText.length||0===this.__elementUnitText.length||0===this.__elementKnob.length)throw new Error("Invalid Template.html");this.__destroyOnDestroy.push(this.__localization.watch(data=>{data.error===TcHmi.Errors.NONE&&data.reader&&(this.__localizationReader=data.reader,this.__elementInvalidNotification.isConnected&&(void 0!==this.__value&&this.__value<this.__internalMinValue&&(this.__elementInvalidNotification.title=tchmi_format_string(this.__localizationReader.get("Tooltip_LessThanMin_Text"),this.__internalMinValue.toString())),void 0!==this.__value&&this.__value>this.__internalMaxValue&&(this.__elementInvalidNotification.title=tchmi_format_string(this.__localizationReader.get("Tooltip_GreaterThanMax_Text"),this.__internalMaxValue.toString()))))})),super.__previnit()}__init(){super.__init(),this.__fetchKnob(),this.__destroyOnDestroy.push(TcHmi.EventProvider.registerDomEvent(this.__elementKnob[0],"mousedown",this.__onMouseDownKnob),TcHmi.EventProvider.registerDomEvent(this.__elementKnob[0],"touchstart",this.__onTouchStartKnob,{passive:!1,capture:!1}),TcHmi.EventProvider.registerDomEvent(this.__elementBackgroundCircle[0],"mousedown",this.__onMouseDownControl),TcHmi.EventProvider.registerDomEvent(this.__elementBackgroundCircle[0],"touchstart",this.__onTouchStartControl,{passive:!1,capture:!1}))}__attach(){super.__attach(),this.__destroyOnDetach.push(TcHmi.EventProvider.register(this.__id+".onResized",this.__onResized),TcHmi.EventProvider.register("onThemeDataChanged",this.__fetchKnob),TcHmi.EventProvider.registerDomEvent(window,"mousemove",this.__onMouseMove),TcHmi.EventProvider.registerDomEvent(window,"mouseup",this.__onMouseUp),TcHmi.EventProvider.registerDomEvent(window,"touchmove",this.__onTouchMove,{passive:!1,capture:!1}),TcHmi.EventProvider.registerDomEvent(window,"touchend",this.__onTouchEnd),TcHmi.EventProvider.registerDomEvent(window,"touchcancel",this.__onTouchCancel)),this.__processValue(),this.__updateInvalidNotificationTimer=setInterval(()=>this.__updateInvalidNotification(),500)}__detach(){super.__detach(),this.__updateInvalidNotificationTimer&&(clearInterval(this.__updateInvalidNotificationTimer),this.__updateInvalidNotificationTimer=0),this.__elementInvalidNotification.isConnected&&TcHmi.TopMostLayer.remove(this,this.__elementInvalidNotification),this.__triggerAsyncLayout=!1,this.__progressAnimation=null,TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_WIDTH"),TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_HEIGHT")}destroy(){this.__keepAlive||(TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_WIDTH"),TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_HEIGHT"),TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.getId()+"]_KNOB_LOADING_ERROR"),super.destroy())}__onResized(_event,_ctrl){0===this.__labels.length&&this.__showLabels&&this.__labelRange&&this.__labelRange>0&&this.__processShowLabels(!1),this.__updateLayout(),this.__updateInvalidNotification()}__onMove(){this.__updateInvalidNotification()}__updateInvalidNotification(){if(this.__isAttached)if(this.__ignoreInvalidValues||void 0===this.__value||this.__isValid(this.__value))this.__elementInvalidNotification.isConnected&&TcHmi.TopMostLayer.remove(this,this.__elementInvalidNotification);else{let boundingRect=this.__element[0].getBoundingClientRect();const width=boundingRect.width,height=boundingRect.height;let radius=this.__proportions.outerRadius;const notificationSize=30,notificationDiagonal=Math.sqrt(notificationSize*notificationSize*2);let left=0,top=0,notificationMovedOutwards=!1;if(radius>0){radius<2*notificationSize&&(radius+=(2*notificationSize-radius)/2,notificationMovedOutwards=!0);const offsetAngle=Math.asin(notificationDiagonal/2/radius),notificationOffset={x:radius*Math.cos(-(Math.PI/4+offsetAngle)),y:radius*Math.sin(-(Math.PI/4+offsetAngle))},gaugeCenterOffset={x:0,y:0};if(width<=height)switch(gaugeCenterOffset.x=width/2,this.__gaugeAlignment){case"Start":gaugeCenterOffset.y=gaugeCenterOffset.x;break;case"Center":gaugeCenterOffset.y=height/2;break;case"End":gaugeCenterOffset.y=gaugeCenterOffset.x+(height-width)}else switch(gaugeCenterOffset.y=height/2,this.__gaugeAlignment){case"Start":gaugeCenterOffset.x=gaugeCenterOffset.y;break;case"Center":gaugeCenterOffset.x=width/2;break;case"End":gaugeCenterOffset.x=gaugeCenterOffset.y+(width-height)}left=boundingRect.left+gaugeCenterOffset.x+notificationOffset.x,top=boundingRect.top+gaugeCenterOffset.y+notificationOffset.y}(notificationMovedOutwards?[document.elementsFromPoint(boundingRect.left+width-1,boundingRect.top)]:[document.elementsFromPoint(left,top+1),document.elementsFromPoint(left+29,top+29)]).every(elementStack=>{const controlIndex=elementStack.indexOf(notificationMovedOutwards?this.__elementTemplateRoot[0]:this.__elementBackgroundCircle[0]);return-1!==controlIndex&&(0===controlIndex||!!elementStack[controlIndex-1].closest("#tchmi-system-topmostlayer-master"))})?(this.__elementInvalidNotification.style.left=left+"px",this.__elementInvalidNotification.style.top=top+"px",this.__localizationReader&&(void 0!==this.__value&&this.__value<this.__internalMinValue&&(this.__elementInvalidNotification.title=tchmi_format_string(this.__localizationReader.get("Tooltip_LessThanMin_Text"),this.__internalMinValue.toString())),void 0!==this.__value&&this.__value>this.__internalMaxValue&&(this.__elementInvalidNotification.title=tchmi_format_string(this.__localizationReader.get("Tooltip_GreaterThanMax_Text"),this.__internalMaxValue.toString()))),TcHmi.TopMostLayer.add(this,this.__elementInvalidNotification,{closeOnBackground:!1,dimBackground:!1,modal:!1,justAbove:{reference:this.__element[0],conflictResolution:TcHmi.TopMostLayer.ConflictResolution.Down}})):this.__elementInvalidNotification.isConnected&&TcHmi.TopMostLayer.remove(this,this.__elementInvalidNotification)}}__fetchKnob(){const knobConfig=TcHmi.Theme.Resources.get(this,"KnobConfig");knobConfig.value&&knobConfig.value.imagePath||(knobConfig.value={imagePath:"Knob.svg",height:40,width:40,offsetX:20,offsetY:20},knobConfig.origin="control"),null!==knobConfig.value.offsetX&&void 0!==knobConfig.value.offsetX||(knobConfig.value.offsetX=0),null!==knobConfig.value.offsetY&&void 0!==knobConfig.value.offsetY||(knobConfig.value.offsetY=0);let url=TcHmi.Theme.Resources.resolveBasePath(this,knobConfig);if(url+=knobConfig.value.imagePath,null===knobConfig.value.width||void 0===knobConfig.value.width||null===knobConfig.value.height||void 0===knobConfig.value.height)return null===knobConfig.value.width||void 0===knobConfig.value.width?TcHmi.Engineering.ErrorPane.add("E_GAUGE["+this.__id+"]_KNOB_MISSING_WIDTH","The Width of the Knob for "+this.__id+" is not defined in the Theme. Knob is invisible.",TcHmi.Engineering.ErrorPane.MessageType.Error):TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_WIDTH"),null===knobConfig.value.height||void 0===knobConfig.value.height?TcHmi.Engineering.ErrorPane.add("E_GAUGE["+this.__id+"]_KNOB_MISSING_HEIGHT","The Height of the Knob for "+this.__id+" is not defined in the Theme. Knob is invisible.",TcHmi.Engineering.ErrorPane.MessageType.Error):TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_HEIGHT"),TcHmi.StyleProvider.setSimpleElementStyle(this.__elementKnob,{"background-image":null,"background-size":null}),this.__knobSvgString=null,void this.__updateKnobColors();TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_WIDTH"),TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.__id+"]_KNOB_MISSING_HEIGHT"),TcHmi.StyleProvider.setSimpleElementStyle(this.__elementKnob,{width:knobConfig.value.width+"px",height:knobConfig.value.height+"px"});let layoutRequired=this.__knobConfig.offsetY!==knobConfig.value.offsetY;this.__knobConfig=knobConfig.value,this.__isAttached&&layoutRequired&&this.__updateLayout(),void 0!==this.__setPoint&&void 0!==this.__internalSetPoint?this.__updateEditKnob(this.__internalSetPoint):this.__updateEditKnob(this.__internalValue),url=tchmi_path(url);let pSvgString=TcHmiRadialGauge.__svgKnobMap.get(url);pSvgString||(url.endsWith("svg")?(pSvgString=fetch(tchmi_encode_uri_components(url)).then(response=>response.ok?response.text():Promise.reject(new Error(`Failed request to ${url} Details: HTTP error ${response.status} ${response.statusText}`))),TcHmiRadialGauge.__svgKnobMap.set(url,pSvgString)):pSvgString=Promise.resolve(`<svg\n class="TcHmi_Controls_Beckhoff_TcHmiRadialGauge-knob-svg"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${knobConfig.value.width}"\n height="${knobConfig.value.height}"\n >\n <image\n xlink:href="${url}"\n x="0"\n y="0"\n width="${knobConfig.value.width}px"\n height="${knobConfig.value.height}px"\n ></image>\n </svg>`)),pSvgString.then(svgString=>{this.__isDestroyed||(this.__knobSvgString=svgString,this.__updateEditKnob(this.__getValueOrSetPoint()),TcHmi.Engineering.ErrorPane.remove("E_GAUGE["+this.getId()+"]_KNOB_LOADING_ERROR"))}).catch(error=>{TcHmiRadialGauge.__svgKnobMap.delete(url),TcHmi.Engineering.ErrorPane.add("E_GAUGE["+this.getId()+"]_KNOB_LOADING_ERROR","[Source=Control, Module="+this.__type+(TcHmiRadialGauge.#tchmiFQN!==this.__type?", Origin="+TcHmiRadialGauge.#tchmiFQN:"")+", Id="+this.getId()+"] Could not load knob file at "+url+(error&&error.message?": "+error.message:""),TcHmi.Engineering.ErrorPane.MessageType.Error),this.__knobSvgString=null}).finally(()=>{this.__updateKnobColors()})}__resolveLinearGradientColorAsSvgStrings(gradientColor){let gradientId="tchmi-styleprovider-"+tchmi_create_guid(),gradientString="<linearGradient";gradientString+=' x1="0" y1="1" x2="0" y2="0"',gradientString+=' id="'+gradientId+'"',gradientString+=' class="tchmi-styleprovider-linear-gradient"',gradientString+=` gradientTransform="rotate(${gradientColor.angle??0}, 0.5, 0.5)"`,gradientString+=">\n";for(let i=0,ii=gradientColor.stopPoints.length;i<ii;i++){let stopPoint=gradientColor.stopPoints[i];if(void 0===stopPoint.stop||null===stopPoint.stop)if(0===i)stopPoint.stop="0%";else if(i===ii-1)stopPoint.stop="100%";else{let previous=0;gradientColor.stopPoints[i-1].stop&&(previous=parseFloat(gradientColor.stopPoints[i-1].stop));let j,next=null;for(j=i+1;j<gradientColor.stopPoints.length;j++){let localStop=gradientColor.stopPoints[j].stop;if(null!=localStop){next=parseFloat(localStop);break}}null===next&&(next=100,j--);let unit="";gradientColor.stopPoints[i-1].stop&&(unit=gradientColor.stopPoints[i-1].stop.replace(/[0-9.]/g,"")),stopPoint.stop=previous+(next-previous)/(j-i)+unit}let stopString="<stop";stopString+=' offset="'+stopPoint.stop+'"',stopString+=' stop-color="'+stopPoint.color+'"',stopString+="></stop>\n",gradientString+=stopString}return gradientString+="</linearGradient>",{gradientString,fillString:"url(#"+gradientId+")"}}__updateKnobColors(){let svgString=this.__knobSvgString;if(svgString){if(TcHmi.isSolidColor(this.__knobColor))svgString=svgString.replace(/{KnobColorGradientDefinition}/g,"").replace(/{KnobColorFill}/g,"fill:"+TcHmi.StyleProvider.resolveSolidColorAsCssValue(this.__knobColor)+";").replace(/{KnobColorStroke}/g,"stroke:"+TcHmi.StyleProvider.resolveSolidColorAsCssValue(this.__knobColor)+";");else if(TcHmi.isLinearGradientColor(this.__knobColor)){const linearColor=this.__resolveLinearGradientColorAsSvgStrings(this.__knobColor);svgString=svgString.replace(/{KnobColorGradientDefinition}/g,linearColor.gradientString).replace(/{KnobColorFill}/g,"fill:"+linearColor.fillString+";").replace(/{KnobColorStroke}/g,"stroke:"+linearColor.fillString+";")}else svgString=svgString.replace(/{KnobColorGradientDefinition}/g,"").replace(/{KnobColorFill}/g,"").replace(/{KnobColorStroke}/g,"");if(TcHmi.isSolidColor(this.__knobArrowsColor))svgString=svgString.replace(/{KnobArrowsColorGradientDefinition}/g,"").replace(/{KnobArrowsColorFill}/g,"fill:"+TcHmi.StyleProvider.resolveSolidColorAsCssValue(this.__knobArrowsColor)+";").replace(/{KnobArrowsColorStroke}/g,"stroke:"+TcHmi.StyleProvider.resolveSolidColorAsCssValue(this.__knobArrowsColor)+";");else if(TcHmi.isLinearGradientColor(this.__knobArrowsColor)){const linearColor=this.__resolveLinearGradientColorAsSvgStrings(this.__knobArrowsColor);svgString=svgString.replace(/{KnobArrowsColorGradientDefinition}/g,linearColor.gradientString).replace(/{KnobArrowsColorFill}/g,"fill:"+linearColor.fillString+";").replace(/{KnobArrowsColorStroke}/g,"")}else svgString=svgString.replace(/{KnobArrowsColorGradientDefinition}/g,"").replace(/{KnobArrowsColorFill}/g,"").replace(/{KnobArrowsColorStroke}/g,"")}else svgString="";this.__elementKnobG.innerHTML=svgString}__onMouseDownKnob(event){0===event.button&&this.getEditable()&&(this.__draggingInfo.isDragging=!0,this.__draggingInfo.originalValue=this.__getValueOrSetPoint(),this.__draggingInfo.offset=this.__draggingInfo.originalValue-this.__calcValueFromEventCoords(event.clientX,event.clientY))}__onMouseDownControl(event){if(0!==event.button||!this.getClickAnywhereToEdit()||!this.getEditable())return;let dx=event.offsetX-this.__proportions.outerRadius,dy=event.offsetY-this.__proportions.outerRadius,dist=Math.sqrt(dx*dx+dy*dy)-this.__proportions.valueThickness/2,dist2=Math.sqrt(dx*dx+dy*dy)+this.__proportions.valueThickness/2;if(dist<=this.__proportions.valueRadius&&this.__proportions.valueRadius<=dist2){let angleFromZero=180*Math.atan2(event.offsetY-this.__proportions.outerRadius,event.offsetX-this.__proportions.outerRadius)/Math.PI;angleFromZero<0?angleFromZero*=-1:angleFromZero=180-angleFromZero+180,this.__checkAngleBetweenAngles(angleFromZero,this.__proportions.startAngle,this.__proportions.endAngle)||(this.__draggingInfo.isDragging=!0,this.__draggingInfo.offset=0,this.__draggingInfo.originalValue=this.__getValueOrSetPoint(),this.__valueBuffer?.setValue(this.__calcValueFromEventCoords(event.clientX,event.clientY)))}}__checkAngleBetweenAngles(angleToCheck,angle1,angle2){return angleToCheck=(360+angleToCheck%360)%360,(angle1=(36e5+angle1)%360)<(angle2=(36e5+angle2)%360)?angle1<=angleToCheck&&angleToCheck<=angle2:angle1<=angleToCheck||angleToCheck<=angle2}__onMouseMove(event){1===event.which?this.__draggingInfo.isDragging&&this.getEditable()&&this.getIsEnabled()&&!0===TcHmi.Access.checkAccess(this,"operate")&&this.__valueBuffer?.setValue(this.__calcValueFromEventCoords(event.clientX,event.clientY)):this.__draggingInfo.isDragging=!1}__onMouseUp(event){this.__draggingInfo.isDragging&&this.getEditable()&&(this.__draggingInfo.isDragging=!1,this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"))}__onTouchStartKnob(event){if(!this.getEditable())return;let touch=null;for(let i=0,ii=event.changedTouches.length;i<ii;i++)if(event.changedTouches[i].target===this.__elementKnob[0]||$.contains(this.__elementKnob[0],event.changedTouches[i].target)){touch=event.changedTouches[i];break}null!==touch&&(event.preventDefault(),null===this.__draggingInfo.touchIdentifier&&(this.__internalSetPoint?this.__draggingInfo.originalValue=this.__internalSetPoint:this.__draggingInfo.originalValue=this.__internalValue),this.__draggingInfo.isDragging=!0,this.__draggingInfo.touchIdentifier=touch.identifier,this.__draggingInfo.offset=this.__getValueOrSetPoint()-this.__calcValueFromEventCoords(touch.clientX,touch.clientY))}__onTouchStartControl(event){if(!this.getClickAnywhereToEdit()||!this.getEditable())return;let touch=null;for(let i=0,ii=event.changedTouches.length;i<ii;i++)if(event.changedTouches[i].target===this.__element[0]||$.contains(this.__element[0],event.changedTouches[i].target)){touch=event.changedTouches[i];break}if(null===touch)return;event.preventDefault();let gaugeBoundingRect=this.__elementBackgroundCircle[0].getBoundingClientRect(),offsetX=touch.clientX-gaugeBoundingRect.left,offsetY=touch.clientY-gaugeBoundingRect.top,dx=offsetX-this.__proportions.outerRadius,dy=offsetY-this.__proportions.outerRadius,dist=Math.sqrt(dx*dx+dy*dy)-this.__proportions.valueThickness/2-5,dist2=Math.sqrt(dx*dx+dy*dy)+this.__proportions.valueThickness/2+5;if(dist<=this.__proportions.valueRadius&&this.__proportions.valueRadius<=dist2){let angleFromZero=180*Math.atan2(offsetY-this.__proportions.outerRadius,offsetX-this.__proportions.outerRadius)/Math.PI;angleFromZero<0?angleFromZero*=-1:angleFromZero=180-angleFromZero+180,this.__checkAngleBetweenAngles(angleFromZero,this.__proportions.startAngle,this.__proportions.endAngle)||(null===this.__draggingInfo.touchIdentifier&&(this.__draggingInfo.originalValue=this.__internalValue),this.__draggingInfo.isDragging=!0,this.__draggingInfo.touchIdentifier=touch.identifier,this.__draggingInfo.offset=0,this.__valueBuffer?.setValue(this.__calcValueFromEventCoords(touch.clientX,touch.clientY)))}}__onTouchMove(event){if(!this.__draggingInfo.isDragging||!this.getEditable())return;let touch=null;for(let i=0,ii=event.changedTouches.length;i<ii;i++)if(event.changedTouches[i].identifier===this.__draggingInfo.touchIdentifier){touch=event.changedTouches[i];break}null!==touch&&this.__valueBuffer?.setValue(this.__calcValueFromEventCoords(touch.clientX,touch.clientY))}__onTouchEnd(event){if(!this.__draggingInfo.isDragging||!this.getEditable())return;let touch=null;for(let i=0,ii=event.changedTouches.length;i<ii;i++)if(event.changedTouches[i].identifier===this.__draggingInfo.touchIdentifier){touch=event.changedTouches[i];break}null!==touch&&(this.__draggingInfo.isDragging=!1,this.__draggingInfo.touchIdentifier=null,this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"))}__onTouchCancel(event){if(!this.__draggingInfo.isDragging||!this.getEditable()||!this.getIsEnabled()||!0!==TcHmi.Access.checkAccess(this,"operate"))return;let touch=null;for(let i=0,ii=event.changedTouches.length;i<ii;i++)if(event.changedTouches[i].identifier===this.__draggingInfo.touchIdentifier){touch=event.changedTouches[i];break}null!==touch&&(this.__draggingInfo.isDragging=!1,this.__draggingInfo.touchIdentifier=null,this.__valueBuffer?.setValue(this.__draggingInfo.originalValue??0),this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"))}__calcValueFromEventCoords(x,y){if(this.__internalMaxValue===this.__internalMinValue)return this.__internalMinValue;let value,gaugeBoundingRect=this.__elementBackgroundCircle[0].getBoundingClientRect(),cx=gaugeBoundingRect.left+gaugeBoundingRect.width/2,cy=gaugeBoundingRect.top+gaugeBoundingRect.height/2,distortion=gaugeBoundingRect.width/gaugeBoundingRect.height,angle=Math.atan2((y-cy)*distortion,x-cx)*(180/Math.PI)*-1,unitsPerDegree=(this.__internalMaxValue-this.__internalMinValue)/Math.abs(this.__proportions.startAngle-this.__proportions.endAngle);return angle=(angle-this.__draggingInfo.offset/unitsPerDegree)%360,angle=angle<0?angle+360:angle,angle>this.__proportions.startAngle&&(angle-=360),value=angle<this.__proportions.endAngle?Math.abs(Math.abs((angle+180)%360-180)-Math.abs((this.__proportions.startAngle+180)%360-180))<=Math.abs(Math.abs((angle+180)%360-180)-Math.abs((this.__proportions.endAngle+180)%360-180))?this.__internalMinValue:this.__internalMaxValue:this.__internalMinValue+(this.__proportions.startAngle-angle)*unitsPerDegree,void 0!==this.__step&&this.__step>0?(value=Math.round((value-this.__stepOffset)/this.__step)*this.__step+this.__stepOffset,value<this.__internalMinValue&&(value=Math.ceil((this.__internalMinValue-this.__stepOffset)/this.__step-10*Number.EPSILON)*this.__step+this.__stepOffset),value>this.__internalMaxValue&&(value=Math.floor((this.__internalMaxValue-this.__stepOffset)/this.__step+10*Number.EPSILON)*this.__step+this.__stepOffset)):(value=value<this.__internalMinValue?this.__internalMinValue:value,value=value>this.__internalMaxValue?this.__internalMaxValue:value),value=parseFloat(value.toPrecision(12)),value}__calcAngleFromValue(value){if(this.__internalMaxValue===this.__internalMinValue)return this.__proportions.startAngle;let angleOfOne=(this.__proportions.startAngle-this.__proportions.endAngle)/(this.__internalMaxValue-this.__internalMinValue),angleFromStart=Math.abs(this.__internalMinValue-value)*angleOfOne;return(360-(this.__proportions.startAngle-angleFromStart-90))%360}__getProportions(){let width=this.getRenderedWidth();if(!width)return;let height=this.getRenderedHeight();if(!height)return;this.__elementLegend&&(height-=this.__elementLegend.getBoundingClientRect().height);let size=0;switch(this.__gaugeAlignment){case"Start":this.__elementTemplateRoot[0].style.placeItems="start";break;case"Center":this.__elementTemplateRoot[0].style.placeItems="center";break;case"End":this.__elementTemplateRoot[0].style.placeItems="end"}size=width<=height?width:height,this.__element[0].style.setProperty("--square-size",size+"px");let outerRadius=size/2,mainTickLength=.1*outerRadius,subTickLength=.05*outerRadius,rangeThickness=.05*outerRadius,valueThickness=.06*outerRadius,labelThickness=0,labelSpace=0,tickSpace=0,rangeSpace=0,editKnobSpace=0,markerSpace=0;this.__labels.forEach(label=>{let boundingRect=label.element.getBoundingClientRect(),hypotenuse_x=boundingRect.width,hypotenuse_length=(boundingRect.height,Math.sqrt(boundingRect.width*boundingRect.width+boundingRect.height*boundingRect.height)),angle=Math.asin(hypotenuse_x/hypotenuse_length)-label.angle%90*(Math.PI/180),distance=Math.cos(angle)*hypotenuse_length;distance>labelThickness&&(labelThickness=distance)}),labelThickness>0&&(labelSpace=labelThickness+5),this.__showTicks&&void 0!==this.__tickDefinition&&null!==this.__tickDefinition&&(this.__tickDefinition.mainTickRange>0||this.__tickDefinition.subTickRange>0)&&(tickSpace=mainTickLength+10),null!==this.__range&&void 0!==this.__range&&this.__range.length>0&&(rangeSpace=rangeThickness+10),this.__markers&&this.__markers.size>0&&(markerSpace=10);let valuePadding=10+valueThickness/2;if("Inside"===this.__labelPosition?(valuePadding+=rangeSpace,valuePadding+=markerSpace):(valuePadding+=labelSpace,valuePadding+=tickSpace),this.getEditable()){let editKnobRadius=this.__knobConfig.offsetY;valuePadding<editKnobRadius&&(editKnobSpace=editKnobRadius-valuePadding,valuePadding+=editKnobSpace)}let labelPadding=10+labelThickness/2+editKnobSpace;"Inside"===this.__labelPosition&&(labelPadding+=valueThickness+5,labelPadding+=tickSpace,labelPadding+=rangeSpace,labelPadding+=markerSpace);let tickPadding=10+editKnobSpace;"Inside"===this.__labelPosition?(tickPadding+=valueThickness+10,tickPadding+=rangeSpace,tickPadding+=markerSpace):tickPadding+=labelSpace,"Inside"===this.__subTickPosition&&(tickPadding+=mainTickLength);let rangePadding=10+rangeThickness/2+editKnobSpace;"Outside"===this.__labelPosition?(rangePadding+=valueThickness+10,rangePadding+=labelSpace,rangePadding+=tickSpace):rangePadding+=markerSpace;let startAngle=(void 0!==this.__startPosition?this.__startPosition:0)%360;startAngle=startAngle<0?startAngle+360:startAngle;let endAngle=(void 0!==this.__endPosition?this.__endPosition:0)%360;endAngle=startAngle-endAngle>360?endAngle+360:endAngle,endAngle=startAngle-endAngle<=0?endAngle-360:endAngle;let markerRadius=0;return markerRadius="Outside"===this.__labelPosition?outerRadius-labelSpace-tickSpace-rangeSpace-2*rangeThickness-markerSpace:outerRadius-markerSpace,{mainTickLength:mainTickLength>0?mainTickLength:0,subTickLength:subTickLength>0?subTickLength:0,rangeThickness:rangeThickness>0?rangeThickness:0,valueThickness:valueThickness>0?valueThickness:0,labelRadius:outerRadius-labelPadding>0?outerRadius-labelPadding:0,tickRadius:outerRadius-tickPadding>0?outerRadius-tickPadding:0,valueRadius:outerRadius-valuePadding>0?outerRadius-valuePadding:0,rangeRadius:outerRadius-rangePadding>0?outerRadius-rangePadding:0,outerRadius:outerRadius>0?outerRadius:0,startAngle,endAngle,markerRadius:markerRadius>0?markerRadius:0}}__updateLayout(){this.__triggerAsyncLayout=!0,this.__requestAsyncWork()}__doAsyncWork(timestamp=performance.now()){if(super.__doAsyncWork(timestamp),this.__triggerAsyncLayout){this.__triggerAsyncLayout=!1;let newProportions=this.__getProportions();if(!newProportions)return;newProportions.outerRadius!==this.__proportions.outerRadius&&(this.__elementBackgroundCircle[0].setAttribute("cx",newProportions.outerRadius.toString()),this.__elementBackgroundCircle[0].setAttribute("cy",newProportions.outerRadius.toString()),this.__elementBackgroundCircle[0].setAttribute("r",newProportions.outerRadius.toString()),this.__elementValueText[0].setAttribute("x",newProportions.outerRadius.toString()),this.__elementValueText[0].setAttribute("y",newProportions.outerRadius.toString()),this.__elementUnitText[0].setAttribute("x",newProportions.outerRadius.toString()),this.__elementUnitText[0].setAttribute("y",newProportions.outerRadius.toString()),this.__elementMainTickContainer[0].setAttribute("transform","translate("+newProportions.outerRadius+", "+newProportions.outerRadius+")"),this.__elementSubTickContainer[0].setAttribute("transform","translate("+newProportions.outerRadius+", "+newProportions.outerRadius+")"),this.__elementSetPointContainer&&this.__elementSetPointContainer.setAttribute("transform","translate("+newProportions.outerRadius+", "+newProportions.outerRadius+")"),this.__elementMarkersContainer&&this.__elementMarkersContainer.setAttribute("transform","translate("+newProportions.outerRadius+", "+newProportions.outerRadius+")")),newProportions.rangeThickness!==this.__proportions.rangeThickness&&TcHmi.StyleProvider.setSimpleElementStyle(this.__elementRangeContainer[0].getElementsByTagName("path"),"stroke-width",newProportions.rangeThickness+"px"),this.__proportions=newProportions,this.__processEditable(!1),this.__processShowLabels(!1),this.__processShowTicks(!1),this.__processRange(!1),this.__drawProgressCircles(!1),void 0!==this.__internalSetPoint&&this.__createSetPointElement(),this.__createMarkerElements()}if(this.__progressAnimation){this.__progressAnimation.startTime||(this.__progressAnimation.startTime=timestamp);const progress=(timestamp-this.__progressAnimation.startTime)/this.__progressAnimation.duration,offset=this.__progressAnimation.fromOffset+(this.__progressAnimation.toOffset-this.__progressAnimation.fromOffset)*progress;if(progress>=1||!this.__element[0].isConnected)this.__elementProgressForegroundCircle[0].style.strokeDashoffset=Math.round(this.__progressAnimation.toOffset).toString(),this.getEditable()&&void 0===this.__internalSetPoint&&this.__updateEditKnob(this.__progressAnimation.toValue),this.__progressAnimation=null;else{if(this.__elementProgressForegroundCircle[0].style.strokeDashoffset=Math.round(offset).toString(),this.getEditable()&&void 0===this.__internalSetPoint){const value=this.__progressAnimation.fromValue+(this.__progressAnimation.toValue-this.__progressAnimation.fromValue)*progress;this.__updateEditKnob(value)}this.__requestAsyncWork()}}}__drawProgressCircles(layout=!0){this.__elementProgressBackgroundCircle[0].setAttribute("cx",this.__proportions.outerRadius.toString()),this.__elementProgressBackgroundCircle[0].setAttribute("cy",this.__proportions.outerRadius.toString()),this.__elementProgressBackgroundCircle[0].setAttribute("r",this.__proportions.valueRadius.toString()),this.__elementProgressBackgroundCircle[0].setAttribute("transform","rotate("+-this.__proportions.startAngle+", "+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")"),this.__elementProgressForegroundCircle[0].setAttribute("cx",this.__proportions.outerRadius.toString()),this.__elementProgressForegroundCircle[0].setAttribute("cy",this.__proportions.outerRadius.toString()),this.__elementProgressForegroundCircle[0].setAttribute("r",this.__proportions.valueRadius.toString()),this.__startFromZero&&this.__internalMinValue<0?this.__elementProgressForegroundCircle[0].setAttribute("transform","rotate("+(this.__calcAngleFromValue(Math.min(0,this.__internalMaxValue))-90)+", "+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")"):this.__elementProgressForegroundCircle[0].setAttribute("transform","rotate("+-this.__proportions.startAngle+", "+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")");let circumference=Math.PI*this.__proportions.valueRadius*2,circleGap=circumference-circumference*((this.__proportions.startAngle-this.__proportions.endAngle)/360);TcHmi.StyleProvider.setSimpleElementStyle(this.__elementProgressBackgroundCircle.add(this.__elementProgressForegroundCircle),"stroke-dasharray",Math.round(circumference).toString()),TcHmi.StyleProvider.setSimpleElementStyle(this.__elementProgressBackgroundCircle,"stroke-dashoffset",Math.round(circleGap).toString()),this.__processValue(),this.__isAttached&&layout&&this.__updateLayout()}__setInternalMinMaxValue(){void 0!==this.__minValue&&void 0!==this.__maxValue?(this.__internalMinValue=this.__minValue>this.__maxValue?this.__maxValue:this.__minValue,this.__internalMaxValue=this.__maxValue<this.__minValue?this.__minValue:this.__maxValue):(this.__internalMinValue=0,this.__internalMaxValue=0)}__setInternalValues(){let internalValueBefore=this.__internalValue;if(this.__setInternalMinMaxValue(),void 0===this.__value?this.__internalValue=0:this.__value>=this.__internalMinValue&&this.__value<=this.__internalMaxValue&&(this.__internalValue=this.__value),this.__oldSetPoint=this.__internalSetPoint,void 0!==this.__oldSetPoint&&(this.__oldSetPoint=this.__oldSetPoint<this.__internalMinValue?this.__internalMinValue:this.__oldSetPoint,this.__oldSetPoint=this.__oldSetPoint>this.__internalMaxValue?this.__internalMaxValue:this.__oldSetPoint),void 0===this.__setPoint||null===this.__setPoint?this.__internalSetPoint=void 0:void 0!==this.__step&&this.__step>0?(this.__internalSetPoint=Math.round((this.__setPoint-this.__stepOffset)/this.__step)*this.__step+this.__stepOffset,this.__internalSetPoint<this.__internalMinValue&&(this.__internalSetPoint=Math.ceil((this.__internalMinValue-this.__stepOffset)/this.__step)*this.__step+this.__stepOffset),this.__internalSetPoint>this.__internalMaxValue&&(this.__internalSetPoint=Math.floor((this.__internalMaxValue-this.__stepOffset)/this.__step)*this.__step+this.__stepOffset)):(this.__internalSetPoint=this.__setPoint,this.__internalSetPoint=this.__internalSetPoint<this.__internalMinValue?this.__internalMinValue:this.__internalSetPoint,this.__internalSetPoint=this.__internalSetPoint>this.__internalMaxValue?this.__internalMaxValue:this.__internalSetPoint),internalValueBefore!==this.__internalValue){let currentValue=this.getValue();void 0!==currentValue&¤tValue!==this.__lastReportedValue&&(this.__lastReportedValue=currentValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Value"}),TcHmi.EventProvider.raise(this.__id+".onValueChanged"))}this.__updateInvalidNotification()}__isValid(value){return value>=this.__internalMinValue&&value<=this.__internalMaxValue}__setValueOrSetPoint(valueNew){void 0!==this.__internalSetPoint?this.__setSetPoint(valueNew):this.__setValue(valueNew)}__getValueOrSetPoint(){return void 0!==this.__internalSetPoint?this.__internalSetPoint:this.__internalValue}setValue(valueNew){if(this.__draggingInfo.isDragging&&void 0===this.__internalSetPoint)return;let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Value")),this.__ignoreInvalidValues&&!this.__isValid(convertedValue)||this.__setValue(convertedValue)}__setValue(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);if(null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Value")),convertedValue===this.__value)return;this.__value=convertedValue,this.__processValue();let currentValue=this.getValue();void 0!==currentValue&¤tValue!==this.__lastReportedValue&&(this.__lastReportedValue=currentValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Value"}),TcHmi.EventProvider.raise(this.__id+".onValueChanged"))}getValue(){return void 0!==this.__value?this.__internalValue:void 0}__processValue(){this.__setInternalMinMaxValue(),this.__setInternalValues();let progressValue=this.__draggingInfo.isDragging?this.__valueBuffer?.getValue()??this.__internalValue:this.__ignoreInvalidValues?this.__internalValue:this.__value??this.__internalValue;if(void 0!==this.__valueFormat&&null!==this.__valueFormat?this.__elementValueText[0].textContent=this.__executeValueFormatFunction(progressValue):this.__elementValueText[0].textContent=this.__numberFormatter.format(progressValue),this.__internalMaxValue!==this.__internalMinValue&&this.__isAttached&&this.__proportions.valueRadius>0){progressValue=progressValue<this.__internalMinValue?this.__internalMinValue:progressValue,progressValue=progressValue>this.__internalMaxValue?this.__internalMaxValue:progressValue;let c=Math.PI*(2*this.__proportions.valueRadius),angleOfOne=(this.__proportions.startAngle-this.__proportions.endAngle)/(this.__internalMaxValue-this.__internalMinValue),startAngle=this.__internalMinValue<0&&this.__startFromZero?-(this.__internalMinValue-Math.min(0,this.__internalMaxValue))*angleOfOne:0,valueRangeOffsetOfValue=(100-100/(360/(Math.abs(this.__internalMinValue-progressValue)*angleOfOne-startAngle)))/100*c;if(this.__progressAnimation&&(this.__elementProgressForegroundCircle[0].style.strokeDashoffset=Math.round(this.__progressAnimation.toOffset).toString(),this.__progressAnimation=null),!this.__draggingInfo.isDragging&&this.__baseAnimationTime&&null!==this.__oldProgressValue){let duration=this.__baseAnimationTime*(Math.abs(this.__oldProgressValue-progressValue)/(this.__internalMaxValue-this.__internalMinValue));if(0===duration)return this.__elementProgressForegroundCircle[0].style.strokeDashoffset=Math.round(valueRangeOffsetOfValue).toString(),this.getEditable()&&void 0===this.__internalSetPoint&&this.__updateEditKnob(progressValue),void(this.__oldProgressValue=progressValue);let oldValueRangeOffsetOfValue=(100-100/(360/(Math.abs(this.__internalMinValue-this.__oldProgressValue)*angleOfOne-startAngle)))/100*c;this.__progressAnimation={fromOffset:oldValueRangeOffsetOfValue,toOffset:valueRangeOffsetOfValue,fromValue:this.__oldProgressValue,toValue:progressValue,duration},this.__requestAsyncWork()}else this.__elementProgressForegroundCircle[0].style.strokeDashoffset=Math.round(valueRangeOffsetOfValue).toString(),void 0===this.__internalSetPoint&&this.__updateEditKnob(progressValue);this.__oldProgressValue=progressValue}}setSetPoint(valueNew){this.__draggingInfo.isDragging||this.__setSetPoint(valueNew)}__setSetPoint(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SetPoint")),convertedValue!==this.__setPoint&&(this.__setPoint=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SetPoint"}),this.__processSetPoint())}getSetPoint(){return this.__setPoint}__processSetPoint(){this.__setInternalMinMaxValue(),this.__setInternalValues(),void 0!==this.__internalSetPoint?(this.__elementSetPoint||this.__createSetPointElement(),this.__updateSetPoint(this.__internalSetPoint),this.getEditable()&&this.__updateEditKnob(this.__internalSetPoint)):(this.__removeSetPointElement(),this.getEditable()&&this.__updateEditKnob(this.__internalValue))}__createSetPointElement(){void 0!==this.__internalSetPoint&&(this.__removeSetPointElement(),this.__elementSetPoint=document.createElementNS("http://www.w3.org/2000/svg","line"),this.__elementSetPoint.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-set-point"),this.__elementSetPoint.setAttribute("x1","0"),this.__elementSetPoint.setAttribute("y1","0"),this.__elementSetPoint.setAttribute("x2","0"),this.__elementSetPoint.setAttribute("y2",(.15*this.__proportions.outerRadius+30).toString()),TcHmi.StyleProvider.processStrokeColor(this.__elementSetPoint,this.__setPointMarkerColor),this.__elementSetPointContainer||(this.__elementSetPointContainer=document.createElementNS("http://www.w3.org/2000/svg","g"),this.__elementSetPointContainer.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-set-point-container"),this.__proportions&&this.__elementSetPointContainer.setAttribute("transform","translate("+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")"),this.__elementKnobG.before(this.__elementSetPointContainer)),this.__elementSetPointContainer.append(this.__elementSetPoint),this.__updateSetPoint(this.__internalSetPoint))}__removeSetPointElement(){if(this.__elementSetPointContainer){for(;this.__elementSetPointContainer.firstChild;)this.__elementSetPointContainer.removeChild(this.__elementSetPointContainer.firstChild);this.__elementSetPoint=void 0}}__updateSetPoint(value){if(value=(value=value>=this.__internalMinValue?value:this.__internalMinValue)<=this.__internalMaxValue?value:this.__internalMaxValue,this.__elementSetPoint){let transform=" rotate("+this.__calcAngleFromValue(value)+" ) translate(0, "+(5-this.__proportions.outerRadius)+")";this.__elementSetPoint.setAttribute("transform",transform)}}setMinValue(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("MinValue")),convertedValue!==this.__minValue&&(this.__minValue=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"MinValue"}),this.__processMinValue(),this.__processMarkers())}getMinValue(){return this.__minValue}__processMinValue(){void 0!==this.__maxValue&&void 0!==this.__minValue&&(this.__setInternalMinMaxValue(),void 0!==this.__value&&(this.__setInternalValues(),this.__isAttached&&(this.__updateLayout(),this.__processValue()),this.__processStep()))}setMaxValue(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("MaxValue")),convertedValue!==this.__maxValue&&(this.__maxValue=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"MaxValue"}),this.__processMaxValue(),this.__processMarkers())}getMaxValue(){return this.__maxValue}__processMaxValue(){void 0!==this.__maxValue&&void 0!==this.__minValue&&(this.__setInternalMinMaxValue(),this.__setInternalValues(),this.__isAttached&&(this.__updateLayout(),this.__processValue()),this.__processStep())}setStep(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Step")),convertedValue!==this.__step&&(this.__step=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Step"}),this.__processStep())}getStep(){return this.__step}__processStep(){function safeModulo(dividend,divisor){if(Number.isInteger(dividend)&&Number.isInteger(divisor))return dividend%divisor;let exponent=0,dividendNext=10*dividend,divisorNext=10*divisor;for(;!Number.isInteger(dividend)&÷ndNext>=Number.MIN_SAFE_INTEGER&÷ndNext<=Number.MAX_SAFE_INTEGER||!Number.isInteger(divisor)&&divisorNext>=Number.MIN_SAFE_INTEGER&&divisorNext<=Number.MAX_SAFE_INTEGER;)dividend=dividendNext,divisor=divisorNext,dividendNext*=10,divisorNext*=10,exponent++;return Math.round(dividend)%Math.round(divisor)/Math.pow(10,exponent)}void 0===this.__step||this.__step<=0?this.__stepOffset=0:(this.__stepOffset=!this.__startFromZero||this.__internalMinValue>=0?safeModulo(this.__internalMinValue,this.__step):this.__internalMaxValue>=0?0:safeModulo(this.__internalMaxValue,this.__step),this.__processSetPoint())}setDecimalDigits(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("DecimalDigits")),convertedValue!==this.__decimalDigits&&(this.__decimalDigits=convertedValue,this.__decimalDigits&&this.__decimalDigits<0&&(this.__decimalDigits=0),TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"DecimalDigits"}),this.__processDecimalDigits())}getDecimalDigits(){return this.__decimalDigits}__processDecimalDigits(){this.__updateFormatter(),this.__processValue()}__updateFormatter(){let numberFormatOptions={maximumFractionDigits:this.__decimalDigits??15,minimumFractionDigits:this.__decimalDigits??0,useGrouping:!1};this.__numberFormatter=Intl.NumberFormat("en-US",numberFormatOptions)}setValueFormat(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFormat"));let resolverInfo=this.__objectResolvers.get("valueFormat");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("ValueFormat")?.type});this.__objectResolvers.set("valueFormat",{resolver,watchCallback:this.__onResolverForValueFormatWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForValueFormatWatchCallback)})}__onResolverForValueFormatWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("valueFormat"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__valueFormat)||(this.__valueFormat=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFormat"}),this.__processValueFormat()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"ValueFormat"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getValueFormat(){return this.__valueFormat}__processValueFormat(){this.__processValue()}__executeValueFormatFunction(value){if(void 0!==this.__valueFormat&&null!==this.__valueFormat&&!1!==this.__valueFormat.active){const args=[value];let res=null,f=new TcHmi.Function(this.__valueFormat);if(!f.isProcessedAsync())return f.executeEx(args,data=>{data.error===TcHmi.Errors.NONE&&void 0!==data.result?res=data.result:TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,`Execution of function=${this.__valueFormat?.fn} failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}),f.destroy(),res;TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,`Execution of function=${this.__valueFormat?.fn} was aborted because it will be processed asynchronous and a synchronous running function call is required. Either the function is running asynchronous by definition or asynchronous running symbols were added to the list of parameters.`)}return value.toString()}setRange(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Range"));let resolverInfo=this.__objectResolvers.get("range");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("Range")?.type});this.__objectResolvers.set("range",{resolver,watchCallback:this.__onResolverForRangeWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForRangeWatchCallback)})}__onResolverForRangeWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("range"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__range)||(this.__range=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Range"}),this.__processRange()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"Range"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getRange(){return this.__range}__processRange(layout=!0){if(void 0!==this.__range){if(0===this.__range.length)return this.__elementRangeContainer.empty(),void(this.__isAttached&&layout&&this.__updateLayout());for(let i=0,ii=this.__range.length;i<ii;i++){let startValue=this.__range[i].start;startValue=startValue>=this.__internalMinValue?startValue:this.__internalMinValue,startValue=startValue<=this.__internalMaxValue?startValue:this.__internalMaxValue;let endValue=this.__range[i].end;endValue=endValue>=this.__internalMinValue?endValue:this.__internalMinValue,endValue=endValue<=this.__internalMaxValue?endValue:this.__internalMaxValue;let path,startAngle=(360-(this.__calcAngleFromValue(startValue)-90))%360*(Math.PI/180),endAngle=(360-(this.__calcAngleFromValue(endValue)-90))%360*(Math.PI/180),startPoint={x:this.__proportions.outerRadius+Math.cos(startAngle)*this.__proportions.rangeRadius,y:this.__proportions.outerRadius-Math.sin(startAngle)*this.__proportions.rangeRadius},endPoint={x:this.__proportions.outerRadius+Math.cos(endAngle)*this.__proportions.rangeRadius,y:this.__proportions.outerRadius-Math.sin(endAngle)*this.__proportions.rangeRadius};startAngle<endAngle&&(startAngle+=2*Math.PI),i>=this.__elementRangeContainer[0].childElementCount?(path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.__elementRangeContainer[0].appendChild(path)):path=this.__elementRangeContainer[0].children[i];let pathData=`M ${startPoint.x} ${startPoint.y} A ${this.__proportions.rangeRadius} ${this.__proportions.rangeRadius}, 0, ${startAngle-endAngle>Math.PI?1:0}, 1, ${endPoint.x} ${endPoint.y}`;TcHmi.StyleProvider.processStrokeColor(path,this.__range[i].color),TcHmi.StyleProvider.setSimpleElementStyle(path,"stroke-width",this.__proportions.rangeThickness+"px"),path.setAttribute("d",pathData)}for(;this.__elementRangeContainer[0].childElementCount>this.__range.length;)this.__elementRangeContainer[0].removeChild(this.__elementRangeContainer[0].lastElementChild);this.__isAttached&&layout&&this.__updateLayout()}}setTickDefinition(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TickDefinition"));let resolverInfo=this.__objectResolvers.get("tickDefinition");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("TickDefinition")?.type});this.__objectResolvers.set("tickDefinition",{resolver,watchCallback:this.__onResolverForTickDefinitionWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTickDefinitionWatchCallback)})}__onResolverForTickDefinitionWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("tickDefinition"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__tickDefinition)||(this.__tickDefinition=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TickDefinition"}),this.__processTickDefinition()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"TickDefinition"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTickDefinition(){return this.__tickDefinition}__processTickDefinition(layout=!0){this.__processShowTicks()}setStartPosition(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StartPosition")),convertedValue!==this.__startPosition&&(this.__startPosition=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StartPosition"}),this.__processStartPosition())}getStartPosition(){return this.__startPosition}__processStartPosition(){this.__isAttached&&this.__updateLayout()}setEndPosition(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("EndPosition")),convertedValue!==this.__endPosition&&(this.__endPosition=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"EndPosition"}),this.__processEndPosition())}getEndPosition(){return this.__endPosition}__processEndPosition(){this.__isAttached&&this.__updateLayout()}setShowLabels(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ShowLabels")),convertedValue!==this.__showLabels&&(this.__showLabels=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ShowLabels"}),this.__processShowLabels())}getShowLabels(){return this.__showLabels}__processShowLabels(layout=!0){if(!this.__isAttached)return;if(void 0===this.__showLabels||void 0===this.__labelRange)return;if(!this.__showLabels||null===this.__labelRange||this.__labelRange<=0)return this.__elementLabelContainer.empty(),this.__labels=[],void(layout&&this.__updateLayout());let labelRadius=this.__proportions.labelRadius;0===labelRadius&&(labelRadius=Math.min(this.getRenderedHeight()||100,this.getRenderedWidth()||100)/5);let labelCount,labelRange=this.__labelRange;labelCount=this.__internalMaxValue===this.__internalMinValue?1:Math.floor((this.__internalMaxValue-this.__internalMinValue)/labelRange)+1;let maxLabelCount=Math.floor(2*labelRadius*Math.PI*((this.__proportions.startAngle-this.__proportions.endAngle)/360)/5)+1;maxLabelCount=maxLabelCount>1?maxLabelCount:1,labelCount>maxLabelCount&&(labelCount=maxLabelCount,labelRange=Math.floor((this.__internalMaxValue-this.__internalMinValue)/maxLabelCount/labelRange)*labelRange);let startingPoint=!this.__startFromZero||this.__internalMinValue>=0?this.__internalMinValue:this.__internalMaxValue>=0?0:this.__internalMaxValue,direction=this.__startFromZero&&this.__internalMaxValue<=0?-1:1;for(let i=0;i<labelCount;i++){let label;i>=this.__labels.length?(label=document.createElementNS("http://www.w3.org/2000/svg","text"),label.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-label"),label.classList.add("tchmi-radial-gauge-template-label"),TcHmi.StyleProvider.processFontSize(label,this.__labelFontSize,this.__labelFontSizeUnit),TcHmi.StyleProvider.processFontSize(label,this.__labelFontSize,this.__labelFontSizeUnit),TcHmi.StyleProvider.processFontFamily(label,this.__labelFontFamily),TcHmi.StyleProvider.processFontStyle(label,this.__labelFontStyle),TcHmi.StyleProvider.processFontWeight(label,this.__labelFontWeight),TcHmi.StyleProvider.processFillColor(label,this.__labelColor),this.__elementLabelContainer[0].appendChild(label)):label=this.__labels[i].element;const rawLabelValue=labelRange*i;let labelValue=startingPoint+rawLabelValue*direction;if(labelValue>this.__internalMaxValue&&(startingPoint=rawLabelValue-labelRange,direction=-1,labelValue=startingPoint+rawLabelValue*direction),labelValue<this.__internalMinValue)break;labelValue=parseFloat(labelValue.toPrecision(12));const labelAngle=this.__calcAngleFromValue(labelValue);label.textContent=this.__executeLabelFormatFunction(labelValue),label.setAttribute("x",this.__proportions.outerRadius.toString()),label.setAttribute("y",this.__proportions.outerRadius.toString()),label.setAttribute("transform","rotate("+labelAngle+", "+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+") translate(0, "+-labelRadius+") rotate("+-labelAngle+", "+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")"),this.__labels[i]={element:label,angle:labelAngle}}for(;this.__labels.length>labelCount;){let removedLabel=this.__labels.pop();removedLabel&&removedLabel.element.parentElement&&removedLabel.element.parentElement.removeChild(removedLabel.element)}layout&&this.__updateLayout()}setLabelFormat(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFormat"));let resolverInfo=this.__objectResolvers.get("labelFormat");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("LabelFormat")?.type});this.__objectResolvers.set("labelFormat",{resolver,watchCallback:this.__onResolverForLabelFormatWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForLabelFormatWatchCallback)})}__onResolverForLabelFormatWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("labelFormat"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__labelFormat)||(this.__labelFormat=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFormat"}),this.__processLabelFormat()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"LabelFormat"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getLabelFormat(){return this.__labelFormat}__processLabelFormat(){this.__processShowLabels()}__executeLabelFormatFunction(value){if(void 0!==this.__labelFormat&&null!==this.__labelFormat&&!1!==this.__labelFormat.active){const args=[value];let res=null,f=new TcHmi.Function(this.__labelFormat);if(!f.isProcessedAsync())return f.executeEx(args,data=>{data.error===TcHmi.Errors.NONE&&void 0!==data.result?res=data.result:TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,`Execution of function=${this.__labelFormat?.fn} failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}),f.destroy(),res;TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,`Execution of function=${this.__labelFormat?.fn} was aborted because it will be processed asynchronous and a synchronous running function call is required. Either the function is running asynchronous by definition or asynchronous running symbols were added to the list of parameters.`)}return value.toString()}setStartFromZero(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StartFromZero")),convertedValue!==this.__startFromZero&&(this.__startFromZero=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StartFromZero"}),this.__processStartFromZero())}getStartFromZero(){return this.__startFromZero}__processStartFromZero(){this.__drawProgressCircles(),this.__processValue(),this.__processShowLabels(),this.__processShowTicks(),this.__processStep()}setEditable(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Editable")),convertedValue!==this.__editable&&(this.__editable=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Editable"}),this.__processEditable())}getEditable(){return this.__editable}__processEditable(layout=!0){this.__editable?(TcHmi.StyleProvider.processVisibility(this.__elementKnob,"Visible"),void 0!==this.__setPoint&&this.__internalSetPoint?this.__updateEditKnob(this.__internalSetPoint):this.__updateEditKnob(this.__internalValue)):TcHmi.StyleProvider.processVisibility(this.__elementKnob,"Collapsed"),this.__isAttached&&layout&&this.__updateLayout()}setIgnoreInvalidValues(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IgnoreInvalidValues")),convertedValue!==this.__ignoreInvalidValues&&(this.__ignoreInvalidValues=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IgnoreInvalidValues"}),this.__processIgnoreInvalidValues())}getIgnoreInvalidValues(){return this.__ignoreInvalidValues}__processIgnoreInvalidValues(){this.__isAttached&&this.__processValue()}setInputProcessingPoint(valueNew){let convertedValue=TcHmi.ValueConverter.toEnum(valueNew,InputProcessingPoint);null===convertedValue&&(convertedValue=InputProcessingPoint[this.getAttributeDefaultValueInternal("InputProcessingPoint")]),convertedValue!==this.__valueBuffer?.processingPoint&&(this.__valueBuffer?this.__valueBuffer.processingPoint=convertedValue:(this.__valueBuffer=new ValueBuffer(convertedValue,value=>this.__setValueOrSetPoint(value)),this.__valueBuffer.onValueSet.add(value=>{void 0!==this.__internalSetPoint?(this.__updateSetPoint(value),this.getEditable()&&this.__updateEditKnob(value)):this.__processValue()})),TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"InputProcessingPoint"}),this.__processInputProcessingPoint())}getInputProcessingPoint(){return this.__valueBuffer?.processingPoint}__processInputProcessingPoint(){}__updateEditKnob(value){if(value=(value=value>=this.__internalMinValue?value:this.__internalMinValue)<=this.__internalMaxValue?value:this.__internalMaxValue,0!==this.__knobConfig.width&&0!==this.__knobConfig.height){let knobOffsetX=this.__knobConfig.offsetX,knobOffsetY=this.__knobConfig.offsetY,transform="translate("+(this.__proportions.outerRadius-knobOffsetX)+", "+(this.__proportions.outerRadius-knobOffsetY)+") rotate("+this.__calcAngleFromValue(value)+", "+knobOffsetX+", "+knobOffsetY+") translate(0, "+-this.__proportions.valueRadius+")";this.__elementKnob[0].setAttribute("transform",transform)}}setClickAnywhereToEdit(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ClickAnywhereToEdit")),convertedValue!==this.__clickAnywhereToEdit&&(this.__clickAnywhereToEdit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ClickAnywhereToEdit"}),this.__processClickAnywhereToEdit())}getClickAnywhereToEdit(){return this.__clickAnywhereToEdit}__processClickAnywhereToEdit(){}setShowValueText(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ShowValueText")),convertedValue!==this.__showValueText&&(this.__showValueText=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ShowValueText"}),this.__processShowValueText())}getShowValueText(){return this.__showValueText}__processShowValueText(){this.__showValueText?(TcHmi.StyleProvider.processVisibility(this.__elementValueText,"Visible"),this.__elementUnitText[0].setAttribute("transform","translate(0, 5)"),this.__elementUnitText[0].setAttribute("dy","0.8em")):(TcHmi.StyleProvider.processVisibility(this.__elementValueText,"Collapsed"),this.__elementUnitText[0].setAttribute("transform",""),this.__elementUnitText[0].setAttribute("dy","0.25em"))}setShowTicks(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ShowTicks")),convertedValue!==this.__showTicks&&(this.__showTicks=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ShowTicks"}),this.__processShowTicks())}getShowTicks(){return this.__showTicks}__processShowTicks(layout=!0){if(void 0===this.__showTicks||void 0===this.__tickDefinition)return;if(!this.__showTicks||null===this.__tickDefinition)return this.__elementMainTickContainer.empty(),this.__elementSubTickContainer.empty(),void(this.__isAttached&&layout&&this.__updateLayout());let maxTickCount=Math.floor(2*this.__proportions.tickRadius*Math.PI*((this.__proportions.startAngle-this.__proportions.endAngle)/360)/2)+1;maxTickCount=maxTickCount>1?maxTickCount:1;const startingPoint=!this.__startFromZero||this.__internalMinValue>=0?this.__internalMinValue:this.__internalMaxValue>=0?0:this.__internalMaxValue,direction=this.__startFromZero&&this.__internalMaxValue<=0?-1:1,ticks=new Map;if(this.__tickDefinition.subTickRange>0){let minorTickCount=Math.floor((this.__internalMaxValue-this.__internalMinValue)/this.__tickDefinition.subTickRange)+1,minorTickRange=this.__tickDefinition.subTickRange;minorTickCount>maxTickCount&&(minorTickCount=maxTickCount,minorTickRange=(this.__internalMaxValue-this.__internalMinValue)/maxTickCount);let minorStartingPoint=startingPoint,minorDirection=direction;for(let i=0;i<minorTickCount;i++){const rawTickValue=minorTickRange*i;let tickValue=minorStartingPoint+rawTickValue*minorDirection;if(tickValue>this.__internalMaxValue&&(minorStartingPoint=rawTickValue-minorTickRange,minorDirection=-1,tickValue=minorStartingPoint+rawTickValue*minorDirection),tickValue<this.__internalMinValue)break;ticks.set(tickValue,"sub")}}if(this.__tickDefinition.mainTickRange>0){let majorTickCount=Math.floor((this.__internalMaxValue-this.__internalMinValue)/this.__tickDefinition.mainTickRange)+1,majorTickRange=this.__tickDefinition.mainTickRange;majorTickCount>maxTickCount&&(majorTickCount=maxTickCount,majorTickRange=(this.__internalMaxValue-this.__internalMinValue)/maxTickCount);let majorStartingPoint=startingPoint,majorDirection=direction;for(let i=0;i<majorTickCount;i++){const rawTickValue=majorTickRange*i;let tickValue=majorStartingPoint+rawTickValue*majorDirection;if(tickValue>this.__internalMaxValue&&(majorStartingPoint=rawTickValue-majorTickRange,majorDirection=-1,tickValue=majorStartingPoint+rawTickValue*majorDirection),tickValue<this.__internalMinValue)break;ticks.set(tickValue,"main")}}let subTickCounter=0,mainTickCounter=0;for(const[tickValue,tickClass]of ticks){let tick,tickLength,isNew=!1;switch(tickClass){case"sub":subTickCounter>=this.__elementSubTickContainer[0].childElementCount?(tick=document.createElementNS("http://www.w3.org/2000/svg","line"),this.__elementSubTickContainer[0].appendChild(tick),isNew=!0):tick=this.__elementSubTickContainer[0].children[subTickCounter],tickLength=this.__proportions.subTickLength,subTickCounter++;break;case"main":mainTickCounter>=this.__elementMainTickContainer[0].childElementCount?(tick=document.createElementNS("http://www.w3.org/2000/svg","line"),this.__elementMainTickContainer[0].appendChild(tick),isNew=!0):tick=this.__elementMainTickContainer[0].children[mainTickCounter],tickLength=this.__proportions.mainTickLength,mainTickCounter++}isNew&&(tick.classList.add(`TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-${tickClass}-tick`),tick.classList.add(`tchmi-radial-gauge-template-${tickClass}-tick`),tick.setAttribute("x1","0"),tick.setAttribute("y1","0"),tick.setAttribute("x2","0"),TcHmi.StyleProvider.processStrokeColor(tick,this.__tickColor)),tick.setAttribute("y2","Inside"===this.__subTickPosition?`-${tickLength.toString()}`:tickLength.toString());let transform=`rotate(${this.__calcAngleFromValue(tickValue)}) translate(0, ${-this.__proportions.tickRadius})`;tick.setAttribute("transform",transform)}for(;this.__elementSubTickContainer[0].childElementCount>subTickCounter;)this.__elementSubTickContainer[0].removeChild(this.__elementSubTickContainer[0].lastElementChild);for(;this.__elementMainTickContainer[0].childElementCount>mainTickCounter;)this.__elementMainTickContainer[0].removeChild(this.__elementMainTickContainer[0].lastElementChild);this.__isAttached&&layout&&this.__updateLayout()}setLabelPosition(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);if(null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelPosition")),convertedValue!==this.__labelPosition){if("Outside"===convertedValue)this.__labelPosition=convertedValue;else this.__labelPosition="Inside";TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelPosition"}),this.__processLabelPosition()}}getLabelPosition(){return this.__labelPosition}__processLabelPosition(){this.__processShowLabels()}setSubTickPosition(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SubTickPosition")),convertedValue!==this.__subTickPosition&&(this.__subTickPosition="Outside"===convertedValue?convertedValue:"Inside",TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SubTickPosition"}),this.__processSubTickPosition())}getSubTickPosition(){return this.__subTickPosition}__processSubTickPosition(){this.__isAttached&&this.__updateLayout()}setLabelRange(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelRange")),convertedValue!==this.__labelRange&&(this.__labelRange=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelRange"}),this.__processLabelRange())}getLabelRange(){return this.__labelRange}__processLabelRange(){this.__processShowLabels()}setValueColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueColor"));let resolverInfo=this.__objectResolvers.get("valueColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("ValueColor")?.type});this.__objectResolvers.set("valueColor",{resolver,watchCallback:this.__onResolverForValueColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForValueColorWatchCallback)})}__onResolverForValueColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("valueColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__valueColor)||(this.__valueColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueColor"}),this.__processValueColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"ValueColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getValueColor(){return this.__valueColor}__processValueColor(){TcHmi.StyleProvider.processFillColor(this.__elementValueText,this.__valueColor)}setLabelColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelColor"));let resolverInfo=this.__objectResolvers.get("labelColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("LabelColor")?.type});this.__objectResolvers.set("labelColor",{resolver,watchCallback:this.__onResolverForLabelColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForLabelColorWatchCallback)})}__onResolverForLabelColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("labelColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__labelColor)||(this.__labelColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelColor"}),this.__processLabelColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"LabelColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getLabelColor(){return this.__labelColor}__processLabelColor(){TcHmi.StyleProvider.processFillColor(this.__labels.map(label=>label.element),this.__labelColor)}setUnitColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitColor"));let resolverInfo=this.__objectResolvers.get("unitColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("UnitColor")?.type});this.__objectResolvers.set("unitColor",{resolver,watchCallback:this.__onResolverForUnitColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForUnitColorWatchCallback)})}__onResolverForUnitColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("unitColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__unitColor)||(this.__unitColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitColor"}),this.__processUnitColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"UnitColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getUnitColor(){return this.__unitColor}__processUnitColor(){TcHmi.StyleProvider.processFillColor(this.__elementUnitText,this.__unitColor)}setTickColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TickColor"));let resolverInfo=this.__objectResolvers.get("tickColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("TickColor")?.type});this.__objectResolvers.set("tickColor",{resolver,watchCallback:this.__onResolverForTickColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTickColorWatchCallback)})}__onResolverForTickColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("tickColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__tickColor)||(this.__tickColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TickColor"}),this.__processTickColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"TickColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTickColor(){return this.__tickColor}__processTickColor(){TcHmi.StyleProvider.processStrokeColor(this.__elementMainTickContainer.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-main-tick").add(this.__elementSubTickContainer.find(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-sub-tick")),this.__tickColor)}setGaugeBackgroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("GaugeBackgroundColor"));let resolverInfo=this.__objectResolvers.get("gaugeBackgroundColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("GaugeBackgroundColor")?.type});this.__objectResolvers.set("gaugeBackgroundColor",{resolver,watchCallback:this.__onResolverForGaugeBackgroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForGaugeBackgroundColorWatchCallback)})}__onResolverForGaugeBackgroundColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("gaugeBackgroundColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__gaugeBackgroundColor)||(this.__gaugeBackgroundColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"GaugeBackgroundColor"}),this.__processGaugeBackgroundColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"GaugeBackgroundColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getGaugeBackgroundColor(){return this.__gaugeBackgroundColor}__processGaugeBackgroundColor(){TcHmi.StyleProvider.processFillColor(this.__elementBackgroundCircle,this.__gaugeBackgroundColor)}setProgressForegroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ProgressForegroundColor"));let resolverInfo=this.__objectResolvers.get("progressForegroundColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("ProgressForegroundColor")?.type});this.__objectResolvers.set("progressForegroundColor",{resolver,watchCallback:this.__onResolverForProgressForegroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForProgressForegroundColorWatchCallback)})}__onResolverForProgressForegroundColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("progressForegroundColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__progressForegroundColor)||(this.__progressForegroundColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ProgressForegroundColor"}),this.__processProgressForegroundColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"ProgressForegroundColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getProgressForegroundColor(){return this.__progressForegroundColor}__processProgressForegroundColor(){TcHmi.StyleProvider.processStrokeColor(this.__elementProgressForegroundCircle,this.__progressForegroundColor)}setProgressBackgroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ProgressBackgroundColor"));let resolverInfo=this.__objectResolvers.get("progressBackgroundColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("ProgressBackgroundColor")?.type});this.__objectResolvers.set("progressBackgroundColor",{resolver,watchCallback:this.__onResolverForProgressBackgroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForProgressBackgroundColorWatchCallback)})}__onResolverForProgressBackgroundColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("progressBackgroundColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__progressBackgroundColor)||(this.__progressBackgroundColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ProgressBackgroundColor"}),this.__processProgressBackgroundColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"ProgressBackgroundColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getProgressBackgroundColor(){return this.__progressBackgroundColor}__processProgressBackgroundColor(){TcHmi.StyleProvider.processStrokeColor(this.__elementProgressBackgroundCircle,this.__progressBackgroundColor)}setKnobColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("KnobColor"));let resolverInfo=this.__objectResolvers.get("knobColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("KnobColor")?.type});this.__objectResolvers.set("knobColor",{resolver,watchCallback:this.__onResolverForKnobColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForKnobColorWatchCallback)})}__onResolverForKnobColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("knobColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__knobColor)||(this.__knobColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"KnobColor"}),this.__processKnobColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"KnobColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getKnobColor(){return this.__knobColor}__processKnobColor(){this.__updateKnobColors()}setKnobArrowsColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("KnobArrowsColor"));let resolverInfo=this.__objectResolvers.get("knobArrowsColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("KnobArrowsColor")?.type});this.__objectResolvers.set("knobArrowsColor",{resolver,watchCallback:this.__onResolverForKnobArrowsColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForKnobArrowsColorWatchCallback)})}__onResolverForKnobArrowsColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("knobArrowsColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__knobArrowsColor)||(this.__knobArrowsColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"KnobArrowsColor"}),this.__processKnobArrowsColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"KnobArrowsColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getKnobArrowsColor(){return this.__knobArrowsColor}__processKnobArrowsColor(){this.__updateKnobColors()}setBaseAnimationTime(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("BaseAnimationTime")),convertedValue!==this.__baseAnimationTime&&(this.__baseAnimationTime=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"BaseAnimationTime"}),this.__processBaseAnimationTime())}getBaseAnimationTime(){return this.__baseAnimationTime}__processBaseAnimationTime(){}setUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Unit")),convertedValue!==this.__unit&&(this.__unit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Unit"}),this.__processUnit())}getUnit(){return this.__unit}__processUnit(){this.__unit?(this.__elementUnitText[0].textContent=this.__unit,this.__elementValueText[0].setAttribute("transform","translate(0, -5)"),this.__elementValueText[0].setAttribute("dy","")):(this.__elementUnitText[0].textContent="",this.__elementValueText[0].setAttribute("transform",""),this.__elementValueText[0].setAttribute("dy","0.25em"))}setLabelFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFontSize")),convertedValue!==this.__labelFontSize&&(this.__labelFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFontSize"}),this.__processLabelFontSize())}getLabelFontSize(){return this.__labelFontSize}__processLabelFontSize(){TcHmi.StyleProvider.processFontSize(this.__labels.map(label=>label.element),this.__labelFontSize,this.__labelFontSizeUnit),this.__isAttached&&"Outside"===this.__labelPosition&&this.__updateLayout()}setLabelFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFontSizeUnit")),convertedValue!==this.__labelFontSizeUnit&&(this.__labelFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFontSizeUnit"}),this.__processLabelFontSizeUnit())}getLabelFontSizeUnit(){return this.__labelFontSizeUnit}__processLabelFontSizeUnit(){TcHmi.StyleProvider.processFontSize(this.__labels.map(label=>label.element),this.__labelFontSize,this.__labelFontSizeUnit),this.__isAttached&&"Outside"===this.__labelPosition&&this.__updateLayout()}setLabelFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFontFamily")),convertedValue!==this.__labelFontFamily&&(this.__labelFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFontFamily"}),this.__processLabelFontFamily())}getLabelFontFamily(){return this.__labelFontFamily}__processLabelFontFamily(){TcHmi.StyleProvider.processFontFamily(this.__labels.map(label=>label.element),this.__labelFontFamily),this.__isAttached&&"Outside"===this.__labelPosition&&this.__updateLayout()}setLabelFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFontStyle")),convertedValue!==this.__labelFontStyle&&(this.__labelFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFontStyle"}),this.__processLabelFontStyle())}getLabelFontStyle(){return this.__labelFontStyle}__processLabelFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__labels.map(label=>label.element),this.__labelFontStyle),this.__isAttached&&"Outside"===this.__labelPosition&&this.__updateLayout()}setLabelFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelFontWeight")),convertedValue!==this.__labelFontWeight&&(this.__labelFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelFontWeight"}),this.__processLabelFontWeight())}getLabelFontWeight(){return this.__labelFontWeight}__processLabelFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__labels.map(label=>label.element),this.__labelFontWeight),this.__isAttached&&"Outside"===this.__labelPosition&&this.__updateLayout()}setValueFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFontSize")),convertedValue!==this.__valueFontSize&&(this.__valueFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFontSize"}),this.__processValueFontSize())}getValueFontSize(){return this.__valueFontSize}__processValueFontSize(){TcHmi.StyleProvider.processFontSize(this.__elementValueText,this.__valueFontSize,this.__valueFontSizeUnit)}setValueFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFontSizeUnit")),convertedValue!==this.__valueFontSizeUnit&&(this.__valueFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFontSizeUnit"}),this.__processValueFontSizeUnit())}getValueFontSizeUnit(){return this.__valueFontSizeUnit}__processValueFontSizeUnit(){TcHmi.StyleProvider.processFontSize(this.__elementValueText,this.__valueFontSize,this.__valueFontSizeUnit)}setValueFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFontFamily")),convertedValue!==this.__valueFontFamily&&(this.__valueFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFontFamily"}),this.__processValueFontFamily())}getValueFontFamily(){return this.__valueFontFamily}__processValueFontFamily(){TcHmi.StyleProvider.processFontFamily(this.__elementValueText,this.__valueFontFamily)}setValueFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFontStyle")),convertedValue!==this.__valueFontStyle&&(this.__valueFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFontStyle"}),this.__processValueFontStyle())}getValueFontStyle(){return this.__valueFontStyle}__processValueFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__elementValueText,this.__valueFontStyle)}setValueFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueFontWeight")),convertedValue!==this.__valueFontWeight&&(this.__valueFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueFontWeight"}),this.__processValueFontWeight())}getValueFontWeight(){return this.__valueFontWeight}__processValueFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__elementValueText,this.__valueFontWeight)}setUnitFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitFontSize")),convertedValue!==this.__unitFontSize&&(this.__unitFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitFontSize"}),this.__processUnitFontSize())}getUnitFontSize(){return this.__unitFontSize}__processUnitFontSize(){TcHmi.StyleProvider.processFontSize(this.__elementUnitText,this.__unitFontSize,this.__unitFontSizeUnit)}setUnitFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitFontSizeUnit")),convertedValue!==this.__unitFontSizeUnit&&(this.__unitFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitFontSizeUnit"}),this.__processUnitFontSizeUnit())}getUnitFontSizeUnit(){return this.__unitFontSizeUnit}__processUnitFontSizeUnit(){TcHmi.StyleProvider.processFontSize(this.__elementUnitText,this.__unitFontSize,this.__unitFontSizeUnit)}setUnitFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitFontFamily")),convertedValue!==this.__unitFontFamily&&(this.__unitFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitFontFamily"}),this.__processUnitFontFamily())}getUnitFontFamily(){return this.__unitFontFamily}__processUnitFontFamily(){TcHmi.StyleProvider.processFontFamily(this.__elementUnitText,this.__unitFontFamily)}setUnitFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitFontStyle")),convertedValue!==this.__unitFontStyle&&(this.__unitFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitFontStyle"}),this.__processUnitFontStyle())}getUnitFontStyle(){return this.__unitFontStyle}__processUnitFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__elementUnitText,this.__unitFontStyle)}setUnitFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UnitFontWeight")),convertedValue!==this.__unitFontWeight&&(this.__unitFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UnitFontWeight"}),this.__processUnitFontWeight())}getUnitFontWeight(){return this.__unitFontWeight}__processUnitFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__elementUnitText,this.__unitFontWeight)}setSetPointMarkerColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SetPointMarkerColor"));let resolverInfo=this.__objectResolvers.get("setPointMarkerColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("SetPointMarkerColor")?.type});this.__objectResolvers.set("pointerColor",{resolver,watchCallback:this.__onResolverForSetPointMarkerColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForSetPointMarkerColorWatchCallback)})}__onResolverForSetPointMarkerColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("setPointMarkerColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__setPointMarkerColor)||(this.__setPointMarkerColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SetPointMarkerColor"}),this.__processSetPointMarkerColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"SetPointMarkerColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getSetPointMarkerColor(){return this.__setPointMarkerColor}__processSetPointMarkerColor(){this.__elementSetPoint&&TcHmi.StyleProvider.processStrokeColor(this.__elementSetPoint,this.__setPointMarkerColor)}setGaugeAlignment(valueNew){const convertedValue=TcHmi.ValueConverter.toEnum(valueNew,{Start:"Start",Center:"Center",End:"End"})??this.getAttributeDefaultValueInternal("GaugeAlignment");convertedValue!==this.__gaugeAlignment&&(this.__gaugeAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"GaugeAlignment"}),this.__processGaugeAlignment())}getGaugeAlignment(){return this.__gaugeAlignment}__processGaugeAlignment(){this.__updateLayout(),this.__updateInvalidNotification()}setMarkers(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Markers"));let resolverInfo=this.__objectResolvers.get("markers");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("Markers")?.type});this.__objectResolvers.set("markers",{resolver,watchCallback:this.__onResolverForMarkersWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForMarkersWatchCallback)})}__onResolverForMarkersWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("markers"),data.error===TcHmi.Errors.NONE?this.__markers===data.value||this.__markers&&tchmi_equal(data.value,Array.from(this.__markers.keys()))||(null===data.value||void 0===data.value?this.__markers=data.value:this.__markers=new Map(data.value.map(marker=>[marker,null])),TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Markers"}),this.__processMarkers()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"Markers"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getMarkers(){return this.__markers?Array.from(this.__markers.keys()):void 0}__processMarkers(){const domLegend=this.__elementTemplateRoot[0].querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");if(domLegend?.remove(),this.__elementLegend=void 0,!this.__markers||0===this.__markers.size)return this.__elementSvg[0].style.alignSelf="",this.__removeMarkerElements(),void this.__updateLayout();const legend=document.createElement("div");this.__elementLegend=legend,legend.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");for(const marker of this.__markers.keys()){if(void 0!==this.__maxValue&&marker.value>this.__maxValue||void 0!==this.__minValue&&marker.value<this.__minValue)continue;const item=document.createElement("div");item.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item");const itemColor=document.createElement("div");itemColor.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-color"),itemColor.style.backgroundColor=TcHmi.StyleProvider.resolveSolidColorAsCssValue(marker.color);const itemLabel=document.createElement("span");itemLabel.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label"),itemLabel.textContent=marker.label,item.append(itemColor,itemLabel),legend.appendChild(item)}this.__elementTemplateRoot[0].appendChild(legend),this.__elementSvg[0].style.alignSelf="end",this.__processLegendFontWeight(),this.__processLegendFontSize(),this.__processLegendFontFamily(),this.__processLegendFontStyle(),this.__createMarkerElements(),this.__updateLayout()}__createMarkerElements(){if(this.__removeMarkerElements(),this.__markers&&0!==this.__markers.size){this.__elementMarkersContainer||(this.__elementMarkersContainer=document.createElementNS("http://www.w3.org/2000/svg","g"),this.__elementMarkersContainer.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-marker-container"),this.__proportions&&this.__elementMarkersContainer.setAttribute("transform","translate("+this.__proportions.outerRadius+", "+this.__proportions.outerRadius+")"),this.__elementKnobG.before(this.__elementMarkersContainer));for(const marker of this.__markers.keys()){if(void 0!==this.__maxValue&&marker.value>this.__maxValue||void 0!==this.__minValue&&marker.value<this.__minValue)continue;const elementMarkerLineSvg=document.createElementNS("http://www.w3.org/2000/svg","line");elementMarkerLineSvg.classList.add("TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-marker"),elementMarkerLineSvg.setAttribute("x1","0"),elementMarkerLineSvg.setAttribute("y1",(this.__proportions.outerRadius-this.__proportions.valueRadius-9-.5).toString()),elementMarkerLineSvg.setAttribute("x2","0"),elementMarkerLineSvg.setAttribute("y2",(this.__proportions.outerRadius-this.__proportions.valueRadius-.5).toString());const elementMarkerTriangleSvg=document.createElementNS("http://www.w3.org/2000/svg","polygon");"Inside"===this.__labelPosition?elementMarkerTriangleSvg.setAttribute("points","0,0 10,0 5,10"):elementMarkerTriangleSvg.setAttribute("points","0,10 10,10 5,0"),TcHmi.StyleProvider.processStrokeColor(elementMarkerLineSvg,marker.color),TcHmi.StyleProvider.processStrokeColor(elementMarkerTriangleSvg,marker.color),TcHmi.StyleProvider.processFillColor(elementMarkerTriangleSvg,marker.color),this.__elementMarkersContainer.append(elementMarkerLineSvg,elementMarkerTriangleSvg);const value={svgElementLine:elementMarkerLineSvg,svgElementTriangle:elementMarkerTriangleSvg};this.__markers.set(marker,value)}this.__updateMarkers()}}__removeMarkerElements(){if(this.__elementMarkersContainer)for(;this.__elementMarkersContainer.firstChild;)this.__elementMarkersContainer.removeChild(this.__elementMarkersContainer.firstChild)}__updateMarkers(){if(this.__markers)for(const[marker,svgs]of this.__markers){if(void 0!==this.__maxValue&&marker.value>this.__maxValue||void 0!==this.__minValue&&marker.value<this.__minValue)continue;let transformTriangle,transformLine=" rotate("+this.__calcAngleFromValue(marker.value)+" ) translate(0, "+(5-this.__proportions.outerRadius)+")";transformTriangle="Inside"===this.__labelPosition?" rotate("+this.__calcAngleFromValue(marker.value)+" ) translate(-5, "+(5-this.__proportions.outerRadius)+")":" rotate("+this.__calcAngleFromValue(marker.value)+" ) translate(-5, "+-this.__proportions.markerRadius+")",svgs?.svgElementLine?.setAttribute("transform",transformLine),svgs?.svgElementTriangle?.setAttribute("transform",transformTriangle)}}setLegendFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LegendFontFamily")),convertedValue!==this.__legendFontFamily&&(this.__legendFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LegendFontFamily"}),this.__processLegendFontFamily())}getLegendFontFamily(){return this.__legendFontFamily}__processLegendFontFamily(){const legend=this.__elementTemplateRoot[0].querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");if(!legend)return;const labels=legend.querySelectorAll(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label");TcHmi.StyleProvider.processFontFamily(labels,this.__legendFontFamily),this.__updateLayout()}setLegendFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LegendFontSize")),convertedValue!==this.__legendFontSize&&(this.__legendFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LegendFontSize"}),this.__processLegendFontSize())}getLegendFontSize(){return this.__legendFontSize}__processLegendFontSize(){const legend=this.__elementTemplateRoot[0].querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");if(!legend)return;const labels=legend.querySelectorAll(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label");TcHmi.StyleProvider.processFontSize(labels,this.__legendFontSize,"px"),this.__updateLayout()}getLegendFontSizeUnit(){return"px"}setLegendFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LegendFontStyle")),convertedValue!==this.__legendFontStyle&&(this.__legendFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LegendFontStyle"}),this.__processLegendFontStyle())}getLegendFontStyle(){return this.__legendFontStyle}__processLegendFontStyle(){const legend=this.__elementTemplateRoot[0].querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");if(!legend)return;const labels=legend.querySelectorAll(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label");TcHmi.StyleProvider.processFontStyle(labels,this.__legendFontStyle),this.__updateLayout()}setLegendFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LegendFontWeight")),convertedValue!==this.__legendFontWeight&&(this.__legendFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LegendFontWeight"}),this.__processLegendFontWeight())}getLegendFontWeight(){return this.__legendFontWeight}__processLegendFontWeight(){const legend=this.__elementTemplateRoot[0].querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend");if(!legend)return;const labels=legend.querySelectorAll(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label");TcHmi.StyleProvider.processFontWeight(labels,this.__legendFontWeight),this.__updateLayout()}setLegendLabelColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LegendLabelColor"));let resolverInfo=this.__objectResolvers.get("legendLabelColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("LegendLabelColor")?.type});this.__objectResolvers.set("legendLabelColor",{resolver,watchCallback:this.__onResolverForLegendLabelColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForLegendLabelColorWatchCallback)})}__onResolverForLegendLabelColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("legendLabelColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__legendLabelColor)||(this.__legendLabelColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LegendLabelColor"}),this.__processLegendLabelColor()):TcHmi.Log.Controls.error(this,TcHmiRadialGauge.#tchmiFQN,{Attribute:"LegendLabelColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getLegendLabelColor(){return this.__legendLabelColor}__processLegendLabelColor(){const legendItems=this.__elementLegend?.querySelectorAll(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item");if(!legendItems)return;const elementLabels=Array.from(legendItems).map(item=>item.querySelector(".TcHmi_Controls_Beckhoff_TcHmiRadialGauge-template-legend-item-label"));elementLabels&&TcHmi.StyleProvider.processTextColor(elementLabels,this.__legendLabelColor)}}})();TcHmi.Controls.registerEx("TcHmiRadialGauge","TcHmi.Controls.Beckhoff",TcHmiRadialGauge,{injectInGlobalObject:!0});export{TcHmiRadialGauge as Control}; |