Files
m.heisig 2d11c43579 Added minimal functionality for Robot teaching
- Added minimal HMI
- Added possibility to open and close all chamber doors
2026-01-17 09:20:39 +01:00

1 line
8.8 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 TcHmiEllipse=(()=>{var _a,_b;let ___onResized_decorators,___onResolverForFillColorWatchCallback_decorators,___onResolverForStrokeColorWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiEllipse extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onResized_decorators=[TcHmi.EventHandler()],___onResolverForFillColorWatchCallback_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onResolverForStrokeColorWatchCallback_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],__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,___onResolverForFillColorWatchCallback_decorators,{kind:"method",name:"__onResolverForFillColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForFillColorWatchCallback"in obj,get:obj=>obj.__onResolverForFillColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForStrokeColorWatchCallback_decorators,{kind:"method",name:"__onResolverForStrokeColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForStrokeColorWatchCallback"in obj,get:obj=>obj.__onResolverForStrokeColorWatchCallback},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);__elementSvgEllipse;__fillColor;__strokeColor;__strokeThickness;__strokeStyle;__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiEllipse-template"),0===this.__elementTemplateRoot.length&&(this.__elementTemplateRoot=this.__element.find(".tchmi-ellipse-template")),this.__elementSvgEllipse=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiEllipse-template-svg-ellipse"),0===this.__elementSvgEllipse.length&&(this.__elementSvgEllipse=this.__elementTemplateRoot.find(".tchmi-ellipse-template-svg-ellipse")),0===this.__elementTemplateRoot.length||0===this.__elementSvgEllipse.length)throw new Error("Invalid Template.html");super.__previnit()}__init(){super.__init()}__attach(){super.__attach(),this.__destroyOnDetach.push(TcHmi.EventProvider.register(this.__id+".onResized",this.__onResized))}__detach(){super.__detach()}destroy(){this.__keepAlive||super.destroy()}__onResized(_event,_control){this.__updateDimensions()}__updateDimensions(){let width=this.getRenderedWidth();if(!width)return;let height=this.getRenderedHeight();if(!height)return;let strokeThickness=this.__strokeThickness?this.__strokeThickness:0;strokeThickness=strokeThickness<width/2?strokeThickness:width/2,strokeThickness=strokeThickness<height/2?strokeThickness:height/2;let rx=width/2-Math.ceil(strokeThickness/2),ry=height/2-Math.ceil(strokeThickness/2);this.__elementSvgEllipse[0].setAttribute("cx",(width/2).toString()),this.__elementSvgEllipse[0].setAttribute("rx",(rx>0?rx:1).toString()),this.__elementSvgEllipse[0].setAttribute("cy",(height/2).toString()),this.__elementSvgEllipse[0].setAttribute("ry",(ry>0?ry:1).toString()),this.__elementSvgEllipse[0].style.strokeWidth=strokeThickness.toString()}setFillColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("FillColor"));let resolverInfo=this.__objectResolvers.get("fillColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("FillColor")?.type});this.__objectResolvers.set("fillColor",{resolver,watchCallback:this.__onResolverForFillColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForFillColorWatchCallback)})}__onResolverForFillColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("fillColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__fillColor)||(this.__fillColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"FillColor"}),this.__processFillColor()):TcHmi.Log.Controls.error(this,TcHmiEllipse.#tchmiFQN,{Attribute:"FillColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getFillColor(){return this.__fillColor}__processFillColor(){TcHmi.StyleProvider.processFillColor(this.__elementSvgEllipse,this.__fillColor)}setStrokeColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StrokeColor"));let resolverInfo=this.__objectResolvers.get("strokeColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("StrokeColor")?.type});this.__objectResolvers.set("strokeColor",{resolver,watchCallback:this.__onResolverForStrokeColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForStrokeColorWatchCallback)})}__onResolverForStrokeColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("strokeColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__strokeColor)||(this.__strokeColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StrokeColor"}),this.__processStrokeColor()):TcHmi.Log.Controls.error(this,TcHmiEllipse.#tchmiFQN,{Attribute:"StrokeColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getStrokeColor(){return this.__strokeColor}__processStrokeColor(){TcHmi.StyleProvider.processStrokeColor(this.__elementSvgEllipse,this.__strokeColor)}setStrokeStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StrokeStyle")),convertedValue!==this.__strokeStyle&&(this.__strokeStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StrokeStyle"}),this.__processStrokeStyle())}getStrokeStyle(){return this.__strokeStyle}__processStrokeStyle(){TcHmi.StyleProvider.setSimpleElementStyle(this.__elementSvgEllipse,"stroke-dasharray",this.__strokeStyle)}setStrokeThickness(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StrokeThickness")),valueNew!==this.__strokeThickness&&(this.__strokeThickness=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StrokeThickness"}),this.__processStrokeThickness())}getStrokeThickness(){return this.__strokeThickness}__processStrokeThickness(){this.__updateDimensions()}getStrokeThicknessUnit(){return"px"}__processStrokeThicknessUnit(){}}})();TcHmi.Controls.registerEx("TcHmiEllipse","TcHmi.Controls.Beckhoff",TcHmiEllipse,{injectInGlobalObject:!0});export{TcHmiEllipse as Control};