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
3.3 KiB
JavaScript

import{Control as TcHmiLinearGauge}from"../TcHmiLinearGauge/TcHmiLinearGauge.esm.js";class TcHmiThermometer extends TcHmiLinearGauge{static#tchmiFQN="TcHmi.Controls.Beckhoff."+this.name;__bulbColor;__resizeObserver;__resizeObserverActive=!1;constructor(element,pcElement,attrs){super(element,pcElement,attrs),this.__resizeObserver=new ResizeObserver(evt=>{this.__resizeObserverActive||(this.__resizeObserverActive=!0,requestAnimationFrame(()=>{this.__resizeBulb(),this.__resizeObserverActive=!1}))})}__previnit(){super.__previnit()}__init(){super.__init()}__attach(){super.__attach(),this.__resizeObserver.observe(this.__elementTrack[0])}__detach(){this.__resizeObserver.unobserve(this.__elementTrack[0]),super.__detach()}destroy(){super.destroy()}__onResized(){super.__onResized(),this.__elementTemplateRoot[0].style.padding="";const paddingLeft=parseFloat(window.getComputedStyle(this.__elementTemplateRoot[0]).paddingLeft),paddingRight=parseFloat(window.getComputedStyle(this.__elementTemplateRoot[0]).paddingRight),paddingTop=parseFloat(window.getComputedStyle(this.__elementTemplateRoot[0]).paddingTop),paddingBottom=parseFloat(window.getComputedStyle(this.__elementTemplateRoot[0]).paddingBottom);if("Vertical"===this.__orientation||"VerticalInverted"===this.__orientation){if(this.__elementTrack[0].clientWidth/2>this.__elementTicks[0].clientWidth+this.__elementLabels[0].clientWidth){const test=this.__elementTrack[0].clientWidth/2-(this.__elementTicks[0].clientWidth+this.__elementLabels[0].clientWidth);this.__elementTemplateRoot[0].style.paddingLeft=paddingLeft+test/2+"px",this.__elementTemplateRoot[0].style.paddingRight=paddingRight+test/2+"px"}}else if(this.__elementTrack[0].clientHeight/2>this.__elementTicks[0].clientHeight+this.__elementLabels[0].clientHeight){const test=this.__elementTrack[0].clientHeight/2-(this.__elementTicks[0].clientHeight+this.__elementLabels[0].clientHeight);this.__elementTemplateRoot[0].style.paddingTop=paddingTop+test/2+"px",this.__elementTemplateRoot[0].style.paddingBottom=paddingBottom+test/2+"px"}}__resizeBulb(){const width=this.__elementTrack[0].getBoundingClientRect().width,height=this.__elementTrack[0].getBoundingClientRect().height;let newBulbRadius;newBulbRadius="Vertical"===this.__orientation||"VerticalInverted"===this.__orientation?width:height,this.__element[0].style.setProperty("--bulb-radius",newBulbRadius+"px"),this.__onResized()}__processOrientation(){super.__processOrientation(),this.__elementTemplateRoot.removeClass("horizontal horizontal-inverted vertical vertical-inverted"),"Horizontal"===this.__orientation?this.__elementTemplateRoot.addClass("horizontal"):"HorizontalInverted"===this.__orientation?this.__elementTemplateRoot.addClass("horizontal-inverted"):"Vertical"===this.__orientation?this.__elementTemplateRoot.addClass("vertical"):"VerticalInverted"===this.__orientation&&this.__elementTemplateRoot.addClass("vertical-inverted")}__processProgressForegroundColor(){if(super.__processProgressForegroundColor(),!TcHmi.isSolidColor(this.__progressForegroundColor))return void this.__element[0].style.setProperty("--bulb-color","");const color=TcHmi.StyleProvider.resolveSolidColorAsCssValue(this.__progressForegroundColor);this.__element[0].style.setProperty("--bulb-color",color)}}TcHmi.Controls.registerEx("TcHmiThermometer","TcHmi.Controls.Beckhoff",TcHmiThermometer,{injectInGlobalObject:!0});export{TcHmiThermometer as Control};