BAObjectHandler
Der BaObjectHandler übernimmt die Verwaltung des BaObjects.
Verwendung
Die Implementierung erfolgt über die jeweiligen Interfaces.
IUsesBaObject
Bereitstellung des BaObjectHandlers.
Erfordert:
- TcHmiBaFramework
module MyNamespace {
export class MyClass<A extends MyClass.IAttributes = MyClass.IAttributes> extends TcHmi.BuildingAutomation.Base implements TcHmi.BuildingAutomation.BaObjectHandler.IUsesBaObject {
public baObjectHandler: TcHmi.BuildingAutomation.BaObjectHandler;
constructor(id: string, parent: TcHmi.BuildingAutomation.IBaseNode | null, attr?: A) {
super(id, parent, attr);
this.baObjectHandler = new TcHmi.BuildingAutomation.BaObjectHandler(this);
}
public processBaObject() {
if (this.baObjectHandler.baObject == null) return;
// do work
}
}
export module MyClass {
export interface IAttributes extends TcHmi.BuildingAutomation.Base.IAttributes {
// optional additional attributes
}
}
}
IFCUsesBaObject
Bereitstellung des BaObjectHandlers mit BaObject-Attribut für den TcHmi Designer.
Erfordert:
- TcHmiBaFramework
- TcHmiBaControls
module MyNamespace {
export class MyControl extends TcHmi.BuildingAutomation.Controls.System.BaseControl implements TcHmi.BuildingAutomation.BaObjectHandler.IFCUsesBaObject {
public baObjectHandler: TcHmi.BuildingAutomation.BaObjectHandler;
constructor(element: JQuery, pcElement: JQuery, attrs: TcHmi.Controls.ControlAttributeList) {
super(element, pcElement, attrs);
this.baObjectHandler = new TcHmi.BuildingAutomation.BaObjectHandler(this);
}
public processBaObject() {
if (this.baObjectHandler.baObject == null) return;
// do work
}
public setBaObject(p: TcHmi.BuildingAutomation.BA.BaBasicObject | TcHmi.BuildingAutomation.BA.BaBasicObject.IBaBasicObjectAttributes | TcHmi.Symbol | null | undefined): this {
this.baObjectHandler.setBaObject(p);
return this;
}
public getBaObject() {
return this.baObjectHandler.baObject;
}
}
}
Im Interface IFCUsesBaObject sind bereits die Setter und Getter für das BaObject definiert, weshalb in der Description.json nur noch das BaObject-Attribut definiert werden muss.
"attributes": [
{
"name": "data-tchmi-ba-object",
"displayName": "BaObject",
"propertyName": "BaObject",
"propertySetterName": "setBaObject",
"propertyGetterName": "getBaObject",
"visible": true,
"themeable": "None",
"type": "tchmi:framework#/definitions/Symbol",
"category": "BA",
"description": "BA object of the control.",
"requiredOnCompile": false,
"readOnly": false,
"bindable": true,
"heritable": true,
"defaultValue": null,
"defaultValueInternal": null
}
]
Eigenschaften
Name | Beschreibung |
---|---|
loadChildren | Legt fest, ob alle Kindelemente geladen werden beim Setzen des BaObjects (als BaView). |
loadTexts | Legt fest, ob alle Texte geladen werden beim Setzen des BaObjects (als BaView). |
enableParentBaObjectProcessor | Legt fest, ob der BaObject Prozessor des Eltern Controls aufgerufen wird. |
baObject | Gibt das BaObject zurück. |
baObjectSymbolExpression | Gibt die SymbolExpression vom BaObject zurück. |
isLoadingBaObject | Prüft, ob das BaObject gesetzt, aber noch am Laden ist. |
Methoden
Name | Beschreibung |
---|---|
setBaObject | Setzt das BaObject. |
resolveBaObject | Löst die übergebenen Informationen auf, um ein BaObject zu erzeugen. |
readBaObject | Liest das BaObject vom Server. |
watchBaVariable | Fügt einen Watch zur übergebenen BaVariable hinzu. Der Watch wird beim Zerstören der Klasse ebenfalls zerstört. |
tryWatchBaVariable | Versucht eine BaVariable zu überwachen. |
tryWatchChildrenBaVariable | Versucht eine BaVariable eines Kindelements eines BaViews zu überwachen. |
watchValueRange | Überwacht den Wertebereich einer spezifischen Variablen. |
checkBaObjectAccess | Prüft den OperationType und den Schreibzugriff der BaVariablen ValueRm. |