1 line
28 KiB
JavaScript
1 line
28 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";let TcHmiPieChart=(()=>{var _a,_b,_c;let ___rebuild_decorators,___onCheckboxMouseDown_decorators,___onCheckboxTouchStart_decorators,___onResolverForSectionsBackgroundColorWatchCallback_decorators,___onResolverForPieGraphDescriptionsWatchCallback_decorators,___onResolverForPieGraphDataWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiPieChart extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___rebuild_decorators=[TcHmi.EventHandler()],___onCheckboxMouseDown_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onCheckboxTouchStart_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onResolverForSectionsBackgroundColorWatchCallback_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onResolverForPieGraphDescriptionsWatchCallback_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],___onResolverForPieGraphDataWatchCallback_decorators=[(_c=TcHmi).CallbackMethod.bind(_c)],__esDecorate(this,null,___rebuild_decorators,{kind:"method",name:"__rebuild",static:!1,private:!1,access:{has:obj=>"__rebuild"in obj,get:obj=>obj.__rebuild},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onCheckboxMouseDown_decorators,{kind:"method",name:"__onCheckboxMouseDown",static:!1,private:!1,access:{has:obj=>"__onCheckboxMouseDown"in obj,get:obj=>obj.__onCheckboxMouseDown},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onCheckboxTouchStart_decorators,{kind:"method",name:"__onCheckboxTouchStart",static:!1,private:!1,access:{has:obj=>"__onCheckboxTouchStart"in obj,get:obj=>obj.__onCheckboxTouchStart},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForSectionsBackgroundColorWatchCallback_decorators,{kind:"method",name:"__onResolverForSectionsBackgroundColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForSectionsBackgroundColorWatchCallback"in obj,get:obj=>obj.__onResolverForSectionsBackgroundColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForPieGraphDescriptionsWatchCallback_decorators,{kind:"method",name:"__onResolverForPieGraphDescriptionsWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForPieGraphDescriptionsWatchCallback"in obj,get:obj=>obj.__onResolverForPieGraphDescriptionsWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForPieGraphDataWatchCallback_decorators,{kind:"method",name:"__onResolverForPieGraphDataWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForPieGraphDataWatchCallback"in obj,get:obj=>obj.__onResolverForPieGraphDataWatchCallback},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);__elementChart;__elementLegend;__pieChart=null;__sectionsBackgroundColor;__pieGraphDescriptions;__pieGraphDescriptionsSelected;__pieGraphData;__pieGraphDataSelected;__legendFontFamily;__legendFontSize;__legendFontStyle;__legendFontWeight;__showLegend;__labelUnit;__labelPosition;__percentLabelDecimalPlaces;__valueLabelDecimalPlaces;__labelFontFamily;__labelFontSize;__labelFontWeight;__storage;__activeLegendElements;__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template"),this.__elementChart=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-chart"),this.__elementLegend=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend"),0!==this.__elementTemplateRoot.length&&0!==this.__elementChart.length&&0!==this.__elementLegend.length||(this.__elementTemplateRoot=this.__element.find(".tchmi-pie-chart-template")),0===this.__elementTemplateRoot.length)throw new Error("Invalid Template.html");if("undefined"==typeof TcHmiCharting)throw new Error("Missing needed TcHmiCharting library");super.__previnit()}__init(){if(super.__init(),this.__storage=new TcHmi.LocalStorage(this,{activeLegendElements:this.getCurrentGraphLength()}),this.__activeLegendElements=this.__storage.get("activeLegendElements"),this.__pieGraphDataSelected=[],this.__pieGraphDescriptionsSelected=[],this.__pieGraphData&&this.__pieGraphDescriptions){for(let i=0,ii=Math.min(this.__pieGraphDescriptions.length,this.__pieGraphData.length);i<ii;i++)(!this.__showLegend||this.__activeLegendElements&&this.__activeLegendElements.includes(i)||!this.__activeLegendElements)&&(this.__pieGraphDataSelected.push(this.__pieGraphData[i]),this.__pieGraphDescriptionsSelected.push(this.__pieGraphDescriptions[i]))}this.__createLegend()}__attach(){super.__attach(),this.__destroyOnDetach.push(TcHmi.EventProvider.register(this.__id+".onResized",this.__rebuild),TcHmi.EventProvider.register("onThemeDataChanged",this.__rebuild),TcHmi.EventProvider.registerDomEvent(this.__elementLegend[0],"mousedown",this.__onCheckboxMouseDown),TcHmi.EventProvider.registerDomEvent(this.__elementLegend[0],"touchstart",this.__onCheckboxTouchStart))}__detach(){super.__detach()}destroy(){this.__keepAlive||super.destroy()}__rebuild(_event,ctrl){this.__drawPieChart()}__drawPieChart(){if(!this.__isAttached)return;let innerWidth=this.__elementChart[0].clientWidth,innerHeight=this.__elementChart[0].clientHeight;if(null!==this.__pieChart?this.__pieChart.clear(innerWidth,innerHeight):this.__pieChart=new TcHmiCharting.PieChart(this.__elementChart,innerWidth,innerHeight),this.__pieGraphDataSelected&&this.__pieGraphDescriptionsSelected){for(let i=0,ii=Math.min(this.__pieGraphDescriptionsSelected.length,this.__pieGraphDataSelected.length);i<ii;i++){let piecesOfPie=tchmi_clone_object(this.__pieGraphDescriptionsSelected[i]);if(null!==piecesOfPie){let color=this.__pieGraphDescriptionsSelected[i].pieColor;if(!TcHmi.isSolidColor(color)){let themeLineColor=TcHmi.Theme.Resources.get(this,"DefaultGraphColor");TcHmi.isSolidColor(themeLineColor.value)&&(piecesOfPie.pieColor=themeLineColor.value)}let labelColor=this.__pieGraphDescriptionsSelected[i].labelColor;if(!TcHmi.isSolidColor(labelColor)){let themeLineColor=TcHmi.Theme.Resources.get(this,"DefaultLabelColor");TcHmi.isSolidColor(themeLineColor.value)&&(piecesOfPie.labelColor=themeLineColor.value)}}this.__pieChart.addPieceOfPie(piecesOfPie),this.__pieChart.addValueOfPie(this.__pieGraphDataSelected[i]),this.__pieChart.setLabelUnit(void 0===this.__labelUnit?this.getAttributeDefaultValueInternal("LabelUnit"):this.__labelUnit),this.__pieChart.setLabelPosition(void 0===this.__labelPosition?this.getAttributeDefaultValueInternal("LabelPosition"):this.__labelPosition),this.__pieChart.setPercentLabelDecimalPlaces(void 0===this.__percentLabelDecimalPlaces?this.getAttributeDefaultValueInternal("PercentLabelDecimalPlaces"):this.__percentLabelDecimalPlaces),this.__pieChart.setValueLabelDecimalPlaces(void 0===this.__valueLabelDecimalPlaces?this.getAttributeDefaultValueInternal("ValueLabelDecimalPlaces"):this.__valueLabelDecimalPlaces),this.__pieChart.setLabelFontFamily(this.__labelFontFamily),this.__pieChart.setLabelFontSize(void 0===this.__labelFontSize?this.getAttributeDefaultValueInternal("LabelFontSize"):this.__labelFontSize),this.__pieChart.setLabelFontWeight(void 0===this.__labelFontWeight?this.getAttributeDefaultValueInternal("LabelFontWeight"):this.__labelFontWeight)}}this.__pieChart.draw()}__createLegend(useOldElements=!1){let legendChildsLength=this.__elementLegend.children().length;if(this.__pieGraphData&&this.__pieGraphDescriptions&&!useOldElements||this.__pieGraphData&&this.__pieGraphDescriptions&&legendChildsLength!==this.__pieGraphData.length){if(this.__elementLegend.children().remove(),this.__showLegend){TcHmi.StyleProvider.setSimpleElementStyle(this.__elementLegend,"display","");for(let i=0,ii=Math.min(this.__pieGraphData.length,this.__pieGraphDescriptions.length);i<ii;i++){let label=document.createElement("label");label.setAttribute("class","TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label"),this.__legendFontFamily&&(label.style.fontFamily=this.__legendFontFamily),this.__legendFontSize&&(label.style.fontSize=this.__legendFontSize+"px"),this.__legendFontStyle&&(label.style.fontStyle=this.__legendFontStyle),this.__legendFontWeight&&(label.style.fontWeight=this.__legendFontWeight);let checkbox=document.createElement("input");checkbox.setAttribute("type","checkbox"),checkbox.setAttribute("id",this.__id+"Element"+i),checkbox.setAttribute("class","TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox");let color=document.createElement("div");color.setAttribute("class","TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-color-element");let backColor=this.__pieGraphDescriptions[i].pieColor;if(TcHmi.isSolidColor(backColor)||(backColor={color:"#4794da"}),color.setAttribute("style","background-color: "+TcHmi.StyleProvider.resolveSolidColorAsCssValue(backColor)+";"),label.append(checkbox),label.append(color),this.__pieGraphDescriptions[i]&&this.__pieGraphDescriptions[i].name)label.append(this.__pieGraphDescriptions[i].name);else{let text=document.createTextNode("["+i+"]");label.appendChild(text)}this.__elementLegend.append(label),this.__activeLegendElements?this.__activeLegendElements.includes(i)?checkbox.checked=!0:checkbox.checked=!1:checkbox.checked=!0}return}TcHmi.StyleProvider.setSimpleElementStyle(this.__elementLegend,"display","none")}}getCurrentGraphLength(){return this.__pieGraphData?this.__pieGraphData.length:0}__onCheckboxMouseDown(event){if(1!==event.which)return;let childElement=event.target,checkboxElem=null;if(childElement.classList.contains("TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox"))checkboxElem=childElement;else if(childElement.classList.contains("TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label")){let checkboxList=childElement.getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox");checkboxList&&checkboxList.length>0&&(checkboxElem=checkboxList[0])}else if(childElement.classList.contains("TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-color-element")&&childElement&&childElement.parentElement){let checkboxList=childElement.parentElement.getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox");checkboxList&&checkboxList.length>0&&(checkboxElem=checkboxList[0])}if(checkboxElem){let checked=!checkboxElem.checked,id=checkboxElem.id,elementIndex=parseInt(id.replace(this.__id+"Element",""),10);if(!TcHmi.Access.checkAccess(this,"operate"))return void(checkboxElem.checked=checked);this.__pieGraphDataSelected=[],this.__pieGraphDescriptionsSelected=[];let children=this.__elementLegend.children(),activeLegendElements=[];for(let i=0,ii=children.length;i<ii;i++){let checkedCheckbox=children[i].childNodes[0].checked;i===elementIndex&&(checkedCheckbox=!checkedCheckbox),checkedCheckbox&&activeLegendElements.push(i),checkedCheckbox&&this.__pieGraphData&&this.__pieGraphDescriptions&&(this.__pieGraphDataSelected.push(this.__pieGraphData[i]),this.__pieGraphDescriptionsSelected.push(this.__pieGraphDescriptions[i]))}this.__activeLegendElements=activeLegendElements,this.__storage?.set("activeLegendElements",activeLegendElements),this.__drawPieChart()}}__onCheckboxTouchStart(event){let childElement=event.target;if(childElement){let checkboxList=childElement.getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiScopeControl-template-legend-checkbox");if(checkboxList&&checkboxList.length>0){let checkoboxElement=checkboxList[0],id=checkoboxElement.id,checked=!checkoboxElement.checked,elementIndex=parseInt(id.replace(this.__id+"Element",""),10);if(!TcHmi.Access.checkAccess(this,"operate"))return void(checkoboxElement.checked=checked);this.__pieGraphDataSelected=[],this.__pieGraphDescriptionsSelected=[];let activeLegendElements=[],children=this.__elementLegend.children();for(let i=0,ii=children.length;i<ii;i++){let checkedCheckbox=children[i].childNodes[0].checked;i===elementIndex&&(checkedCheckbox=!checkedCheckbox),checkedCheckbox&&activeLegendElements.push(i),checkedCheckbox&&this.__pieGraphData&&this.__pieGraphDescriptions&&(this.__pieGraphDataSelected.push(this.__pieGraphData[i]),this.__pieGraphDescriptionsSelected.push(this.__pieGraphDescriptions[i]))}this.__activeLegendElements=activeLegendElements,this.__storage?.set("activeLegendElements",activeLegendElements),this.__drawPieChart()}}}setSectionsBackgroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SectionsBackgroundColor"));let resolverInfo=this.__objectResolvers.get("sectionsBackgroundColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("SectionsBackgroundColor")?.type});this.__objectResolvers.set("sectionsBackgroundColor",{resolver,watchCallback:this.__onResolverForSectionsBackgroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForSectionsBackgroundColorWatchCallback)})}__onResolverForSectionsBackgroundColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("sectionsBackgroundColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__sectionsBackgroundColor)||(this.__sectionsBackgroundColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SectionsBackgroundColor"}),this.__processSectionsBackgroundColor()):TcHmi.Log.Controls.error(this,TcHmiPieChart.#tchmiFQN,{Attribute:"SectionsBackgroundColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getSectionsBackgroundColor(){return this.__sectionsBackgroundColor}__processSectionsBackgroundColor(){TcHmi.StyleProvider.processBackgroundColor(this.__elementChart,this.__sectionsBackgroundColor),TcHmi.StyleProvider.processBackgroundColor(this.__elementLegend,this.__sectionsBackgroundColor)}setPieGraphDescriptions(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("PieGraphDescriptions"));let resolverInfo=this.__objectResolvers.get("pieGraphDescriptions");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("PieGraphDescriptions")?.type});this.__objectResolvers.set("pieGraphDescriptions",{resolver,watchCallback:this.__onResolverForPieGraphDescriptionsWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForPieGraphDescriptionsWatchCallback)})}__onResolverForPieGraphDescriptionsWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("pieGraphDescriptions"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__pieGraphDescriptions)||(this.__pieGraphDescriptions=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"PieGraphDescriptions"}),this.__processPieGraphDescriptions()):TcHmi.Log.Controls.error(this,TcHmiPieChart.#tchmiFQN,{Attribute:"PieGraphDescriptions"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getPieGraphDescriptions(){return this.__pieGraphDescriptions}__processPieGraphDescriptions(){this.__pieGraphDescriptionsSelected=this.__pieGraphDescriptions,this.__pieGraphDataSelected=this.__pieGraphData,this.__attributesInitialized&&(this.__createLegend(),this.__drawPieChart())}setPieGraphData(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("PieGraphData"));let resolverInfo=this.__objectResolvers.get("pieGraphData");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("PieGraphData")?.type});this.__objectResolvers.set("pieGraphData",{resolver,watchCallback:this.__onResolverForPieGraphDataWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForPieGraphDataWatchCallback)})}__onResolverForPieGraphDataWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("pieGraphData"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__pieGraphData)||(this.__pieGraphData=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"PieGraphData"}),this.__processPieGraphData()):TcHmi.Log.Controls.error(this,TcHmiPieChart.#tchmiFQN,{Attribute:"PieGraphData"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getPieGraphData(){return this.__pieGraphData}__processPieGraphData(){if(this.__pieGraphDataSelected=[],this.__pieGraphDescriptionsSelected=[],this.__pieGraphData&&this.__pieGraphDescriptions){let min=Math.min(this.__pieGraphData.length,this.__pieGraphDescriptions.length),children=this.__elementLegend.children();this.__activeLegendElements=[];for(let i=0,ii=min;i<ii;i++){let checkedCheckbox=!0;children[i]&&(checkedCheckbox=children[i].childNodes[0].checked),checkedCheckbox&&(this.__pieGraphDataSelected.push(this.__pieGraphData[i]),this.__pieGraphDescriptionsSelected.push(this.__pieGraphDescriptions[i]),this.__activeLegendElements.push(i))}}this.__attributesInitialized&&(this.__createLegend(!0),this.__drawPieChart())}setShowLegend(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ShowLegend")),convertedValue!==this.__showLegend&&(this.__showLegend=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ShowLegend"}),this.__processShowLegend())}getShowLegend(){return this.__showLegend}__processShowLegend(){if(this.__pieGraphDataSelected=[],this.__pieGraphDescriptionsSelected=[],this.__pieGraphData&&this.__pieGraphDescriptions){for(let i=0,ii=Math.min(this.__pieGraphDescriptions.length,this.__pieGraphData.length);i<ii;i++)(!this.__showLegend||this.__activeLegendElements&&this.__activeLegendElements.includes(i)||!this.__activeLegendElements)&&(this.__pieGraphDataSelected.push(this.__pieGraphData[i]),this.__pieGraphDescriptionsSelected.push(this.__pieGraphDescriptions[i]))}this.__attributesInitialized&&(this.__createLegend(),this.__drawPieChart())}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(){this.__isAttached&&(TcHmi.StyleProvider.processFontFamily(this.__elementLegend.children(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label"),this.__legendFontFamily),this.__drawPieChart())}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(){this.__isAttached&&(TcHmi.StyleProvider.processFontSize(this.__elementLegend.children(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label"),this.__legendFontSize,"px"),this.__drawPieChart())}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(){this.__isAttached&&(TcHmi.StyleProvider.processFontStyle(this.__elementLegend.children(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label"),this.__legendFontStyle),this.__drawPieChart())}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(){this.__isAttached&&(TcHmi.StyleProvider.processFontWeight(this.__elementLegend.children(".TcHmi_Controls_Beckhoff_TcHmiPieChart-template-legend-checkbox-label"),this.__legendFontWeight),this.__drawPieChart())}setLabelUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("LabelUnit")),convertedValue!==this.__labelUnit&&(this.__labelUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"LabelUnit"}),this.__processLabelUnit())}getLabelUnit(){return this.__labelUnit}__processLabelUnit(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setLabelUnit(void 0===this.__labelUnit?this.getAttributeDefaultValueInternal("LabelUnit"):this.__labelUnit),this.__pieChart.draw())}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.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setLabelPosition(void 0===this.__labelPosition?this.getAttributeDefaultValueInternal("LabelPosition"):this.__labelPosition),this.__pieChart.draw())}setPercentLabelDecimalPlaces(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("PercentLabelDecimalPlaces")),convertedValue!==this.__percentLabelDecimalPlaces&&(this.__percentLabelDecimalPlaces=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"PercentLabelDecimalPlaces"}),this.__processPercentLabelDecimalPlaces())}getPercentLabelDecimalPlaces(){return this.__percentLabelDecimalPlaces}__processPercentLabelDecimalPlaces(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setPercentLabelDecimalPlaces(void 0===this.__percentLabelDecimalPlaces?this.getAttributeDefaultValueInternal("PercentLabelDecimalPlaces"):this.__percentLabelDecimalPlaces),this.__pieChart.draw())}setValueLabelDecimalPlaces(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ValueLabelDecimalPlaces")),convertedValue!==this.__valueLabelDecimalPlaces&&(this.__valueLabelDecimalPlaces=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ValueLabelDecimalPlaces"}),this.__processValueLabelDecimalPlaces())}getValueLabelDecimalPlaces(){return this.__valueLabelDecimalPlaces}__processValueLabelDecimalPlaces(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setValueLabelDecimalPlaces(void 0===this.__valueLabelDecimalPlaces?this.getAttributeDefaultValueInternal("ValueLabelDecimalPlaces"):this.__valueLabelDecimalPlaces),this.__pieChart.draw())}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(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setLabelFontFamily(this.__labelFontFamily),this.__pieChart.draw())}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(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setLabelFontSize(void 0===this.__labelFontSize?this.getAttributeDefaultValueInternal("LabelFontSize"):this.__labelFontSize),this.__pieChart.draw())}getLabelFontSizeUnit(){return"px"}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(){this.__pieChart&&this.__attributesInitialized&&(this.__pieChart.setLabelFontWeight(void 0===this.__labelFontWeight?this.getAttributeDefaultValueInternal("LabelFontWeight"):this.__labelFontWeight),this.__pieChart.draw())}}})();TcHmi.Controls.registerEx("TcHmiPieChart","TcHmi.Controls.Beckhoff",TcHmiPieChart,{injectInGlobalObject:!0});export{TcHmiPieChart as Control}; |