1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
"use strict";var TcHmi;!function(TcHmi){!function(Functions){!function(Beckhoff){Beckhoff.SymbolExists=function(ctx,symbol){if(!ctx)throw new TypeError("Parameter 'ctx' must be defined.");if(!ctx.success||!ctx.error)throw new TypeError("Parameter 'ctx' must be defined properly. Either 'success' or 'error' or both are missing.");if("function"!=typeof ctx.success||"function"!=typeof ctx.error)throw new TypeError("Parameter 'ctx' must be defined properly. Either 'success' or 'error' or both are not of type 'function'.");null!=symbol?symbol instanceof TcHmi.Symbol?symbol.exists(data=>{data.error===TcHmi.Errors.NONE?ctx.success(data.result):ctx.error(data.error,{code:data.error,message:TcHmi.Errors[data.error],reason:"Symbol existence check failed",domain:"TcHmi.Functions.Beckhoff.SymbolExists",errors:data.details?[data.details]:void 0})}):ctx.error(TcHmi.Errors.E_PARAMETER_INVALID,{code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:"Parameter is no symbol.",domain:"TcHmi.Functions.Beckhoff.SymbolExists"}):ctx.error(TcHmi.Errors.E_PARAMETER_INVALID,{code:TcHmi.Errors.E_PARAMETER_INVALID,message:TcHmi.Errors[TcHmi.Errors.E_PARAMETER_INVALID],reason:"Requested symbol is not set.",domain:"TcHmi.Functions.Beckhoff.SymbolExists"})}}(Functions.Beckhoff||(Functions.Beckhoff={}))}(TcHmi.Functions||(TcHmi.Functions={}))}(TcHmi||(TcHmi={})),TcHmi.Functions.registerFunctionEx("SymbolExists","TcHmi.Functions.Beckhoff",TcHmi.Functions.Beckhoff.SymbolExists); |