Added minimal functionality for Robot teaching

- Added minimal HMI
- Added possibility to open and close all chamber doors
This commit is contained in:
2026-01-17 09:20:39 +01:00
parent 9f058db2a3
commit 2d11c43579
2274 changed files with 912690 additions and 162 deletions

View File

@@ -0,0 +1,427 @@
{
"$schema": "../../TcHmiFramework/Schema/ControlDescription.Schema.json",
"apiVersion": 1,
"name": "TcHmiAudio",
"namespace": "TcHmi.Controls.Beckhoff",
"displayName": "Audio",
"version": {
"full": "14.4.1.0",
"major": 14,
"minor": 4,
"build": 1,
"revision": 0
},
"visible": true,
"themeable": "Standard",
"base": "TcHmi.Controls.System.TcHmiControl",
"description": "A simple audio player.",
"defaultDesignerEvent": "",
"properties": {
"containerControl": false,
"geometry": {
"width": 300,
"height": 54
}
},
"icons": [
{
"name": "Icons/16x16.png",
"width": 16,
"height": 16
}
],
"template": "Template.html",
"dependencyFiles": [
{
"name": "Style.css",
"type": "Stylesheet",
"description": ""
},
{
"name": "../dist/TcHmiAudio/TcHmiAudio.esm.js",
"type": "EsModule",
"description": "Contains all the main logic as ES module."
}
],
"themes": {},
"attributes": [
{
"name": "data-tchmi-src-list",
"propertyName": "SrcList",
"propertySetterName": "setSrcList",
"propertyGetterName": "getSrcList",
"displayName": "Src List",
"visible": true,
"themeable": "Advanced",
"displayPriority": 10,
"type": "tchmi:framework#/definitions/TcHmi.Controls.Beckhoff.TcHmiAudio.AudioSourceList",
"category": "Common",
"description": "A List of audio sources. The order of the list corresponds to the order in which the sources are attempted to be loaded.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"allowSymbolExpressionsInObject": true,
"defaultValue": null,
"defaultValueInternal": null
},
{
"name": "data-tchmi-volume",
"propertyName": "Volume",
"propertySetterName": "setVolume",
"propertyGetterName": "getVolume",
"displayName": "Volume",
"visible": true,
"themeable": "Advanced",
"displayPriority": 20,
"type": "tchmi:framework#/definitions/Fraction",
"category": "Audio",
"description": "The volume value between 0 and 1.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": null,
"defaultValueInternal": 1
},
{
"name": "data-tchmi-mute",
"propertyName": "Mute",
"propertySetterName": "setMute",
"propertyGetterName": "getMute",
"displayName": "Mute",
"visible": true,
"themeable": "Advanced",
"displayPriority": 20,
"type": "tchmi:general#/definitions/Boolean",
"category": "Audio",
"description": "If set true, the audio will be silenced.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": true,
"defaultValueInternal": false
},
{
"name": "data-tchmi-playbackrate",
"propertyName": "Playbackrate",
"propertySetterName": "setPlaybackrate",
"propertyGetterName": "getPlaybackrate",
"displayName": "Playbackrate",
"visible": true,
"themeable": "Advanced",
"displayPriority": 70,
"type": "tchmi:general#/definitions/Number",
"category": "Audio",
"description": "The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": null,
"defaultValueInternal": 1
},
{
"name": "data-tchmi-current-time",
"propertyName": "CurrentTime",
"propertySetterName": "setCurrentTime",
"propertyGetterName": "getCurrentTime",
"displayName": "Current Time",
"visible": true,
"themeable": "Advanced",
"displayPriority": 200,
"type": "tchmi:general#/definitions/Number",
"category": "Audio",
"description": "The current playback time of the audio.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": null,
"defaultValueInternal": 0
},
{
"name": "data-tchmi-duration",
"propertyName": "Duration",
"propertyGetterName": "getDuration",
"displayName": "Duration",
"visible": true,
"displayPriority": 200,
"type": "tchmi:general#/definitions/Number",
"category": "Audio",
"description": "Returns a number indicating the length of the media in seconds or 0 if no media is available.",
"readOnly": true,
"bindable": false,
"defaultBindingMode": "OneWay",
"heritable": true
},
{
"name": "data-tchmi-is-ended",
"propertyName": "IsEnded",
"propertyGetterName": "getIsEnded",
"displayName": "Is Ended",
"visible": true,
"displayPriority": 200,
"type": "tchmi:general#/definitions/Boolean",
"category": "Audio",
"description": "Returns a Boolean that indicates whether the media element has finished playing.",
"readOnly": true,
"bindable": false,
"defaultBindingMode": "OneWay",
"heritable": true
},
{
"name": "data-tchmi-is-playing",
"propertyName": "IsPlaying",
"propertyGetterName": "getIsPlaying",
"displayName": "Is Playing",
"visible": true,
"displayPriority": 200,
"type": "tchmi:general#/definitions/Boolean",
"category": "Audio",
"description": "Returns a Boolean that indicates whether the media element is playing right now.",
"readOnly": true,
"bindable": false,
"defaultBindingMode": "OneWay",
"heritable": true
},
{
"name": "data-tchmi-controls",
"propertyName": "Controls",
"propertySetterName": "setControls",
"propertyGetterName": "getControls",
"displayName": "Controls",
"visible": true,
"themeable": "Standard",
"displayPriority": 10,
"type": "tchmi:general#/definitions/Boolean",
"category": "Player",
"description": "If set true, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": true,
"defaultValueInternal": false
},
{
"name": "data-tchmi-autoplay",
"propertyName": "Autoplay",
"propertySetterName": "setAutoplay",
"propertyGetterName": "getAutoplay",
"displayName": "Autoplay",
"visible": true,
"themeable": "Standard",
"displayPriority": 20,
"type": "tchmi:general#/definitions/Boolean",
"category": "Player",
"description": "If set true, the audio automatically begins to play back.\nNote: On modern browsers this is not allowed for unmuted audio.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": null,
"defaultValueInternal": false
},
{
"name": "data-tchmi-loop",
"propertyName": "Loop",
"propertySetterName": "setLoop",
"propertyGetterName": "getLoop",
"displayName": "Loop",
"visible": true,
"themeable": "Standard",
"displayPriority": 20,
"type": "tchmi:general#/definitions/Boolean",
"category": "Player",
"description": "If set true, we will, upon reaching the end of the audio, automatically seek back to the start.",
"readOnly": false,
"bindable": true,
"defaultBindingMode": "OneWay",
"heritable": true,
"defaultValue": null,
"defaultValueInternal": false
}
],
"attributeCategories": [
{
"name": "Audio",
"displayPriority": 500,
"defaultCollapsed": true,
"description": "Attributes defining the audio playback of the control."
},
{
"name": "Player",
"displayPriority": 510,
"defaultCollapsed": true,
"description": "Attributes defining the audio player of the control."
}
],
"functions": [
{
"name": "play",
"displayName": "play",
"visible": true,
"description": "Begins playback of the audio.",
"category": "Playback handling",
"params": [],
"type": null,
"heritable": true
},
{
"name": "pause",
"displayName": "pause",
"visible": true,
"description": "Pauses the audio playback.",
"category": "Playback handling",
"params": [],
"type": null,
"heritable": true
},
{
"name": "stop",
"displayName": "stop",
"visible": true,
"description": "Stops the media playback which means pause playback and set current time to 0.",
"category": "Playback handling",
"params": [],
"type": null,
"heritable": true
},
{
"name": "skipForward",
"displayName": "skipForward",
"visible": true,
"description": "Move the current time position forward.",
"category": "Playback handling",
"params": [
{
"name": "valueNew",
"displayName": "valueNew",
"description": "Delta time in seconds.",
"type": "tchmi:general#/definitions/Number",
"bindable": true,
"visible": true
}
],
"type": null,
"heritable": true
},
{
"name": "skipBackward",
"displayName": "skipBackward",
"visible": true,
"description": "Move the current time position backwards.",
"category": "Playback handling",
"params": [
{
"name": "valueNew",
"displayName": "valueNew",
"description": "Delta time in seconds.",
"type": "tchmi:general#/definitions/Number",
"bindable": true,
"visible": true
}
],
"type": null,
"heritable": true
}
],
"events": [
{
"name": ".onLoadedData",
"displayName": ".onLoadedData",
"visible": true,
"category": "Control",
"description": "The loadedData event is fired after the browser has loaded the audio data.",
"heritable": true,
"arguments": []
},
{
"name": ".onError",
"displayName": ".onError",
"visible": true,
"displayPriority": 30,
"category": "Control",
"description": "The error event is fired when the audio was not loaded successfully.",
"heritable": true,
"arguments": [
{
"type": "tchmi:framework#/definitions/DOMErrorEvent",
"description": "The ErrorEvent object of the underlying error dom event."
}
]
},
{
"name": ".onVolumeChange",
"displayName": ".onVolumeChange",
"visible": true,
"category": "Control",
"description": "The volumechange event is fired when the volume has changed.",
"heritable": true,
"arguments": [
{
"type": "tchmi:framework#/definitions/Fraction",
"description": "The new volume value between 0 and 1."
}
]
},
{
"name": ".onDurationChange",
"displayName": ".onDurationChange",
"visible": true,
"category": "Control",
"description": "The durationchange event is fired when the duration has changed.",
"heritable": true,
"arguments": [
{
"type": "tchmi:general#/definitions/Number",
"description": "The new duration in seconds."
}
]
},
{
"name": ".onIsEndedChange",
"displayName": ".onIsEndedChange",
"visible": true,
"category": "Control",
"description": "The onIsEndedChange event is fired when the playback stops because the end of the media is reached or because no further data is available.",
"heritable": true,
"arguments": [
{
"type": "tchmi:general#/definitions/Boolean",
"description": "The new isEnded value."
}
]
},
{
"name": ".onIsPlayingChange",
"displayName": ".onIsPlayingChange",
"visible": true,
"category": "Control",
"description": "The onIsPlayingChange event is fired when the audio playback has started.",
"heritable": true,
"arguments": [
{
"type": "tchmi:general#/definitions/Boolean",
"description": "The new isPlaying value."
}
]
},
{
"name": ".onTimeUpdate",
"displayName": ".onTimeUpdate",
"visible": true,
"category": "Control",
"description": "The timeupdate event is fired when the time of audio is updated.",
"heritable": true,
"arguments": []
}
],
"dataTypes": [
{
"schema": "Schema/Types.Schema.json"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View File

@@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"definitions": {
"TcHmi.Controls.Beckhoff.TcHmiAudio": {
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"frameworkInstanceOf": "TcHmi.Controls.System.TcHmiControl",
"frameworkControlType": "TcHmiAudio",
"frameworkControlNamespace": "TcHmi.Controls.Beckhoff"
},
"TcHmi.Controls.Beckhoff.TcHmiAudio.AudioSourceList": {
"title": "AudioSourceList",
"description": "Audio Source List",
"type": "array",
"items": {
"type": "object",
"title": "Audio Source",
"engineeringColumns": ["source", "type"],
"propertiesMeta": [
{
"name": "source",
"displayName": "Source",
"category": "General",
"displayPriority": 10,
"description": "The source path of the audio source",
"defaultValue": null,
"defaultValueInternal": null
},
{
"name": "type",
"displayName": "Type",
"category": "General",
"displayPriority": 10,
"description": "The type of the audio source.",
"defaultValue": null,
"defaultValueInternal": null
}
],
"properties": {
"source": {
"$ref": "tchmi:framework#/definitions/Path"
},
"type": {
"type": "string",
"category": "Common",
"enum": [
"",
"audio/mpeg",
"audio/ogg",
"audio/wav",
"audio/flac",
"application/dash+xml",
"application/vnd.apple.mpegurl"
],
"options": [
{
"label": "<auto detect>",
"value": ""
}
],
"default": ""
}
},
"additionalProperties": false,
"required": ["source"]
}
},
"TcHmiAudio": {
"$ref": "tchmi:framework#/definitions/TcHmi.Controls.Beckhoff.TcHmiAudio"
}
}
}

View File

@@ -0,0 +1,35 @@
/** Styles for all themes */
/* Style for the main element */
.TcHmi_Controls_Beckhoff_TcHmiAudio {
/* Prevent overflow if the border radius is huge */
overflow: hidden;
}
.TcHmi_Controls_Beckhoff_TcHmiAudio-template {
position: relative;
width: 100%;
height: 100%;
}
.TcHmi_Controls_Beckhoff_TcHmiAudio-template-content {
position: absolute;
width: 100%;
height: 100%;
}
.TcHmi_Controls_Beckhoff_TcHmiAudio-template-focus-border {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}
.TcHmi_Controls_Beckhoff_TcHmiAudio-template-border {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}

View File

@@ -0,0 +1,258 @@
// Compatibility file for non-module typescript compiles without adjustments.
// Use the following line for modern code (needs adjustments to tsconfig.json#configOptions/paths)
// import { TcHmiControl } from "Beckhoff.TwinCAT.HMI.Framework/index.esm.js";
// ***************************************************************************
declare class TcHmiAudio extends TcHmi.Controls.System.TcHmiControl {
#private;
constructor(element: JQuery, pcElement: JQuery, attrs: TcHmi.Controls.ControlAttributeList);
/** Reference to the root dom element of the current control template as jquery object. */
protected __elementTemplateRoot: JQuery;
/** Reference to the dom element in current control template which handles the border style as jquery object. */
protected __elementBorder: JQuery;
/** Reference to the dom element in current control template which handles the focus style as jquery object. */
protected __elementFocusBorder: JQuery;
/** Reference to the underlying default html text audio element as default html element object. */
protected __elemAudio: HTMLAudioElement;
/**
* Internal reference to the attribute "tchmi-src-list" */
protected __srcList: AudioSource[] | null | undefined;
/** Internal reference to the attribute "data-tchmi-controls" */
protected __controls: boolean | undefined | undefined;
/** Internal reference to the attribute "data-tchmi-volume". Value between 0 and 1. */
protected __volume: number | undefined;
/** Internal reference to the attribute "data-tchmi-autoplay". */
protected __autoplay: boolean | undefined;
/** Internal reference to the attribute "data-tchmi-muted". */
protected __mute: boolean | undefined;
/** Internal reference to the attribute "data-tchmi-loop". */
protected __loop: boolean | undefined;
/** Internal reference to the attribute "data-tchmi-playbackrate". */
protected __playbackrate: number | undefined;
/** Returns the current duration of the audio. */
protected __duration: number;
/** Returns the current duration of the audio. */
protected __currentTime: number;
/**
* If raised, the control object exists in control cache and constructor of each inheritation level was called.
* This function is only to be used by the System. Other function calls are not intended.
*/
__previnit(): void;
/**
* If raised, all attributes have been set to it's default or dom values.
* This function is only to be used by the System. Other function calls are not intended.
*/
__init(): void;
/**
* Is called by the system after the control instance gets part of the current DOM.
* This function is only to be used by the System. Other function calls are not intended.
*/
__attach(): void;
/**
* Is called by the system after the control instance is no longer part of the current DOM.
* This function is only to be used by the System. Other function calls are not intended.
*/
__detach(): void;
/**
* Destroy the current control instance.
* Will be called automatically if system destroys control!
*/
destroy(): void;
/**
* Loads Audio and Poster if access is now possible
*/
__processAccessConfig(): void;
/**
* Loads Audio and Poster if access is now possible
*/
__processIsEnabled(): void;
/**
* Is raised if the browser have loaded the audio data.
*/
protected __onLoadedData(_event: Event): void;
/**
* Is raised if the browser had an error while loading the audio data.
* Handles the audio and all source elements!
*/
protected __onError(event: ErrorEvent): void;
/**
* Is raised if the volume of audio is change.
*/
protected __onVolumeChange(_event: Event): void;
/**
* Is raised if the duration of audio is change.
*/
protected __onDurationChange(_event: Event): void;
/**
* Is raised if the audio ended playing.
*/
protected __onEnded(_event: Event): void;
/**
* Is raised if the audio started or paused playing.
*/
protected __onPlayingChange(_event: Event): void;
/**
* Is raised if the speed of audio is change.
*/
protected __onRateChange(_event: Event): void;
/**
* Is raised if the time of audio is updated.
*/
protected __onTimeUpdate(_event: Event): void;
/**
* Returns a {number} value in seconds which says whether the audio is long.
*/
getDuration(): number;
/**
* Returns a {boolean} value which says whether the audio is ended or not.
*/
getIsEnded(): boolean;
/**
* Returns a {boolean} value which says whether the audio is playing or not.
*/
getIsPlaying(): boolean;
/**
* Sets the srcList attribute to a new value.
* @param valueNew The new value for the src attribute;
*/
setSrcList(valueNew: AudioSource[] | null): void;
/**
* The watch callback for the srcList object resolver.
*/
protected __onResolverForSrcListWatchCallback(data: TcHmi.Symbol.ObjectResolver.IWatchResultObject<AudioSource[]>): void;
/**
* The current value of the src attribute.
*/
getSrcList(): AudioSource[] | null | undefined;
/**
* Processes the current value of attribute src.
*/
protected __processSrcList(): void;
/**
* Starts the audio.
*/
play(): void;
/**
* Paused the audio.
*/
pause(): void;
/**
* Stops the audio (paused audio and reset the currentTime).
*/
stop(): void;
/**
* Skip backward (at the new value).
*/
skipBackward(valueNew: number): void;
/**
* Skip forward (with the new value).
*/
skipForward(valueNew: number): void;
/**
* Set the current time position to audio in seconds.
*/
setCurrentTime(valueNew: number | null): void;
/**
* Returns a (Number) value in seconds which describes the current position in the audio.
*/
getCurrentTime(): number;
/**
* Processes the current time
*/
protected __processCurrentTime(): void;
/**
* Sets the controls value and calls the associated process function (processControls).
* @param valueNew The new controls value.
*/
setControls(valueNew: boolean | null): void;
/**
* Returns the current controls value.
*/
getControls(): boolean | undefined;
/**
* Processes the current controls attribute.
*/
protected __processControls(): void;
/**
* Sets the volume value and calls the associated process function (processVolume).
* @param valueNew The new volume value between 0 and 1.
*/
setVolume(valueNew: number | null): void;
/**
* Returns the current volume value.
*/
getVolume(): number | undefined;
/**
* Processes the current volume attribute.
*/
protected __processVolume(): void;
/**
* Sets the autoplay value and calls the associated process function (processAutoplay).
* @param valueNew The new autoplay value.
*/
setAutoplay(valueNew: boolean | null): void;
/**
* Returns the current autoplay value.
*/
getAutoplay(): boolean | undefined;
/**
* Processes the current autoplay attribute.
*/
protected __processAutoplay(): void;
/**
* Sets the mute value and calls the associated process function (processMute).
* @param valueNew The new mute value.
*/
setMute(valueNew: boolean | null): void;
/**
* Returns the current mute value.
*/
getMute(): boolean | undefined;
/**
* Processes the current mute attribute.
*/
protected __processMute(): void;
/**
* Sets the loop value and calls the associated process function (processLoop).
* @param valueNew The new loop value.
*/
setLoop(valueNew: boolean | null): void;
/**
* Returns the current loop value.
*/
getLoop(): boolean | undefined;
/**
* Processes the current loop attribute.
*/
protected __processLoop(): void;
/**
* Sets the playbackrate value and calls the associated process function (processPlaybackrate).
* @param valueNew The new playbackrate value.
*/
setPlaybackrate(valueNew: number | null): void;
/**
* Returns the current playbackrate value.
*/
getPlaybackrate(): number | undefined;
/**
* Processes the current playbackrate attribute.
*/
protected __processPlaybackrate(): void;
}
export interface AudioSource {
source: string;
type?: string;
}
export { TcHmiAudio as Control };
declare const _TcHmiAudio: typeof TcHmiAudio;
type tTcHmiAudio = TcHmiAudio;
type tAudioSource = AudioSource;
declare global {
namespace TcHmi.Controls.Beckhoff {
const TcHmiAudio: typeof _TcHmiAudio;
type TcHmiAudio = tTcHmiAudio;
namespace TcHmiAudio {
type AudioSource = tAudioSource;
}
}
}

View File

@@ -0,0 +1,11 @@
<div class="TcHmi_Controls_Beckhoff_TcHmiAudio-template tchmi-box">
<div class="TcHmi_Controls_Beckhoff_TcHmiAudio-template-border tchmi-box">
<audio
class="TcHmi_Controls_Beckhoff_TcHmiAudio-template-content"
controls
playsinline
controlsList="nodownload"
></audio>
</div>
<div class="TcHmi_Controls_Beckhoff_TcHmiAudio-template-focus-border tchmi-box tchmi-no-pointer-events"></div>
</div>