From 4a9ef04a748cbeac69ef6181d914354a5c0eabb6 Mon Sep 17 00:00:00 2001 From: juileetikekar <99317579+juileetikekar@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:38:45 +0200 Subject: [PATCH] Revert "Support for AID and AIMC Submodel Templates (#211)" (#243) This reverts commit 51d719269edc3f7fcbfdad03870773a295f1b01a. --- .../AdminShellCollections.cs | 60 - src/AasxCsharpLibrary/AdminShellUtil.cs | 151 +-- .../Extensions/ExtendIReferable.cs | 12 - .../Extensions/ExtendReferenceList.cs | 35 - .../AasForms/AasFormUtils.cs | 19 - .../AasForms/FormDescription.cs | 89 +- .../AasForms/FormInstance.cs | 157 --- .../AasForms/FormDescriptionV20.cs | 22 - .../AasxPluginInterface.cs | 11 - src/AasxIntegrationBase/LogInstance.cs | 24 - src/AasxPackageExplorer.sln | 97 +- .../options-debug.MIHO.json | 8 - src/AasxPackageExplorer/options-debug.json | 12 +- src/AasxPluginAID/AIDAnyUiControl.cs | 938 ------------- src/AasxPluginAID/AIDSemanticConfig.cs | 118 -- src/AasxPluginAID/AIDTDExport.cs | 161 --- src/AasxPluginAID/AIDTDImport.cs | 381 ------ src/AasxPluginAID/AasxPluginAID.csproj | 40 - src/AasxPluginAID/AasxPluginAID.options.json | 1 - src/AasxPluginAID/AasxPluginAID.plugin | 1 - src/AasxPluginAID/InterfaceEntity.cs | 250 ---- src/AasxPluginAID/InterfaceShelfOptions.cs | 56 - src/AasxPluginAID/LICENSE.txt | 1 - src/AasxPluginAID/Plugin.cs | 229 ---- src/AasxPluginAID/app.config | 11 - src/AasxPluginAID/packages.config | 6 - .../AasOpcUaClient.cs | 336 ----- .../AasxPluginAssetInterfaceDesc.csproj | 55 - .../AasxPluginAssetInterfaceDesc.options.json | 28 - .../AasxPluginAssetInterfaceDesc.plugin | 1 - .../AidHttpConnection.cs | 126 -- .../AidInterfaceService.cs | 135 -- .../AidInterfaceStatus.cs | 994 -------------- .../AidModbusConnection.cs | 239 ---- .../AidMqttConnection.cs | 156 --- .../AidOpcUaConnection.cs | 182 --- .../AssetInterfaceAnyUiControl.cs | 653 --------- .../AssetInterfaceOptions.cs | 63 - src/AasxPluginAssetInterfaceDesc/LICENSE.TXT | 244 ---- .../Opc.Ua.SampleClient.Config.xml | 99 -- src/AasxPluginAssetInterfaceDesc/Plugin.cs | 361 ----- .../Resources/LICENSE.TXT | 651 --------- .../Resources/logo-http.png | Bin 1369 -> 0 bytes .../Resources/logo-modbus.png | Bin 2733 -> 0 bytes .../Resources/logo-mqtt.png | Bin 2570 -> 0 bytes .../Resources/logo-opc-ua.png | Bin 4103 -> 0 bytes .../SMT_AssetInterfacesDescription.png | Bin 17033 -> 0 bytes .../KnownSubmodelsOptions.cs | 32 - src/AasxPredefinedConcepts/AIDResources.cs | 1184 ----------------- src/AasxPredefinedConcepts/DefinitionsAID.cs | 91 -- .../DefinitionsAssetInterfacesDescription.cs | 551 -------- .../DefinitionsAssetInterfacesMapping.cs | 65 - .../PredefinedConceptsClassMapper.cs | 857 ------------ 53 files changed, 35 insertions(+), 9958 deletions(-) delete mode 100644 src/AasxCsharpLibrary/Extensions/ExtendReferenceList.cs delete mode 100644 src/AasxPluginAID/AIDAnyUiControl.cs delete mode 100644 src/AasxPluginAID/AIDSemanticConfig.cs delete mode 100644 src/AasxPluginAID/AIDTDExport.cs delete mode 100644 src/AasxPluginAID/AIDTDImport.cs delete mode 100644 src/AasxPluginAID/AasxPluginAID.csproj delete mode 100644 src/AasxPluginAID/AasxPluginAID.options.json delete mode 100644 src/AasxPluginAID/AasxPluginAID.plugin delete mode 100644 src/AasxPluginAID/InterfaceEntity.cs delete mode 100644 src/AasxPluginAID/InterfaceShelfOptions.cs delete mode 100644 src/AasxPluginAID/LICENSE.txt delete mode 100644 src/AasxPluginAID/Plugin.cs delete mode 100644 src/AasxPluginAID/app.config delete mode 100644 src/AasxPluginAID/packages.config delete mode 100644 src/AasxPluginAssetInterfaceDesc/AasOpcUaClient.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.csproj delete mode 100644 src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.options.json delete mode 100644 src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.plugin delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidHttpConnection.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidInterfaceService.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidInterfaceStatus.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidModbusConnection.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidMqttConnection.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AidOpcUaConnection.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AssetInterfaceAnyUiControl.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/AssetInterfaceOptions.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/LICENSE.TXT delete mode 100644 src/AasxPluginAssetInterfaceDesc/Opc.Ua.SampleClient.Config.xml delete mode 100644 src/AasxPluginAssetInterfaceDesc/Plugin.cs delete mode 100644 src/AasxPluginAssetInterfaceDesc/Resources/LICENSE.TXT delete mode 100644 src/AasxPluginAssetInterfaceDesc/Resources/logo-http.png delete mode 100644 src/AasxPluginAssetInterfaceDesc/Resources/logo-modbus.png delete mode 100644 src/AasxPluginAssetInterfaceDesc/Resources/logo-mqtt.png delete mode 100644 src/AasxPluginAssetInterfaceDesc/Resources/logo-opc-ua.png delete mode 100644 src/AasxPluginKnownSubmodels/AasxPluginKnownSubmodels.media/SMT_AssetInterfacesDescription.png delete mode 100644 src/AasxPredefinedConcepts/AIDResources.cs delete mode 100644 src/AasxPredefinedConcepts/DefinitionsAID.cs delete mode 100644 src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs delete mode 100644 src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs delete mode 100644 src/AasxPredefinedConcepts/PredefinedConceptsClassMapper.cs diff --git a/src/AasxCsharpLibrary/AdminShellCollections.cs b/src/AasxCsharpLibrary/AdminShellCollections.cs index 98103b05..32e6774a 100644 --- a/src/AasxCsharpLibrary/AdminShellCollections.cs +++ b/src/AasxCsharpLibrary/AdminShellCollections.cs @@ -26,8 +26,6 @@ public V GetValueOrDefault(K key) } } - /* - Commented out to add some lines to MultivalueDictionary class public class MultiValueDictionary { private Dictionary> dict = new Dictionary>(); @@ -51,65 +49,7 @@ public IEnumerable> Keys } } } - */ - public class MultiValueDictionary - { - private Dictionary> dict = new Dictionary>(); - - public void Add(K key, V value) - { - if (dict.TryGetValue(key, out var list)) - list.Add(value); - else - dict.Add(key, new List { value }); - } - public void Remove(K key) - { - if (dict.ContainsKey(key)) - dict.Remove(key); - } - - public bool ContainsKey(K key) => dict.ContainsKey(key); - - public List this[K key] => dict[key]; - - public IEnumerable> ValueLists - { - get - { - return dict.Values; - } - } - - public IEnumerable Values - { - get - { - foreach (var vl in dict.Values) - foreach (var v in vl) - yield return v; - } - } - - public IEnumerable Keys - { - get - { - return dict.Keys; - } - } - - public void Clear() => dict.Clear(); - - public IEnumerable All(K key) - { - if (!dict.ContainsKey(key)) - yield break; - foreach (var x in dict[key]) - yield return x; - } - } public class DoubleSidedDict { private Dictionary _forward = new Dictionary(); diff --git a/src/AasxCsharpLibrary/AdminShellUtil.cs b/src/AasxCsharpLibrary/AdminShellUtil.cs index 81f1ffe1..34ba3982 100644 --- a/src/AasxCsharpLibrary/AdminShellUtil.cs +++ b/src/AasxCsharpLibrary/AdminShellUtil.cs @@ -427,17 +427,6 @@ public static string EvalToNonEmptyString(string fmt, string o, string elseStrin return string.Format(fmt, o); } - /// - /// Some syntactic sugar to easily take the first string which has content. - /// - public static string TakeFirstContent(params string[] choices) - { - foreach (var c in choices) - if (c != null && c.Trim().Length > 0) - return c; - return ""; - } - /// /// If len of exceeds then /// string is shortened and returned with an ellipsis(…) at the end. @@ -469,14 +458,10 @@ public static string ToSingleLineShortened(string str, int maxLen, string textNe /// Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); /// Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); /// - public static string FilterFriendlyName(string src, bool pascalCase = false) + public static string FilterFriendlyName(string src) { if (src == null) return null; - - if (pascalCase && src.Length > 0) - src = char.ToUpper(src[0]) + src.Substring(1); - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); } @@ -800,25 +785,6 @@ public static string WrapLinesAtColumn(string text, int columnLimit) // Reflection // - /// - /// Returns type or the underlying type, if is a Nullable or if it is a - /// generic type, e.g. a List<> - /// - public static Type GetTypeOrUnderlyingType(Type type, bool resolveGeneric = false) - { - var nut = Nullable.GetUnderlyingType(type); - if (nut != null) - { - type = nut; - } - else - if (resolveGeneric && type.IsGenericType && type.GetGenericArguments().Count() > 0) - { - type = type.GetGenericArguments()[0]; - } - return type; - } - public static void SetFieldLazyValue(FieldInfo f, object obj, object value) { // access @@ -893,121 +859,6 @@ public static void SetFieldLazyValue(FieldInfo f, object obj, object value) } } - /// - /// Rathhe sepcialised: adding a type-specific value to a list - /// of type-specific values. - /// Works for most scalars, dateTime, string. - /// - public static void AddToListLazyValue(object obj, object value) - { - // access - if (obj == null) - return; - - switch (obj) - { - case List lstr: - lstr.Add("" + value); - break; - - case List ldt: - if (DateTime.TryParse("" + value, out var dt)) - ldt.Add(dt); - break; - - case List lbyte: - if (Byte.TryParse("" + value, out var ui8)) - lbyte.Add(ui8); - break; - - case List lsbyte: - if (SByte.TryParse("" + value, out var i8)) - lsbyte.Add(i8); - break; - - case List li16: - if (Int16.TryParse("" + value, out var i16)) - li16.Add(i16); - break; - - case List li32: - if (Int32.TryParse("" + value, out var i32)) - li32.Add(i32); - break; - - case List li64: - if (Int64.TryParse("" + value, out var i64)) - li64.Add(i64); - break; - - case List lui16: - if (UInt16.TryParse("" + value, out var ui16)) - lui16.Add(ui16); - break; - - case List lui32: - if (UInt32.TryParse("" + value, out var ui32)) - lui32.Add(ui32); - break; - - case List lui64: - if (UInt64.TryParse("" + value, out var ui64)) - lui64.Add(ui64); - break; - - case List lfloat: - if (value is double vd) - lfloat.Add((float)vd); - else - if (value is float vf) - lfloat.Add(vf); - else - if (Single.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var sgl)) - lfloat.Add(sgl); - break; - - case List ldouble: - if (value is double vd2) - ldouble.Add(vd2); - else - if (value is float vf2) - ldouble.Add(vf2); - else - if (Double.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var dbl)) - ldouble.Add(dbl); - break; - - case List lbool: - var isFalse = value == null - || (value is int vi && vi == 0) - || (value is string vs && (vs == "" || vs == "false")) - || (value is bool vb && !vb); - lbool.Add(!isFalse); - break; - } - } - - public static string ToStringInvariant(object o) - { - // trivial - if (o == null) - return ""; - - // special cases - if (o is double od) - return od.ToString(CultureInfo.InvariantCulture); - if (o is float of) - return of.ToString(CultureInfo.InvariantCulture); - if (o is DateTime odt) - return odt.ToUniversalTime() - .ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"); - - // use automatic conversion - return "" + o; - } - // // temp file utilities // diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs b/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs index 9b9545a8..1c0e0597 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs @@ -204,18 +204,6 @@ public static void BaseValidation(this IReferable referable, AasValidationRecord })); } - /// - /// Tells, if the IReferable can sub-structure more elements - /// - public static bool IsStructured(this IReferable rf) - { - return (rf is ISubmodel - || rf is ISubmodelElementCollection - || rf is ISubmodelElementList - || rf is IOperation - || rf is IEntity); - } - /// /// Tells, if the IReferable is used with an index instead of idShort. /// diff --git a/src/AasxCsharpLibrary/Extensions/ExtendReferenceList.cs b/src/AasxCsharpLibrary/Extensions/ExtendReferenceList.cs deleted file mode 100644 index 8708236c..00000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendReferenceList.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS.Exceptions; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendReferenceList - { - /// - /// Useful, if the searched reference will have only on key (e.g. ECLASS properties) - /// - public static bool MatchesAnyWithExactlyOneKey(this List reflist, IKey key, MatchMode matchMode = MatchMode.Strict) - { - if (key == null || reflist == null || reflist.Count < 1) - { - return false; - } - - var found = false; - foreach (var r in reflist) - found = found || r.MatchesExactlyOneKey(key, matchMode); - - return found; - } - } - -} diff --git a/src/AasxIntegrationBase/AasForms/AasFormUtils.cs b/src/AasxIntegrationBase/AasForms/AasFormUtils.cs index 8e74e9e4..31ce15f3 100644 --- a/src/AasxIntegrationBase/AasForms/AasFormUtils.cs +++ b/src/AasxIntegrationBase/AasForms/AasFormUtils.cs @@ -18,25 +18,6 @@ namespace AasxIntegrationBase.AasForms { public static class AasFormUtils { - public static FormMultiplicity? GetCardinality(List qs) - { - if (qs == null) - return null; - - var multiTrigger = new[] { "Multiplicity", "Cardinality", "SMT/Cardinality" }; - foreach (var mt in multiTrigger) - { - var q = qs?.FindQualifierOfType(mt); - if (q != null) - { - foreach (var m in (FormMultiplicity[])Enum.GetValues(typeof(FormMultiplicity))) - if (("" + q.Value) == Enum.GetName(typeof(FormMultiplicity), m)) - return m; - } - } - - return null; - } private static void RecurseExportAsTemplate( List smwc, FormDescListOfElement tels, Aas.Environment env = null, List cds = null) diff --git a/src/AasxIntegrationBase/AasForms/FormDescription.cs b/src/AasxIntegrationBase/AasForms/FormDescription.cs index db921789..5d5320bd 100644 --- a/src/AasxIntegrationBase/AasForms/FormDescription.cs +++ b/src/AasxIntegrationBase/AasForms/FormDescription.cs @@ -86,7 +86,7 @@ public class FormDescReferable : FormDescBase /// Preset for Referable.description /// [JsonProperty(Order = 7)] - public List PresetDescription = new List(); + public List PresetDescription = null; /// /// SemanticId of the SubmodelElement. Always required. @@ -591,93 +591,6 @@ public Aas.Property GenerateDefault() } } - [DisplayName("FormRange")] - public class FormDescRange : FormDescSubmodelElement - { - [JsonProperty(Order = 20)] - public string[] allowedValueTypes = new string[] { "string" }; - - /// - /// Pre-set the editable Property value with this value. - /// - [JsonProperty(Order = 21)] - public string presetMin = ""; - - [JsonProperty(Order = 22)] - public string presetMax = ""; - - // Constructors - //============= - - public FormDescRange() { } - - public FormDescRange( - string formText, FormMultiplicity multiplicity, Aas.Key smeSemanticId, - string presetIdShort, string formInfo = null, bool isReadOnly = false, string valueType = null, - string presetMin = null, string presetMax = null) - : base(formText, multiplicity, smeSemanticId, presetIdShort, formInfo, isReadOnly) - { - // init - if (valueType != null) - this.allowedValueTypes = new[] { valueType }; - if (presetMin != null) - this.presetMin = presetMin; - if (presetMax != null) - this.presetMax = presetMax; - - } - - public FormDescRange(FormDescRange other) - : base(other) - { - // this part == static, therefore only shallow copy - this.allowedValueTypes = other.allowedValueTypes; - this.presetMin = other.presetMin; - this.presetMax = other.presetMax; - } - -#if !DoNotUseAasxCompatibilityModels - public FormDescRange(AasxCompatibilityModels.AasxIntegrationBase.AasForms.FormDescRangeV20 other) - : base(other) - { - // this part == static, therefore only shallow copy - this.allowedValueTypes = other.allowedValueTypes; - this.presetMin = other.presetMin; - this.presetMax = other.presetMax; - } -#endif - - public override FormDescSubmodelElement Clone() - { - return new FormDescRange(this); - } - - /// - /// Build a new instance, based on the description data - /// - public override FormInstanceSubmodelElement CreateInstance( - FormInstanceListOfSame parentInstance, Aas.ISubmodelElement source = null) - { - return new FormInstanceRange(parentInstance, this, source); - } - - public Aas.Range GenerateDefault() - { - var res = new Aas.Range(Aas.DataTypeDefXsd.String); - this.InitSme(res); - if (this.presetMin != null) - res.Min = this.presetMin; - if (this.presetMax != null) - res.Max = this.presetMax; - if (this.allowedValueTypes.Length == 1) - { - res.ValueType = Aas.Stringification.DataTypeDefXsdFromString(this.allowedValueTypes[0]) - ?? Aas.DataTypeDefXsd.String; - } - return res; - } - } - [DisplayName("FormMultiLangProp")] public class FormDescMultiLangProp : FormDescSubmodelElement { diff --git a/src/AasxIntegrationBase/AasForms/FormInstance.cs b/src/AasxIntegrationBase/AasForms/FormInstance.cs index fcd9010c..0ef43b49 100644 --- a/src/AasxIntegrationBase/AasForms/FormInstance.cs +++ b/src/AasxIntegrationBase/AasForms/FormInstance.cs @@ -1569,163 +1569,6 @@ public override void RenderAnyUi(AnyUiStackPanel view, AnyUiSmallWidgetToolkit u } } - public class FormInstanceRange : FormInstanceSubmodelElement - { - public FormInstanceRange( - FormInstanceListOfSame parentInstance, FormDescRange parentDesc, - Aas.ISubmodelElement source = null, bool deepCopy = false) - { - // way back to description - this.parentInstance = parentInstance; - this.desc = parentDesc; - - // initialize Referable - var p = new Aas.Range(Aas.DataTypeDefXsd.String); - this.sme = p; - InitReferable(parentDesc, source); - - // check, if a source is present - this.sourceSme = source; - var pSource = this.sourceSme as Aas.Range; - if (pSource != null) - { - // take over - p.ValueType = pSource.ValueType; - p.Min = pSource.Min; - p.Max = pSource.Max; - } - else - { - // some more preferences - if (parentDesc.allowedValueTypes != null && parentDesc.allowedValueTypes.Length >= 1) - p.ValueType = Aas.Stringification.DataTypeDefXsdFromString(parentDesc.allowedValueTypes[0]) - ?? Aas.DataTypeDefXsd.String; - - if (parentDesc.presetMin != null && parentDesc.presetMax != null) - { - p.Min = parentDesc.presetMin; - p.Max = parentDesc.presetMax; - // immediately set touched in order to have this value saved - this.Touch(); - } - } - - // create user control -#if USE_WPF - if (createSubControls) - { - this.subControl = new FormSubControlProperty(); - this.subControl.DataContext = this; - } -#endif - } - - /// - /// Before rendering the SME into a list of new elements, process the SME. - /// If Touched, sourceSme and editSource is set, - /// this function shall write back the new values instead of - /// producing a new element. Returns True, if a new element shall be rendered. - /// - public override bool ProcessSmeForRender( - AdminShellPackageEnv packageEnv = null, bool addFilesToPackage = false, bool editSource = false) - { - // refer to base (SME) function, but not caring about result - base.ProcessSmeForRender(packageEnv, addFilesToPackage, editSource); - - var p = this.sme as Aas.Range; - var pSource = this.sourceSme as Aas.Range; - if (p != null && Touched && pSource != null && editSource) - { - pSource.ValueType = p.ValueType; - pSource.Min = p.Min; - pSource.Max = p.Max; - return false; - } - return true; - } - - /// - /// Event was raised from master because matching slave. - /// - public override void OnSlaveEvent( - FormDescSubmodelElement masterDesc, FormInstanceSubmodelElement masterInst, int index) - { - // access to master - var pMasterInst = masterInst as FormInstanceRange; - var pMaster = pMasterInst?.sme as Aas.Range; - if (pMaster?.Min == null || pMaster.Max == null) - return; - - // accues to this - var pThis = this.sme as Aas.Range; - if (pThis == null) - return; - - // refresh -#if USE_WPF - if (this.subControl != null && this.subControl is FormSubControlRange scr) - scr.UpdateDisplay(); -#endif - if (MainControl is AnyUiTextBox mtb) - { - mtb.Text = pThis.Min + ".." + pThis.Max; - mtb.Touch(); - } - - if (MainControl is AnyUiComboBox mcb && mcb.IsEditable == true) - { - mcb.Text = pThis.Min + ".." + pThis.Max; - mcb.Touch(); - } - } - - /// - /// Render the AnyUI representation of the current instance data structure - /// - public override void RenderAnyUi(AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - PluginOperationContextBase opctx) - { - // access - var prop = sme as Aas.Range; - var pDesc = desc as FormDescRange; - if (prop == null || pDesc == null) - return; - - // Intended layout - // Grid - // Index - // TextBox | ComboBox - - var g = view.Add( - uitk.AddSmallGrid(rows: 2, cols: 3, colWidths: new[] { "2:", "*", "2:" })); - - - MainControl = AnyUiUIElement.RegisterControl( - uitk.AddSmallTextBoxTo(g, 0, 1, - margin: new AnyUiThickness(0, 2, 0, 2), - text: "" + prop.Min), - (o) => - { - if (o is string os) - prop.Min = os; - Touch(); - return new AnyUiLambdaActionNone(); - }); - - - MainControl = AnyUiUIElement.RegisterControl( - uitk.AddSmallTextBoxTo(g, 1, 1, - margin: new AnyUiThickness(0, 2, 0, 2), - text: "" + prop.Max), - (o) => - { - if (o is string os) - prop.Max = os; - Touch(); - return new AnyUiLambdaActionNone(); - }); - } - } public class FormInstanceMultiLangProp : FormInstanceSubmodelElement { public FormInstanceMultiLangProp( diff --git a/src/AasxIntegrationBase/AasxCompatibilityModels/AasForms/FormDescriptionV20.cs b/src/AasxIntegrationBase/AasxCompatibilityModels/AasForms/FormDescriptionV20.cs index 89fb5d5b..3e8e430f 100644 --- a/src/AasxIntegrationBase/AasxCompatibilityModels/AasForms/FormDescriptionV20.cs +++ b/src/AasxIntegrationBase/AasxCompatibilityModels/AasForms/FormDescriptionV20.cs @@ -198,28 +198,6 @@ public class FormDescPropertyV20 : FormDescSubmodelElementV20 } - [DisplayName("FormRange_V20")] - public class FormDescRangeV20 : FormDescSubmodelElementV20 - { - /// - /// Pre-set the Property with this valueType. Right now, only one item (and this shall be "string") is allowed! - /// - [JsonProperty(Order = 20)] - public string[] allowedValueTypes = new string[] { "string" }; - - /// - /// Pre-set the editable Range Min with this value. - /// - [JsonProperty(Order = 21)] - public string presetMin = ""; - - /// - /// Pre-set the editable Range Max with this value. - /// - [JsonProperty(Order = 22)] - public string presetMax = ""; - } - [DisplayName("FormMultiLangProp_V20")] public class FormDescMultiLangPropV20 : FormDescSubmodelElementV20 { diff --git a/src/AasxIntegrationBase/AasxPluginInterface.cs b/src/AasxIntegrationBase/AasxPluginInterface.cs index c5b5f8bd..81e3f94d 100644 --- a/src/AasxIntegrationBase/AasxPluginInterface.cs +++ b/src/AasxIntegrationBase/AasxPluginInterface.cs @@ -7,7 +7,6 @@ This source code is licensed under the Apache License 2.0 (see LICENSE.txt). This source code may use other Open Source software components (see LICENSE.txt). */ -using AasxIntegrationBase.AdminShellEvents; using AnyUi; using Newtonsoft.Json; using System; @@ -175,16 +174,6 @@ public class AasxPluginResultEventInvokeOtherPlugin : AasxPluginResultEventBase public object[] Args = null; } - /// - /// This plugin result event shall be sent to the host in order to push - /// AAS events, such as updates. - /// - public class AasxPluginResultEventPushSomeEvents : AasxPluginResultEventBase - { - public List AasEvents = null; - public List AnimateSingleEvents = null; - } - public class AasxPluginEventReturnBase { public AasxPluginResultEventBase sourceEvent = null; diff --git a/src/AasxIntegrationBase/LogInstance.cs b/src/AasxIntegrationBase/LogInstance.cs index 417d7a94..27facca1 100644 --- a/src/AasxIntegrationBase/LogInstance.cs +++ b/src/AasxIntegrationBase/LogInstance.cs @@ -108,32 +108,8 @@ public StoredPrint( { return String.Format("{0}:{1} {2}", color, msg, linkTxt); } - - /// - /// Item1 = Foreground, Item2 = Background. - /// - public static Tuple LightThemeColor(Color color) - { - // https://coolors.co/palette/ffadad-ffd6a5-fdffb6-caffbf-9bf6ff-a0c4ff-bdb2ff-ffc6ff-fffffc - switch (color) - { - case Color.Blue: - return new Tuple(0xFF000000, 0xFFA0C4FF); - - case Color.Yellow: - return new Tuple(0xFF000000, 0xFFFDFFB6); - - case Color.Red: - return new Tuple(0xFF000000, 0xFFFFADAD); - - case Color.Black: - default: - return new Tuple(0xFF000000, 0xFFFFFFFF); - } - } } - public class StoredPrintsMinimalStore { // private members diff --git a/src/AasxPackageExplorer.sln b/src/AasxPackageExplorer.sln index cb445d7d..286b0978 100644 --- a/src/AasxPackageExplorer.sln +++ b/src/AasxPackageExplorer.sln @@ -157,10 +157,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginDigitalNameplate" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginContactInformation", "AasxPluginContactInformation\AasxPluginContactInformation.csproj", "{938BB137-DC45-4A84-B0C9-AC46DA321FDB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginAID", "AasxPluginAID\AasxPluginAID.csproj", "{22EB0741-DAE3-47C7-B94E-4A7269FC3D15}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginAssetInterfaceDesc", "AasxPluginAssetInterfaceDesc\AasxPluginAssetInterfaceDesc.csproj", "{97EF75AE-EF8A-4D15-93B6-664190269582}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -269,6 +265,7 @@ Global {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|Any CPU.Build.0 = Debug|Any CPU {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x64.ActiveCfg = Debug|Any CPU {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x64.Build.0 = Debug|Any CPU {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -298,6 +295,7 @@ Global {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|Any CPU.Build.0 = Debug|Any CPU {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x64.ActiveCfg = Debug|Any CPU {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x64.Build.0 = Debug|Any CPU {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -835,6 +833,7 @@ Global {7788AC2B-7F97-4755-B343-C4196FA90198}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {7788AC2B-7F97-4755-B343-C4196FA90198}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x64.ActiveCfg = Debug|Any CPU {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x64.Build.0 = Debug|Any CPU {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -1074,6 +1073,7 @@ Global {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|Any CPU.Build.0 = Debug|Any CPU {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x64.ActiveCfg = Debug|Any CPU {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x64.Build.0 = Debug|Any CPU {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -1433,6 +1433,7 @@ Global {E9AC7B0F-58FC-4BD8-A1C9-97BBB34A4E99}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {E9AC7B0F-58FC-4BD8-A1C9-97BBB34A4E99}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.Debug|x64.ActiveCfg = Debug|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.Debug|x64.Build.0 = Debug|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -1701,6 +1702,30 @@ Global {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x64.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x86.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x86.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|Any CPU.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|x64.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|x86.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|Any CPU.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x64.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x64.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x86.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x86.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|Any CPU.ActiveCfg = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|Any CPU.Build.0 = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x64.ActiveCfg = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x86.ActiveCfg = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x86.Build.0 = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|Any CPU.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x64.ActiveCfg = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x64.Build.0 = Debug|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x86.ActiveCfg = Release|x86 + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x86.Build.0 = Release|x86 {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1732,6 +1757,7 @@ Global {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {BE68E42C-28CB-4298-9F34-A18AF92FC4DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE68E42C-28CB-4298-9F34-A18AF92FC4DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {BE68E42C-28CB-4298-9F34-A18AF92FC4DE}.Debug|x64.ActiveCfg = Debug|Any CPU {BE68E42C-28CB-4298-9F34-A18AF92FC4DE}.Debug|x64.Build.0 = Debug|Any CPU {BE68E42C-28CB-4298-9F34-A18AF92FC4DE}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -1910,66 +1936,6 @@ Global {938BB137-DC45-4A84-B0C9-AC46DA321FDB}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {938BB137-DC45-4A84-B0C9-AC46DA321FDB}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {938BB137-DC45-4A84-B0C9-AC46DA321FDB}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|x64.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|x64.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|x86.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Debug|x86.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|x64.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugSlow|x86.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|Any CPU.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|x64.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|x64.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|x86.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.Release|x86.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|x64.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|x64.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|x86.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Debug|x86.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|x64.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugSlow|x86.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|Any CPU.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|x64.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|x64.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|x86.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.Release|x86.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {97EF75AE-EF8A-4D15-93B6-664190269582}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2026,14 +1992,13 @@ Global {00F5EA49-F66D-4104-A621-AF668DD58C05} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {A713E962-38FB-4FD0-9687-30F530E95E91} = {98C89299-C429-4F0B-9938-4B7775943393} {AB60370B-DC87-414D-8A6C-7B095F940A1B} = {98C89299-C429-4F0B-9938-4B7775943393} + {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34} = {5BA4D327-1907-4F5A-BC90-5EA939497BFC} {4EB64F40-1A01-46BB-BEED-D1A75313C7F8} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {BE68E42C-28CB-4298-9F34-A18AF92FC4DE} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {6A1F717C-8F43-4260-98A6-49345F983EFC} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} {938BB137-DC45-4A84-B0C9-AC46DA321FDB} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} - {22EB0741-DAE3-47C7-B94E-4A7269FC3D15} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} - {97EF75AE-EF8A-4D15-93B6-664190269582} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1AE21162-9541-4B98-A49C-A63B6AD03998} diff --git a/src/AasxPackageExplorer/options-debug.MIHO.json b/src/AasxPackageExplorer/options-debug.MIHO.json index 4108affd..d4cd79b6 100644 --- a/src/AasxPackageExplorer/options-debug.MIHO.json +++ b/src/AasxPackageExplorer/options-debug.MIHO.json @@ -108,14 +108,6 @@ "Args": [] }, */ - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAID\\bin\\Debug\\net6.0-windows\\AasxPluginAID.dll", - "Args": [] - }, - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAssetInterfaceDesc\\bin\\Debug\\net6.0-windows\\AasxPluginAssetInterfaceDesc.dll", - "Args": [] - }, { "Path": "..\\..\\..\\..\\..\\..\\AasxPluginKnownSubmodels\\bin\\Debug\\net6.0-windows\\AasxPluginKnownSubmodels.dll", "Args": [] diff --git a/src/AasxPackageExplorer/options-debug.json b/src/AasxPackageExplorer/options-debug.json index cbff5533..55e6b550 100644 --- a/src/AasxPackageExplorer/options-debug.json +++ b/src/AasxPackageExplorer/options-debug.json @@ -59,8 +59,8 @@ ], "PluginPrefer": "ANYUI", "PluginDll": [ - - { + + { "Path": "..\\..\\..\\..\\..\\..\\AasxPluginUaNetServer\\bin\\Debug\\net6.0-windows\\AasxPluginUaNetServer.dll", "Args": [ "-single-nodeids", @@ -81,14 +81,6 @@ "Path": "..\\..\\..\\..\\..\\AasxPluginBomStructure\\bin\\Debug\\net472\\AasxPluginBomStructure.dll", "Args": [] },*/ - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAID\\bin\\Debug\\net6.0-windows\\AasxPluginAID.dll", - "Args": [] - }, - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAssetInterfaceDesc\\bin\\Debug\\net6.0-windows\\AasxPluginAssetInterfaceDesc.dll", - "Args": [] - }, { "Path": "..\\..\\..\\..\\..\\..\\AasxPluginKnownSubmodels\\bin\\Debug\\net6.0-windows\\AasxPluginKnownSubmodels.dll", "Args": [] diff --git a/src/AasxPluginAID/AIDAnyUiControl.cs b/src/AasxPluginAID/AIDAnyUiControl.cs deleted file mode 100644 index a24c343d..00000000 --- a/src/AasxPluginAID/AIDAnyUiControl.cs +++ /dev/null @@ -1,938 +0,0 @@ -/* -Copyright (c) 2024 Festo SE & Co. KG -Author: Harish Kumar Pakala - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasxIntegrationBase; -using AasxIntegrationBase.AasForms; -using AasxIntegrationBaseGdi; -using AasxPredefinedConcepts; -using AdminShellNS; -using AnyUi; -using Extensions; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; - -// ReSharper disable InconsistentlySynchronizedField -// ReSharper disable AccessToModifiedClosure - -namespace AasxPluginAID -{ - public class AIDAnyUiControl - { - #region Members - //============= - - private LogInstance _log = new LogInstance(); - private AdminShellPackageEnv _package = null; - private Aas.Submodel _submodel = null; - private PluginEventStack _eventStack = null; - private PluginSessionBase _session = null; - private AnyUiStackPanel _panel = null; - private AnyUiContextPlusDialogs _displayContext = null; - private PluginOperationContextBase _opContext = null; - private AasxPluginBase _plugin = null; - - protected AnyUiSmallWidgetToolkit _uitk = new AnyUiSmallWidgetToolkit(); - - private String _selectedProtocolType = "HTTP"; - - private List _renderedInterfaces = new List(); - private List theDocEntitiesToPreview = new List(); - - private System.Timers.Timer _dispatcherTimer = null; - - // members for form editing - - protected AnyUiRenderForm _formDoc = null; - - protected static int InstCounter = 1; - - protected string CurrInst = ""; - - #endregion - - #region Cache for already generated Images - //======================================== - -#if USE_WPF - private static Dictionary referableHashToCachedBitmap = - new Dictionary(); -#else - private static Dictionary referableHashToCachedBitmap = - new Dictionary(); -#endif - #endregion - - #region Constructors, as for WPF control - //============= - - public AIDAnyUiControl() - { -#if JUST_FOR_INFO - // Timer for loading - //System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); - //dispatcherTimer.Tick += DispatcherTimer_Tick; - //dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); - //dispatcherTimer.Start(); - - //var _timer = new System.Threading.Timer((e) => - //{ - // DispatcherTimer_Tick(null, null); - //}, null, TimeSpan.FromMilliseconds(2000), TimeSpan.FromMilliseconds(1000)); - - // see: https://stackoverflow.com/questions/5143599/detecting-whether-on-ui-thread-in-wpf-and-winforms - //var dispatcher = System.Windows.Threading.Dispatcher.FromThread(System.Threading.Thread.CurrentThread); - //if (dispatcher != null) - //{ - // var dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); - // dispatcherTimer.Tick += DispatcherTimer_Tick; - // dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); - // dispatcherTimer.Start(); - //} - //else - //{ - // // Note: this timer shall work for all sorts of applications? - // // see: https://stackoverflow.com/questions/21041299/c-sharp-dispatchertimer-in-dll-application-never-triggered - // var _timer2 = new System.Timers.Timer(1000); - // _timer2.Elapsed += DispatcherTimer_Tick; - // _timer2.Enabled = true; - // _timer2.Start(); - //} -#endif -#if USE_WPF - AnyUiHelper.CreatePluginTimer(1000, DispatcherTimer_Tick); -#else - // Note: this timer shall work for all sorts of applications? - // see: https://stackoverflow.com/questions/21041299/c-sharp-dispatchertimer-in-dll-application-never-triggered - _dispatcherTimer = new System.Timers.Timer(1000); - _dispatcherTimer.Elapsed += DispatcherTimer_Tick; - _dispatcherTimer.Enabled = true; - _dispatcherTimer.Start(); -#endif - - CurrInst = "" + InstCounter; - InstCounter++; - - } - - public void Dispose() - { - if (_dispatcherTimer != null) - { - _dispatcherTimer.Stop(); - _dispatcherTimer.Dispose(); - } - } - - public void Start( - LogInstance log, - AdminShellPackageEnv thePackage, - Aas.Submodel theSubmodel, - PluginEventStack eventStack, - PluginSessionBase session, - AnyUiStackPanel panel, - PluginOperationContextBase opContext, - AnyUiContextPlusDialogs cdp, - AasxPluginBase plugin) - { - _log = log; - _package = thePackage; - _submodel = theSubmodel; - _eventStack = eventStack; - _session = session; - _panel = panel; - _opContext = opContext; - _displayContext = cdp; - _plugin = plugin; - - // no form, yet - _formDoc = null; - - // fill given panel - RenderFullShelf(_panel, _uitk); - } - - public static AIDAnyUiControl FillWithAnyUiControls( - LogInstance log, - object opackage, object osm, - PluginEventStack eventStack, - PluginSessionBase session, - object opanel, - PluginOperationContextBase opContext, - AnyUiContextPlusDialogs cdp, - AasxPluginBase plugin) - { - // access - var package = opackage as AdminShellPackageEnv; - var sm = osm as Aas.Submodel; - var panel = opanel as AnyUiStackPanel; - if (package == null || sm == null || panel == null) - return null; - - // the Submodel elements need to have parents - sm.SetAllParents(); - - // do NOT create WPF controls - FormInstanceBase.createSubControls = false; - - // factory this object - var shelfCntl = new AIDAnyUiControl(); - shelfCntl.Start(log, package, sm, eventStack, session, panel, opContext, cdp, plugin); - - // return shelf - return shelfCntl; - } - - #endregion - - #region Display Submodel - //============= - - private void RenderFullShelf(AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk) - { - // test trivial access - if ( _submodel?.SemanticId == null) - return; - - var found = false; - if (_submodel.SemanticId.GetAsExactlyOneKey().Value.ToString() == "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel") - found = true; - - if (!found) - return; - - // set usage info - string useinf = null; - - // what defaultLanguage - string defaultLang = "en"; - - // make new list box items - _renderedInterfaces = new List(); - // ReSharper disable ExpressionIsAlwaysNull - _renderedInterfaces = ListOfInterfaceEntity.ParseSubmodelAID( - _package, _submodel); - // bring it to the panel - RenderPanelOutside(view, uitk, useinf, defaultLang, _renderedInterfaces); - } - - protected double _lastScrollPosition = 0.0; - - protected void RenderPanelOutside( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - string usageInfo, - string defaultLanguage, - List its, - double? initialScrollPos = null) - { - var outer = view.Add(uitk.AddSmallGrid(rows: 4, cols: 1, colWidths: new[] { "*" })); - outer.RowDefinitions[2].Height = new AnyUiGridLength(1.0, AnyUiGridUnitType.Star); - - // at top, make buttons for the general form - var header = uitk.AddSmallGridTo(outer, 0, 0, rows: 2, cols: 5, - colWidths: new[] { "*", "#", "#", "#", "#" }); - - header.Margin = new AnyUiThickness(0); - header.Background = AnyUiBrushes.LightBlue; - - // - // Blue bar - // - - uitk.AddSmallBasicLabelTo(header, 0, 0, margin: new AnyUiThickness(8, 6, 0, 6), - foreground: AnyUiBrushes.DarkBlue, - fontSize: 1.5f, - setBold: true, - content: $"AssetInterfacesDescription"); - - if (_opContext?.IsDisplayModeEditOrAdd == true) - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(header, 0, 2, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(2, 0, 2, 0), - content: "Add Interface Description .."), - setValueAsync: (o) => ButtonTabPanels_Click("ButtonAddInterface")); - // controls - var controls = uitk.AddSmallWrapPanelTo(outer, 1, 0, - background: AnyUiBrushes.MiddleGray, margin: new AnyUiThickness(0, 0, 0, 2)); - - AnyUiButton importButton = null; - - importButton = AnyUiUIElement.RegisterControl(controls.Add(new AnyUiButton() - { - Margin = new AnyUiThickness(2), - MinHeight = 21, - Content = "Import Thing Description .." - }), (o) => - { - ButtonTabPanels_Click("ButtonImportInterface"); - return new AnyUiLambdaActionNone(); - }); - - // - // Scroll area - // - - // small spacer - outer.RowDefinitions[2] = new AnyUiRowDefinition(2.0, AnyUiGridUnitType.Pixel); - uitk.AddSmallBasicLabelTo(outer, 2, 0, - fontSize: 0.3f, - verticalAlignment: AnyUiVerticalAlignment.Top, - content: "", background: AnyUiBrushes.White); - - // add the body, a scroll viewer - outer.RowDefinitions[3] = new AnyUiRowDefinition(1.0, AnyUiGridUnitType.Star); - var scroll = AnyUiUIElement.RegisterControl( - uitk.AddSmallScrollViewerTo(outer, 3, 0, - horizontalScrollBarVisibility: AnyUiScrollBarVisibility.Disabled, - verticalScrollBarVisibility: AnyUiScrollBarVisibility.Visible, - flattenForTarget: AnyUiTargetPlatform.Browser, initialScrollPosition: initialScrollPos), - (o) => - { - if (o is Tuple positions) - { - _lastScrollPosition = positions.Item2; - } - return new AnyUiLambdaActionNone(); - }); - - // need a stack panel to add inside - var inner = new AnyUiStackPanel() { Orientation = AnyUiOrientation.Vertical }; - scroll.Content = inner; - - // render the innerts of the scroll viewer - inner.Background = AnyUiBrushes.LightGray; - - if (its != null) - foreach (var de in its) - { - var rde = RenderAnyUiInterfaceEntity(uitk, de); - if (rde != null) - inner.Add(rde); - } - - // post process - if (its != null) - foreach (var ent in its) - { - // attach events and add - ent.DoubleClick += InterfaceEntity_DoubleClick; - ent.MenuClick += InterfaceEntity_MenuClick; - } - } - - public AnyUiFrameworkElement RenderAnyUiInterfaceEntity( - AnyUiSmallWidgetToolkit uitk, InterfaceEntity de) - { - // access - if (de == null) - return new AnyUiStackPanel(); - - // make a outer grid - var outerG = uitk.AddSmallGrid(1, 1, - colWidths: new[] { "*" }, rowHeights: new[] { "*" }, - margin: new AnyUiThickness(0)); - - // make background border - for (int i = 2; i > 0; i--) - uitk.Set( - uitk.AddSmallBorderTo(outerG, 0, 0, - margin: new AnyUiThickness(3 + 2 * i, 3 + 2 * i, 3 + 4 - 2 * i, 3 + 4 - 2 * i), - background: AnyUiBrushes.White, - borderBrush: AnyUiBrushes.Black, - borderThickness: new AnyUiThickness(1.0)), - skipForTarget: AnyUiTargetPlatform.Browser); - - // make the border, which will get content - var border = uitk.AddSmallBorderTo(outerG, 0, 0, - margin: new AnyUiThickness(3, 3, 3 + 4, 3 + 4), - background: AnyUiBrushes.White, - borderBrush: AnyUiBrushes.Black, - borderThickness: new AnyUiThickness(1.0)); - - // the border emits double clicks - border.EmitEvent = AnyUiEventMask.LeftDouble; - border.setValueLambda = (o) => - { - if (o is AnyUiEventData ed - && ed.Mask == AnyUiEventMask.LeftDouble - && ed.ClickCount == 2) - { - de.RaiseDoubleClick(); - } - return new AnyUiLambdaActionNone(); - }; - - // make a grid - var g = uitk.AddSmallGrid(4, 4, - colWidths: new[] { "*", "5:", "*", "22:" }, - rowHeights: new[] { "*", "5:", "*", "25:" }, - margin: new AnyUiThickness(1), - background: AnyUiBrushes.White); - border.Child = g; - - uitk.AddSmallBasicLabelTo(g, 0, 0, - textIsSelectable: false, - margin: new AnyUiThickness(2), - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - fontSize: 1.0f, - content: "Title : " + $"{de.Title}"); - - - uitk.AddSmallBasicLabelTo(g, 0, 2, - textIsSelectable: false, - margin: new AnyUiThickness(2), - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - fontSize: 1.0f, - content: "Created : " + $"{de.Created}"); - - uitk.AddSmallBasicLabelTo(g, 2, 0, - textIsSelectable: false, - margin: new AnyUiThickness(2), - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - fontSize: 1.0f, - content: "contentType : " + $"{de.ContentType}"); - - - uitk.AddSmallBasicLabelTo(g, 2, 2, - textIsSelectable: false, - margin: new AnyUiThickness(2), - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - fontSize: 1.0f, - content: "ProtocolType : " + $"{de.ProtocolType}"); - - var hds = new List(); - if (_opContext?.IsDisplayModeEditOrAdd == true) - { - hds.AddRange(new[] { "\u270e", "Edit Interface Data" }); - hds.AddRange(new[] { "\u2702", "Delete Interface Data" }); - } - else - hds.AddRange(new[] { "\u270e", "View Interface Data" }); - - hds.AddRange(new[] { "\U0001F4BE", "Save to thing description file .." }); - - // context menu - uitk.AddSmallContextMenuItemTo(g, 3, 3, - "\u22ee", - hds.ToArray(), - margin: new AnyUiThickness(2, 2, 2, 2), - padding: new AnyUiThickness(5, 0, 5, 0), - fontWeight: AnyUiFontWeight.Bold, - menuItemLambda: null, - menuItemLambdaAsync: async (o) => - { - if (o is int ti && ti >= 0 && ti < hds.Count) - // awkyard, but for compatibility to WPF version - await de?.RaiseMenuClick(hds[2 * ti + 1], null); - return new AnyUiLambdaActionNone(); - }); - - // ok - return outerG; - } - - #endregion - - #region Create entity - //===================== - - protected AnyUiPanelEntity _formEntity = null; - - protected class AnyUiPanelEntity - { - public string IdShort = ""; - - public void RenderAnyUi( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - Func> lambdaCancel = null, - Func> lambdaAdd = null) - { - // - // make an outer grid, very simple grid of rows: header, spacer, body - // - - var outer = view.Add(uitk.AddSmallGrid(rows: 3, cols: 1, colWidths: new[] { "*" })); - outer.RowDefinitions[2].Height = new AnyUiGridLength(1.0, AnyUiGridUnitType.Star); - - // at top, make buttons for the general form - var header = uitk.AddSmallGridTo(outer, 0, 0, 1, cols: 5, colWidths: new[] { "*", "#", "#", "#", "#" }); - - header.Margin = new AnyUiThickness(0); - header.Background = AnyUiBrushes.LightBlue; - - // - // Blue bar - // - - uitk.AddSmallBasicLabelTo(header, 0, 0, margin: new AnyUiThickness(8, 6, 0, 6), - foreground: AnyUiBrushes.DarkBlue, - fontSize: 1.5f, - setBold: true, - content: $"Entity"); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(header, 0, 1, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(4, 0, 4, 0), - content: "Cancel"), - setValueAsync: lambdaCancel); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(header, 0, 2, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(4, 0, 4, 0), - content: "Add"), - setValueAsync: lambdaAdd); - - // small spacer - outer.RowDefinitions[1] = new AnyUiRowDefinition(2.0, AnyUiGridUnitType.Pixel); - uitk.AddSmallBasicLabelTo(outer, 1, 0, - fontSize: 0.3f, - verticalAlignment: AnyUiVerticalAlignment.Top, - content: "", background: AnyUiBrushes.White); - - // - // Grid with entries - // - - var body = uitk.AddSmallGridTo(outer, 2, 0, rows: 1, cols: 2, - colWidths: new[] { "#", "*" }, - background: AnyUiBrushes.LightGray); - - uitk.AddSmallBasicLabelTo(body, 0, 0, - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - margin: new AnyUiThickness(0, 0, 4, 0), - textWrapping: AnyUiTextWrapping.NoWrap, - content: "idShort:"); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallTextBoxTo(body, 0, 1, - margin: new AnyUiThickness(2, 10, 2, 10), - text: "" + IdShort), - (o) => - { - if (o is string os) - IdShort = os; - return new AnyUiLambdaActionNone(); - }); - } - - } - - #endregion - - #region Event handling - //============= - - private Action _menuSubscribeForNextEventReturn = null; - - protected void PushUpdateEvent(AnyUiRenderMode mode = AnyUiRenderMode.All) - { - // bring it to the panel by redrawing the plugin - _eventStack?.PushEvent(new AasxPluginEventReturnUpdateAnyUi() - { - // get the always currentplugin name - PluginName = "AasxPluginAID", - Session = _session, - Mode = mode, - UseInnerGrid = true - }); - } - - protected void PushUpdatenRedrawEvent(AnyUiRenderMode mode = AnyUiRenderMode.All) - { - // bring it to the panel by redrawing the plugin - _eventStack?.PushEvent(new AasxPluginEventReturnUpdateAnyUi() - { - // get the always currentplugin name - PluginName = "AasxPluginAID", - Session = _session, - Mode = mode, - UseInnerGrid = true - }); - - _eventStack?.PushEvent(new AasxPluginResultEventRedrawAllElements() - { - Session = _session, - }); - } - - public void HandleEventReturn(AasxPluginEventReturnBase evtReturn) - { - // demands from shelf - if (_menuSubscribeForNextEventReturn != null) - { - // delete first - var tempLambda = _menuSubscribeForNextEventReturn; - _menuSubscribeForNextEventReturn = null; - - // execute - tempLambda(evtReturn); - - // finish - return; - } - - // check, if a form is active - if (_formDoc != null) - { - _formDoc.HandleEventReturn(evtReturn); - } - } - - #endregion - - #region Update - //============= - - public void Update(params object[] args) - { - // check args - if (args == null || args.Length < 2 - || !(args[0] is AnyUiStackPanel newPanel) - || !(args[1] is AnyUiContextPlusDialogs newCdp)) - return; - - // ok, re-assign panel and re-display - _displayContext = newCdp; - _panel = newPanel; - _panel.Children.Clear(); - - // multiple different views can be renders - if (_formEntity != null) - { - _formEntity.RenderAnyUi(_panel, _uitk, - lambdaCancel: (o) => ButtonTabPanels_Click("ButtonCancelEntity"), - lambdaAdd: (o) => ButtonTabPanels_Click("ButtonAddEntity")); - } - else - if (_formDoc != null) - { - if (_opContext?.IsDisplayModeEditOrAdd == true) - { - _formDoc.RenderFormInst(_panel, _uitk, _opContext, - setLastScrollPos: true, - lambdaFixCds: (o) => ButtonTabPanels_Click("ButtonFixCDs"), - lambdaCancel: (o) => ButtonTabPanels_Click("ButtonCancel"), - lambdaOK: (o) => ButtonTabPanels_Click("ButtonUpdate")); - } - else - { - _formDoc.RenderFormInst(_panel, _uitk, _opContext, - setLastScrollPos: true, - lambdaCancel: (o) => ButtonTabPanels_Click("ButtonCancel")); - } - } - else - { - // the default: the full shelf - RenderFullShelf(_panel, _uitk); - } - } - - #endregion - - #region Callbacks - //=============== - - private List _updateSourceElements = null; - private async Task InterfaceEntity_MenuClick(InterfaceEntity e, string menuItemHeader, object tag) - { - // first check - if (e == null || menuItemHeader == null) - return; - - // what to do? - if (tag == null - && (menuItemHeader == "Edit Interface Data" || menuItemHeader == "View Interface Data")) - { - // lambda - Action lambda = (desc) => - { - var fi = new FormInstanceSubmodelElementCollection(null, desc); - fi.PresetInstancesBasedOnSource(_updateSourceElements); - fi.outerEventStack = _eventStack; - fi.OuterPluginName = _plugin?.GetPluginName(); - fi.OuterPluginSession = _session; - - // initialize form - _formDoc = new AnyUiRenderForm( - fi, - updateMode: true); - PushUpdateEvent(); - }; - - var desc = AIDSemanticConfig.CreateAssetInterfaceDescription(); - _updateSourceElements = e.SourceElementsInterface; - - lambda(desc); - - // OK - return; - } - - if (tag == null && menuItemHeader == "Delete Interface Data" && _submodel?.SubmodelElements != null - && _opContext?.IsDisplayModeEditOrAdd == true) - { - // the source elements need to match a Document - var semConf = IDTAAid.Static.AID_Interface; - var found = false; - foreach (var smcDoc in - _submodel.SubmodelElements.FindAllSemanticIdAs( - semConf, MatchMode.Relaxed)) - if (smcDoc?.Value == e.SourceElementsInterface) - { - // ask back via display context - if (AnyUiMessageBoxResult.Cancel == await _displayContext?.MessageBoxFlyoutShowAsync( - "Delete Interface description? This cannot be reverted!", - "AssetInterfacesDescription", - AnyUiMessageBoxButton.OKCancel, - AnyUiMessageBoxImage.Question)) - return; - - // do it - try - { - _submodel.SubmodelElements.Remove(smcDoc); - e.SourceElementsInterface.Remove(smcDoc); - - // re-display also in Explorer - _eventStack?.PushEvent(new AasxPluginResultEventRedrawAllElements() - { Session = _session }); - - // log - _log?.Info("Deleted Interface description."); - } - catch (Exception ex) - { - _log?.Error(ex, "while saveing digital file to user specified loacation"); - } - - // OK - return; - - // ReSharper enable PossibleMultipleEnumeration - } - - if (!found) - _log?.Error("Document element was not found properly!"); - } - - // show digital file - if (tag == null && menuItemHeader == "View file") - InterfaceEntity_DisplaySaveFileAsync(e, true, false); - - // save digital file? - if (tag == null && menuItemHeader == "Save to thing description file ..") - { - InterfaceEntity_DisplaySaveFileAsync(e, true, true); - } - - } - private async Task InterfaceEntity_DisplaySaveFileAsync(InterfaceEntity e, bool display, bool save) - { - try - { - if (e.SourceElementsInterface.Count == 0) - { - return; - } - Aas.ISubmodelElementCollection dmc = e.SourceElementsInterface[0].Parent as Aas.ISubmodelElementCollection; - var uc = await _displayContext.MenuSelectSaveFilenameAsync( - ticket: null, argName: null, - caption: "Select preset JSON file to save ..", - proposeFn: e.InterfaceName + ".json", - filter: "Preset JSON file (*.json)|*.json|All files (*.*)|*.*", - msg: "Not found"); - - - - JObject tdJson = AIDTDExport.ExportInterfacetoTDJson(dmc); - using (var s = new StreamWriter(uc.TargetFileName as string)) - { - string output = Newtonsoft.Json.JsonConvert.SerializeObject(tdJson, - Newtonsoft.Json.Formatting.Indented); - s.WriteLine(output); - } - } - catch (Exception ex) - { - _log?.Error(ex, "when executing file action"); - return; - } - } - private void InterfaceEntity_DoubleClick(InterfaceEntity e) - { - InterfaceEntity_DisplaySaveFileAsync(e, true, false); - } - private async Task ButtonTabPanels_Click(string cmd, string args = null) - { - if (cmd == "ButtonCancel") - { - // re-display (tree & panel) - return new AnyUiLambdaActionRedrawAllElementsBase() { RedrawCurrentEntity = true }; - } - - if (cmd == "ButtonUpdate") - { - // add - if (this._formDoc != null - && _package != null - && _submodel != null) - { - // on this level of the hierarchy, shall a new SMEC be created or shall - // the existing source of elements be used? - List currentElements = null; - if (_formDoc.InUpdateMode) - { - currentElements = _updateSourceElements; - } - else - { - currentElements = new List(); - } - - // create a sequence of SMEs - try - { - if (_formDoc.FormInstance is FormInstanceSubmodelElementCollection fismec) - fismec.AddOrUpdateDifferentElementsToCollection( - currentElements, _package, addFilesToPackage: true); - - _log?.Info("Document elements updated. Do not forget to save, if necessary!"); - } - catch (Exception ex) - { - _log?.Error(ex, "when adding Document"); - } - // the InstSubmodel, which started the process, should have a "fresh" SMEC available - // make it unique in the Documentens Submodel - var newSmc = (_formDoc.FormInstance as FormInstanceSubmodelElementCollection)?.sme - as Aas.SubmodelElementCollection; - - // if not update, put them into the Document's Submodel - if (!_formDoc.InUpdateMode && currentElements != null && newSmc != null) - { - // make newSmc unique in the cotext of the Submodel - FormInstanceHelper.MakeIdShortUnique(_submodel.SubmodelElements, newSmc); - - // add the elements - newSmc.Value = currentElements; - - // add the whole SMC - _submodel.Add(newSmc); - } - } - else - { - _log?.Error("Preconditions for update entities from Document not met."); - } - // re-display (tree & panel) - return new AnyUiLambdaActionRedrawAllElementsBase() { NextFocus = _submodel }; - } - - if (cmd == "ButtonAddInterface") - { - Action lambda = (desc) => - { - var fi = new FormInstanceSubmodelElementCollection(null, desc); - fi.outerEventStack = _eventStack; - fi.OuterPluginName = _plugin?.GetPluginName(); - fi.OuterPluginSession = _session; - - // initialize form - _formDoc = new AnyUiRenderForm( - fi, - updateMode: false); - - // bring it to the panel by redrawing the plugin - PushUpdateEvent(); - }; - - var desc = AIDSemanticConfig.CreateAssetInterfaceDescription(); - _updateSourceElements = null; - lambda(desc); - - return new AnyUiLambdaActionNone(); - } - - if (cmd == "ButtonImportInterface") - { - var uc = await _displayContext.MenuSelectOpenFilenameAsync( - ticket: null, argName: null, - caption: "Select JSON file to import..", - proposeFn: null, filter: "Preset JSON file (*.json)|*.json|All files (*.*)|*.*", - msg: "Not found"); - - - string text = System.IO.File.ReadAllText(uc.TargetFileName); - JObject tdJObject; - using (var tdStringReader = new StringReader(text)) - using (var jsonTextReader = new JsonTextReader(tdStringReader) - { DateParseHandling = DateParseHandling.None }) - { - tdJObject = JObject.FromObject(JToken.ReadFrom(jsonTextReader)); - } - var targetPath = "/aasx/files/"; - var onlyFn = System.IO.Path.GetFileNameWithoutExtension(uc.TargetFileName); - var onlyExt = System.IO.Path.GetExtension(uc.TargetFileName); - var salt = Guid.NewGuid().ToString().Substring(0, 8); - var targetFn = String.Format("{0}_{1}{2}", onlyFn, salt, onlyExt); - - var desc = AIDTDImport.CreateAssetInterfaceDescriptionFromTd(tdJObject, - targetPath + targetFn,_submodel.Id.ToString(),_submodel.SubmodelElements.Count,"JSONLD"); - _submodel.Add(desc); - PushUpdatenRedrawEvent(); - return new AnyUiLambdaActionRedrawAllElementsBase() { NextFocus = _submodel }; - } - - if (cmd == "ButtonCancelEntity") - { - // reset view - _formEntity = null; - _formDoc = null; - - // redisplay - PushUpdateEvent(); - return new AnyUiLambdaActionNone(); - } - - return new AnyUiLambdaActionNone(); - } - #endregion - - #region Timer - //=========== - - protected int _dispatcherNumException = 0; - - private void DispatcherTimer_Tick(object sender, EventArgs e) - { - - } - #region Utilities - //=============== - - #endregion - } -} -#endregion \ No newline at end of file diff --git a/src/AasxPluginAID/AIDSemanticConfig.cs b/src/AasxPluginAID/AIDSemanticConfig.cs deleted file mode 100644 index 83797791..00000000 --- a/src/AasxPluginAID/AIDSemanticConfig.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxIntegrationBase; -using AasxIntegrationBase.AasForms; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using Newtonsoft.Json; -using AasxPluginAID; -using Microsoft.VisualBasic; -using AnyUi; -using Newtonsoft.Json.Linq; -using System.Windows.Forms; -using AasCore.Aas3_0; -using ImageMagick; -using JetBrains.Annotations; - -namespace AasxPluginAID -{ - public class AIDSemanticConfig - - { - public Aas.Key SemIdReferencedObject = null; - public static AasxPredefinedConcepts.IDTAAid idtaDef = AasxPredefinedConcepts.IDTAAid.Static; - public static FormDescSubmodelElement BuildUIFormElem(JToken formElem) - { - JObject elemJObject = JObject.FromObject(formElem); - - string elem = elemJObject["formtext"].ToString(); - string elemType = elemJObject["AasElementType"].ToString(); - string presetIdShort = elemJObject["presetIdShort"].ToString(); - - FormMultiplicity multiplicity = idtaDef.GetFormMultiplicity(elemJObject["multiplcity"].ToString()); - Aas.Key semanticReferenceKey = idtaDef.ConstructKey(KeyTypes.GlobalReference, elemJObject["semanticReference"].ToString()); - - LangStringTextType description = new Aas.LangStringTextType("en", elemJObject["description"].ToString()); - - if (elemType == "Property") - { - string valueType = elemJObject["valueType"].ToString(); - FormDescProperty _propertyFrom = new FormDescProperty(elem, - multiplicity,semanticReferenceKey, presetIdShort, - valueType: valueType); - _propertyFrom.PresetDescription.Add(description); - - return _propertyFrom; - } - else if (elemJObject["AasElementType"].ToString() == "SubmodelElementCollection") - { - FormDescSubmodelElementCollection _formCollection = new FormDescSubmodelElementCollection(elem, - multiplicity, semanticReferenceKey, presetIdShort - ); - _formCollection.PresetDescription.Add(description); - foreach (var childElem in elemJObject["childs"]) - { - _formCollection.Add(BuildUIFormElem(childElem)); - } - return _formCollection; - } - else if (elemJObject["AasElementType"].ToString() == "Range") - { - string valueType = elemJObject["valueType"].ToString(); - FormDescRange _rangeFrom = new FormDescRange(elem, - multiplicity, semanticReferenceKey, presetIdShort, - valueType: valueType); - _rangeFrom.PresetDescription.Add(new Aas.LangStringTextType("en", elemJObject["description"].ToString())); - - return _rangeFrom; - } - else if (elemJObject["AasElementType"].ToString() == "ReferenceElement") - { - FormDescReferenceElement _referenceElementFrom = new FormDescReferenceElement(elem, - multiplicity, semanticReferenceKey, presetIdShort - ); - _referenceElementFrom.PresetDescription.Add(new Aas.LangStringTextType("en", elemJObject["description"].ToString())); - - return _referenceElementFrom; - } - else if (elemJObject["AasElementType"].ToString() == "File") - { - FormDescFile _fileElementForm = new FormDescFile(elem, - multiplicity, semanticReferenceKey, presetIdShort - ); - - return _fileElementForm; - } - return null; - } - public static FormDescSubmodelElementCollection CreateAssetInterfaceDescription() - { - try - { - FormDescSubmodelElementCollection interfaceDescription = BuildUIFormElem(idtaDef.EndpointMetadataJObject["interface"]) as FormDescSubmodelElementCollection; - - return interfaceDescription; - } - catch(Exception ex) { - Console.WriteLine(ex.ToString()); - return null; - } - } - - } -} \ No newline at end of file diff --git a/src/AasxPluginAID/AIDTDExport.cs b/src/AasxPluginAID/AIDTDExport.cs deleted file mode 100644 index 00c2f367..00000000 --- a/src/AasxPluginAID/AIDTDExport.cs +++ /dev/null @@ -1,161 +0,0 @@ -using AasCore.Aas3_0; -using Extensions; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using Aas = AasCore.Aas3_0; - -namespace AasxPluginAID -{ - class AIDTDExport - { - public static AasxPredefinedConcepts.IDTAAid idtaDef = AasxPredefinedConcepts.IDTAAid.Static; - public static JToken TDelemDefinition(ISubmodelElement se, JObject tdSchemaObject, string addParams = null) - { - string semanticReference = se.SemanticId.GetAsExactlyOneKey().Value; - - foreach (var child in tdSchemaObject["childs"]) - { - JObject childElemJObject = JObject.FromObject(child); - if (childElemJObject["semanticReference"].ToString() == semanticReference) - { - return child; - } - } - return null; - } - public static JObject serialize_aid_elem(JToken tdJToken, Aas.ISubmodelElement sme) - { - JObject TDJson = new JObject(); - JObject tdSchemaObject = JObject.FromObject(tdJToken); - string presetIdShort = tdSchemaObject["presetIdShort"].ToString(); - string elemType = tdSchemaObject["AasElementType"].ToString(); - string semanticReference = tdSchemaObject["semanticReference"].ToString(); - string multiplcity = tdSchemaObject["multiplcity"].ToString(); - - if (elemType == "Property") - { - Aas.Property _property = sme as Aas.Property; - TDJson[sme.IdShort] = _property.Value.ToString(); - } - else if (elemType == "Range") - { - Aas.Range _range = sme as Aas.Range; - if (_range.IdShort == "min_max") - { - TDJson["minimum"] = _range.Min; - TDJson["maximum"] = _range.Max; - } - if (_range.IdShort == "lengthRange") - { - TDJson["minLength"] = _range.Min; - TDJson["maxLength"] = _range.Max; - } - if (_range.IdShort == "itemsRange") - { - TDJson["minItems"] = _range.Min; - TDJson["maxItems"] = _range.Max; - } - } - else if (elemType == "SubmodelElementCollection") - { - Aas.ISubmodelElementCollection smc = sme as Aas.SubmodelElementCollection; - if (presetIdShort == "scopes" || presetIdShort == "enum" || presetIdShort == "security") - { - List listElem = new List(); - foreach (var se in smc.Value) - { - if (presetIdShort == "security") - { - Aas.ReferenceElement referenceElem = se as Aas.ReferenceElement; - listElem.Add(referenceElem.Value.Keys.Last().Value.ToString()); - } - else - { - Aas.Property _property = se as Aas.Property; - listElem.Add(_property.Value.ToString()); - } - } - TDJson[presetIdShort] = JToken.FromObject(listElem); - } - else if (presetIdShort == "forms") - { - JObject smcJObject = new JObject(); - List forms = new List(); - Aas.ISubmodelElementCollection formsSC = sme as Aas.SubmodelElementCollection; - foreach (var form in formsSC.Value) - { - - JToken formSchemadefinition = TDelemDefinition(form, tdSchemaObject); - JObject serializedJObject = serialize_aid_elem(formSchemadefinition, form); - smcJObject.Merge(JToken.FromObject(serializedJObject)); - - } - forms.Add(smcJObject); - TDJson["forms"] = JToken.FromObject(forms); - } - else - { - JObject smcJObject = new JObject(); - foreach (var se in smc.Value) - { - JToken childSchemaDefinition = TDelemDefinition(se, tdSchemaObject); - JObject serializeJObject = serialize_aid_elem(childSchemaDefinition, se); - smcJObject.Merge(JToken.FromObject(serializeJObject)); - } - if (semanticReference == "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition" - || semanticReference == "https://www.w3.org/2019/wot/json-schema#propertyName") - { - string _key = smcJObject["key"].ToString(); - smcJObject.Remove("key"); - TDJson[_key] = JToken.FromObject(smcJObject); - } - else - { - TDJson[sme.IdShort] = JToken.FromObject(smcJObject); - } - } - } - - return TDJson; - } - public static JObject ExportInterfacetoTDJson(Aas.ISubmodelElementCollection smc) - { - JObject TDJson = new JObject(); - TDJson["@context"] = "https://www.w3.org/2019/wot/td/v1"; - TDJson["@type"] = "Thing"; - try - { - foreach (var se in smc.Value) - { - if (se.IdShort == "EndpointMetadata") - { - JToken endpointmetaData = serialize_aid_elem(idtaDef.EndpointMetadataJObject["interface"]["childs"][4], se)["EndpointMetadata"]; - TDJson.Merge(JObject.FromObject(endpointmetaData)); - } - else if (se.IdShort == "ExternalDescriptor") - { - - } - else if (se.IdShort == "InteractionMetadata") - { - JToken InterfaceMetaData = serialize_aid_elem(idtaDef.EndpointMetadataJObject["interface"]["childs"][6], se)["InteractionMetadata"]; - TDJson.Merge(JObject.FromObject(InterfaceMetaData)); - } - else - { - Aas.Property _property = se as Aas.Property; - TDJson[se.IdShort] = _property.Value.ToString(); - } - } - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - return TDJson; - - } - } -} diff --git a/src/AasxPluginAID/AIDTDImport.cs b/src/AasxPluginAID/AIDTDImport.cs deleted file mode 100644 index e7420681..00000000 --- a/src/AasxPluginAID/AIDTDImport.cs +++ /dev/null @@ -1,381 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; -using Extensions; -using AasCore.Aas3_0; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Xml.Linq; -using System.Security.Policy; -using System.Windows.Forms; -using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox; -using AasxIntegrationBase.AasForms; -using System.Text.RegularExpressions; -using System.Windows.Input; -using System.Web.Services.Description; -using System.Net; - -namespace AasxPluginAID -{ - class AIDTDImport - { - public static string submodelId = null; - public static string interfaceId = null; - public static string contentType = ""; - public static string fileName = ""; - public static AasxPredefinedConcepts.IDTAAid idtaDef = AasxPredefinedConcepts.IDTAAid.Static; - - public static Property BuildAasProperty(string idShort, Reference semanticReference, - LangStringTextType description, string value, DataTypeDefXsd valueType) - { - Property _property = new Property(valueType, idShort: idShort, - semanticId: semanticReference, description: new List { description }, - value: value); - return _property; - } - public static File BuildAasFile(string idShort, Reference semanticReference, string contentType) - { - File descriptorName = new Aas.File(contentType: contentType, idShort: idShort, - semanticId: semanticReference); - return descriptorName; - } - - public static SubmodelElementCollection BuildSEC(string idShort, Reference semanticReference, LangStringTextType description) - { - SubmodelElementCollection sec = new SubmodelElementCollection(idShort: idShort, - semanticId: semanticReference, - description: new List { description }); - return sec; - } - public static ISubmodelElement BuildAasElement(JObject tdJObject, JObject tdSchemaObject) - { - - string formText = tdSchemaObject["formtext"].ToString(); - ISubmodelElement submodelElement = null; - Reference semanticReference = idtaDef.ConstructReference(tdSchemaObject["semanticReference"].ToString()); - FormMultiplicity multiplicity = idtaDef.GetFormMultiplicity(tdSchemaObject["multiplcity"].ToString()); - string presetIdShort = tdSchemaObject["presetIdShort"].ToString(); - string elemType = tdSchemaObject["AasElementType"].ToString(); - LangStringTextType description = new Aas.LangStringTextType("en", tdSchemaObject["description"].ToString()); - if (elemType == "Property") - { - if (formText.Contains("_")) - { - formText = formText.Replace("_", ":"); - } - DataTypeDefXsd valueType = idtaDef.GetValueType(tdSchemaObject["valueType"].ToString()); - submodelElement = BuildAasProperty(presetIdShort, semanticReference, description, tdJObject[formText].ToString(), - valueType); - return submodelElement; - } - else if (elemType == "SubmodelElementCollection") - { - submodelElement = new SubmodelElementCollection(idShort: presetIdShort, - semanticId: semanticReference, description: new List { description }); - if (formText == "scopes" || formText == "enum") - { - if (!tdJObject.ContainsKey(formText)) - { - return null; - } - JObject _cSchemaObject = JObject.FromObject(tdSchemaObject["childs"][0]); - int j = 0; - foreach (var cElem in tdJObject[formText]) - { - submodelElement.Add(BuildAasProperty(formText + string.Format("{00:00}", j), semanticReference, - description, cElem.ToString(), DataTypeDefXsd.String)); - j++; - } - return submodelElement; - } - else if (formText == "security") - { - if (!tdJObject.ContainsKey(formText)) - { - return null; - } - int j = 0; - foreach (var _security in tdJObject["security"]) - { - List _keys = new List - { - idtaDef.ConstructKey(KeyTypes.Submodel,submodelId), - idtaDef.ConstructKey(KeyTypes.SubmodelElementCollection,interfaceId), - idtaDef.ConstructKey(KeyTypes.SubmodelElementCollection,"EndpointMetadata"), - idtaDef.ConstructKey(KeyTypes.SubmodelElementCollection,"securityDefinitions"), - idtaDef.ConstructKey(KeyTypes.SubmodelElementCollection,_security.ToString()) - }; - - Aas.ReferenceElement _secRef = new ReferenceElement(idShort: "security" + string.Format("{00:00}", j), - semanticId: semanticReference, description: new List { new Aas.LangStringTextType("en", "Reference element to security scheme definition") }, - value: new Reference(ReferenceTypes.ModelReference, _keys)); - - submodelElement.Add(_secRef); - j++; - } - return submodelElement; - } - else if (formText == "properties") - { - foreach (JProperty _property in tdJObject["properties"]) - { - string _key = _property.Name; - JObject propertyJObject = new JObject(); - propertyJObject["property"] = JToken.FromObject(_property.Value); - propertyJObject["property"]["key"] = _key; - JObject propertySchemaJObject = JObject.FromObject(tdSchemaObject["childs"][0]); - SubmodelElementCollection _pSEC = BuildAasElement(propertyJObject, propertySchemaJObject) as - SubmodelElementCollection; - _pSEC.IdShort = _key; - submodelElement.Add(_pSEC); - } - return submodelElement; - } - //This form conversion is at the moment not in AID V1.0 specification. might be used in later version - //else if (formText == "forms") - //{ - // if (!tdJObject.ContainsKey(formText)) - // { - // return null; - // } - // int i = 1; - // foreach (var _form in tdJObject["forms"]) - // { - // JObject formJObject = JObject.FromObject(_form); - // List keys = formJObject.Properties().Select(p => p.Name).ToList(); - // if (keys.Contains("htv:methodName")) - // { - // JObject formSchemaJObject = JObject.FromObject(tdSchemaObject["childs"][0]); - // string methodName = formJObject["htv:methodName"].ToString(); - // formJObject.Remove("htv:methodName"); - // formJObject["htv_methodName"] = methodName; - // JObject httpFormJobject = new JObject(); - // httpFormJobject["HTTP Form"] = JToken.FromObject(formJObject); - // ISubmodelElement fsmc = BuildAasElement(httpFormJobject, formSchemaJObject); - // fsmc.IdShort = "form" + string.Format("{00:00}", i); - // submodelElement.Add(fsmc); - // } - // else if (isMQTTForm(keys)) - // { - // JObject mttFormJobject = new JObject(); - // mttFormJobject["MQTT Form"] = JToken.FromObject(formJObject); - // JObject formSchemaJObject = JObject.FromObject(tdSchemaObject["childs"][1]); - // ISubmodelElement fsmc = BuildAasElement(mttFormJobject, formSchemaJObject); - // fsmc.IdShort = "form" + string.Format("{00:00}", i); - // submodelElement.Add(fsmc); - // } - // else if (isModBusForm(keys)) - // { - // JObject modbusFormJobject = new JObject(); - // modbusFormJobject["MODBUS Form"] = JToken.FromObject(formJObject); - // JObject formSchemaJObject = JObject.FromObject(tdSchemaObject["childs"][2]); - // ISubmodelElement fsmc = BuildAasElement(modbusFormJobject, formSchemaJObject); - // fsmc.IdShort = "form" + string.Format("{00:00}", i); - // submodelElement.Add(fsmc); - // } - // break; - // } - //} - - ///Do this on Saturday. - else if (formText == "forms") - { - if (!tdJObject.ContainsKey(formText)) - { - return null; - } - - foreach (var _form in tdJObject["forms"]) - { - JObject formJObject = JObject.FromObject(_form); - List keys = formJObject.Properties().Select(p => p.Name).ToList(); - if (keys.Contains("href")) - { - foreach(var _formSchemaJObject in tdSchemaObject["childs"]) - { - JObject formSchemaJObjects = JObject.FromObject(_formSchemaJObject); - if(formJObject.ContainsKey(formSchemaJObjects["tdText"].ToString())) - { - ISubmodelElement formElement = BuildAasElement(formJObject, formSchemaJObjects); - if (formElement != null) - { - submodelElement.Add(formElement); - } - } - - } - - } - - break; - } - } - else - { - JObject jobject = JObject.FromObject(tdJObject[formText]); - foreach (var childSchemaElem in tdSchemaObject["childs"]) - { - string cformText = childSchemaElem["formtext"].ToString(); - string cElementType = childSchemaElem["AasElementType"].ToString(); - - if (cElementType == "Range") - { - string cpresetIdShort = childSchemaElem["presetIdShort"].ToString(); - Reference csemanticReference = idtaDef.ConstructReference(childSchemaElem["semanticReference"].ToString()); - LangStringTextType cdescription = new Aas.LangStringTextType("en", childSchemaElem["description"].ToString()); - - bool present = false; - Aas.Range _range = new Aas.Range(Aas.DataTypeDefXsd.String, idShort: cpresetIdShort, - semanticId: csemanticReference, description: new List { cdescription }); - if (cformText == "min_max") - { - if (jobject.ContainsKey("minimum")) - { - present = true; - _range.Min = jobject["minimum"].ToString(); - } - if (jobject.ContainsKey("maximum")) - { - present = true; - _range.Max = jobject["maximum"].ToString(); - } - } - else if (cformText == "itemsRange") - { - if (jobject.ContainsKey("minItems")) - { - present = true; - _range.Min = jobject["minItems"].ToString(); - } - if (jobject.ContainsKey("maxItems")) - { - present = true; - _range.Max = jobject["maxItems"].ToString(); - } - } - else if (cformText == "lengthRange") - { - if (jobject.ContainsKey("minLength")) - { - present = true; - _range.Min = jobject["minLength"].ToString(); - } - if (jobject.ContainsKey("maxLength")) - { - present = true; - _range.Max = jobject["maxLength"].ToString(); - } - } - if (present) - { - submodelElement.Add(_range); - } - } - else if (jobject.ContainsKey(cformText)) - { - JObject childSchemaElemObject = JObject.FromObject(childSchemaElem); - submodelElement.Add(BuildAasElement(jobject, childSchemaElemObject)); - } - } - } - return submodelElement; - } - else if (elemType == "File") - { - File dName = BuildAasFile("fileName", idtaDef.ConstructReference("https://admin-shell.io/idta/AssetInterfacesDescription/1/0/externalDescriptorName"), contentType); - dName.Value = fileName; - return dName; - } - return submodelElement; - - } - public static Boolean isMQTTForm(List keysList) - { - foreach (string key in idtaDef.mqttFormElemList) - { - if (keysList.Contains(key)) - return true; - } - return false; - } - public static Boolean isModBusForm(List keysList) - { - foreach (string key in idtaDef.modvFormElemList) - { - if (keysList.Contains(key)) - return true; - } - return false; - } - public static SubmodelElementCollection CreateAssetInterfaceDescriptionFromTd( - JObject tdJObject, string filename, string _submodelId, int interfaceCount, string _contentType) - { - interfaceCount++; - submodelId = _submodelId; - contentType = _contentType; - interfaceId = "interface" + string.Format("{00:00}", interfaceCount); - fileName = filename; - JObject interfaceJObject = JObject.FromObject(idtaDef.EndpointMetadataJObject["interface"]); - Aas.Reference semanticReference = idtaDef.ConstructReference(interfaceJObject["semanticReference"].ToString()); - LangStringTextType description = new Aas.LangStringTextType("en", interfaceJObject["description"].ToString()); - - Aas.SubmodelElementCollection interfaceDescription = new SubmodelElementCollection(idShort: interfaceId, - semanticId: semanticReference, description: new List { description }); - try - { - foreach (var childElem in interfaceJObject["childs"]) - { - JObject childSchemaObject = JObject.FromObject(childElem); - string formText = childSchemaObject["formtext"].ToString(); - if (formText == "EndpointMetadata" || formText == "InteractionMetadata" || - formText == "ExternalDescriptor") - { - Reference smcsemanticReference = idtaDef.ConstructReference(childSchemaObject["semanticReference"].ToString()); - LangStringTextType smcdescription = new Aas.LangStringTextType("en", childSchemaObject["description"].ToString()); - SubmodelElementCollection smc = BuildSEC(formText, smcsemanticReference, smcdescription); - foreach (var childSchemaElem in childSchemaObject["childs"]) - { - JObject childSchemaElemObject = JObject.FromObject(childSchemaElem); - string cElemformText = childSchemaElem["formtext"].ToString(); - if (cElemformText != "descriptorName") - { - if (tdJObject.ContainsKey(cElemformText)) - { - smc.Add(BuildAasElement(tdJObject, childSchemaElemObject)); - } - } - else - { - smc.Add(BuildAasElement(tdJObject, childSchemaElemObject)); - } - - - } - interfaceDescription.Add(smc); - - } - else if(tdJObject.ContainsKey(childSchemaObject["formtext"].ToString())) - - { - Aas.ISubmodelElement tdElement = BuildAasElement(tdJObject, childSchemaObject); - if (tdElement != null) - { - interfaceDescription.Add(tdElement); - } - } - } - - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - return interfaceDescription; - - } - - } -} diff --git a/src/AasxPluginAID/AasxPluginAID.csproj b/src/AasxPluginAID/AasxPluginAID.csproj deleted file mode 100644 index c6530f74..00000000 --- a/src/AasxPluginAID/AasxPluginAID.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - net6.0-windows - Library - false - true - false - false - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - - - - - - diff --git a/src/AasxPluginAID/AasxPluginAID.options.json b/src/AasxPluginAID/AasxPluginAID.options.json deleted file mode 100644 index daf4912b..00000000 --- a/src/AasxPluginAID/AasxPluginAID.options.json +++ /dev/null @@ -1 +0,0 @@ -null /* by intention NO JSON data. Built in options are used. */ \ No newline at end of file diff --git a/src/AasxPluginAID/AasxPluginAID.plugin b/src/AasxPluginAID/AasxPluginAID.plugin deleted file mode 100644 index 3beebdf2..00000000 --- a/src/AasxPluginAID/AasxPluginAID.plugin +++ /dev/null @@ -1 +0,0 @@ -This file tags the according .ddl to be a plug-in for AasxPackageExplorer. \ No newline at end of file diff --git a/src/AasxPluginAID/InterfaceEntity.cs b/src/AasxPluginAID/InterfaceEntity.cs deleted file mode 100644 index 05cce8d7..00000000 --- a/src/AasxPluginAID/InterfaceEntity.cs +++ /dev/null @@ -1,250 +0,0 @@ -/* -Copyright (c) 2024 Festo SE & Co. KG -Author: Harish Kumar Pakala - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using AasxIntegrationBase; -using AasxIntegrationBaseGdi; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AnyUi; -using System.Threading.Tasks; -using System.Net.Mime; -using System.Net.Sockets; - -namespace AasxPluginAID -{ - public class InterfaceEntity - { - public delegate void InterfaceEntityEvent(InterfaceEntity e); - public event InterfaceEntityEvent DoubleClick = null; - - public delegate Task MenuClickDelegate(InterfaceEntity e, string menuItemHeader, object tag); - public event MenuClickDelegate MenuClick = null; - - public event InterfaceEntityEvent DragStart = null; - - public string Title = ""; - public string Created = ""; - public string ContentType = ""; - public string ProtocolType = ""; - public string InterfaceName = ""; - -#if USE_WPF - public System.Windows.Controls.Viewbox ImgContainerWpf = null; -#endif - public AnyUiImage ImgContainerAnyUi = null; - public string ReferableHash = null; - - public List SourceElementsInterface = null; - public List SourceElementsDocumentVersion = null; - - public string ImageReadyToBeLoaded = null; // adding Image to ImgContainer needs to be done by the GUI thread!! - public string[] DeleteFilesAfterLoading = null; - - public enum DocRelationType { DocumentedEntity, RefersTo, BasedOn, Affecting, TranslationOf }; - public List> Relations = - new List>(); - - /// - /// The parsing might add a dedicated, version-specific action to add. - /// - public delegate bool AddPreviewFileDelegate(InterfaceEntity e, string path, string contentType); - - public AddPreviewFileDelegate AddPreviewFile; - - public class FileInfo - { - public string Path = ""; - public string MimeType = ""; - - public FileInfo() { } - - public FileInfo(Aas.File file) - { - Path = file?.Value; - MimeType = file?.ContentType; - } - } - - public InterfaceEntity() { } - - public InterfaceEntity(string Title, string Created, string ContentType, string ProtocolType, - string interfaceName) - { - this.Title = Title; - this.Created = Created; - this.ContentType = ContentType; - this.ProtocolType = ProtocolType; - InterfaceName = interfaceName; - } - - public void RaiseDoubleClick() - { - if (DoubleClick != null) - DoubleClick(this); - } - - public async Task RaiseMenuClick(string menuItemHeader, object tag) - { - await MenuClick?.Invoke(this, menuItemHeader, tag); - } - - public void RaiseDragStart() - { - DragStart?.Invoke(this); - } - - /// - /// This function needs to be called as part of tick-Thread in STA / UI thread - /// - public AnyUiBitmapInfo LoadImageFromPath(string fn) - { - // be a bit suspicous .. - if (!System.IO.File.Exists(fn)) - return null; - - // convert here, as the tick-Thread in STA / UI thread - try - { -#if USE_WPF - var bi = new BitmapImage(new Uri(fn, UriKind.RelativeOrAbsolute)); - - if (ImgContainerWpf != null) - { - var img = new Image(); - img.Source = bi; - ImgContainerWpf.Child = img; - } - - if (ImgContainerAnyUi != null) - { - ImgContainerAnyUi.BitmapInfo = AnyUiHelper.CreateAnyUiBitmapInfo(bi); - } - return bi; -#else - ImgContainerAnyUi.BitmapInfo = AnyUiGdiHelper.CreateAnyUiBitmapInfo(fn); -#endif - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - return null; - } - } - - public class ListOfInterfaceEntity : List - { - public static AasxPredefinedConcepts.IDTAAid idtaDef = AasxPredefinedConcepts.IDTAAid.Static; - - public static InterfaceEntity ParseSCInterfaceDescription(Aas.SubmodelElementCollection smcInterface, - string referableHash) - { - string title = "", created = "", contentype = "", protocolType = ""; - - foreach (var elem in smcInterface.Value) - { - if (elem.IdShort == "title") - { - title = (elem as Aas.Property).Value.ToString(); - } - else if (elem.IdShort == "created") - { - created = (elem as Aas.Property).Value.ToString(); - } - else if (elem.IdShort == "InteractionMetadata") - { - Aas.SubmodelElementCollection InterfaceMetaData = (elem as Aas.SubmodelElementCollection); - foreach (var imdElem in InterfaceMetaData.Value) - { - if (imdElem.IdShort == "properties") - { - Aas.SubmodelElementCollection properties = (imdElem as Aas.SubmodelElementCollection); - foreach (var property in properties.Value) - { - Aas.SubmodelElementCollection propertySMC = (property as Aas.SubmodelElementCollection); - foreach (var propertyElem in propertySMC.Value) - { - if (propertyElem.IdShort == "forms") - { - Aas.SubmodelElementCollection formsSMC = (propertyElem as Aas.SubmodelElementCollection); - foreach(var form in formsSMC.Value) - //{ - //Aas.SubmodelElementCollection formSMC = (form as Aas.SubmodelElementCollection); - //foreach (var formElem in formSMC.Value) - { - if (form.IdShort == "htv_methodName") - { - protocolType = "HTTP"; - break; - } - else if (idtaDef.mqttFormElemList.Contains(form.IdShort)) - { - protocolType = "MQTT"; - break; - } - else if (idtaDef.modvFormElemList.Contains(form.IdShort)) - { - protocolType = "MODBUS"; - break; - } - } - foreach (var form in formsSMC.Value) - { - if (form.IdShort == "contentType") - { - contentype = (form as Aas.Property).Value.ToString(); - break; - } - } - break; - //} - } - } - } - } - } - } - } - var InterfaceName = smcInterface.IdShort; - var ent = new InterfaceEntity(title, created, contentype, protocolType, InterfaceName); - ent.SourceElementsInterface = smcInterface.Value; - ent.ReferableHash = referableHash; - - return ent; - } - - public static ListOfInterfaceEntity ParseSubmodelAID(AdminShellPackageEnv thePackage, - Aas.Submodel subModel) - { - var interfaceEntities = new ListOfInterfaceEntity(); - var defs1 = AasxPredefinedConcepts.IDTAAid.Static; - - if (thePackage == null || subModel == null) - return interfaceEntities; - - // look for Interfaces - if (subModel.SubmodelElements != null) - foreach (var smcInterface in - subModel.SubmodelElements.FindAllSemanticIdAs( - defs1.AID_Interface, MatchMode.Relaxed)) - { - if (smcInterface == null || smcInterface.Value == null) - continue; - string referableHash = String.Format( - "{0:X14} {1:X14}", thePackage.GetHashCode(), smcInterface.GetHashCode()); - interfaceEntities.Add(ParseSCInterfaceDescription(smcInterface, referableHash)); - } - return interfaceEntities; - } - } -} \ No newline at end of file diff --git a/src/AasxPluginAID/InterfaceShelfOptions.cs b/src/AasxPluginAID/InterfaceShelfOptions.cs deleted file mode 100644 index 160634e3..00000000 --- a/src/AasxPluginAID/InterfaceShelfOptions.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxIntegrationBase; -using AasxIntegrationBase.AasForms; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using Newtonsoft.Json; - -namespace AasxPluginAID -{ - public class IntefaceShelfOptionsRecord : AasxPluginOptionsLookupRecordBase - { - public string UsageInfo = null; - } - - public class InterfaceShelfOptions : AasxPluginLookupOptionsBase - { - public List Records = new List(); - public static AasxPredefinedConcepts.IDTAAid idtaDef = AasxPredefinedConcepts.IDTAAid.Static; - - /// - /// Create a set of minimal options - /// - public static InterfaceShelfOptions CreateDefault() - { - var opt = new InterfaceShelfOptions(); - - // - // basic record - // - - var rec = new IntefaceShelfOptionsRecord(); - opt.Records.Add(rec); - - rec.AllowSubmodelSemanticId.Add(idtaDef.SM_AssetInterfaceDescription.GetSemanticKey()); - - return opt; - } - } - -} diff --git a/src/AasxPluginAID/LICENSE.txt b/src/AasxPluginAID/LICENSE.txt deleted file mode 100644 index e41b5715..00000000 --- a/src/AasxPluginAID/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -Please see LICENSE.txt of the AASX Package Explorer main application. \ No newline at end of file diff --git a/src/AasxPluginAID/Plugin.cs b/src/AasxPluginAID/Plugin.cs deleted file mode 100644 index 8f33dcb7..00000000 --- a/src/AasxPluginAID/Plugin.cs +++ /dev/null @@ -1,229 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using AasxPluginAID; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using JetBrains.Annotations; -using System.Windows.Controls; - -using AnyUi; -using AasxPredefinedConcepts; - -namespace AasxIntegrationBase // the namespace has to be: AasxIntegrationBase -{ - [UsedImplicitlyAttribute] - // the class names has to be: AasxPlugin and subclassing IAasxPluginInterface - public class AasxPlugin : AasxPluginBase - { - InterfaceShelfOptions _options = new InterfaceShelfOptions(); - public class Session : PluginSessionBase - { - public AasxPluginAID.AIDAnyUiControl AnyUiControl = null; - } - - public new void InitPlugin(string[] args) - { - // start .. - PluginName = "AasxPluginAID"; - _log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args)); - } - - public new AasxPluginActionDescriptionBase[] ListActions() - { - var res = ListActionsBasicHelper( - enableCheckVisualExt: true, - enableOptions: true, - enableLicenses: true, - enableEventsGet: true, - enableEventReturn: true, - enableNewSubmodel: true, - enablePanelAnyUi: true); - return res.ToArray(); - } - - public new AasxPluginResultBase ActivateAction(string action, params object[] args) - { - // for speed reasons, have the most often used at top! - if (action == "call-check-visual-extension") - { - // arguments - if (args.Length < 1) - return null; - - // looking only for Submodels - var sm = args[0] as Aas.Submodel; - if (sm == null) - return null; - - // check for a record in options, that matches Submodel - var found = false; - // ReSharper disable once UnusedVariable - if (sm.SemanticId?.GetAsExactlyOneKey().Value.ToString() == "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel") - found = true; - if (!found) - return null; - - // success prepare record - var cve = new AasxPluginResultVisualExtension("AID", "Asset Interfaces Description"); - - // ok - return cve; - } - - // can basic helper help to reduce lines of code? - var help = ActivateActionBasicHelper(action, ref _options, args, - disableDefaultLicense: true, - enableGetCheckVisuExt: true); - if (help != null) - return help; - - // rest follows - - if (action == "get-licenses") - { - var lic = new AasxPluginResultLicense(); - lic.shortLicense = "The CountryFlag library (NuGet) is licensed under the MIT license (MIT)."; - - lic.isStandardLicense = true; - lic.longLicense = AasxPluginHelper.LoadLicenseTxtFromAssemblyDir( - "LICENSE.txt", Assembly.GetExecutingAssembly()); - - return lic; - } - - if (action == "event-return" && args != null - && args.Length >= 1 && args[0] is AasxPluginEventReturnBase erb) - { - // arguments (event return, session-id) - if (args.Length >= 2 - && _sessions.AccessSession(args[1], out Session session) - && session.AnyUiControl != null) - { - session.AnyUiControl.HandleEventReturn(erb); - } - } - - if (action == "get-check-visual-extension") - { - var cve = new AasxPluginResultBaseObject(); - cve.strType = "True"; - cve.obj = true; - return cve; - } - - if (action == "fill-anyui-visual-extension") - { - // arguments (package, submodel, panel, display-context, session-id, operation-context) - if (args == null || args.Length < 6) - return null; - - // create session and call - var session = _sessions.CreateNewSession(args[4]); - var opContext = args[5] as PluginOperationContextBase; - session.AnyUiControl = AasxPluginAID.AIDAnyUiControl.FillWithAnyUiControls( - _log, args[0], args[1], _eventStack, session, args[2], opContext, - args[3] as AnyUiContextPlusDialogs, this); - - // give object back - var res = new AasxPluginResultBaseObject(); - res.obj = session.AnyUiControl; - return res; - } - - if (action == "update-anyui-visual-extension" - && _sessions != null) - { - // arguments (panel, display-context, session-id) - if (args == null || args.Length < 3) - return null; - - if (_sessions.AccessSession(args[2], out Session session)) - { - // call - session.AnyUiControl.Update(args); - - // give object back - var res = new AasxPluginResultBaseObject(); - res.obj = 42; - return res; - } - } - - if (action == "dispose-anyui-visual-extension" - && _sessions != null) - { - // arguments (session-id) - if (args == null || args.Length < 1) - return null; - - // ReSharper disable UnusedVariable - if (_sessions.AccessSession(args[0], out Session session)) - { - // dispose all ressources - session.AnyUiControl.Dispose(); - - // remove - _sessions.Remove(args[0]); - } - // ReSharper enable UnusedVariable - } - - if (action == "get-list-new-submodel") - { - // prepare list - var list = new List(); - list.Add("Asset Interfaces Description V1.0"); - - // make result - var res = new AasxPluginResultBaseObject(); - res.obj = list; - return res; - } - - if (action == "generate-submodel" && args != null && args.Length >= 1 && args[0] is string) - { - try - { - // get arguments - var smName = args[0] as string; - if (smName == null) - return null; - - // generate (by hand) - var sm = new Aas.Submodel(""); - sm.SemanticId = IDTAAid.Static.AID_Submodel; - sm.IdShort = "AssetInterfacesDescription"; - - // make result - var res = new AasxPluginResultBaseObject(); - res.strType = "OK"; - res.obj = sm; - return res; - } - catch (Exception ex) { - Console.WriteLine(ex.ToString()); - return null; - } - } - - // default - return null; - } - - } -} diff --git a/src/AasxPluginAID/app.config b/src/AasxPluginAID/app.config deleted file mode 100644 index e936cc13..00000000 --- a/src/AasxPluginAID/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/AasxPluginAID/packages.config b/src/AasxPluginAID/packages.config deleted file mode 100644 index 635271e7..00000000 --- a/src/AasxPluginAID/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/AasxPluginAssetInterfaceDesc/AasOpcUaClient.cs b/src/AasxPluginAssetInterfaceDesc/AasOpcUaClient.cs deleted file mode 100644 index fe954134..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AasOpcUaClient.cs +++ /dev/null @@ -1,336 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using AasxIntegrationBase; -using Opc.Ua; -using Opc.Ua.Client; -using Opc.Ua.Configuration; - -// Note: this is a DUPLICATE from WpfMtpControl - -namespace AasxPluginAssetInterfaceDescription -{ - public enum AasOpcUaClientStatus - { - Starting = 0, - ErrorCreateApplication = 0x11, - ErrorDiscoverEndpoints = 0x12, - ErrorCreateSession = 0x13, - ErrorBrowseNamespace = 0x14, - ErrorCreateSubscription = 0x15, - ErrorMonitoredItem = 0x16, - ErrorAddSubscription = 0x17, - ErrorRunning = 0x18, - ErrorReadConfigFile = 0x19, - ErrorNoKeepAlive = 0x30, - ErrorInvalidCommandLine = 0x100, - Running = 0x1000, - Quitting = 0x8000, - Quitted = 0x8001 - }; - - public class AasOpcUaClient - { - const int ReconnectPeriod = 10; - - /// - /// Good condition: starting or running - /// - public AasOpcUaClientStatus ClientStatus; - - protected LogInstance _log = null; - - protected string _endpointURL; - protected static bool _autoAccept = true; - protected string _userName; - protected string _password; - protected uint _timeOutMs = 2000; - - protected ISession _session; - protected SessionReconnectHandler _reconnectHandler; - - public AasOpcUaClient(string endpointURL, bool autoAccept, - string userName, string password, - uint timeOutMs = 2000, - LogInstance log = null) - { - _endpointURL = endpointURL; - _autoAccept = autoAccept; - _userName = userName; - _password = password; - _timeOutMs = timeOutMs; - _log = log; - } - - public async Task DirectConnect() - { - await StartClientAsync(); - } - - public void Close() - { - if (_session == null) - return; - _session.Close(1); - _session = null; - } - - public AasOpcUaClientStatus StatusCode { get => ClientStatus; } - - public async Task StartClientAsync() - { - _log?.Info("1 - Create an Application Configuration."); - ClientStatus = AasOpcUaClientStatus.ErrorCreateApplication; - - ApplicationInstance application = new ApplicationInstance - { - ApplicationName = "UA Core Sample Client", - ApplicationType = ApplicationType.Client, - ConfigSectionName = Utils.IsRunningOnMono() ? "Opc.Ua.MonoSampleClient" : "Opc.Ua.SampleClient" - }; - - // load the application configuration. - ApplicationConfiguration config = null; - try - { - config = await application.LoadApplicationConfiguration(false); - } - catch (Exception ex) - { - _log?.Error(ex, "Error reading the config file"); - ClientStatus = AasOpcUaClientStatus.ErrorReadConfigFile; - return; - } - - // check the application certificate. - bool haveAppCertificate = await application.CheckApplicationInstanceCertificate(false, 0); - if (!haveAppCertificate) - { - throw new Exception("Application instance certificate invalid!"); - } - - // ReSharper disable HeuristicUnreachableCode - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (haveAppCertificate) - { - config.ApplicationUri = X509Utils.GetApplicationUriFromCertificate( - config.SecurityConfiguration.ApplicationCertificate.Certificate); - - if (config.SecurityConfiguration.AutoAcceptUntrustedCertificates) - { - _autoAccept = true; - } - // ReSharper disable once RedundantDelegateCreation - config.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler( - CertificateValidator_CertificateValidation); - } - else - { - _log?.Info( - "WARN: missing application certificate, using unsecure connection."); - } - // ReSharper enable HeuristicUnreachableCode - - _log?.Info("2 - Discover endpoints of {0}.", _endpointURL); - ClientStatus = AasOpcUaClientStatus.ErrorDiscoverEndpoints; - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - var selectedEndpoint = CoreClientUtils.SelectEndpoint(_endpointURL, haveAppCertificate, - (int) _timeOutMs); - _log?.Info(" Selected endpoint uses: {0}", - selectedEndpoint.SecurityPolicyUri.Substring(selectedEndpoint.SecurityPolicyUri.LastIndexOf('#') + 1)); - - _log?.Info("3 - Create a session with OPC UA server."); - ClientStatus = AasOpcUaClientStatus.ErrorCreateSession; - var endpointConfiguration = EndpointConfiguration.Create(config); - var endpoint = new ConfiguredEndpoint(null, selectedEndpoint, endpointConfiguration); - - _session = await Session.Create( - config, endpoint, false, "AasxPluginAssetInterfaceDesc", _timeOutMs, - new UserIdentity(_userName, _password), null); - - // register keep alive handler - _session.KeepAlive += Client_KeepAlive; - - // ok - ClientStatus = AasOpcUaClientStatus.Running; - - // final - _log?.Info("9 - Connection established."); - } - - // very helpful when debugging and breaking - - private void Client_KeepAlive(Opc.Ua.Client.ISession sender, KeepAliveEventArgs e) - { - if (e.Status != null && ServiceResult.IsNotGood(e.Status)) - { - _log?.Info("Keep alive {0} {1}/{2}", e.Status, sender.OutstandingRequestCount, - sender.DefunctRequestCount); - - if (_reconnectHandler == null) - { - _log?.Info("--- RECONNECTING ---"); - _reconnectHandler = new SessionReconnectHandler(); - _reconnectHandler.BeginReconnect( - sender, ReconnectPeriod * (int) _timeOutMs, Client_ReconnectComplete); - } - } - } - - private void Client_ReconnectComplete(object sender, EventArgs e) - { - // ignore callbacks from discarded objects. - if (!Object.ReferenceEquals(sender, _reconnectHandler)) - { - return; - } - - if (_reconnectHandler != null) - { - _session = _reconnectHandler.Session; - _reconnectHandler.Dispose(); - } - - _reconnectHandler = null; - - _log?.Info("--- RECONNECTED ---"); - } - - private void CertificateValidator_CertificateValidation( - CertificateValidator validator, CertificateValidationEventArgs e) - { - if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted) - { - e.Accept = _autoAccept; - if (_autoAccept) - { - _log?.Info("Accepted Certificate: {0}", e.Certificate.Subject); - } - else - { - _log?.Info("Rejected Certificate: {0}", e.Certificate.Subject); - } - } - } - - public NodeId CreateNodeId(uint value, int nsIndex) - { - return new NodeId(value, (ushort)nsIndex); - } - - public NodeId CreateNodeId(string nodeName, int index) - { - return new NodeId(nodeName, (ushort)index); - } - - private Dictionary nsDict = null; - - public NodeId CreateNodeId(string nodeName, string ns) - { - if (_session == null || _session.NamespaceUris == null) - return null; - - // build up? - if (nsDict == null) - { - nsDict = new Dictionary(); - for (ushort i = 0; i < _session.NamespaceUris.Count; i++) - nsDict.Add(_session.NamespaceUris.GetString(i), i); - } - - // find? - if (nsDict == null || !nsDict.ContainsKey(ns)) - return null; - - return new NodeId(nodeName, nsDict[ns]); - } - - public NodeId ParseAndCreateNodeId(string input) - { - if (input?.HasContent() != true) - return null; - - { - var match = Regex.Match(input, @"^\s*ns\s*=\s*(\d+)\s*;\s*i\s*=\s*(\d+)\s*$"); - if (match.Success - && ushort.TryParse(match.Groups[1].ToString(), out var ns) - && uint.TryParse(match.Groups[2].ToString(), out var i)) - return new NodeId(i, ns); - } - { - var match = Regex.Match(input, @"^\s*NS\s*(\d+)\s*\|\s*Numeric\s*\|\s*(\d+)\s*$"); - if (match.Success - && ushort.TryParse(match.Groups[1].ToString(), out var ns) - && uint.TryParse(match.Groups[2].ToString(), out var i)) - return new NodeId(i, ns); - } - { - var match = Regex.Match(input, @"^\s*ns\s*=\s*(\d+)\s*;\s*s\s*=\s*(.*)$"); - if (match.Success - && ushort.TryParse(match.Groups[1].ToString(), out var ns)) - return new NodeId("" + match.Groups[2].ToString(), ns); - } - { - var match = Regex.Match(input, @"^\s*NS\s*(\d+)\s*\|\s*Alphanumeric\s*\|\s*(.+)$"); - if (match.Success - && ushort.TryParse(match.Groups[1].ToString(), out var ns)) - return new NodeId("" + match.Groups[2].ToString(), ns); - } - - // no - return null; - } - - public string ReadSubmodelElementValueAsString(string nodeName, int index) - { - if (_session == null) - return ""; - - NodeId node = new NodeId(nodeName, (ushort)index); - return (_session.ReadValue(node).ToString()); - } - - public DataValue ReadNodeId(NodeId nid) - { - if (_session == null || nid == null || !_session.Connected) - return null; - return (_session.ReadValue(nid)); - } - - public Opc.Ua.Client.Subscription SubscribeNodeIds(NodeId[] nids, MonitoredItemNotificationEventHandler handler, - int publishingInterval = 1000) - { - if (_session == null || nids == null || !_session.Connected || handler == null) - return null; - - var subscription = new Subscription(_session.DefaultSubscription) - { PublishingInterval = publishingInterval }; - - foreach (var nid in nids) - { - var mi = new MonitoredItem(subscription.DefaultItem); - mi.StartNodeId = nid; - mi.Notification += handler; - subscription.AddItem(mi); - } - - _session.AddSubscription(subscription); - subscription.Create(); - return subscription; - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.csproj b/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.csproj deleted file mode 100644 index 345b0387..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - net6.0-windows - library - false - true - - - - true - false - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - - - - - diff --git a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.options.json b/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.options.json deleted file mode 100644 index 95730d45..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.options.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Records": [ - { - "IsDescription": true, - "IsMapping": false, - "AllowSubmodelSemanticId": [ - { - "type": "Submodel", - "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel" - } - ], - "UseHttp": true, - "UseModbus": true, - "UseMqtt": false, - "UseOpcUa": false - }, - { - "IsDescription": false, - "IsMapping": true, - "AllowSubmodelSemanticId": [ - { - "type": "Submodel", - "value": "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/Submodel" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.plugin b/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.plugin deleted file mode 100644 index 3beebdf2..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AasxPluginAssetInterfaceDesc.plugin +++ /dev/null @@ -1 +0,0 @@ -This file tags the according .ddl to be a plug-in for AasxPackageExplorer. \ No newline at end of file diff --git a/src/AasxPluginAssetInterfaceDesc/AidHttpConnection.cs b/src/AasxPluginAssetInterfaceDesc/AidHttpConnection.cs deleted file mode 100644 index 1cc0aa06..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidHttpConnection.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using AdminShellNS.DiaryData; -using Extensions; -using AasxIntegrationBase; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using FluentModbus; -using System.Net; -using System.Text.RegularExpressions; -using System.Globalization; -using System.Net.Http; -using AasxIntegrationBase.AdminShellEvents; -using System.Drawing; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json; -using System.IO; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AidHttpConnection : AidBaseConnection - { - public HttpClient Client; - - override public bool Open() - { - // pretty simple - Client = new HttpClient(); - - if (TimeOutMs >= 10) - Client.Timeout = new TimeSpan(0, 0, 0, 0, milliseconds: (int)TimeOutMs); - - return true; - } - - override public bool IsConnected() - { - // nothing to do, this simple http connection is stateless - return Client != null; - } - - override public void Close() - { - // nothing to do, this simple http connection is stateless - } - - override public async Task UpdateItemValueAsync(AidIfxItemStatus item) - { - // access - if (item?.FormData?.Href?.HasContent() != true - || item.FormData.Htv_methodName?.HasContent() != true - || !IsConnected()) - return 0; - int res = 0; - - // GET? - if (item.FormData.Htv_methodName.Trim().ToLower() == "get") - { - try - { - // get combined uri - var url = new Uri(TargetUri, item.FormData.Href); - - // get response (synchronously) - var response = await Client.GetAsync(url); - - // ok? - if (response.IsSuccessStatusCode) - { - // set internal value - // set internal value - var strval = await response.Content.ReadAsStringAsync(); - if (response.Content.Headers.ContentType.MediaType == "application/json" && item.payloadType != "object") - { - JObject payloadJObject; - - using (var tdStringReader = new StringReader(strval)) - using (var jsonTextReader = new JsonTextReader(tdStringReader) - { DateParseHandling = DateParseHandling.None }) - { - payloadJObject = JObject.FromObject(JToken.ReadFrom(jsonTextReader)); - } - if (payloadJObject.ContainsKey(item.DisplayName)) - { - // set The value related to the json key found here - //TO DO : which is priority for displayName and json payload key? idShort or key or title? - strval = payloadJObject[item.DisplayName].ToString(); - item.Value = strval; - res = 1; - - } - else - strval = "None"; - } - else - { - item.Value = strval; - res = 1; - } - // notify - NotifyOutputItems(item, strval); - } - } catch (Exception ex) - { - ; - } - } - - return res; - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AidInterfaceService.cs b/src/AasxPluginAssetInterfaceDesc/AidInterfaceService.cs deleted file mode 100644 index ac68626e..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidInterfaceService.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasxIntegrationBase; -using AasxIntegrationBaseGdi; -using AdminShellNS; -using AnyUi; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; - -namespace AasxPluginAssetInterfaceDescription -{ - /// - /// This is thought as ONE service per ONE instance of AASX PE / BlazorExplorer - /// to care for all (continous) interfacing. - /// - public class AidInterfaceService - { - // - // Start of service - // - - private LogInstance _log = null; - protected PluginEventStack _eventStack = null; - - private const int _timerTickMs = 200; - private System.Timers.Timer _dispatcherTimer = null; - - private AidAllInterfaceStatus _allInterfaceStatus = null; - - public void StartOperation( - LogInstance log, - PluginEventStack eventStack, - AidAllInterfaceStatus allInterfaceStatus) - { - _log = log; - _eventStack = eventStack; - _allInterfaceStatus = allInterfaceStatus; - - _dispatcherTimer = new System.Timers.Timer(_timerTickMs); - _dispatcherTimer.Elapsed += DispatcherTimer_TickAsync; - _dispatcherTimer.Enabled = true; - _dispatcherTimer.Start(); - } - - // - // Service - // - - private bool _inDispatcherTimer = false; - - private int _counter = 0; - - private async void DispatcherTimer_TickAsync(object sender, EventArgs e) - { - // access - if (_allInterfaceStatus == null || _inDispatcherTimer) - return; - - // block - _inDispatcherTimer = true; - -#if hardcore_debug - _counter++; - if (_counter > 100) - { - _counter = 0; - - try - { - Console.WriteLine("Hello, World!"); - var client = new AasOpcUaClient("opc.tcp://MMT-HOMI2-N1:4840", true, "", ""); - await client.DirectConnect(); - Console.WriteLine("Running.."); - while (client.StatusCode == AasOpcUaClientStatus.Starting - || client.StatusCode == AasOpcUaClientStatus.Running) - { - Thread.Sleep(500); - Console.Write("."); - var nid = client.CreateNodeId(5, 2); - var x = client.ReadNodeId(nid); - Console.WriteLine("" + x); - } - } catch (Exception ex) - { - ; - } - } -#endif - - // call cyclic tasks - try - { - await _allInterfaceStatus.UpdateValuesContinousByTickAsyc(); - } catch (Exception ex) - { - ; - } - - // check if to send an event - var potEvt = new AasxPluginResultEventPushSomeEvents(); - lock (_allInterfaceStatus.AnimatedSingleValueChange) - { - if (_allInterfaceStatus.AnimatedSingleValueChange != null - && _allInterfaceStatus.AnimatedSingleValueChange.Count >= 0) - { - potEvt.AnimateSingleEvents = new List(); - potEvt.AnimateSingleEvents.AddRange(_allInterfaceStatus.AnimatedSingleValueChange); - _allInterfaceStatus.AnimatedSingleValueChange.Clear(); - } - } - if (potEvt.AnimateSingleEvents != null) - { - _eventStack?.PushEvent(potEvt); - } - - // release mutex - _inDispatcherTimer = false; - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AidInterfaceStatus.cs b/src/AasxPluginAssetInterfaceDesc/AidInterfaceStatus.cs deleted file mode 100644 index ab5807f7..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidInterfaceStatus.cs +++ /dev/null @@ -1,994 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using AdminShellNS.DiaryData; -using Extensions; -using AasxIntegrationBase; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using FluentModbus; -using System.Net; -using System.Text.RegularExpressions; -using System.Globalization; -using AnyUi; -using System.Windows.Media.Animation; -using AasxIntegrationBase.AdminShellEvents; -using System.IO; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json; - -namespace AasxPluginAssetInterfaceDescription -{ - /// - /// These instances are attached to an AidIfxItemStatus in order to - /// identify, which AAS elements need to be updated. - /// - public class AidMappingOutputItem - { - /// - /// The RelationElements of the AIMC, which caused this item. - /// - public AasClassMapperHintedRelation MapRelation; - } - - public enum AidIfxItemKind { Unknown, Property, Action, Event }; - - public class AidIfxItemStatus - { - /// - /// Which kind of information: Property, Action, Event. - /// - public AidIfxItemKind Kind = AidIfxItemKind.Unknown; - - /// - /// Contains the hierarchy information, where the item is stored in hierarchy - /// of the given interface (end-point). - /// - public string Location = ""; - - /// - /// Display name of the item. Could be from IdShort, key, title. - /// - public string DisplayName = ""; - - /// - /// Contains the forms information with all detailed information for the - /// technology. - /// - public CD_Forms FormData = null; - - - /// - /// added by Kazeem...it will be useful to map object payloads(JSON, XML complex or Octet-stream that is complex) - /// String data for payload data type. it can be object, integer, number, e.t.c. if it empty, - /// the program assume the payload cannot be object(JSON, XML complex or Octet-stream that is complex) or array. - /// - public string payloadType = null; - - /// - /// String data for value incl. unit information. - /// - public string Value = ""; - - /// - /// Link to entity (property, action, event). - /// - public object Tag = null; - - /// - /// Initally null, set to the items which shall be updated, whenever - /// this item status is updated. - /// - public List MapOutputItems = null; - - /// - /// Holds reference to the AnyUI element showing the value. - /// - public AnyUiUIElement RenderedUiElement = null; - } - - public enum AidInterfaceTechnology { HTTP, Modbus, MQTT, OPCUA } - - public class AidInterfaceStatus - { - /// - /// Technology being used .. - /// - public AidInterfaceTechnology Technology = AidInterfaceTechnology.HTTP; - - /// - /// Display name. Could be from SMC IdShort or title. - /// Will be printed in bold. - /// - public string DisplayName = ""; - - /// - /// Further infornation. Printed in light appearence. - /// - public string Info = ""; - - /// - /// The information items (properties, actions, events) - /// - public MultiValueDictionary Items = - new MultiValueDictionary(); - - /// - /// Base connect information. - /// - public string EndpointBase = ""; - - - - /// - /// Contains the forms information with all detailed information for the - /// technology. - /// - public string mostSignificantByte = ""; - - /// - /// Contains the forms information with all detailed information for the - /// technology. - /// - public string mostSignificantWord = ""; - - /// - /// Actual summary of the status of the interface. - /// - public string LogLine = "Idle."; - - /// - /// Black = idle, Blue = active, Red = error. - /// - public StoredPrint.Color LogColor = StoredPrint.Color.Black; - - /// - /// Link to entity (interface). - /// - public object Tag = null; - - /// - /// Holds the technology connection currently used. - /// - public AidBaseConnection Connection = null; - - /// - /// Will get increment, when a value changed. - /// - public UInt64 ValueChanges = 0; - - /// - /// If greater 10, specifies the time rate in milli seconds for polling the - /// respective subscriptions. - /// - public double UpdateFreqMs = 0; - - /// - /// If greater 10, specifies the desired timeout in milli seconds. - /// - public double TimeOutMs = 0; - - /// - /// To be used with UpdateFreqMs. - /// - protected DateTime _lastCyclicUpdate = DateTime.Now; - - public bool CheckIfTimeForCyclicUpdate(DateTime now) - { - if (UpdateFreqMs >= 10.0 - && (now - _lastCyclicUpdate).TotalMilliseconds < UpdateFreqMs) - return false; - _lastCyclicUpdate = now; - return true; - } - - protected string ComputeKey(string key) - { - if (key != null) - { - if (Technology == AidInterfaceTechnology.MQTT) - { - key = key.Trim().Trim('/').ToLower(); - } - } - return key; - } - - public void SetLogLine (StoredPrint.Color color, string line) - { - LogColor = color; - LogLine = line; - } - - /// - /// Computes a technology specific key and adds item. - /// - /// - public void AddItem(AidIfxItemStatus item) - { - // acceess - if (item == null) - return; - - // compute key - var key = ComputeKey(item?.FormData?.Href); - - // now add - Items.Add(key, item); - } - - /// - /// Computes key based on technology, checks if items can be found - /// and enumerates these. - /// - public IEnumerable GetItemsFor(string key) - { - key = ComputeKey(key); - if (Items.ContainsKey(key)) - foreach (var item in Items[key]) - yield return item; - } - } - - public class AidBaseConnection - { - /// - /// As a connection is a very "brittle" technology depending on a lot of external - /// events, a log might be helpful. - /// - public LogInstance Log = null; - - public Uri TargetUri; - - /// - /// For initiating the connection. Right now, not foreseen/ encouraged by the SMT. - /// - public string User = null; - - /// - /// For initiating the connection. Right now, not foreseen/ encouraged by the SMT. - /// - public string Password = null; - - - /// - /// Contains the forms information with all detailed information for the - /// technology. - /// - public string mostSignificantByte = ""; - - /// - /// Contains the forms information with all detailed information for the - /// technology. - /// - public string mostSignificantWord = ""; - - /// - /// If greater 10, specifies the time rate in milli seconds for polling the - /// respective subscriptions. - /// - public double UpdateFreqMs = 0; - - /// - /// If greater 10, specifies the desired timeout in milli seconds. - /// - public double TimeOutMs = 0; - - public DateTime LastActive = default(DateTime); - - public Action MessageReceived = null; - - public Action AnimateSingleValueChange = null; - - virtual public bool Open() - { - return false; - } - - virtual public bool IsConnected() - { - return false; - } - - virtual public void Close() - { - } - - /// - /// Tries to update the value (by polling). - /// - /// Number of values changed - virtual public int UpdateItemValue(AidIfxItemStatus item) - { - return 0; - } - - /// - /// Tries to update the value (by polling). - /// - /// Number of values changed - virtual public async Task UpdateItemValueAsync(AidIfxItemStatus item) - { - await Task.Yield(); - return 0; - } - - // - /// Tries to update the value (by polling). Async opion is preferred. - /// - /// Number of values changed - virtual public void PrepareContinousRun(IEnumerable items) - { - - } - - public void NotifyOutputItems(AidIfxItemStatus item, string strval) - { - // access - if (item == null) - return; - - // map output items - if (item.MapOutputItems != null) - foreach (var moi in item.MapOutputItems) - { - - // check is secondHint is property and second is not null - if (moi?.MapRelation?.Second != null && (moi.MapRelation.SecondHint is Aas.Property prop)) - { - // set here - prop.Value = strval; - - // create - var evi = new AasPayloadUpdateValueItem( - path: (prop)?.GetModelReference()?.Keys, - value: prop.ValueAsText()); - - evi.ValueId = prop.ValueId; - - evi.FoundReferable = prop; - - // add to the aas element itself - DiaryDataDef.AddAndSetTimestamps(prop, evi, isCreate: false); - - // give upwards for animation - AnimateSingleValueChange?.Invoke(prop); - } - else if (moi?.MapRelation?.Second != null && (moi.MapRelation.SecondHint is Aas.SubmodelElementCollection coll)) - { - //run complex mappping here - - JObject payloadJObject; - - using (var tdStringReader = new StringReader(strval)) - using (var jsonTextReader = new JsonTextReader(tdStringReader) - { DateParseHandling = DateParseHandling.None }) - { - payloadJObject = JObject.FromObject(JToken.ReadFrom(jsonTextReader)); - } - foreach (var internalProperty in coll.Value) - { - if ((internalProperty is Aas.Property internalProp) && payloadJObject.ContainsKey(internalProperty.IdShort)) - { - // set The value related to the json key found here - internalProp.Value = payloadJObject[internalProperty.IdShort].ToString(); - - // create - var evi = new AasPayloadUpdateValueItem( - path: (internalProp)?.GetModelReference()?.Keys, - value: internalProp.ValueAsText()); - - evi.ValueId = internalProp.ValueId; - - evi.FoundReferable = internalProp; - - // add to the aas element itself - DiaryDataDef.AddAndSetTimestamps(internalProp, evi, isCreate: false); - - // give upwards for animation - AnimateSingleValueChange?.Invoke(internalProp); - } - } - //prop.Value = strval; - - // create - //var evi = new AasPayloadUpdateValueItem( - // path: (prop)?.GetModelReference()?.Keys, - // value: prop.ValueAsText()); - - //evi.ValueId = prop.ValueId; - - //evi.FoundReferable = prop; - - //// add to the aas element itself - //DiaryDataDef.AddAndSetTimestamps(prop, evi, isCreate: false); - - //// give upwards for animation - //AnimateSingleValueChange?.Invoke(prop); - } - else - { - continue; - } - //// valid? - //if (moi?.MapRelation?.Second == null - //|| !(moi.MapRelation.SecondHint is Aas.Property)) - - - - } - } - } - - public class AidGenericConnections : Dictionary where T : AidBaseConnection, new() - { - public T GetOrCreate(string target, LogInstance log = null) - { - if (!Uri.TryCreate(target, UriKind.Absolute, out var uri)) - return null; - if (this.ContainsKey(uri)) - return this[uri]; - - var conn = new T() { Log = log, TargetUri = uri }; - return conn; - } - } - - /// - /// Holds track of all current Aid interface status information. - /// Idea: well be preset and updated by plug-in events. - /// Will then allow technical connect to asset interfaces. - /// Will exist **longer** than the invocation of just the plugin UI. - /// - public class AidAllInterfaceStatus - { - /// - /// Set to logger, if logging is desired. - /// - protected LogInstance _log = null; - - /// - /// Holds a "pointer" to the "last current" Submodel defining the AID description. - /// Note: unlike most other plugins, this plugin is mostly intended to run in - /// the background. - /// - public Aas.ISubmodel SmAidDescription = null; - - /// - /// Holds a "pointer" to the "last current" Submodel defining the - /// AID mapping configuration. - /// Note: unlike most other plugins, this plugin is mostly intended to run in - /// the background. - /// - public Aas.ISubmodel SmAidMapping = null; - - /// - /// Current setting, which technologies shall be used. - /// - public bool[] UseTech = { false, false, false, true }; - - /// - /// Will hold connections steady and continously update values, either by - /// timer pased polling or by subscriptions. - /// - public bool ContinousRun = false; - - public List InterfaceStatus = new List(); - - public AidGenericConnections HttpConnections = - new AidGenericConnections(); - - public AidGenericConnections ModbusConnections = - new AidGenericConnections(); - - public AidGenericConnections MqttConnections = - new AidGenericConnections(); - - public AidGenericConnections OpcUaConnections = - new AidGenericConnections(); - - public AidAllInterfaceStatus(LogInstance log = null) - { - _log = log; - } - - public void RememberNothing() - { - SmAidDescription = null; - } - - public bool EnoughMemories() - { - return SmAidDescription != null; - } - - public void RememberAidSubmodel(Aas.ISubmodel sm, AssetInterfaceOptionsRecord optRec, - bool adoptUseFlags) - { - if (sm == null || optRec == null) - return; - - if (optRec.IsDescription) - SmAidDescription = sm; - - if (adoptUseFlags) - { - UseTech[(int)AidInterfaceTechnology.HTTP] = optRec.UseHttp; - UseTech[(int)AidInterfaceTechnology.Modbus] = optRec.UseModbus; - UseTech[(int)AidInterfaceTechnology.MQTT] = optRec.UseMqtt; - UseTech[(int)AidInterfaceTechnology.OPCUA] = optRec.UseOpcUa; - } - } - - public void RememberMappingSubmodel(Aas.ISubmodel sm) - { - SmAidMapping = sm; - } - - protected AidBaseConnection GetOrCreate( - AidInterfaceStatus ifcStatus, - string endpointBase, - LogInstance log = null) - { - // access - if (ifcStatus == null) - return null; - - // find connection by factory - AidBaseConnection conn = null; - switch (ifcStatus.Technology) - { - case AidInterfaceTechnology.HTTP: - conn = HttpConnections.GetOrCreate(endpointBase, log); - break; - - case AidInterfaceTechnology.Modbus: - conn = ModbusConnections.GetOrCreate(endpointBase, log); - conn.mostSignificantByte = ifcStatus.mostSignificantByte; - conn.mostSignificantWord = ifcStatus.mostSignificantWord; - break; - - case AidInterfaceTechnology.MQTT: - conn = MqttConnections.GetOrCreate(endpointBase, log); - break; - - case AidInterfaceTechnology.OPCUA: - conn = OpcUaConnections.GetOrCreate(endpointBase, log); - break; - } - - conn.UpdateFreqMs = ifcStatus.UpdateFreqMs; - conn.TimeOutMs = ifcStatus.TimeOutMs; - - return conn; - } - - /// - /// Will get increment, when a value changed. - /// - public UInt64 SumValueChanges() - { - UInt64 sum = 0; - foreach (var ifc in InterfaceStatus) - sum += ifc.ValueChanges; - return sum; - } - - /// - /// Will connect to each target once, get values and will disconnect again. - /// - public void UpdateValuesSingleShot() - { - // access allowed - if (ContinousRun) - return; - SetAllLogIdle(); - - // for all - foreach (var tech in AdminShellUtil.GetEnumValues()) - { - // use? - if (!UseTech[(int)tech]) - continue; - - // find all interfaces with that technology - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == tech)) - { - // get a connection - if (ifc.EndpointBase?.HasContent() != true) - continue; - - // find connection by factory - // single means: log the events - AidBaseConnection conn = GetOrCreate(ifc, ifc.EndpointBase, _log); - if (conn == null) - continue; - - // open it - if (!conn.Open()) - continue; - ifc.Connection = conn; - - - // go thru all items (sync) - foreach (var item in ifc.Items.Values) - //use mostSignificant byte here - if (tech == AidInterfaceTechnology.Modbus) - ifc.ValueChanges += (UInt64)conn.UpdateItemValue(item); - else - ifc.ValueChanges += (UInt64)conn.UpdateItemValue(item); - // go thru all items (async) - var task = Task.Run(async () => - { - // see: https://www.hanselman.com/blog/parallelforeachasync-in-net-6 - await Parallel.ForEachAsync( - ifc.Items.Values, - new ParallelOptions() { MaxDegreeOfParallelism = 10 }, - async (item, token) => - { - ifc.ValueChanges += (UInt64)(await ifc.Connection.UpdateItemValueAsync(item)); - }); - }); - task.Wait(); - } - } - - // close all connections - foreach (var ifc in InterfaceStatus) - { - if (ifc.Connection?.IsConnected() == true) - ifc.Connection.Close(); - } - } - - protected void SetAllLogIdle() - { - foreach (var ifc in InterfaceStatus) - ifc.SetLogLine(StoredPrint.Color.Black, "Idle."); - } - - /// - /// Will connect to each target, leave the connection open, will enable - /// cyclic updates. - /// - public void StartContinousRun() - { - // off - ContinousRun = false; - SetAllLogIdle(); - - // for all - foreach (var tech in AdminShellUtil.GetEnumValues()) - { - // use? - if (!UseTech[(int)tech]) - continue; - - // find all interfaces with that technology - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == tech)) - { - // get a connection - if (ifc.EndpointBase?.HasContent() != true) - { - ifc.SetLogLine(StoredPrint.Color.Red, "Endpoint is not specified."); - continue; - } - - // find connection by factory - AidBaseConnection conn = GetOrCreate(ifc, ifc.EndpointBase); - if (conn == null) - continue; - - // open it - if (!conn.Open()) - { - ifc.SetLogLine(StoredPrint.Color.Red, $"Endpoint connot be opened: {ifc.EndpointBase}."); - continue; - } - ifc.Connection = conn; - ifc.SetLogLine(StoredPrint.Color.Blue, "Connection established."); - - // start subscriptions .. - conn.MessageReceived = (topic, msg) => - { - foreach (var ifc2 in InterfaceStatus) - foreach (var item in ifc2.GetItemsFor(topic)) - { - // note value - item.Value = msg; - - // notify - conn.NotifyOutputItems(item, msg); - - // note value change - ifc2.ValueChanges++; - - // remember last use - if (ifc2.Connection != null) - ifc2.Connection.LastActive = DateTime.Now; - } - }; - conn.AnimateSingleValueChange = OnAnimateSingleValueChange; - conn.PrepareContinousRun(ifc.Items.Values); - ifc.SetLogLine(StoredPrint.Color.Blue, "Connection established and prepared."); - } - } - - // now switch ON! - ContinousRun = true; - } - - /// - /// Will stop continous run and close all connections. - /// - public void StopContinousRun() - { - // off - ContinousRun = false; - SetAllLogIdle(); - - // close all connections - foreach (var ifc in InterfaceStatus) - { - if (ifc.Connection?.IsConnected() == true) - ifc.Connection.Close(); - } - } - - /// - /// In continous run, will fetch values for polling based technologies (HTTP, Modbus, ..). - /// - public async Task UpdateValuesContinousByTickAsyc() - { - // access allowed - if (!ContinousRun) - return; - - var now = DateTime.Now; - - // for all - foreach (var tech in AdminShellUtil.GetEnumValues()) - { - // use? - if (!UseTech[(int)tech]) - continue; - - // find all interfaces with that technology - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == tech)) - { - // get a connection - if (ifc?.Connection?.IsConnected() != true) - continue; - - // recently enough - if (!ifc.CheckIfTimeForCyclicUpdate(now)) - continue; - - // go thru all items (sync) - foreach (var item in ifc.Items.Values) - ifc.ValueChanges += (UInt64) ifc.Connection.UpdateItemValue(item); - - // go thru all items (async) - // see: https://www.hanselman.com/blog/parallelforeachasync-in-net-6 - await Parallel.ForEachAsync( - ifc.Items.Values, - new ParallelOptions() { MaxDegreeOfParallelism = 10 }, - async (item, token) => - { - ifc.ValueChanges += (UInt64) (await ifc.Connection.UpdateItemValueAsync(item)); - }); - } - } - } - - // - // further Event collection - // - - public List AnimatedSingleValueChange = new List(); - - protected void OnAnimateSingleValueChange(Aas.ISubmodelElement sme) - { - if (sme == null) - return; - - lock (AnimatedSingleValueChange) - AnimatedSingleValueChange.Add(sme); - } - - // - // Building, intake from Submodel - // - - public void PrepareAidInformation(Aas.ISubmodel smAid, Aas.ISubmodel smMapping = null, - Func lambdaLookupReference = null) - { - // access - InterfaceStatus.Clear(); - if (smAid == null) - return; - - // get data AID - var dataAid = new AasxPredefinedConcepts.AssetInterfacesDescription.CD_AssetInterfacesDescription(); - PredefinedConceptsClassMapper.ParseAasElemsToObject(smAid, dataAid, lambdaLookupReference); - - // get data AIMC - var dataMc = (smMapping != null) ? - new AasxPredefinedConcepts.AssetInterfacesMappingConfiguration. - CD_AssetInterfacesMappingConfiguration() : null; - PredefinedConceptsClassMapper.ParseAasElemsToObject(smMapping, dataMc, lambdaLookupReference); - - // prepare - foreach (var tech in AdminShellUtil.GetEnumValues()) - { - var ifxs = dataAid?.InterfaceHTTP; - if (tech == AidInterfaceTechnology.Modbus) ifxs = dataAid?.InterfaceMODBUS; - if (tech == AidInterfaceTechnology.MQTT) ifxs = dataAid?.InterfaceMQTT; - if (tech == AidInterfaceTechnology.OPCUA) ifxs = dataAid?.InterfaceOPCUA; - if (ifxs == null || ifxs.Count < 1) - continue; - foreach (var ifx in ifxs) - { - // new interface - var dn = AdminShellUtil.TakeFirstContent(ifx.Title, ifx.__Info__?.Referable?.IdShort); - var aidIfx = new AidInterfaceStatus() - { - Technology = tech, - DisplayName = $"{dn}", - Info = $"{ifx.EndpointMetadata?.Base}", - EndpointBase = "" + ifx.EndpointMetadata?.Base, - mostSignificantByte = "" + ifx.EndpointMetadata?.Modv_mostSignificantByte, - mostSignificantWord = "" + ifx.EndpointMetadata?.Modv_mostSignificantWord, - Tag = ifx - }; - InterfaceStatus.Add(aidIfx); - - // Properties .. lambda recursion - Action recurseProp = null; - recurseProp = (location, propName) => - { - // add item - var ifcItem = new AidIfxItemStatus() - { - Kind = AidIfxItemKind.Property, - Location = location, - DisplayName = AdminShellUtil.TakeFirstContent( - propName.Title, propName.Key, propName.__Info__?.Referable?.IdShort), - FormData = propName.Forms, - payloadType = propName.Type, - Value = "???" - }; - - - // does (some) mapping have a source with this property name? - var lst = new List(); - if (dataMc?.MappingConfigurations?.MappingConfigs != null) - foreach (var mc in dataMc.MappingConfigurations.MappingConfigs) - if (mc.InterfaceReference?.ValueHint != null - && mc.InterfaceReference?.ValueHint == ifx?.__Info__?.Referable - && mc.MappingSourceSinkRelations?.MapRels != null) - foreach (var mr in mc.MappingSourceSinkRelations.MapRels) - if (mr?.FirstHint != null - && mr.FirstHint == propName?.__Info__?.Referable) - lst.Add(new AidMappingOutputItem() - { - MapRelation = mr - }); - if (lst.Count > 0) - { - aidIfx.AddItem(ifcItem); - ifcItem.MapOutputItems = lst; - } - - - // directly recurse? - if (propName?.Properties?.Property != null) - foreach (var child in propName.Properties.Property) - { - //added this to cater for internal object mapping. - child.Forms = propName.Forms; - recurseProp(location + " . " + ifcItem.DisplayName, child); - } - - }; - - if (ifx.InteractionMetadata?.Properties?.Property == null) - continue; - foreach (var propName in ifx.InteractionMetadata?.Properties?.Property) - recurseProp("\u2302", propName); - } - } - } - - protected List SelectValuesToIntList( - IEnumerable items, - Func selectStringValue) where ITEM : class - { - return items - // select polling time present - .Select(selectStringValue) - .Where((pt) => pt != null) - // convert to int - .Select(s => Int32.TryParse(s, out int n) ? n : (int?)null) - .Where(n => n.HasValue) - .Select(n => n.Value) - .ToList(); - } - - protected void SetDoubleOnDefaultOrAvgOfIntList( - ref double theValue, - double minimumVal, - double defaultVal, - List list) - { - if (defaultVal >= minimumVal) - theValue = defaultVal; - if (list.Count > 0) - theValue = Math.Max(minimumVal, list.Average()); - } - - /// - /// to be called after PrepareAidInformation - /// - public void SetAidInformationForUpdateAndTimeout( - double defaultUpdateFreqMs = 0, - double defaultTimeOutMs = 0) - { - // for Http, analyze update frequency and timeout - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == AidInterfaceTechnology.HTTP)) - { - // polltimes - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.UpdateFreqMs, 10.0, defaultUpdateFreqMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.Htv_pollingTime)); - - // time out - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.TimeOutMs, 10.0, defaultTimeOutMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.Htv_timeout)); - } - - // for Modbus, analyze update frequency and timeout - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == AidInterfaceTechnology.Modbus)) - { - // polltimes - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.UpdateFreqMs, 10.0, defaultUpdateFreqMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.Modv_pollingTime)); - - // time out - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.TimeOutMs, 10.0, defaultTimeOutMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.Modv_timeout)); - } - - // for OPC UA, analyze update frequency and timeout - foreach (var ifc in InterfaceStatus.Where((i) => i.Technology == AidInterfaceTechnology.OPCUA)) - { - // polltimes - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.UpdateFreqMs, 10.0, defaultUpdateFreqMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.OpcUa_pollingTime)); - - // time out - SetDoubleOnDefaultOrAvgOfIntList( - ref ifc.TimeOutMs, 10.0, defaultTimeOutMs, - SelectValuesToIntList(ifc?.Items?.Values, (it) => it.FormData?.OpcUa_timeout)); - } - } - } - -} diff --git a/src/AasxPluginAssetInterfaceDesc/AidModbusConnection.cs b/src/AasxPluginAssetInterfaceDesc/AidModbusConnection.cs deleted file mode 100644 index ff4b9bd2..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidModbusConnection.cs +++ /dev/null @@ -1,239 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AasxIntegrationBase; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using FluentModbus; -using System.Net; -using System.Text.RegularExpressions; -using System.Globalization; -using Org.BouncyCastle.Asn1; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AidModbusConnection : AidBaseConnection - { - public ModbusTcpClient Client; - - override public bool Open() - { - try - { - Client = new ModbusTcpClient(); - if (TimeOutMs >= 10) - Client.ConnectTimeout = (int)TimeOutMs; - Client.Connect(new IPEndPoint(IPAddress.Parse(TargetUri.Host), TargetUri.Port)); - LastActive = DateTime.Now; - return true; - } catch (Exception ex) - { - Client = null; - return false; - } - } - - override public bool IsConnected() - { - return Client != null && Client.IsConnected; - } - - override public void Close() - { - if (IsConnected()) - { - Client.Disconnect(); - Client = null; - } - else - { - Client = null; - } - } - - // Note: the async version of ReadHoldingRegisters seems not to work properly? - override public int UpdateItemValue(AidIfxItemStatus item) - { - // access - if (item?.FormData?.Href?.HasContent() != true - || item.FormData.Modv_function?.HasContent() != true) - return 0; - int res = 0; - - // decode address + quantity - // (assumption: 1 quantity = 2 bytes) - var match = Regex.Match(item.FormData.Href, @"^(\d{1,5})(\?quantity=(\d+))?$"); - if (!match.Success) - return 0; - - if (!int.TryParse(match.Groups[1].ToString(), out var address)) - return 0; - if (!int.TryParse(match.Groups[3].ToString(), out var quantity)) - quantity = 1; - quantity = Math.Max(0, Math.Min(0xffff, quantity)); - - // perform function (id = in data) - byte[] id = null; - if (item.FormData.Modv_function.Trim().ToLower() == "readholdingregisters") - { - // readHoldingRegisters - - //Get device unitID - int.TryParse(TargetUri.LocalPath.Replace("/", ""), out var unitID); - - id = (Client.ReadHoldingRegisters(unitID, address, 2 * quantity)).ToArray(); - if (BitConverter.IsLittleEndian) - Array.Reverse(id); - // time - LastActive = DateTime.Now; - } - - // success with reading? - if (id == null || id.Length < 1) - return 0; - - // swapping (od = out data) - // https://doc.iobroker.net/#de/adapters/adapterref/iobroker.modbus/README.md?wp - var mbtp = item.FormData.Modv_type?.ToLower(); - var byteSequence = item.FormData.Modv_mostSignificantByte; - var wordSequence = item.FormData.Modv_mostSignificantWord; - byte[] od = id.ToArray(); - if (quantity == 2) - { - if (byteSequence == "" && wordSequence == "") // //byte sequence defined at the local level - - //byte sequence defined at the global level - if ((mostSignificantByte == "" && mostSignificantWord == "") || (mostSignificantByte == "true" && mostSignificantWord == "") || (mostSignificantByte == "" && mostSignificantWord == "true") || (mostSignificantByte == "true" && mostSignificantWord == "true")) - { - //use default, byte == true and word == true (Big endian and no word swapping) - } - else if ((mostSignificantByte == "" && mostSignificantWord == "false") || (mostSignificantByte == "true" && mostSignificantWord == "false")) - { - //big endian wordswap AABBCCDD => CCDDAABB - od[3] = id[1]; od[2] = id[0]; od[1] = id[3]; od[0] = id[2]; - } - else if ((mostSignificantByte == "false" && mostSignificantWord == "true") || (mostSignificantByte == "false" && mostSignificantWord == "")) - { - // Little Endian AABBCCDD => DDCCBBAA - Array.Reverse(od); - } - - //byte sequence defined at the global level - else if ((byteSequence == "true" && wordSequence == "") || (byteSequence == "" && wordSequence == "true") || (byteSequence == "true" && wordSequence == "true")) - { - //use default, byte == true and word == true (Big endian and no word swapping) - } - - //byte sequence defined at the global level - else if ((byteSequence == "true" && wordSequence == "false") || (byteSequence == "" && wordSequence == "false")) - { - //big endian wordswap AABBCCDD => CCDDAABB - od[3] = id[1]; od[2] = id[0]; od[1] = id[3]; od[0] = id[2]; - } - - //byte sequence defined at the global level - else if ((byteSequence == "false" && wordSequence == "true") || (byteSequence == "false" && wordSequence == "")) - { - // Little Endian little endian AABBCCDD => DDCCBBAA - Array.Reverse(od); - } - - - - } - else if (quantity == 1) - { - - if (byteSequence == "" && mostSignificantByte == "false") //byte sequence defined at the global level - { - // little endian AABB => BBAA - od[1] = id[0]; od[0] = id[1]; - } - - else if (byteSequence != "" && byteSequence.ToLower() == "false") //byte sequence defined at local level, it overrides gloabal level - { - // little endian AABB => BBAA - od[1] = id[0]; od[0] = id[1]; - } - else - { - // big endian AABB => AABB - } - } - - // conversion to value - // idea: (1) convert to binary type, (2) convert to adequate string representation - //var mbtp = item.FormData.Modv_type?.ToLower().Trim(); - - // no definition for long, byte, unsignedbyte, boolean, decimal, unsignedlong, and hexbinary yet - var strval = ""; - if (mbtp == "xsd:unsignedint" && quantity >= 2) - { - strval = BitConverter.ToUInt32(od).ToString(); - } - else - if (mbtp == "xsd:integer" && quantity >= 2) - { - strval = BitConverter.ToInt32(od).ToString(); - } - else - if (mbtp == "xsd:int" && quantity >= 1) - { - strval = BitConverter.ToUInt16(od).ToString(); - } - else - if (mbtp == "xsd:int" && quantity >= 1) - { - strval = BitConverter.ToInt16(od).ToString(); - } - else - if (mbtp == "xsd:unsignedshort" && quantity >= 1) - { - strval = Convert.ToByte(od[0]).ToString(); - } - else - if (mbtp == "xsd:short" && quantity >= 1) - { - strval = Convert.ToSByte(od[0]).ToString(); - } - else - if (mbtp == "xsd:float" && quantity >= 2) - { - strval = BitConverter.ToSingle(od).ToString("R", CultureInfo.InvariantCulture); - } - else - if (mbtp == "xsd:double" && quantity >= 4) - { - strval = BitConverter.ToDouble(od).ToString("R", CultureInfo.InvariantCulture); - } - else - if (mbtp == "xsd:string" && quantity >= 1) - { - strval = BitConverter.ToString(od); - } - - // save in item - item.Value = strval; - - // notify - NotifyOutputItems(item, strval); - - // ok - return 1; - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AidMqttConnection.cs b/src/AasxPluginAssetInterfaceDesc/AidMqttConnection.cs deleted file mode 100644 index f7bbdb28..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidMqttConnection.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AasxIntegrationBase; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using FluentModbus; -using System.Net; -using System.Text.RegularExpressions; -using System.Globalization; -using System.Net.Http; -using MQTTnet; -using MQTTnet.Client; -using System.Web.Services.Description; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AidMqttConnection : AidBaseConnection - { - protected static MqttFactory _factory = new MqttFactory(); - - public IMqttClient Client; - - protected Dictionary _subscribedTopics = new Dictionary(); - - override public bool Open() - { - try - { - // see: https://www.emqx.com/en/blog/connecting-to-serverless-mqtt-broker-with-mqttnet-in-csharp - Client = _factory.CreateMqttClient(); - - var options = new MqttClientOptionsBuilder() - .WithTcpServer(TargetUri.Host, TargetUri.Port) // MQTT broker address and port - // .WithCredentials(username, password) // Set username and password - .WithClientId("AasxPackageExplorer") - .WithCleanSession() - .Build(); - - // need to switch to async - var task = Task.Run(() => Client.ConnectAsync(options)); - task.Wait(); - var res = task.Result; - - // no subscriptions, yet - _subscribedTopics.Clear(); - - // get messages - Client.ApplicationMessageReceivedAsync += Client_ApplicationMessageReceivedAsync; - - // ok - return Client.IsConnected; - } - catch (Exception ex) - { - Client = null; - _subscribedTopics.Clear(); - return false; - } - } - - private async Task Client_ApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs arg) - { - // access - if (arg == null) - return; - - // topic? - var topic = arg.ApplicationMessage?.Topic; - if (topic?.HasContent() != true) - return; - - // payload? - // var payload = Encoding.UTF8.GetString(arg.ApplicationMessage.PayloadSegment); - var payload = arg.ApplicationMessage.ConvertPayloadToString(); - if (payload?.HasContent() != true) - return; - - // refer further.. - MessageReceived?.Invoke(topic, payload); - - // ok - await Task.Yield(); - } - - override public bool IsConnected() - { - // simple - return Client != null && Client.IsConnected; - } - - override public void Close() - { - if (IsConnected()) - { - var task = Task.Run(() => Client.DisconnectAsync()); - task.Wait(); - _subscribedTopics.Clear(); - } - } - - override public int UpdateItemValue(AidIfxItemStatus item) - { - // Cannot do anything. MQTT is pure publish/ subscribe. - // Unable to ask for a status value. - return 0; - } - - override public void PrepareContinousRun(IEnumerable items) - { - // access - if (!IsConnected() || items == null) - return; - - foreach (var item in items) - { - // valid topic? - var topic = "" + item.FormData?.Href; - if (topic.StartsWith("/")) - topic = topic.Remove(0, 1); - if (!topic.HasContent()) - continue; - - // need only "subscribe" - if (item.FormData?.Mqv_controlPacket?.HasContent() != true) - continue; - if (item.FormData.Mqv_controlPacket.Trim().ToLower() != "subscribe") - continue; - - // is topic already subscribed? - if (_subscribedTopics.ContainsKey(topic)) - continue; - - // ok, subscribe - var task = Task.Run(() => Client.SubscribeAsync(topic)); - task.Wait(); - _subscribedTopics.Add(topic, topic); - } - } - - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AidOpcUaConnection.cs b/src/AasxPluginAssetInterfaceDesc/AidOpcUaConnection.cs deleted file mode 100644 index 1fe57ddc..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AidOpcUaConnection.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AasxIntegrationBase; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using FluentModbus; -using System.Net; -using System.Text.RegularExpressions; -using System.Globalization; -using System.Net.Http; -using MQTTnet; -using MQTTnet.Client; -using System.Web.Services.Description; -using Opc.Ua; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AidOpcUaConnection : AidBaseConnection - { - public AasOpcUaClient Client; - - public class SubscribedItem - { - public string NodePath; - public Opc.Ua.Client.Subscription Subscription; - public AidIfxItemStatus Item; - } - - protected Dictionary _subscriptions - = new Dictionary(); - - override public bool Open() - { - try - { - // make client - // use the full target uri as endpoint (first) - Client = new AasOpcUaClient( - TargetUri.ToString(), - autoAccept: true, - userName: this.User, - password: this.Password, - timeOutMs: (TimeOutMs >= 10) ? (uint) TimeOutMs : 2000, - log: Log); - // Client.Run(); - - var task = Task.Run(async () => await Client.DirectConnect()); - task.Wait(); - - // ok - return IsConnected(); - } - catch (Exception ex) - { - Client = null; - // _subscribedTopics.Clear(); - return false; - } - } - - override public bool IsConnected() - { - // simple - return Client != null && Client.StatusCode == AasOpcUaClientStatus.Running; - } - - override public void Close() - { - if (IsConnected()) - { - try - { - // Client.Cancel(); - Client.Close(); - } catch (Exception ex) - { - ; - } - // _subscribedTopics.Clear(); - } - } - - override public int UpdateItemValue(AidIfxItemStatus item) - { - // access - if (!IsConnected()) - return 0; - - // careful - try - { - // get an node id? - var nid = Client.ParseAndCreateNodeId(item?.FormData?.Href); - - // direct read possible? - var dv = Client.ReadNodeId(nid); - item.Value = AdminShellUtil.ToStringInvariant(dv?.Value); - LastActive = DateTime.Now; - } - catch (Exception ex) - { - ; - } - - return 0; - } - - override public void PrepareContinousRun(IEnumerable items) - { - // access - if (!IsConnected() || items == null) - return; - - // over the items - // go the easy way: put each item into one subscription - foreach (var item in items) - { - // valid href? - var nodePath = "" + item.FormData?.Href; - nodePath = nodePath.Trim(); - if (!nodePath.HasContent()) - continue; - - // get an node id? - var nid = Client.ParseAndCreateNodeId(nodePath); - if (nid == null) - continue; - - // is topic already subscribed? - if (_subscriptions.ContainsKey(nodePath)) - continue; - - // ok, make subscription - var sub = Client.SubscribeNodeIds( - new[] { nid }, - handler: SubscriptionHandler, - publishingInterval: (UpdateFreqMs >= 10) ? (int) UpdateFreqMs : 500); - _subscriptions.Add(nodePath, - new SubscribedItem() { - NodePath = nodePath, - Subscription = sub, - Item = item, - }); - } - } - - protected void SubscriptionHandler( - Opc.Ua.Client.MonitoredItem monitoredItem, - Opc.Ua.Client.MonitoredItemNotificationEventArgs e) - { - // key is the "start node" - if (_subscriptions == null || monitoredItem?.StartNodeId == null - || !_subscriptions.ContainsKey(monitoredItem.StartNodeId)) - return; - - // okay - var subi = _subscriptions[monitoredItem.StartNodeId]; - if (subi?.Item != null && subi.NodePath?.HasContent() == true) - { - // take over most actual value - var valueObj = monitoredItem.DequeueValues().LastOrDefault(); - if (valueObj != null) - MessageReceived?.Invoke(subi.NodePath, AdminShellUtil.ToStringInvariant(valueObj.Value)); - } - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AssetInterfaceAnyUiControl.cs b/src/AasxPluginAssetInterfaceDesc/AssetInterfaceAnyUiControl.cs deleted file mode 100644 index 477720ff..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AssetInterfaceAnyUiControl.cs +++ /dev/null @@ -1,653 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using AasxIntegrationBase; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AnyUi; -using Newtonsoft.Json; -using AasxPredefinedConcepts; -using AasxPredefinedConcepts.AssetInterfacesDescription; -using System.Windows.Shapes; -using AasxIntegrationBaseGdi; -using FluentModbus; -using System.Net; -using Org.BouncyCastle.Asn1.X509; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AssetInterfaceAnyUiControl - { - #region Members - //============= - - private LogInstance _log = new LogInstance(); - private AdminShellPackageEnv _package = null; - private Aas.Submodel _submodel = null; - private AssetInterfaceOptions _options = null; - private PluginEventStack _eventStack = null; - private PluginSessionBase _session = null; - private AnyUiStackPanel _panel = null; - private AasxPluginBase _plugin = null; - - private AidAllInterfaceStatus _allInterfaceStatus = null; - - protected AnyUiSmallWidgetToolkit _uitk = new AnyUiSmallWidgetToolkit(); - - protected Dictionary _dictTechnologyToBitmap = - new Dictionary(); - - private System.Timers.Timer _dispatcherTimer = null; - - #endregion - - #region Members to be kept for state/ update - //============= - - protected double _lastScrollPosition = 0.0; - - protected int _selectedLangIndex = 0; - protected string _selectedLangStr = null; - - #endregion - - #region Constructors - //============= - - public AssetInterfaceAnyUiControl() - { - _dispatcherTimer = new System.Timers.Timer(500); - _dispatcherTimer.Elapsed += DispatcherTimer_Tick; - _dispatcherTimer.Enabled = true; - _dispatcherTimer.Start(); - } - - public void Dispose() - { - if (_dispatcherTimer != null) - { - _dispatcherTimer.Stop(); - _dispatcherTimer.Dispose(); - } - } - - public void Start( - LogInstance log, - AdminShellPackageEnv thePackage, - Aas.Submodel theSubmodel, - AssetInterfaceOptions theOptions, - PluginEventStack eventStack, - PluginSessionBase session, - AnyUiStackPanel panel, - AasxPluginBase plugin, - AidAllInterfaceStatus ifxStatus) - { - // internal members - _log = log; - _package = thePackage; - _submodel = theSubmodel; - _options = theOptions; - _eventStack = eventStack; - _session = session; - _panel = panel; - _plugin = plugin; - _allInterfaceStatus = ifxStatus; - - // some required logos - _dictTechnologyToBitmap = new Dictionary(); - if (OperatingSystem.IsWindowsVersionAtLeast(7)) - { - _dictTechnologyToBitmap.Add(AidInterfaceTechnology.HTTP, - AnyUiGdiHelper.CreateAnyUiBitmapFromResource( - "AasxPluginAssetInterfaceDesc.Resources.logo-http.png", - assembly: Assembly.GetExecutingAssembly())); - _dictTechnologyToBitmap.Add(AidInterfaceTechnology.Modbus, - AnyUiGdiHelper.CreateAnyUiBitmapFromResource( - "AasxPluginAssetInterfaceDesc.Resources.logo-modbus.png", - assembly: Assembly.GetExecutingAssembly())); - _dictTechnologyToBitmap.Add(AidInterfaceTechnology.MQTT, - AnyUiGdiHelper.CreateAnyUiBitmapFromResource( - "AasxPluginAssetInterfaceDesc.Resources.logo-mqtt.png", - assembly: Assembly.GetExecutingAssembly())); - _dictTechnologyToBitmap.Add(AidInterfaceTechnology.OPCUA, - AnyUiGdiHelper.CreateAnyUiBitmapFromResource( - "AasxPluginAssetInterfaceDesc.Resources.logo-opc-ua.png", - assembly: Assembly.GetExecutingAssembly())); - } - - // fill given panel - RenderFullView(_panel, _uitk, _package, _submodel); - } - - public static AssetInterfaceAnyUiControl FillWithAnyUiControls( - LogInstance log, - object opackage, object osm, - AssetInterfaceOptions options, - PluginEventStack eventStack, - PluginSessionBase session, - object opanel, - AasxPluginBase plugin, - AidAllInterfaceStatus ifxStatus) - { - // access - var package = opackage as AdminShellPackageEnv; - var sm = osm as Aas.Submodel; - var panel = opanel as AnyUiStackPanel; - if (package == null || sm == null || panel == null) - return null; - - // the Submodel elements need to have parents - sm.SetAllParents(); - - // factory this object - var aidCntl = new AssetInterfaceAnyUiControl(); - aidCntl.Start(log, package, sm, options, eventStack, session, panel, plugin, ifxStatus); - - // return shelf - return aidCntl; - } - - #endregion - - #region Display Submodel - //============= - - private void RenderFullView( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - AdminShellPackageEnv package, - Aas.Submodel sm) - { - // test trivial access - if (_options == null || _submodel?.SemanticId == null) - return; - - // make sure for the right Submodel - var foundRecs = new List(); - foreach (var rec in _options.LookupAllIndexKey( - _submodel?.SemanticId?.GetAsExactlyOneKey())) - foundRecs.Add(rec); - - // render - RenderPanelOutside(view, uitk, foundRecs, package, sm); - } - - protected void RenderPanelOutside( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - IEnumerable foundRecs, - AdminShellPackageEnv package, - Aas.Submodel sm) - { - // make an outer grid, very simple grid of two rows: header & body - var outer = view.Add(uitk.AddSmallGrid(rows: 7, cols: 1, colWidths: new[] { "*" })); - - // - // Bluebar - // - - var bluebar = uitk.AddSmallGridTo(outer, 0, 0, 1, cols: 5, colWidths: new[] { "*", "#", "#", "#", "#" }); - - bluebar.Margin = new AnyUiThickness(0); - bluebar.Background = AnyUiBrushes.LightBlue; - - uitk.AddSmallBasicLabelTo(bluebar, 0, 0, margin: new AnyUiThickness(8, 6, 0, 6), - foreground: AnyUiBrushes.DarkBlue, - fontSize: 1.5f, - setBold: true, - content: $"Asset Interfaces Descriptions"); - - // - // Scroll area - // - - // small spacer - outer.RowDefinitions[1] = new AnyUiRowDefinition(2.0, AnyUiGridUnitType.Pixel); - uitk.AddSmallBasicLabelTo(outer, 1, 0, - fontSize: 0.3f, - verticalAlignment: AnyUiVerticalAlignment.Top, - content: "", background: AnyUiBrushes.White); - - // add the body, a scroll viewer - outer.RowDefinitions[2] = new AnyUiRowDefinition(1.0, AnyUiGridUnitType.Star); - var scroll = AnyUiUIElement.RegisterControl( - uitk.AddSmallScrollViewerTo(outer, 2, 0, - horizontalScrollBarVisibility: AnyUiScrollBarVisibility.Disabled, - verticalScrollBarVisibility: AnyUiScrollBarVisibility.Visible, - flattenForTarget: AnyUiTargetPlatform.Browser, initialScrollPosition: _lastScrollPosition), - (o) => - { - if (o is Tuple positions) - { - _lastScrollPosition = positions.Item2; - } - return new AnyUiLambdaActionNone(); - }); - - // content of the scroll viewer - // need a stack panel to add inside - var inner = new AnyUiStackPanel() - { - Orientation = AnyUiOrientation.Vertical, - Margin = new AnyUiThickness(2, 2, 8, 2) - }; - scroll.Content = inner; - - if (foundRecs != null) - foreach (var rec in foundRecs) - RenderPanelInner(inner, uitk, rec, package, sm); - } - - #endregion - - #region Inner - //============= - - protected AnyUiLambdaActionBase TriggerUpdate(bool full = true) - { - // trigger a complete redraw, as the regions might emit - // events or not, depending on this flag - return new AnyUiLambdaActionPluginUpdateAnyUi() - { - PluginName = _plugin?.GetPluginName(), - UpdateMode = AnyUiRenderMode.All, - UseInnerGrid = true - }; - } - - protected void RenderPanelInner( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - AssetInterfaceOptionsRecord rec, - AdminShellPackageEnv package, - Aas.Submodel sm) - { - // access - if (view == null || uitk == null || sm == null || rec == null) - return; - - var grid = view.Add(uitk.AddSmallGrid(rows: 5, cols: 2, colWidths: new[] { "110:", "*" })); - - // - // Technologies - // - - uitk.AddSmallLabelTo(grid, 0, 0, content: "Technologies:"); - - var gridTech = uitk.AddSmallGridTo(grid, 0, 1, rows: 1, cols: 6, - colWidths: new[] { "#", "#", "#", "#", "#", "#" }); - - foreach (var tech in AdminShellUtil.GetEnumValues()) - { - AnyUiUIElement.SetBoolFromControl( - uitk.AddSmallCheckBoxTo(gridTech, 0, 0 + ((int) tech), - margin: new AnyUiThickness(0, 0, 10, 0), - content: "" + tech.ToString(), - isChecked: _allInterfaceStatus.UseTech[(int)tech], - verticalContentAlignment: AnyUiVerticalAlignment.Center), - (b) => { _allInterfaceStatus.UseTech[(int)tech] = b; }); - } - - // - // Commanding - // - - uitk.AddSmallLabelTo(grid, 1, 0, content: "Startup:"); - - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(grid, 1, 1, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(2, 0, 2, 0), - content: "Create status items"), - (o) => - { - try - { - // locked? - if (_allInterfaceStatus?.ContinousRun == true) - { - _log.Info(StoredPrint.Color.Blue, "Not possible. Interfaces are in continous mode."); - return new AnyUiLambdaActionNone(); - } - - // build up data structures - _allInterfaceStatus.PrepareAidInformation( - _allInterfaceStatus.SmAidDescription, - _allInterfaceStatus.SmAidMapping, - lambdaLookupReference: (rf) => package?.AasEnv?.FindReferableByReference(rf)); - _allInterfaceStatus.SetAidInformationForUpdateAndTimeout(); - - // trigger a complete redraw, as the regions might emit - // events or not, depending on this flag - return TriggerUpdate(full: true); - } - catch (Exception ex) - { - ; - } - return new AnyUiLambdaActionNone(); - }); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(grid, 2, 1, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(2, 0, 2, 0), - content: "Single update .."), - (o) => - { - try - { - // locked? - if (_allInterfaceStatus?.ContinousRun == true) - { - _log.Info(StoredPrint.Color.Blue, "Not possible. Interfaces are in continous mode."); - return new AnyUiLambdaActionNone(); - } - - // single shot - _allInterfaceStatus?.UpdateValuesSingleShot(); - - // trigger a complete redraw, as the regions might emit - // events or not, depending on this flag - return TriggerUpdate(full: true); - } - catch (Exception ex) - { - ; - } - return new AnyUiLambdaActionNone(); - }); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(grid, 3, 1, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(2, 0, 2, 0), - content: "Start continous run .."), - (o) => - { - try - { - // command - if (_allInterfaceStatus != null) - { - _allInterfaceStatus.StartContinousRun(); - } - - // trigger a complete redraw - return TriggerUpdate(full: true); - } - catch (Exception ex) - { - ; - } - return new AnyUiLambdaActionNone(); - }); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(grid, 4, 1, - margin: new AnyUiThickness(2), setHeight: 21, - padding: new AnyUiThickness(2, 0, 2, 0), - content: "Stop continous run .."), - (o) => - { - try - { - // command - if (_allInterfaceStatus != null) - { - _allInterfaceStatus.StopContinousRun(); - } - - // trigger a complete redraw - return TriggerUpdate(full: true); - } - catch (Exception ex) - { - ; - } - return new AnyUiLambdaActionNone(); - }); - - // get SM data and - RenderTripleRowData(view, uitk, _allInterfaceStatus.InterfaceStatus); - } - - #endregion - - #region Update - //============= - - public void Update(params object[] args) - { - // check args - if (args == null || args.Length < 1 - || !(args[0] is AnyUiStackPanel newPanel)) - return; - - // ok, re-assign panel and re-display - _panel = newPanel; - _panel.Children.Clear(); - - // the default: the full shelf - RenderFullView(_panel, _uitk, _package, _submodel); - } - - #endregion - - #region Interface items - //===================== - - protected void RenderTripleRowData( - AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, - List interfaces) - { - // access - if (interfaces == null) - return; - - // ok - var grid = view.Add(uitk.AddSmallGrid(rows: interfaces.Count, cols: 5, - colWidths: new[] { "40:", "1*", "1*", "1*", "180:" })); - int rowIndex = 0; - foreach (var ifx in interfaces) - { - // - // heading - // - - grid.RowDefinitions.Add(new AnyUiRowDefinition()); - - var headGrid = uitk.Set( - uitk.AddSmallGridTo(grid, rowIndex++, 0, - rows: 1, cols: 3, colWidths: new[] { "#", "#", "#" }, - margin: new AnyUiThickness(0, 8, 0, 4)), - colSpan: 5); - - if (_dictTechnologyToBitmap.ContainsKey(ifx.Technology)) - uitk.AddSmallImageTo(headGrid, 0, 0, - margin: new AnyUiThickness(0, 4, 10, 4), - bitmap: _dictTechnologyToBitmap[ifx.Technology]); - - uitk.AddSmallBasicLabelTo(headGrid, 0, 1, fontSize: 1.2f, setBold: true, - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - content: ifx.DisplayName); - - uitk.AddSmallBasicLabelTo(headGrid, 0, 2, fontSize: 1.2f, - margin: new AnyUiThickness(10, 0, 0, 0), - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - content: ifx.Info); - - // - // items - // - - if (ifx.Items != null) - foreach (var item in ifx.Items.Values) - { - // normal row, 5 bordered cells - grid.RowDefinitions.Add(new AnyUiRowDefinition()); - var cols = new[] { - "Prop.", item.Location, item.DisplayName, "" + item.FormData?.Href, item.Value }; - for (int ci = 0; ci < 5; ci++) - { - var brd = uitk.AddSmallBorderTo(grid, rowIndex, ci, - margin: (ci == 0) ? new AnyUiThickness(0, -1, 0, 0) - : new AnyUiThickness(-1, -1, 0, 0), - borderThickness: new AnyUiThickness(1.0), borderBrush: AnyUiBrushes.DarkGray); - brd.Child = new AnyUiSelectableTextBlock() - { - Text = cols[ci], - Padding = new AnyUiThickness(3, 1, 3, 1), - FontSize = 1.0f, - FontWeight = AnyUiFontWeight.Normal - }; - - if (ci == 4) - { - // remember value widget!! - item.RenderedUiElement = brd.Child; - } - } - rowIndex++; - - // map output item rows? - if (item.MapOutputItems != null && item.MapOutputItems.Count > 0) - { - grid.RowDefinitions.Add(new AnyUiRowDefinition()); - - var innerGrid = uitk.Set( - uitk.AddSmallGridTo(grid, rowIndex++, 1, - rows: item.MapOutputItems.Count, - cols: 3, colWidths: new[] { "#", "*", "#" }, - margin: new AnyUiThickness(2, 0, 0, 6)), - colSpan: 4); - - foreach (var moi in item.MapOutputItems) - { - // any content? - if (moi?.MapRelation?.Second == null) - continue; - - uitk.AddSmallBasicLabelTo(innerGrid, 0, 0, fontSize: 1.4f, - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - margin: new AnyUiThickness(1, -2, 6, -4), - content: "\u2ba1"); - - var secStr = "" + moi.MapRelation.Second.ToStringExtended(2, delimiter: "."); - uitk.AddSmallBasicLabelTo(innerGrid, 0, 1, fontSize: 0.9f, - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - content: secStr); - - AnyUiUIElement.RegisterControl( - uitk.AddSmallButtonTo(innerGrid, 0, 2, - content: "\U0001f872", - padding: new AnyUiThickness(0, -2, 0, -2), - margin: new AnyUiThickness(4, 2, 0, 2)), - (o) => - { - _eventStack?.PushEvent(new AasxPluginResultEventNavigateToReference() - { - targetReference = moi.MapRelation.Second - }); - return new AnyUiLambdaActionNone(); - }); - } - } - } - - // - // LogLine - // - - grid.RowDefinitions.Add(new AnyUiRowDefinition()); - - var clr = StoredPrint.LightThemeColor(ifx.LogColor); - - var ll = uitk.Set( - uitk.AddSmallBasicLabelTo(grid, rowIndex++, 0, fontSize: 0.8, - verticalAlignment: AnyUiVerticalAlignment.Center, - verticalContentAlignment: AnyUiVerticalAlignment.Center, - background: new AnyUiBrush(clr.Item2), - foreground: new AnyUiBrush(clr.Item1), - margin: new AnyUiThickness(0, 4, 0, 8), - padding: new AnyUiThickness(2, 1, 2, 1), - content: "" + ifx.LogLine), - colSpan: 5); - } - } - - #endregion - - #region Timer - //=========== - - private bool _inDispatcherTimer = false; - private UInt64 _lastValueChanges = 0; - - private void DispatcherTimer_Tick(object sender, EventArgs e) - { - // better debugging - _inDispatcherTimer = true; - var updateDisplay = false; - - // trigger update of values? - if (_allInterfaceStatus?.ContinousRun == true - && _allInterfaceStatus.SumValueChanges() != _lastValueChanges) - { - // rember new - _lastValueChanges = _allInterfaceStatus.SumValueChanges(); - - // re-render values only - foreach (var ifc in _allInterfaceStatus.InterfaceStatus) - foreach (var item in ifc.Items.Values) - if (item.RenderedUiElement is AnyUiSelectableTextBlock tb) - { - tb.Text = item.Value; - } - - // set - updateDisplay = true; - } - - // trigger update value? - if (_eventStack != null && updateDisplay) - _eventStack.PushEvent(new AasxPluginEventReturnUpdateAnyUi() - { - Session = _session, - PluginName = null, // do NOT call the plugin before rendering - Mode = AnyUiRenderMode.StatusToUi, - UseInnerGrid = true - }); - - // end debugging - _inDispatcherTimer = false; - } - - #endregion - - #region Callbacks - //=============== - - - #endregion - - #region Utilities - //=============== - - - #endregion - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/AssetInterfaceOptions.cs b/src/AasxPluginAssetInterfaceDesc/AssetInterfaceOptions.cs deleted file mode 100644 index f9dff130..00000000 --- a/src/AasxPluginAssetInterfaceDesc/AssetInterfaceOptions.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using AasxIntegrationBase; - -namespace AasxPluginAssetInterfaceDescription -{ - public class AssetInterfaceOptionsRecord : AasxPluginOptionsLookupRecordBase - { - public bool IsDescription = false; - public bool IsMapping = false; - - public bool UseHttp = true; - public bool UseModbus = true; - public bool UseMqtt = true; - public bool UseOpcUa = true; - } - - public class AssetInterfaceOptions : AasxPluginLookupOptionsBase - { - public List Records = new List(); - - /// - /// Create a set of minimal options - /// - public static AssetInterfaceOptions CreateDefault() - { - var defs = new DefinitionsMTP.ModuleTypePackage(); - - var rec1 = new AssetInterfaceOptionsRecord(); - rec1.IsDescription = true; - rec1.AllowSubmodelSemanticId = new[] { - new Aas.Key(Aas.KeyTypes.Submodel, - "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel") }.ToList(); - - var rec2 = new AssetInterfaceOptionsRecord(); - rec2.IsMapping = true; - rec1.AllowSubmodelSemanticId = new[] { - new Aas.Key(Aas.KeyTypes.Submodel, - "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/Submodel") }.ToList(); - - var opt = new AssetInterfaceOptions(); - opt.Records.Add(rec1); - - return opt; - } - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/LICENSE.TXT b/src/AasxPluginAssetInterfaceDesc/LICENSE.TXT deleted file mode 100644 index 21bf04b1..00000000 --- a/src/AasxPluginAssetInterfaceDesc/LICENSE.TXT +++ /dev/null @@ -1,244 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -This software is licensed under the Apache Public License 2.0 (APL-2.0) -(see below). -The AutomationML.Engine is licensed under the MIT license (MIT) -(see below). - -This application is a sample application for demonstration of the features -of the Administration Shell. -It is not allowed for productive use. The implementation uses the concepts -of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - diff --git a/src/AasxPluginAssetInterfaceDesc/Opc.Ua.SampleClient.Config.xml b/src/AasxPluginAssetInterfaceDesc/Opc.Ua.SampleClient.Config.xml deleted file mode 100644 index 8c8ea824..00000000 --- a/src/AasxPluginAssetInterfaceDesc/Opc.Ua.SampleClient.Config.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - UA Core Sample Client - urn:localhost:OPCFoundation:CoreSampleClient - http://opcfoundation.org/UA/CoreSampleClient - Client_1 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Client, C=US, S=Arizona, O=OPC Foundation, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - false - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - - - 600000 - - - - opc.tcp://{0}:4840/UADiscovery - - - - - - - 10000 - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleClient.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/AasxPluginAssetInterfaceDesc/Plugin.cs b/src/AasxPluginAssetInterfaceDesc/Plugin.cs deleted file mode 100644 index cf8279c4..00000000 --- a/src/AasxPluginAssetInterfaceDesc/Plugin.cs +++ /dev/null @@ -1,361 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using JetBrains.Annotations; -using Newtonsoft.Json; -using AasxPluginAssetInterfaceDescription; -using AnyUi; -using System.Windows.Controls; -using System.IO.Packaging; - -namespace AasxIntegrationBase // the namespace has to be: AasxIntegrationBase -{ - [UsedImplicitlyAttribute] - // the class names has to be: AasxPlugin and subclassing IAasxPluginInterface - public class AasxPlugin : AasxPluginBase - { - private AasxPluginAssetInterfaceDescription.AssetInterfaceOptions _options - = new AasxPluginAssetInterfaceDescription.AssetInterfaceOptions(); - - // TODO: make this multi-session!! - private AidAllInterfaceStatus _allInterfaceStatus = null; - private AidInterfaceService _interfaceService = null; - - public class Session : PluginSessionBase - { - public AasxPluginAssetInterfaceDescription.AssetInterfaceAnyUiControl AnyUiControl = null; - } - - public new void InitPlugin(string[] args) - { - // start .. - PluginName = "AasxPluginAssetInterfaceDesc"; - - // .. with built-in options - _options = AasxPluginAssetInterfaceDescription.AssetInterfaceOptions.CreateDefault(); - - // try load defaults options from assy directory - try - { - var newOpt = - AasxPluginOptionsBase - .LoadDefaultOptionsFromAssemblyDir( - this.GetPluginName(), Assembly.GetExecutingAssembly()); - if (newOpt != null) - _options = newOpt; - } - catch (Exception ex) - { - _log.Error(ex, "Exception when reading default options {1}"); - } - - // index them! - _options.IndexListOfRecords(_options.Records); - - // start interface service - _allInterfaceStatus = new AidAllInterfaceStatus(_log); - _interfaceService = new AidInterfaceService(); - _interfaceService.StartOperation(_log, _eventStack, _allInterfaceStatus); - } - - public new object CheckForLogMessage() - { - return _log.PopLastShortTermPrint(); - } - - public new AasxPluginActionDescriptionBase[] ListActions() - { - var res = ListActionsBasicHelper( - enableCheckVisualExt: true, - enableOptions: true, - enableLicenses: true, - enableEventsGet: true, - enableEventReturn: true, - enableMenuItems: true, - enablePanelAnyUi: true); - return res.ToArray(); - } - - public new AasxPluginResultBase ActivateAction(string action, params object[] args) - { - // for speed reasons, have the most often used at top! - if (action == "call-check-visual-extension") - { - // arguments - if (args.Length < 1) - return null; - - // looking only for Submodels - var sm = args[0] as Aas.Submodel; - if (sm == null) - return null; - - // check for a record in options, that matches Submodel - bool found = _options?.ContainsIndexKey(sm?.SemanticId?.GetAsExactlyOneKey()) ?? false; - if (!found) - return null; - - // specifically find the record - var foundOptRec = _options.LookupAllIndexKey( - sm.SemanticId.GetAsExactlyOneKey()).FirstOrDefault(); - if (foundOptRec == null) - return null; - - // remember for later / background - - if (foundOptRec.IsDescription) - { - _allInterfaceStatus.RememberAidSubmodel(sm, foundOptRec, - adoptUseFlags: true); - return null; - } - - - if (foundOptRec.IsMapping) - _allInterfaceStatus.RememberMappingSubmodel(sm); - - // success prepare record - var cve = new AasxPluginResultVisualExtension("AIMC", "Asset Interfaces Mapping Configuration"); - - // ok - return cve; - } - - // can basic helper help to reduce lines of code? - var help = ActivateActionBasicHelper(action, ref _options, args, - enableGetCheckVisuExt: true); - if (help != null) - return help; - - // rest follows - - if (action == "fill-anyui-visual-extension") - { - // arguments (package, submodel, panel, display-context, session-id) - if (args == null || args.Length < 5) - return null; - - // create session and call - var session = _sessions.CreateNewSession(args[4]); - session.AnyUiControl = AasxPluginAssetInterfaceDescription.AssetInterfaceAnyUiControl.FillWithAnyUiControls( - _log, args[0], args[1], _options, _eventStack, session, args[2], this, _allInterfaceStatus); - - // give object back - var res = new AasxPluginResultBaseObject(); - res.obj = session.AnyUiControl; - return res; - } - - if (action == "update-anyui-visual-extension" - && _sessions != null) - { - // arguments (panel, display-context, session-id) - if (args == null || args.Length < 3) - return null; - - if (_sessions.AccessSession(args[2], out Session session)) - { - // call - session.AnyUiControl.Update(args); - - // give object back - var res = new AasxPluginResultBaseObject(); - res.obj = 42; - return res; - } - } - - if (action == "dispose-anyui-visual-extension" - && _sessions != null) - { - // arguments (session-id) - if (args == null || args.Length < 1) - return null; - - // ReSharper disable UnusedVariable - if (_sessions.AccessSession(args[0], out Session session)) - { - // dispose all ressources - session.AnyUiControl.Dispose(); - - // remove - _sessions.Remove(args[0]); - } - // ReSharper enable UnusedVariable - } - - if (action == "get-menu-items") - { - // result list - var res = new List(); - - // attach - // note: need to be single items, no childs allowed! - res.Add(new AasxPluginResultSingleMenuItem() - { - AttachPoint = "Plugins", - MenuItem = new AasxMenuItem() - { - Name = "AssetInterfaceOperationStart", - Header = "Asset Interfaces (AID): Start operations …", - HelpText = "Looks for a suitable Submodel with SMT Asset Interfaces Descriptions " + - "(AID) and mapping and starts operations in the background." - } - }); - res.Add(new AasxPluginResultSingleMenuItem() - { - AttachPoint = "Plugins", - MenuItem = new AasxMenuItem() - { - Name = "AssetInterfaceOperationStop", - Header = "Asset Interfaces (AID): Stop operations …", - HelpText = "Stops all AID operations." - } - }); - - // return - return new AasxPluginResultProvideMenuItems() - { - MenuItems = res - }; - } - - // default - return null; - } - - /// - /// Async variant of ActivateAction. - /// Note: for some reason of type conversion, it has to return Task. - /// - public new async Task ActivateActionAsync(string action, params object[] args) - { - if (action == "call-menu-item") - { - if (args != null && args.Length >= 3 - && args[0] is string cmd - && args[1] is AasxMenuActionTicket ticket - && args[2] is AnyUiContextPlusDialogs displayContext - && args[3] is DockPanel masterPanel) - { - try - { - if (cmd == "assetinterfaceoperationstart") - { - await Task.Yield(); - - // be safe - if (_allInterfaceStatus == null) - { - _log?.Error("Error accessing background all interface status! Aborting."); - return null; - } - - try - { - // in (used!)Submodels of the respecitve AAS, find memories - _allInterfaceStatus.RememberNothing(); - if (ticket.Env != null) - foreach (var sm in ticket.Env.FindAllSubmodelGroupedByAAS()) - { - var foundOptRec = _options.LookupAllIndexKey( - sm.SemanticId.GetAsExactlyOneKey()).FirstOrDefault(); - if (foundOptRec == null) - continue; - - if (foundOptRec.IsDescription) - _allInterfaceStatus.RememberAidSubmodel(sm, foundOptRec, - adoptUseFlags: true); - if (foundOptRec.IsMapping) - _allInterfaceStatus.RememberMappingSubmodel(sm); - } - - // start? - if (_allInterfaceStatus.EnoughMemories()) - { - // switch off current? - if (_allInterfaceStatus.ContinousRun) - { - _log?.Info("Asset Interfaces: stopping current operation .."); - _allInterfaceStatus.StopContinousRun(); - } - - // (re-) init - _log?.Info("Asset Interfaces: starting new operation .."); - _allInterfaceStatus.PrepareAidInformation( - _allInterfaceStatus.SmAidDescription, - _allInterfaceStatus.SmAidMapping, - lambdaLookupReference: (rf) => ticket?.Env.FindReferableByReference(rf)); - _allInterfaceStatus.SetAidInformationForUpdateAndTimeout(); - _allInterfaceStatus.StartContinousRun(); - } - - } catch (Exception ex) - { - _log?.Error(ex, "when starting Asset Interface operations"); - } - - // give object back - var res = new AasxPluginResultCallMenuItem(); - return res; - } - - if (cmd == "assetinterfaceoperationstop") - { - await Task.Yield(); - - // be safe - if (_allInterfaceStatus == null) - { - _log?.Error("Error accessing background all interface status! Aborting."); - return null; - } - - try - { - // switch off current? - if (_allInterfaceStatus.ContinousRun) - { - _log?.Info("Asset Interfaces: stopping current operation .."); - _allInterfaceStatus.StopContinousRun(); - } - } - catch (Exception ex) - { - _log?.Error(ex, "when starting Asset Interface operations"); - } - - // give object back - var res = new AasxPluginResultCallMenuItem(); - return res; - } - } - catch (Exception ex) - { - _log?.Error(ex, "when executing plugin menu item " + cmd); - } - } - } - - // default - return null; - } - - } -} diff --git a/src/AasxPluginAssetInterfaceDesc/Resources/LICENSE.TXT b/src/AasxPluginAssetInterfaceDesc/Resources/LICENSE.TXT deleted file mode 100644 index fc70527e..00000000 --- a/src/AasxPluginAssetInterfaceDesc/Resources/LICENSE.TXT +++ /dev/null @@ -1,651 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG , author: Michael Hoffmeister -Copyright (c) 2019 PHOENIX CONTACT GmbH & Co. KG , author: Andreas Orzelski -This software is licensed under the Eclipse Public License 2.0 (EPL-2.0) (see below) -The browser functionality is licensed under the cefSharp license (see below) -The Newtonsoft.JSON serialization is licensed under the MIT License (MIT) (see below) -The QR code generation is licensed under the MIT license (MIT) (see below) -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under the Apache License 2.0 (Apache-2.0) (see below) -The Grapevine REST server framework is licensed under Apache License 2.0 (Apache-2.0) (see below) -The AutomationML.Engine is licensed under the MIT license (MIT) (see below) -The MQTT server and client is licensed under the MIT license (MIT) (see below) - -This application is a sample application for demonstration of the features of the Administration Shell. -It is not allowed for productive use. The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed under Creative Commons CC BY-ND 3.0 DE. - -Eclipse Public License 2.0 (EPL-2.0) -==================================== - -(https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt) - - THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE - PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION - OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - - a) in the case of the initial Contributor, the initial content - Distributed under this Agreement, and - - b) in the case of each subsequent Contributor: - i) changes to the Program, and - ii) additions to the Program; - where such changes and/or additions to the Program originate from - and are Distributed by that particular Contributor. A Contribution - "originates" from a Contributor if it was added to the Program by - such Contributor itself or anyone acting on such Contributor's behalf. - Contributions do not include changes or additions to the Program that - are not Modified Works. - -"Contributor" means any person or entity that Distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which -are necessarily infringed by the use or sale of its Contribution alone -or when combined with the Program. - -"Program" means the Contributions Distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this Agreement -or any Secondary License (as applicable), including Contributors. - -"Derivative Works" shall mean any work, whether in Source Code or other -form, that is based on (or derived from) the Program and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. - -"Modified Works" shall mean any work in Source Code or other form that -results from an addition to, deletion from, or modification of the -contents of the Program, including, for purposes of clarity any new file -in Source Code form that contains any contents of the Program. Modified -Works shall not include works that contain only declarations, -interfaces, types, classes, structures, or files of the Program solely -in each case in order to link to, bind by name, or subclass the Program -or Modified Works thereof. - -"Distribute" means the acts of a) distributing or b) making available -in any manner that enables the transfer of a copy. - -"Source Code" means the form of a Program preferred for making -modifications, including but not limited to software source code, -documentation source, and configuration files. - -"Secondary License" means either the GNU General Public License, -Version 2.0, or any later versions of that license, including any -exceptions or additional permissions as identified by the initial -Contributor. - -2. GRANT OF RIGHTS - - a) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free copyright - license to reproduce, prepare Derivative Works of, publicly display, - publicly perform, Distribute and sublicense the Contribution of such - Contributor, if any, and such Derivative Works. - - b) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free patent - license under Licensed Patents to make, use, sell, offer to sell, - import and otherwise transfer the Contribution of such Contributor, - if any, in Source Code or other form. This patent license shall - apply to the combination of the Contribution and the Program if, at - the time the Contribution is added by the Contributor, such addition - of the Contribution causes such combination to be covered by the - Licensed Patents. The patent license shall not apply to any other - combinations which include the Contribution. No hardware per se is - licensed hereunder. - - c) Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. - Each Contributor disclaims any liability to Recipient for claims - brought by any other entity based on infringement of intellectual - property rights or otherwise. As a condition to exercising the - rights and licenses granted hereunder, each Recipient hereby - assumes sole responsibility to secure any other intellectual - property rights needed, if any. For example, if a third party - patent license is required to allow Recipient to Distribute the - Program, it is Recipient's responsibility to acquire that license - before distributing the Program. - - d) Each Contributor represents that to its knowledge it has - sufficient copyright rights in its Contribution, if any, to grant - the copyright license set forth in this Agreement. - - e) Notwithstanding the terms of any Secondary License, no - Contributor makes additional grants to any Recipient (other than - those set forth in this Agreement) as a result of such Recipient's - receipt of the Program under the terms of a Secondary License - (if permitted under the terms of Section 3). - -3. REQUIREMENTS - -3.1 If a Contributor Distributes the Program in any form, then: - - a) the Program must also be made available as Source Code, in - accordance with section 3.2, and the Contributor must accompany - the Program with a statement that the Source Code for the Program - is available under this Agreement, and informs Recipients how to - obtain it in a reasonable manner on or through a medium customarily - used for software exchange; and - - b) the Contributor may Distribute the Program under a license - different than this Agreement, provided that such license: - i) effectively disclaims on behalf of all other Contributors all - warranties and conditions, express and implied, including - warranties or conditions of title and non-infringement, and - implied warranties or conditions of merchantability and fitness - for a particular purpose; - - ii) effectively excludes on behalf of all other Contributors all - liability for damages, including direct, indirect, special, - incidental and consequential damages, such as lost profits; - - iii) does not attempt to limit or alter the recipients' rights - in the Source Code under section 3.2; and - - iv) requires any subsequent distribution of the Program by any - party to be under a license that satisfies the requirements - of this section 3. - -3.2 When the Program is Distributed as Source Code: - - a) it must be made available under this Agreement, or if the - Program (i) is combined with other material in a separate file or - files made available under a Secondary License, and (ii) the initial - Contributor attached to the Source Code the notice described in - Exhibit A of this Agreement, then the Program may be made available - under the terms of such Secondary Licenses, and - - b) a copy of this Agreement must be included with each copy of - the Program. - -3.3 Contributors may not remove or alter any copyright, patent, -trademark, attribution notices, disclaimers of warranty, or limitations -of liability ("notices") contained within the Program from any copy of -the Program which they Distribute, provided that Contributors may add -their own appropriate notices. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities -with respect to end users, business partners and the like. While this -license is intended to facilitate the commercial use of the Program, -the Contributor who includes the Program in a commercial product -offering should do so in a manner which does not create potential -liability for other Contributors. Therefore, if a Contributor includes -the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and indemnify every -other Contributor ("Indemnified Contributor") against any losses, -damages and costs (collectively "Losses") arising from claims, lawsuits -and other legal actions brought by a third party against the Indemnified -Contributor to the extent caused by the acts or omissions of such -Commercial Contributor in connection with its distribution of the Program -in a commercial product offering. The obligations in this section do not -apply to any claims or Losses relating to any actual or alleged -intellectual property infringement. In order to qualify, an Indemnified -Contributor must: a) promptly notify the Commercial Contributor in -writing of such claim, and b) allow the Commercial Contributor to control, -and cooperate with the Commercial Contributor in, the defense and any -related settlement negotiations. The Indemnified Contributor may -participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those performance -claims and warranties, and if a court requires any other Contributor to -pay any damages as a result, the Commercial Contributor must pay -those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" -BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR -IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF -TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR -PURPOSE. Each Recipient is solely responsible for determining the -appropriateness of using and distributing the Program and assumes all -risks associated with its exercise of rights under this Agreement, -including but not limited to the risks and costs of program errors, -compliance with applicable laws, damage to or loss of data, programs -or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS -SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST -PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE -EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other software -or hardware) infringes such Recipient's patent(s), then such Recipient's -rights granted under Section 2(b) shall terminate as of the date such -litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign the -responsibility to serve as the Agreement Steward to a suitable separate -entity. Each new version of the Agreement will be given a distinguishing -version number. The Program (including Contributions) may always be -Distributed subject to the version of the Agreement under which it was -received. In addition, after a new version of the Agreement is published, -Contributor may elect to Distribute the Program (including its -Contributions) under the new version. - -Except as expressly stated in Sections 2(a) and 2(b) above, Recipient -receives no rights or licenses to the intellectual property of any -Contributor under this Agreement, whether expressly, by implication, -estoppel or otherwise. All rights in the Program not expressly granted -under this Agreement are reserved. Nothing in this Agreement is intended -to be enforceable by any entity that is not a Contributor or Recipient. -No third-party beneficiary rights are created under this Agreement. - -Exhibit A - Form of Secondary Licenses Notice - -"This Source Code may also be made available under the following -Secondary Licenses when the conditions for such availability set forth -in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), -version(s), and exceptions or additional permissions here}." - - Simply including a copy of this Agreement, including this Exhibit A - is not sufficient to license the Source Code under Secondary Licenses. - - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to - look for such a notice. - - You may add additional accurate notices of copyright ownership. - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -// Copyright © The CefSharp Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// * Neither the name of Google Inc. nor the name Chromium Embedded -// Framework nor the name CefSharp nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/src/AasxPluginAssetInterfaceDesc/Resources/logo-http.png b/src/AasxPluginAssetInterfaceDesc/Resources/logo-http.png deleted file mode 100644 index 0424ef88316a20ba356dddeb203683d175f16116..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1369 zcmV-f1*ZCmP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1nx;hK~z{r)tGB+ zQ)L*(+tb@Q-MXz?w{^qKZG?&-8#Tw-P-B!~nsYNCLNOB9Uw zL6{*UAi<18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#8Lgc#TU51$6c@)4YQk3jmU)Gs>yd5`7*@BW272fMB$9V)A2L zAMx*?_?u!E9>>ZEsLThAGv2^TGUF~nnsm&8HVG>_2sYnPwizo)j=PA6IOO58viqni nhe_K^I`1)pw%~!J215S=6h^h2>FO!O00000NkvXXu0mjfZ&NP^ diff --git a/src/AasxPluginAssetInterfaceDesc/Resources/logo-mqtt.png b/src/AasxPluginAssetInterfaceDesc/Resources/logo-mqtt.png deleted file mode 100644 index 158d239a4f64b27e3dc1fa66a75bc03ff58fa51d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2570 zcmV+l3ib7gP)T00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D37<(sK~!i%?V1Tx zROc1P-wcQ#2m&bxf+H>nk|?5v9K;}sxSW6*wGnGUYfcr7wJfew5Cx-H6;t)NL+r7( zA)zV(6v3T=O3=8Wq9CBS5ClaQ7nc5c-{sB53}a56CLVu>6Yu|Fmz4!Y7FJ#6BTD{k{7$ z2`X+^Jh=XV*&>n1-ql{|6Vy?DrM$AFk_5-~@#te>X+lDdrpBg{ypnrA-mAV>{p$HE zgDwUZJuPsmc7yEjb#xF!j!Ydw0J`KMRQkEpgn1Z!aXyPJB`Of=SoOuEEK{%m(RSrXN~yhy=&s z`d8mvjq@h0hWiEgV_ajJUNw>CxUf@Uj$V!=cxo$aGya;9y)V1=r&?N)!?Ks9*L*MU z1>SHvTPczj#SM>RwwA=*k2A9|`)a~h*V3=ik`~y$ZyR+biUf~BqQJ#}y8hD%5feOS zc{qIJ(8)-_7r18WK53*=Wa{cv;riXCx-FG16=JicSyN`ODyurP^9%{~d>{S2ynj{6 z`&Zsd$Cby{A8XgY;Bm?0$pmc>`chh~M2 zTrkqu!kCWWI6RL>qK>TlXdRLOTj}vZkMJ|$7WT5x)&TtSvi>EB_CSijlR=_Aj;=qt zCty!~bvX^_mBvjZjWyi(jizM0*62$h09$UO#^Q^p4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P ze?S1~AO^4{-Tyuckb{xdJp|qddrL4X>?v5W{QP_}n@;|a)#cLC+SV@O4;<+Q6{efR zQ(ksN3j6l$!wlfz5c|>pIDwKZEG=1`Z*gzjxQUno4ftLXp#;9OV=U3Xc#Ek~Sb`-> zmXJR00}cX%*@~6M2RfGs8OSk(l8O+;#>j)1IcVU=^Kr9 z5426LI2>ft&?s~UBl#jHr{hg8i$&@$E{H7-uwG2w$ZFvvk*n23jzW>KB?dZ{u|jdJu(wfFEsEJ$;sqhI$-?v^3zYX zjNe}VY-($3lai7!`;d?j*f+W`BO_zmwr#L=h;os82jp8WFj!o($YG5^e7R; z0}qa)aP{i72M>PD$;qMrWD2be8#YW^d!)I!8A5BAJG!wr!2L%=MBI*!e){xjWkm&T zS0p8+6cprfi0vj%p6lku&9mWde0+Ski_Zim_weDvL|}04+_{SvFA{;5g^L!=^YEar zd!LW~kAXu24e?(6^n diff --git a/src/AasxPluginKnownSubmodels/AasxPluginKnownSubmodels.media/SMT_AssetInterfacesDescription.png b/src/AasxPluginKnownSubmodels/AasxPluginKnownSubmodels.media/SMT_AssetInterfacesDescription.png deleted file mode 100644 index 62c528184be2dd6722b9c7d20b7e8b272d1a2d9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17033 zcmeFXLvSum@Ti^S#I|jlC$??dwr$(ViEZ1q?YyyV+~5EEHn;Bn?(Sl$yQgL`H9gh+ zO!q`8$ce*2V?zT00l`U1h$#IhyMcg!p&>#3(8pg-`rADA z>TCB^R!59aM=$Eo+mJ|`3laSO9W`+tS zKz%+tuRoF;4y9IQzU4Ojr(*_-eGJfD z4O>Y}hPlcJHb~OguOgXEJ&p$M5j+X$7ENSs^<$k?X?7(hY7NA{h9vJzqFY_fxA5p* zEG*fRZkfR5L>17YBbp;%xI$mL6C~%iKGr9->pSzj{I)4ECBZh98up4qhUhpdqvK0M%DsIXw7=0Umqu$?pdw5nDhfR)iFMQ|BRzsG-JK$|U-GhLtm z^XWT$O2`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~f>ycOLnzk5x*VWj&4keKR2G${>zSngx(C z8LO7jnG{YNVbjY~^Ix|l{_nmDf&YS6t1zFhpk$^n&|$^nWJES8_d0L550fIQv1FSI z|DeBCJyuCci9lIpCG-MK5au**5L!F_I(P;;P~Z{d!v9n>Hn+BxmX;PE$rHkd7XOQi z@Sse=!NCqnjQnV5XyY{(mzPKs1qjvfg@rLOF%x8AApzt;H|y6cjrvl1RRq3)aAf-B zVtMW<1gx%>aM`mg);PhK7)Ty@oB1>drL&X;%mDSaOIGxbso zyT12AEC0g4w`orv*B8I7cx%+j+w1Z|Zdsn*kKG)b>VnyK-VA2>Kl#y0w=*oOBGpW` zD;5aFoQhWc wV|W;+(XSKjd-KBUhs%5f>mBx{FZ|$N74=-CIs0@P@E8dOPgg&ebxsLQ0Bf2ZjQ{`u diff --git a/src/AasxPluginKnownSubmodels/KnownSubmodelsOptions.cs b/src/AasxPluginKnownSubmodels/KnownSubmodelsOptions.cs index c2bc2453..319c0309 100644 --- a/src/AasxPluginKnownSubmodels/KnownSubmodelsOptions.cs +++ b/src/AasxPluginKnownSubmodels/KnownSubmodelsOptions.cs @@ -38,38 +38,6 @@ public static KnownSubmodelsOptions CreateDefault() { var opt = new KnownSubmodelsOptions(); - opt.Records.Add(new KnownSubmodelsOptionsRecord() - { - Header = "IDTA Asset Interfaces Description", - Content = "This Submodel template aims at being part of asset onboarding " + - "solution by specifying an information model and a common representation" + - "for describing interface(s) of an asset service or asset related service." + - "Based on this information, it is possible to initiate a connection to" + - "such kind of service and start to request or subscribe to datapoints," + - "and/or perform operations.", - ImageLink = "AasxPluginKnownSubmodels.media\\SMT_Generic.png", - FurtherUrl = "https://github.com/admin-shell-io/submodel-templates/tree/main/published/Asset%20Interfaces%20Description/1/0", - AllowSubmodelSemanticId = (new Aas.Key[] { - new Aas.Key(Aas.KeyTypes.Submodel, "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel") - }.ToList()) - }); - - opt.Records.Add(new KnownSubmodelsOptionsRecord() - { - Header = "IDTA Asset Interfaces Mapping Configuration", - Content = "This Submodel template aims at being part of asset onboarding solution " + - "of an asset of the respective Asset Administration Shell. " + - "The intended use-case is the provision of mapping information of a data's " + - "the source (asset) and target (AAS submodel element) endpoint." + - "information provided in AIMC, is used to effortlessly integrate" + - "and accelerate asset onboarding.", - ImageLink = "AasxPluginKnownSubmodels.media\\SMT_Generic.png", - FurtherUrl = "https://github.com/admin-shell-io/id", - AllowSubmodelSemanticId = (new Aas.Key[] { - new Aas.Key(Aas.KeyTypes.Submodel, "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/Submodel") - }.ToList()) - }); - opt.Records.Add(new KnownSubmodelsOptionsRecord() { Header = "Contact Information (IDTA) V1.0", diff --git a/src/AasxPredefinedConcepts/AIDResources.cs b/src/AasxPredefinedConcepts/AIDResources.cs deleted file mode 100644 index f68b7162..00000000 --- a/src/AasxPredefinedConcepts/AIDResources.cs +++ /dev/null @@ -1,1184 +0,0 @@ -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AasxPredefinedConcepts -{ - class AIDResources - { - public static JObject EndpointMetadataJObject = JObject.Parse( - @" - { - 'interface': { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'An abstraction of a physical or a virtual entity whose metadata and interfaces are described by a WoT Thing Description, whereas a virtual entity is the composition of one or more Things.', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface', - 'formtext': 'interface', - 'presetIdShort': 'interface{00:00}', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'title', - 'presetIdShort': 'title', - 'multiplcity': '1', - 'description': 'Provides a human-readable title', - 'semanticReference': 'https://www.w3.org/2019/wot/td#title' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'created', - 'presetIdShort': 'created', - 'multiplcity': '0..1', - 'description': 'Provides information when the TD instance was created.', - 'semanticReference': 'http://purl.org/dc/terms/created' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'modified', - 'presetIdShort': 'modified', - 'multiplcity': '0..1', - 'description': 'Provides information when the TD instance was last modified.', - 'semanticReference': 'http://purl.org/dc/terms/modified' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'support', - 'presetIdShort': 'support', - 'multiplcity': '0..1', - 'description': 'Provides information about the TD maintainer as URI scheme (e.g., mailto [RFC6068], tel [RFC3966], https [RFC9112]).', - 'semanticReference': 'https://www.w3.org/2019/wot/td#supportContact' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides the metadata of the asset’s endpoint (base, content type that is used for interaction, etc)', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/EndpointMetadata', - 'formtext': 'EndpointMetadata', - 'presetIdShort': 'EndpointMetadata', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'base', - 'presetIdShort': 'base', - 'multiplcity': '0..1', - 'description': 'Define the base URI that is used for all relative URI references throughout a TD document. In TD instances: all relative URIs are resolved relative to the base URI using the algorithm defined in [RFC3986].', - 'semanticReference': 'https://www.w3.org/2019/wot/td#baseURI' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'contentType', - 'presetIdShort': 'contentType', - 'multiplcity': '0..1', - 'description': 'Assign a content type based on a media type (e.g.: text/plain) and potential parameters (e.g.: charset=utf-8) for the media type [RFC2046].', - 'semanticReference': 'https://www.w3.org/2019/wot/hypermedia#forContentType' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Defines the security scheme according to W3C', - 'semanticReference': 'https://www.w3.org/2019/wot/hypermedia#securityDefinitions', - 'formtext': 'securityDefinitions', - 'presetIdShort': 'securityDefinitions', - 'childs': [ - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Bearer Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#BearerSecurityScheme', - 'formtext': 'bearer_sc', - 'presetIdShort': 'bearer_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'authorization', - 'presetIdShort': 'authorization', - 'multiplcity': '0..1', - 'description': 'URI of the authorization server.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#authorization' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'name', - 'presetIdShort': 'name', - 'multiplcity': '0..1', - 'description': 'Name for query: header: cookie: or uri parameters.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#name' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'alg', - 'presetIdShort': 'alg', - 'multiplcity': '0..1', - 'description': 'Encoding: encryption: or digest algorithm.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#alg' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'format', - 'presetIdShort': 'format', - 'multiplcity': '0..1', - 'description': 'Specifies format of security authentication information.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#format' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'in', - 'presetIdShort': 'in', - 'multiplcity': '0..1', - 'description': 'Specifies the location of security authentication information.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#in' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Digest Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#DigestSecurityScheme', - 'formtext': 'digest_sc', - 'presetIdShort': 'digest_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'name', - 'presetIdShort': 'name', - 'multiplcity': '0..1', - 'description': 'Name for query: header: cookie: or uri parameters.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#name' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'in', - 'presetIdShort': 'in', - 'multiplcity': '0..1', - 'description': 'Specifies the location of security authentication information.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#in' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Api Key Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#APIKeySecurityScheme', - 'formtext': 'apikey_sc', - 'presetIdShort': 'apikey_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'name', - 'presetIdShort': 'name', - 'multiplcity': '0..1', - 'description': 'Name for query: header: cookie: or uri parameters.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#name' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'in', - 'presetIdShort': 'in', - 'multiplcity': '0..1', - 'description': 'Specifies the location of security authentication information.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#in' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'PSK Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#PSKSecurityScheme', - 'formtext': 'psk_sc', - 'presetIdShort': 'psk_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'identity', - 'presetIdShort': 'identity', - 'multiplcity': '0..1', - 'description': 'Identifier providing information which can be used for selection or confirmation.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#identity' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Basic Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#BasicSecurityScheme', - 'formtext': 'basic_sc', - 'presetIdShort': 'basic_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'name', - 'presetIdShort': 'name', - 'multiplcity': '0..1', - 'description': 'Name for query: header: cookie: or uri parameters.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#name' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'in', - 'presetIdShort': 'in', - 'multiplcity': '0..1', - 'description': 'Name for query, header, cookie, or uri parameters', - 'semanticReference': 'https://www.w3.org/2019/wot/security#name' - } - ] - }, -{ - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Basic Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#NoSecurityScheme', - 'formtext': 'nosec_sc', - 'presetIdShort': 'nosec_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'OAuth2 Security Definition', - 'semanticReference': 'https://www.w3.org/2019/wot/security#OAuth2SecurityScheme', - 'formtext': 'oauth2_sc', - 'presetIdShort': 'oauth2_sc', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'proxy', - 'presetIdShort': 'proxy', - 'multiplcity': '0..1', - 'description': 'Identification of the security mechanism being configured.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#proxy' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scheme', - 'presetIdShort': 'scheme', - 'multiplcity': '1', - 'description': 'URI of the proxy server this security configuration provides access to. If not given, the corresponding security configuration is for the endpoint.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#SecurityScheme' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'authorization', - 'presetIdShort': 'authorization', - 'multiplcity': '0..1', - 'description': 'URI of the authorization server.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#authorization' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'token', - 'presetIdShort': 'token', - 'multiplcity': '0..1', - 'description': 'URI of the token server.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#token' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:anyURI', - 'formtext': 'refresh', - 'presetIdShort': 'refresh', - 'multiplcity': '0..1', - 'description': 'URI of the refresh server.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#refresh' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'format', - 'presetIdShort': 'format', - 'multiplcity': '0..1', - 'description': 'Specifies format of security authentication information.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#format' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'flow', - 'presetIdShort': 'flow', - 'multiplcity': '0..1', - 'description': 'Defines authorization flow such as code or client', - 'semanticReference': 'https://www.w3.org/2019/wot/security#flow' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'formtext': 'scopes', - 'presetIdShort': 'scopes', - 'multiplcity': '0..1', - 'description': 'Set of authorization scope identifiers provided as an array. These are provided in tokens returned by an authorization server and associated with forms in order to identify what resources a client may access and how.', - 'semanticReference': 'https://www.w3.org/2019/wot/security#scopes', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'scope', - 'presetIdShort': 'scope{00:00}', - 'multiplcity': '0..*', - 'description': 'Authorization scope identifier', - 'semanticReference': 'https://www.w3.org/2019/wot/security#scopes' - } - ] - } - ] - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '1', - 'description': 'Selects one or more of the security scheme(s) that can be applied at runtime from the collection of security schemes defines in securityDefinitions', - 'semanticReference': 'https://www.w3.org/2019/wot/td#hasSecurityConfiguration', - 'formtext': 'security', - 'presetIdShort': 'security', - 'childs': [ - { - 'AasElementType': 'ReferenceElement', - 'multiplcity': '0..*', - 'description': 'Reference element to security scheme definition', - 'semanticReference': 'https://www.w3.org/2019/wot/td#hasSecurityConfiguration', - 'formtext': 'security', - 'presetIdShort': '' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'modv_mostSignificantByte', - 'presetIdShort': 'modv_mostSignificantByte', - 'multiplcity': '0..1', - 'description': 'Define the base URI that is used for all relative URI references throughout a TD document. In TD instances: all relative URIs are resolved relative to the base URI using the algorithm defined in [RFC3986].', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasMostSignificByte' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'modv_mostSignificantWord', - 'presetIdShort': 'modv_mostSignificantWord', - 'multiplcity': '0..1', - 'description': 'When true: it describes that the word order of the data in the Modbus message is the most significant word first (i.e.: no word swapping). When false: it describes the least significant word first (i.e. word swapping) ', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasMostSignificantWord' - } - ] - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides an place for existing description files (e.g., Thing Description, GSDML, etc,).', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/ExternalDescriptor', - 'formtext': 'ExternalDescriptor', - 'presetIdShort': 'ExternalDescriptor', - 'childs': [ - { - 'AasElementType': 'File', - 'formtext': 'descriptorName', - 'presetIdShort': 'descriptorName', - 'multiplcity': '1..*', - 'description': 'File reference (local in AASX or outside) to an external descriptor description (e.g., Thing Description, GSDML, etc,).', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/externalDescriptorName' - } - ] - }, -{ - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'An abstraction of a physical or a virtual entity whose metadata and interfaces are described by a WoT Thing Description, whereas a virtual entity is the composition of one or more Things.', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InteractionMetadata', - 'formtext': 'InteractionMetadata', - 'presetIdShort': 'InteractionMetadata', - 'childs': [ - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'All Property-based Interaction Affordances of the Thing.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#PropertyAffordance', - 'formtext': 'properties', - 'presetIdShort': 'properties', - 'childs': [ - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'An Interaction Affordance that exposes state of the Thing', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition', - 'formtext': 'property', - 'presetIdShort': 'property{00:00}', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'key', - 'presetIdShort': 'key', - 'multiplcity': '0..1', - 'description': 'Optional element when the idShort of {property_name} cannot be used to reflect the desired property name due to the idShort restrictions', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/key' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'title', - 'presetIdShort': 'title', - 'multiplcity': '0..1', - 'description': 'Provides a human-readable title (e.g., display a text for UI representation) based on a default language.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#title' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'observable', - 'presetIdShort': 'observable', - 'multiplcity': '0..1', - 'description': 'An indicator that tells that the interaction datapoint can be observed with a, e.g., subscription mechanism by an underlying protocol.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#isObservable' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '1', - 'description': 'Provides a list of restricted set of values that the asset can provide as datapoint value.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#hasForm', - 'formtext': 'forms', - 'presetIdShort': 'forms', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'contentType', - 'tdText' : 'contentType', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/hypermedia#forContentType', - 'presetIdShort': 'contentType', - 'description': 'Indicates the datapoint media type specified by IANA.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'subprotocol', - 'tdText' : 'subprotocol', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/hypermedia#forSubProtocol', - 'presetIdShort': 'subprotocol', - 'description': 'Indicates the exact mechanism by which an interaction will be accomplished for a given protocol when there are multiple options.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'href', - 'tdText' : 'href', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/hypermedia#hasTarget', - 'presetIdShort': 'href', - 'description': 'Target IRI relative path or full IRI of assets datapoint.The relative endpoint definition in href is always relative to base defined in EndpointMetadata' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'formtext': 'security', - 'tdText' : 'security', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/td#hasSecurityConfiguration', - 'presetIdShort': 'security', - 'description': 'Selects one or more of the security scheme(s) that can be applied at runtime from the collection of security schemes defines in securityDefinitions', - 'childs': [ - { - 'AasElementType': 'ReferenceElement', - 'formtext': 'security', - 'multiplcity': '0..*', - 'semanticReference': 'https://www.w3.org/2019/wot/td#hasSecurityConfiguration', - 'presetIdShort': '', - 'description': 'Reference element to security scheme definition' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'htv_methodName', - 'tdText' : 'htv:methodName', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2011/http#methodName', - 'presetIdShort': 'htv_methodName', - 'description': 'HTTP method name (Literal).' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'formtext': 'htv_header', - 'tdText' : 'htv:header', - 'multiplcity': '0..*', - 'semanticReference': 'https://www.w3.org/2011/http#headers', - 'presetIdShort': '', - 'description': ' Information for http message header definition', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'htv_fieldName', - 'tdText' : 'htv:fieldName', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2011/http#fieldName', - 'presetIdShort': 'htv_fieldName', - 'description': '' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'htv_fieldValue', - 'tdText' : 'htv:fieldValue', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2011/http#fieldValue', - 'presetIdShort': 'htv_fieldValue', - 'description': '' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'mqv_retain', - 'tdText' : 'mqv:retain', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/mqtt#hasRetainFlag', - 'presetIdShort': 'mqv_retain', - 'description': 'It is an indicator that tells the broker to always retain last published payload.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'mqv_controlPacket', - 'tdText' : 'mqv:controlPacket', - 'multiplcity': '1', - 'semanticReference': 'https://www.w3.org/2019/wot/mqtt#ControlPacket', - 'presetIdShort': 'mqv_controlPacket', - 'description': 'Defines the method associated to the datapoint in relation to the broker.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'mqv_qos', - 'tdText' : 'mqv:qos', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/mqtt#hasQoSFlag', - 'presetIdShort': 'mqv_qos', - 'description': 'Defined the level of guarantee for message delivery between clients.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'modv_function', - 'tdText' : 'modv:function', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasFunction', - 'presetIdShort': 'modv_function', - 'description': 'Abstraction of the Modbus function code sent during a request. A function value can be either readCoil, readDeviceIdentification, readDiscreteInput, readHoldingRegisters, readInputRegisters, writeMultipleCoils, writeMultipleHoldingRegisters, writeSingleCoil, or writeSingleHoldingRegister' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'modv_entity', - 'tdText' : 'modv:entity', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasEntity', - 'presetIdShort': 'modv_entity', - 'description': 'A registry type to let the runtime automatically detect the right function code. An entity value can be Coil, DiscreteInput, HoldingRegister, or InputRegister ' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'modv_zeroBasedAddressing', - 'tdText' : 'modv:zeroBasedAddressing', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasZeroBasedAddressingFlag', - 'presetIdShort': 'modv_zeroBasedAddressing', - 'description': 'Modbus implementations can differ in the way addressing works, as the first coil/register can be either referred to as True or False.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:integer', - 'formtext': 'modv_timeout', - 'tdText' : 'modv:timeout', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasTimeout', - 'presetIdShort': 'modv_timeout', - 'description': 'Modbus response maximum waiting time. Defines how much time in milliseconds the runtime should wait until it receives a reply from the device.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:integer', - 'formtext': 'modv_pollingTime', - 'tdText' : 'modv:pollingTime', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasPollingTime', - 'presetIdShort': 'modv_pollingTime', - 'description': 'Modbus TCP maximum polling rate. The Modbus specification does not define a maximum or minimum allowed polling rate, however specific implementations might introduce such limits. Defined as integer of milliseconds.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'modv_type', - 'tdText' : 'modv:type', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasPayloadDataType', - 'presetIdShort': 'modv_type', - 'description': 'Defines the data type of the modbus asset payload. type in terms of possible sign, base type. the modv_type offers a set a types defined in XML schema' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'modv_mostSignificantByte', - 'tdText' : 'modv:mostSignificantByte', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasMostSignificantByte', - 'presetIdShort': 'modv_mostSignificantByte', - 'description': 'Define the base URI that is used for all relative URI references throughout a TD document. In TD instances, all relative URIs are resolved relative to the base URI using the algorithm defined in [RFC3986].' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'modv_mostSignificantWord', - 'tdText' : 'modv:mostSignificantWord', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/modbus#hasMostSignificantWord', - 'presetIdShort': 'modv_mostSignificantWord', - 'description': 'When true, it describes that the word order of the data in the Modbus message is the most significant word first (i.e., no word swapping). When false, it describes the least significant word first (i.e. word swapping) ' - } - ] - }, - { - 'AasElementType': 'ReferenceElement', - 'formtext': 'valueSemantics', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/valueSemantics', - 'presetIdShort': 'valueSemantics', - 'description': 'Provides additional semantic information of the value that is read/subscribed at runtime.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'type', - 'presetIdShort': 'type', - 'multiplcity': '0..1', - 'description': 'Assignment of JSON-based data types compatible with JSON Schema (one of boolean, integer, number, string, object, array, or null).', - 'semanticReference': 'https://www.w3.org/1999/02/22-rdf-syntax-ns#type' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'const', - 'presetIdShort': 'const', - 'multiplcity': '0..1', - 'description': 'Provides a constant value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#const' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides a list of restricted set of values that the asset can provide as datapoint value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum', - 'formtext': 'enum', - 'presetIdShort': 'enum', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'enum', - 'presetIdShort': 'enum{00:00}', - 'multiplcity': '0..*', - 'description': 'Data Point Value', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'default', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#default', - 'presetIdShort': 'default', - 'description': 'Supply a default value. The value SHOULD validate against the data schema in which it resides.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'unit', - 'multiplcity': '0..1', - 'semanticReference': 'https://schema.org/unitCode', - 'presetIdShort': 'unit', - 'description': 'Provides unit information that is used, e.g., in international science, engineering, and business. To preserve uniqueness, it is recommended that the value of the unit points to a semantic definition' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:integer', - 'formtext': 'min_max', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange', - 'presetIdShort': 'min_max', - 'description': 'Specifies a minimum and/or maximum numeric value for the datapoint.' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'lengthRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange', - 'presetIdShort': 'lengthRange', - 'description': 'Specifies the minimum and maximum length of a string.' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '1', - 'description': 'Used to define the data schema characteristics of an array payload.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#items', - 'formtext': 'items', - 'presetIdShort': 'items', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'type', - 'presetIdShort': 'type', - 'multiplcity': '0..1', - 'description': 'Assignment of JSON-based data types compatible with JSON Schema (one of boolean, integer, number, string, object, array, or null).', - 'semanticReference': 'https://www.w3.org/1999/02/22-rdf-syntax-ns#type' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'const', - 'presetIdShort': 'const', - 'multiplcity': '0..1', - 'description': 'Provides a constant value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#const' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides a list of restricted set of values that the asset can provide as datapoint value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum', - 'formtext': 'enum', - 'presetIdShort': 'enum', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'enum{00:00}', - 'presetIdShort': 'enum{00:00}', - 'multiplcity': '0..*', - 'description': 'Data Point Value', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'default', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#default', - 'presetIdShort': 'default', - 'description': 'Supply a default value. The value SHOULD validate against the data schema in which it resides.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'unit', - 'multiplcity': '0..1', - 'semanticReference': 'https://schema.org/unitCode', - 'presetIdShort': 'unit', - 'description': 'Provides unit information that is used, e.g., in international science, engineering, and business. To preserve uniqueness, it is recommended that the value of the unit points to a semantic definition' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:integer', - 'formtext': 'min_max', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange', - 'presetIdShort': 'min_max', - 'description': 'Specifies a minimum and/or maximum numeric value for the datapoint.' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'lengthRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange', - 'presetIdShort': 'lengthRange', - 'description': 'Specifies the minimum and maximum length of a string.' - } - ] - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'itemsRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/itemsRange', - 'presetIdShort': 'itemsRange', - 'description': 'Defines the minimum and maximum number of items that have to be in an array payload.' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Nested definitions of a datapoint. Only applicable if type=object', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#properties', - 'formtext': 'properties', - 'presetIdShort': 'properties', - 'childs': [ - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'An Interaction Affordance that exposes state of the Thing', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#propertyName', - 'formtext': 'property', - 'presetIdShort': 'property{00:00}', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'key', - 'presetIdShort': 'key', - 'multiplcity': '0..1', - 'description': 'Optional element when the idShort of {property_name} cannot be used to reflect the desired property name due to the idShort restrictions', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/key' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'title', - 'presetIdShort': 'title', - 'multiplcity': '0..1', - 'description': 'Provides a human-readable title (e.g., display a text for UI representation) based on a default language.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#title' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'observable', - 'presetIdShort': 'observable', - 'multiplcity': '0..1', - 'description': 'An indicator that tells that the interaction datapoint can be observed with a, e.g., subscription mechanism by an underlying protocol.', - 'semanticReference': 'https://www.w3.org/2019/wot/td#isObservable' - }, - { - 'AasElementType': 'ReferenceElement', - 'formtext': 'valueSemantics', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/valueSemantics', - 'presetIdShort': 'valueSemantics', - 'description': 'Provides additional semantic information of the value that is read/subscribed at runtime.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'type', - 'presetIdShort': 'type', - 'multiplcity': '0..1', - 'description': 'Assignment of JSON-based data types compatible with JSON Schema (one of boolean, integer, number, string, object, array, or null).', - 'semanticReference': 'https://www.w3.org/1999/02/22-rdf-syntax-ns#type' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'const', - 'presetIdShort': 'const', - 'multiplcity': '0..1', - 'description': 'Provides a constant value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#const' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides a list of restricted set of values that the asset can provide as datapoint value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum', - 'formtext': 'enum', - 'presetIdShort': 'enum', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'enum', - 'presetIdShort': 'enum{00:00}', - 'multiplcity': '0..*', - 'description': 'Data Point Value', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'default', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#default', - 'presetIdShort': 'default', - 'description': 'Supply a default value. The value SHOULD validate against the data schema in which it resides.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'unit', - 'multiplcity': '0..1', - 'semanticReference': 'https://schema.org/unitCode', - 'presetIdShort': 'unit', - 'description': 'Provides unit information that is used, e.g., in international science, engineering, and business. To preserve uniqueness, it is recommended that the value of the unit points to a semantic definition' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:integer', - 'formtext': 'min_max', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange', - 'presetIdShort': 'min_max', - 'description': 'Specifies a minimum and/or maximum numeric value for the datapoint.' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'lengthRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange', - 'presetIdShort': 'lengthRange', - 'description': 'Specifies the minimum and maximum length of a string.' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Used to define the data schema characteristics of an array payload.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#items', - 'formtext': 'items', - 'presetIdShort': 'items', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'type', - 'presetIdShort': 'type', - 'multiplcity': '0..1', - 'description': 'Assignment of JSON-based data types compatible with JSON Schema (one of boolean, integer, number, string, object, array, or null).', - 'semanticReference': 'https://www.w3.org/1999/02/22-rdf-syntax-ns#type' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'const', - 'presetIdShort': 'const', - 'multiplcity': '0..1', - 'description': 'Provides a constant value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#const' - }, - { - 'AasElementType': 'SubmodelElementCollection', - 'multiplcity': '0..1', - 'description': 'Provides a list of restricted set of values that the asset can provide as datapoint value.', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum', - 'formtext': 'enum', - 'presetIdShort': 'enum', - 'childs': [ - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'enum{00:00}', - 'presetIdShort': 'enum{00:00}', - 'multiplcity': '0..*', - 'description': 'Data Point Value', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#enum' - } - ] - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:boolean', - 'formtext': 'default', - 'multiplcity': '0..1', - 'semanticReference': 'https://www.w3.org/2019/wot/json-schema#default', - 'presetIdShort': 'default', - 'description': 'Supply a default value. The value SHOULD validate against the data schema in which it resides.' - }, - { - 'AasElementType': 'Property', - 'valueType' : 'xs:string', - 'formtext': 'unit', - 'multiplcity': '0..1', - 'semanticReference': 'https://schema.org/unitCode', - 'presetIdShort': 'unit', - 'description': 'Provides unit information that is used, e.g., in international science, engineering, and business. To preserve uniqueness, it is recommended that the value of the unit points to a semantic definition' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:integer', - 'formtext': 'min_max', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange', - 'presetIdShort': 'min_max', - 'description': 'Specifies a minimum and/or maximum numeric value for the datapoint.' - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'lengthRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange', - 'presetIdShort': 'lengthRange', - 'description': 'Specifies the minimum and maximum length of a string.' - } - ] - }, - { - 'AasElementType': 'Range', - 'valueType' : 'xs:unsignedInt', - 'formtext': 'itemsRange', - 'multiplcity': '0..1', - 'semanticReference': 'https://admin-shell.io/idta/AssetInterfacesDescription/1/0/itemsRange', - 'presetIdShort': 'itemsRange', - 'description': 'Defines the minimum and maximum number of items that have to be in an array payload.' - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - }"); - - } -} diff --git a/src/AasxPredefinedConcepts/DefinitionsAID.cs b/src/AasxPredefinedConcepts/DefinitionsAID.cs deleted file mode 100644 index 6cc4bc25..00000000 --- a/src/AasxPredefinedConcepts/DefinitionsAID.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using Newtonsoft.Json.Linq; -using System.Reflection; -using AdminShellNS; -using AasCore.Aas3_0; -using System.Collections.Generic; -using JetBrains.Annotations; -using Microsoft.VisualBasic; -using System.Security.Cryptography; -using AasxIntegrationBase.AasForms; -// ReSharper disable UnassignedField.Global -// (working by reflection) - -namespace AasxPredefinedConcepts -{ - /// - /// Definitions of Submodel VDI2770 according to new alignment with VDI - /// - public class IDTAAid : AasxDefinitionBase - { - public static IDTAAid Static = new IDTAAid(); - public Submodel - SM_AssetInterfaceDescription; - - public JObject EndpointMetadataJObject = AIDResources.EndpointMetadataJObject; - public List mqttFormElemList = new List() { "mqv_retain", - "mqv_controlPacket","mqv_qos"}; - public List modvFormElemList = new List() { "modv_function", - "modv_entity","modv_zeroBasedAddressing","modv_pollingTime", - "modv_type","modv_mostSignificantByte","modv_mostSignificantWord" - }; - - public Reference AID_Submodel = new Reference(ReferenceTypes.ExternalReference, new List { new Key(KeyTypes.GlobalReference, "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel") }); - public Reference AID_Interface = new Reference(ReferenceTypes.ExternalReference, new List { new Key(KeyTypes.GlobalReference, "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface") }); - - public Reference ConstructReference(string value) - { - Reference _ref = new Reference(ReferenceTypes.ExternalReference, new List { new Key(KeyTypes.GlobalReference, value) }); - return _ref; - } - public Key ConstructKey(KeyTypes _keyType, string value) { - - Key _key = new Key(_keyType, value); - return _key; - } - public FormMultiplicity GetFormMultiplicity(string multipli) - { - if (multipli == "1") - { - return FormMultiplicity.One; - } - else if (multipli == "0..1") - { - return FormMultiplicity.ZeroToOne; - } - else if (multipli == "0..*") - { - return FormMultiplicity.ZeroToMany; - } - else if (multipli == "1..*") - { - return FormMultiplicity.OneToMany; - } - return FormMultiplicity.ZeroToOne; - } - public DataTypeDefXsd GetValueType(string valueType) - { - return Stringification.DataTypeDefXsdFromString(valueType) - ?? DataTypeDefXsd.String; - } - public IDTAAid() - { - // info - this.DomainInfo = "IDTA Asset Interfaces Description"; - - // IReferable - this.ReadLibrary( - Assembly.GetExecutingAssembly(), "AasxPredefinedConcepts.Resources." + "IdtaAssetInterfaceDescription.json"); - this.RetrieveEntriesFromLibraryByReflection(typeof(IDTAAid), useFieldNames: true); - } - } - -} diff --git a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs b/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs deleted file mode 100644 index 4c4f07ff..00000000 --- a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs +++ /dev/null @@ -1,551 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG - -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). - -This source code was auto-generated by the AASX Package Explorer. -*/ - -using AasxIntegrationBase; -using AdminShellNS; -using Extensions; -using System; -using System.Collections.Generic; -using Aas = AasCore.Aas3_0; - -namespace AasxPredefinedConcepts.AssetInterfacesDescription -{ - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface")] - public class CD_GenericInterface - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#title", Card = AasxPredefinedCardinality.One)] - public string Title; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#created", Card = AasxPredefinedCardinality.ZeroToOne)] - public DateTime? Created; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#modified", Card = AasxPredefinedCardinality.ZeroToOne)] - public DateTime? Modified; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#support", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Support; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/EndpointMetadata", Card = AasxPredefinedCardinality.One)] - public CD_EndpointMetadata EndpointMetadata = new CD_EndpointMetadata(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InteractionMetadata", Card = AasxPredefinedCardinality.One)] - public CD_InteractionMetadata InteractionMetadata = new CD_InteractionMetadata(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/ExternalDescriptor", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_ExternalDescriptor ExternalDescriptor = null; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/EndpointMetadata")] - public class CD_EndpointMetadata - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#baseURI", Card = AasxPredefinedCardinality.One)] - public string Base; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/hypermedia#forContentType", Card = AasxPredefinedCardinality.One)] - public string ContentType; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasMostSignificantByte", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_mostSignificantByte = ""; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasMostSignificantWord", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_mostSignificantWord = ""; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#hasSecurityConfiguration", Card = AasxPredefinedCardinality.One)] - public CD_Security Security = new CD_Security(); - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public CD_SecurityDefinitions SecurityDefinitions = new CD_SecurityDefinitions(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#hasSecurityConfiguration")] - public class CD_Security - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme")] - public class CD_SecurityDefinitions - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#NoSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Nosec_sc Nosec_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#AutoSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Auto_sc Auto_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#BasicSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Basic_sc Basic_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#ComboSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Combo_sc Combo_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#APIKeySecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Apikey_sc Apikey_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#PSKSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Psk_sc Psk_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#DigestSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Digest_sc Digest_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#BearerSecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Bearer_sc Bearer_sc = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#OAuth2SecurityScheme", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Oauth2_sc Oauth2_sc = null; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#NoSecurityScheme")] - public class CD_Nosec_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#AutoSecurityScheme")] - public class CD_Auto_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#BasicSecurityScheme")] - public class CD_Basic_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#name", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Name; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#in", Card = AasxPredefinedCardinality.ZeroToOne)] - public string In; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#ComboSecurityScheme")] - public class CD_Combo_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#oneOf", Card = AasxPredefinedCardinality.One)] - public CD_OneOf OneOf = new CD_OneOf(); - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#allOf", Card = AasxPredefinedCardinality.One)] - public CD_AllOf AllOf = new CD_AllOf(); - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#oneOf")] - public class CD_OneOf - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#allOf")] - public class CD_AllOf - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#APIKeySecurityScheme")] - public class CD_Apikey_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#name", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Name; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#in", Card = AasxPredefinedCardinality.ZeroToOne)] - public string In; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#PSKSecurityScheme")] - public class CD_Psk_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#identity", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Identity; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#DigestSecurityScheme")] - public class CD_Digest_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#name", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Name; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#in", Card = AasxPredefinedCardinality.ZeroToOne)] - public string In; - - public string Qop; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#BearerSecurityScheme")] - public class CD_Bearer_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#name", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Name; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#in", Card = AasxPredefinedCardinality.ZeroToOne)] - public string In; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#authorization", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Authorization; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#alg", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Alg; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#format", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Format; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#OAuth2SecurityScheme")] - public class CD_Oauth2_sc - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#definesSecurityScheme", Card = AasxPredefinedCardinality.One)] - public string Scheme; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#token", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Token; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#refresh", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Refresh; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#authorization", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Authorization; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#scopes", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Scopes; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#flow", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Flow; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/security#proxy", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Proxy; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InteractionMetadata")] - public class CD_InteractionMetadata - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#PropertyAffordance", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_PropertiesAffordance Properties = null; - // public CD_Properties Properties = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#ActionAffordance", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Actions Actions = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#EventAffordance", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Events Events = null; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#PropertyAffordance")] - public class CD_PropertiesAffordance - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition", Card = AasxPredefinedCardinality.ZeroToMany)] - public List Property = new List(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition")] - public class CD_PropertyName - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/key", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Key; - - [AasConcept(Cd = "https://www.w3.org/1999/02/22-rdf-syntax-ns#type", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Type; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#title", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Title; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#isObservable", Card = AasxPredefinedCardinality.ZeroToOne)] - public bool? Observable; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#const", Card = AasxPredefinedCardinality.ZeroToOne)] - public int? Const; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#default", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Default; - - [AasConcept(Cd = "https://schema.org/unitCode", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Unit; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange", Card = AasxPredefinedCardinality.ZeroToOne)] - public AasClassMapperRange Min_max = null; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange", Card = AasxPredefinedCardinality.ZeroToOne)] - public AasClassMapperRange LengthRange = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#items", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Items Items = null; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/itemsRange", Card = AasxPredefinedCardinality.ZeroToOne)] - public AasClassMapperRange ItemsRange = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#properties", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Properties Properties = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#hasForm", Card = AasxPredefinedCardinality.One)] - public CD_Forms Forms = new CD_Forms(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#items")] - public class CD_Items - { - [AasConcept(Cd = "https://www.w3.org/1999/02/22-rdf-syntax-ns#type", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Type; - - [AasConcept(Cd = "https://schema.org/unitCode", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Unit; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#default", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Default; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#const", Card = AasxPredefinedCardinality.ZeroToOne)] - public int? Const; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#isObservable", Card = AasxPredefinedCardinality.ZeroToOne)] - public bool? Observable; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#title", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Title; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange", Card = AasxPredefinedCardinality.ZeroToOne)] - public AasClassMapperRange Min_max = null; - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/lengthRange", Card = AasxPredefinedCardinality.ZeroToOne)] - public AasClassMapperRange LengthRange = null; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#properties")] - public class CD_Properties - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/json-schema#propertyName", Card = AasxPredefinedCardinality.ZeroToMany)] - public List Property = new List(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#hasForm")] - public class CD_Forms - { - [AasConcept(Cd = "https://www.w3.org/2019/wot/hypermedia#hasTarget", Card = AasxPredefinedCardinality.One)] - public string Href; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/hypermedia#forContentType", Card = AasxPredefinedCardinality.ZeroToOne)] - public string ContentType; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#hasSecurityConfiguration", Card = AasxPredefinedCardinality.One)] - public CD_Security Security = new CD_Security(); - - [AasConcept(Cd = "https://www.w3.org/2011/http#methodName", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Htv_methodName; - - [AasConcept(Cd = "https://www.w3.org/2011/http#headers", Card = AasxPredefinedCardinality.ZeroToOne)] - public CD_Htv_headers Htv_headers = null; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/http#pollingTime", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Htv_pollingTime; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/http#timeout", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Htv_timeout; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasMostSignificantByte", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_mostSignificantByte = ""; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasMostSignificantWord", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_mostSignificantWord = ""; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasFunction", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_function; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasEntity", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_entity; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasZeroBasedAddressingFlag", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_zeroBasedAddressing; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasPollingTime", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_pollingTime; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasTimeout", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_timeout; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/modbus#hasPayloadDataType", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Modv_type; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/mqtt#hasRetainFlag", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Mqv_retain; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/mqtt#ControlPacket", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Mqv_controlPacket; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/mqtt#hasQoSFlag", Card = AasxPredefinedCardinality.ZeroToOne)] - public string Mqv_qos; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/opc-ua#pollingTime", Card = AasxPredefinedCardinality.ZeroToOne)] - public string OpcUa_pollingTime; - - [AasConcept(Cd = "https://www.w3.org/2019/wot/opc-ua#timeout", Card = AasxPredefinedCardinality.ZeroToOne)] - public string OpcUa_timeout; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2011/http#headers")] - public class CD_Htv_headers - { - [AasConcept(Cd = "https://www.w3.org/2011/http#headers", Card = AasxPredefinedCardinality.OneToMany)] - public List Htv_headers = new List(); - - [AasConcept(Cd = "https://www.w3.org/2011/http#fieldName", Card = AasxPredefinedCardinality.One)] - public string Htv_fieldName; - - [AasConcept(Cd = "https://www.w3.org/2011/http#fieldValue", Card = AasxPredefinedCardinality.One)] - public string Htv_fieldValue; - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#ActionAffordance")] - public class CD_Actions - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://www.w3.org/2019/wot/td#EventAffordance")] - public class CD_Events - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/ExternalDescriptor")] - public class CD_ExternalDescriptor - { - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel")] - public class CD_AssetInterfacesDescription - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface", Card = AasxPredefinedCardinality.ZeroToMany, - SupplSemId = "http://www.w3.org/2011/http")] - public List InterfaceHTTP = new List(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface", Card = AasxPredefinedCardinality.ZeroToMany, - SupplSemId = "http://www.w3.org/2011/modbus")] - public List InterfaceMODBUS = new List(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface", Card = AasxPredefinedCardinality.ZeroToMany, - SupplSemId = "http://www.w3.org/2011/mqtt")] - public List InterfaceMQTT = new List(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface", Card = AasxPredefinedCardinality.ZeroToMany, - SupplSemId = "http://www.w3.org/2011/opc-ua")] - public List InterfaceOPCUA = new List(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } -} - diff --git a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs b/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs deleted file mode 100644 index 9e85ec0d..00000000 --- a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG - -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). - -This source code was auto-generated by the AASX Package Explorer. -*/ - -using AasxIntegrationBase; -using AdminShellNS; -using Extensions; -using System; -using System.Collections.Generic; -using Aas = AasCore.Aas3_0; - -namespace AasxPredefinedConcepts.AssetInterfacesMappingConfiguration -{ - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingConfigurations")] - public class CD_MappingConfigurations - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingConfiguration", Card = AasxPredefinedCardinality.ZeroToMany)] - public List MappingConfigs = new List(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingConfiguration")] - public class CD_MappingConfiguration - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/InterfaceReference", Card = AasxPredefinedCardinality.One)] - public AasClassMapperHintedReference InterfaceReference = new AasClassMapperHintedReference(); - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingSourceSinkRelations", Card = AasxPredefinedCardinality.One)] - public CD_MappingSourceSinkRelations MappingSourceSinkRelations = new CD_MappingSourceSinkRelations(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingSourceSinkRelations")] - public class CD_MappingSourceSinkRelations - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingSourceSinkRelation", Card = AasxPredefinedCardinality.ZeroToMany)] - public List MapRels = new List(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } - - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/Submodel")] - public class CD_AssetInterfacesMappingConfiguration - { - [AasConcept(Cd = "https://admin-shell.io/idta/AssetInterfacesMappingConfiguration/1/0/MappingConfigurations", Card = AasxPredefinedCardinality.One)] - public CD_MappingConfigurations MappingConfigurations = new CD_MappingConfigurations(); - - // auto-generated informations - public AasClassMapperInfo __Info__ = null; - } -} - diff --git a/src/AasxPredefinedConcepts/PredefinedConceptsClassMapper.cs b/src/AasxPredefinedConcepts/PredefinedConceptsClassMapper.cs deleted file mode 100644 index 31ace41d..00000000 --- a/src/AasxPredefinedConcepts/PredefinedConceptsClassMapper.cs +++ /dev/null @@ -1,857 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasCore.Aas3_0; -using AasxIntegrationBase; -using AasxIntegrationBase.AasForms; -using AdminShellNS; -using Extensions; -using Namotion.Reflection; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.Intrinsics.X86; -using Aas = AasCore.Aas3_0; - -namespace AasxPredefinedConcepts -{ - /// - /// AAS cardinality for predefined concepts - /// - public enum AasxPredefinedCardinality { ZeroToOne = 0, One, ZeroToMany, OneToMany }; - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Class)] - public class AasConceptAttribute : Attribute - { - public string Cd { get; set; } - public string SupplSemId { get; set; } - - public AasxPredefinedCardinality Card { get; set; } - - public AasConceptAttribute() - { - } - } - - /// - /// This class is used in auto-generated files by AasxPredefinedConcepts.PredefinedConceptsClassMapper - /// - public class AasClassMapperRange - { - public T Min; - public T Max; - } - - /// - /// This class is used in auto-generated files by AasxPredefinedConcepts.PredefinedConceptsClassMapper - /// - public class AasClassMapperHintedReference - { - /// - /// The original reference. - /// - public Aas.IReference Value; - - /// - /// If possible, links directly to the target of the reference. - /// - public Aas.IReferable ValueHint; - - /// - /// This allows accessing the full AAS element. - /// - public AasClassMapperInfo __Info__ = null; - } - - /// - /// This class is used in auto-generated files by AasxPredefinedConcepts.PredefinedConceptsClassMapper - /// - public class AasClassMapperHintedRelation - { - /// - /// The original reference of the first reference. - /// - public Aas.IReference First; - - /// - /// If possible, links directly to the target of the first reference. - /// - public Aas.IReferable FirstHint; - - /// - /// The original reference of the first reference. - /// - public Aas.IReference Second; - - /// - /// If possible, links directly to the target of the second reference. - /// - public Aas.IReferable SecondHint; - - /// - /// This allows accessing the full AAS element. - /// - public AasClassMapperInfo __Info__ = null; - } - - /// - /// If this class is present in an mapped class, then (source) information will be added to the - /// data objects. - /// - public class AasClassMapperInfo - { - public Aas.IReferable Referable; - - public AasClassMapperInfo (Aas.IReferable rf = null) - { - Referable = rf; - } - } - - /// - /// This class provides methods to derive a set of C# class definitions from a SMT definition and - /// to create runtime instances from it based on a concrete SM. - /// - public class PredefinedConceptsClassMapper - { - // - // Export C# classes - // - - private static string CSharpTypeFrom(Aas.DataTypeDefXsd valueType) - { - switch (valueType) - { - case Aas.DataTypeDefXsd.Boolean: - return "bool"; - - case Aas.DataTypeDefXsd.Byte: - return "byte"; - - case Aas.DataTypeDefXsd.Date: - case Aas.DataTypeDefXsd.DateTime: - case Aas.DataTypeDefXsd.Time: - return "DateTime"; - - case Aas.DataTypeDefXsd.Float: - return "float"; - - case Aas.DataTypeDefXsd.Double: - return "double"; - - case Aas.DataTypeDefXsd.Int: - case Aas.DataTypeDefXsd.Integer: - return "int"; - - case Aas.DataTypeDefXsd.Long: - return "long"; - - case Aas.DataTypeDefXsd.NegativeInteger: - case Aas.DataTypeDefXsd.NonPositiveInteger: - return "int"; - - case Aas.DataTypeDefXsd.NonNegativeInteger: - case Aas.DataTypeDefXsd.PositiveInteger: - return "unsigned int"; - - case Aas.DataTypeDefXsd.Short: - return "short"; - - case Aas.DataTypeDefXsd.UnsignedByte: - return "unsigned byte"; - - case Aas.DataTypeDefXsd.UnsignedInt: - return "unsigned int"; - - case Aas.DataTypeDefXsd.UnsignedLong: - return "usingned long"; - - case Aas.DataTypeDefXsd.UnsignedShort: - return "unsigned short"; - } - - return "string"; - } - - private static void ExportCSharpMapperSingleItems( - string indent, Aas.Environment env, Aas.IReferable rf, System.IO.StreamWriter snippets, - bool noEmptyLineFirst = false) - { - // access - if (snippets == null || env == null || rf == null) - return; - - // - // require CD - // - - Aas.IConceptDescription cd = null; - if (rf is Aas.IHasSemantics ihs) - cd = env.FindConceptDescriptionByReference(ihs.SemanticId); - - var cdff = AdminShellUtil.FilterFriendlyName(cd?.IdShort, pascalCase: true); - - var cdRef = cd?.GetCdReference()?.ToStringExtended(format: 2); - - // - // pretty idShort - // - - var idsff = AdminShellUtil.FilterFriendlyName(rf.IdShort, pascalCase: true); - if (idsff.HasContent() != true) - return; - - // - // check Qualifiers/ Extensions - // - - FormMultiplicity card = FormMultiplicity.One; - if (rf is Aas.IQualifiable iqf) - { - var tst = AasFormUtils.GetCardinality(iqf.Qualifiers); - if (tst.HasValue) - card = tst.Value; - } - - var cardSt = card.ToString(); - - // - // lambda for attribute declaration - // - - Action declareLambda = (dt, isScalar, instance) => - { - // empty line ahead - if (!noEmptyLineFirst) - snippets.WriteLine(); - - // write attribute's attribute - if (cdRef?.HasContent() == true) - snippets.WriteLine($"{indent}[AasConcept(Cd = \"{cdRef}\", " + - $"Card = AasxPredefinedCardinality.{cardSt})]"); - - // write attribute itself - if (isScalar) - { - var nullOp = (dt == "string") ? "" : "?"; - - if (card == FormMultiplicity.ZeroToOne) - snippets.WriteLine($"{indent}public {dt}{nullOp} {instance};"); - else - if (card == FormMultiplicity.One) - snippets.WriteLine($"{indent}public {dt} {instance};"); - else - snippets.WriteLine($"{indent}public List<{dt}> {instance} = new List<{dt}>();"); - } - else - { - if (card == FormMultiplicity.ZeroToOne) - snippets.WriteLine($"{indent}public {dt} {instance} = null;"); - else - if (card == FormMultiplicity.One) - snippets.WriteLine($"{indent}public {dt} {instance} = new {dt}();"); - else - snippets.WriteLine($"{indent}public List<{dt}> {instance} = new List<{dt}>();"); - } - }; - - // - // Property - // - - if (rf is Aas.Property prop) - { - var dt = CSharpTypeFrom(prop.ValueType); - declareLambda(dt, true, idsff); - } - - // - // Range - // - - if (rf is Aas.Range rng) - { - var dt = CSharpTypeFrom(rng.ValueType); - declareLambda($"AasClassMapperRange<{dt}>", false, idsff); - } - - // - // MultiLanguageProperty - // - - if (rf is MultiLanguageProperty mlp) - { - declareLambda("List", false, idsff); - } - - // - // Reference - // - - if (rf is ReferenceElement rfe) - { - declareLambda("AasClassMapperHintedReference", false, idsff); - } - - // - // Relation - // - - if (rf is RelationshipElement rle) - { - declareLambda("AasClassMapperHintedRelation", false, idsff); - } - - // - // SMC, SML .. - // - - if (( rf is Aas.Submodel - || rf is Aas.SubmodelElementCollection - || rf is Aas.SubmodelElementList) - && cdRef?.HasContent() == true) - { - // in sequence: class first -#if do_not_do - snippets.WriteLine($"{indent}public class {cdff} {{"); - - foreach (var x in rf.DescendOnce()) - if (x is Aas.ISubmodelElement sme) - ExportCSharpMapper("" + indent + " ", env, sme, snippets); - - snippets.WriteLine($"{indent}}}"); -#endif - - declareLambda($"CD_{cdff}", false, idsff); - } - } - - /// - /// The contents of this class are based on one or multiple SMCs (SML..), however - /// the class itself is associated with the associated CD of the SMC (SML..), therefore - /// it is intended to aggregate member definitions. - /// Duplicate members are avoided. Members are found to be duplicate, if IdShort and - /// SemanticId are the same. - /// - private class ExportCSharpClassDef - { - /// - /// The respective SM, SMC, SML .. - /// - public Aas.IReferable Rf = null; - - /// - /// The associated CD. - /// - public Aas.IConceptDescription Cd = null; - - /// - /// Superset of representative memebers. - /// - public List Members = new List(); - - public ExportCSharpClassDef(Aas.Environment env, Aas.IReferable rf) - { - Rf = rf; - if (rf is Aas.IHasSemantics ihs) - Cd = env?.FindConceptDescriptionByReference(ihs.SemanticId); - - if (rf == null) - return; - - foreach (var x in rf.DescendOnce()) - if (x is Aas.ISubmodelElement sme) - Members.Add(sme); - } - - public void EnrichMembersFrom(ExportCSharpClassDef cld) - { - if (cld?.Members == null) - return; - - foreach (var x in cld.Members) - if (x is Aas.ISubmodelElement sme) - { - // check if member with same name and CD is already present - var found = false; - foreach (var em in Members) - if (em?.IdShort?.HasContent() == true - && em.IdShort == sme?.IdShort - && (em.SemanticId?.IsValid() != true - || em.SemanticId?.Matches(sme?.SemanticId, MatchMode.Relaxed) == true)) - found = true; - if (!found) - Members.Add(sme); - } - } - } - - private static void ExportCSharpMapperOnlyClasses( - string indent, Aas.Environment env, Aas.ISubmodel sm, System.IO.StreamWriter snippets, - bool addInfoObj = false) - { - // list of class definitions (not merged, yet) - var elems = new List(); - foreach (var sme in sm.SubmodelElements?.FindDeep((sme) => sme.IsStructured())) - elems.Add(new ExportCSharpClassDef(env, sme)); - - // list of merged class defs - var distElems = new List(); - foreach (var x in elems.GroupBy((cld) => cld.Cd)) - { - var l = x.ToList(); - for (int i = 1; i < l.Count; i++) - l[0].EnrichMembersFrom(l[i]); - distElems.Add(l[0]); - } - - // add Submodel at last, to be sure it is distinct - distElems.Add(new ExportCSharpClassDef(env, sm)); - // distElems.Reverse(); - - // try to output classed, do not recurse by itself - foreach (var cld in distElems) - { - // gather infos - var cdff = AdminShellUtil.FilterFriendlyName(cld.Cd?.IdShort, pascalCase: true); - var cdRef = cld?.Cd?.GetCdReference()?.ToStringExtended(format: 2); - - // no empty class - if (cdff?.HasContent() != true) - continue; - - // write out class - snippets.WriteLine(); - - if (cdRef?.HasContent() == true) - snippets.WriteLine($"{indent}[AasConcept(Cd = \"{cdRef}\")]"); - - snippets.WriteLine($"{indent}public class CD_{cdff}"); - snippets.WriteLine($"{indent}{{"); - - if (cdff == "MappingSourceSinkRelations") - { - ; - } - - if (cld.Members != null) - { - var noEmptyLineFirst = true; - foreach (var x in cld.Members) - if (x is Aas.ISubmodelElement sme) - { - ExportCSharpMapperSingleItems("" + indent + " ", env, sme, snippets, - noEmptyLineFirst: noEmptyLineFirst); - noEmptyLineFirst = false; - } - } - - if (addInfoObj) - { - snippets.WriteLine($""); - snippets.WriteLine($"{indent} // auto-generated informations"); - snippets.WriteLine($"{indent} public AasClassMapperInfo __Info__ = null;"); - } - - snippets.WriteLine($"{indent}}}"); - } - } - - public static void ExportCSharpClassDefs(Aas.Environment env, Aas.ISubmodel sm, System.IO.StreamWriter snippets) - { - // access - if (snippets == null || env == null || sm == null) - return; - - var head = AdminShellUtil.CleanHereStringWithNewlines( - @" - /* - Copyright (c) 2018-2023 Festo SE & Co. KG - - Author: Michael Hoffmeister - - This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - - This source code may use other Open Source software components (see LICENSE.txt). - - This source code was auto-generated by the AASX Package Explorer. - */ - - using AasxIntegrationBase; - using AdminShellNS; - using Extensions; - using System; - using System.Collections.Generic; - using Aas = AasCore.Aas3_0;"); - snippets.WriteLine(head); - snippets.WriteLine(""); - - snippets.WriteLine($"namespace AasxPredefinedConcepts.{AdminShellUtil.FilterFriendlyName(sm?.IdShort)} {{"); - - ExportCSharpMapperOnlyClasses(" ", env, sm, snippets, - addInfoObj: true); - - // ExportCSharpMapperSingleItems(" ", env, sm, snippets); - - snippets.WriteLine($"}}"); - } - - // - // Parse AASX structures - // - - private class ElemAttrInfo - { - public object Obj; - public FieldInfo Fi; - public AasConceptAttribute Attr; - } - - private static object CreateRangeObjectSpecific(Type genericType0, Aas.ISubmodelElement sme) - { - // access - if (genericType0 == null || sme == null || !(sme is Aas.IRange rng)) - return null; - - // create generic instance - // see: https://stackoverflow.com/questions/4194033/adding-items-to-listt-using-reflection - var objTyp = genericType0; - var IListRef = typeof(AasClassMapperRange<>); - Type[] IListParam = { objTyp }; - object rngObj = Activator.CreateInstance(IListRef.MakeGenericType(IListParam)); - - // set - var rngType = rngObj.GetType(); - AdminShellUtil.SetFieldLazyValue(rngType.GetField("Min"), rngObj, "" + rng.Min); - AdminShellUtil.SetFieldLazyValue(rngType.GetField("Max"), rngObj, "" + rng.Max); - - // ok - return rngObj; - } - - // TODO (MIHO, 2024-01-04): Move to AdminShellUtil .. - private static void SetFieldLazyFromSme(FieldInfo f, object obj, Aas.ISubmodelElement sme, - Func lambdaLookupReference = null) - { - // access - if (f == null || obj == null || sme == null) - return; - - // identify type - var t = AdminShellUtil.GetTypeOrUnderlyingType(f.FieldType); - - // - // Range - // - - if (t.IsGenericType - && t.GetGenericTypeDefinition() == typeof(AasClassMapperRange<>) - && t.GenericTypeArguments.Length >= 1 - && sme is Aas.IRange rng) - { - // create generic instance - var rngObj = CreateRangeObjectSpecific(t.GenericTypeArguments[0], sme); - - // set it - f.SetValue(obj, rngObj); - - // done - return; - } - - // - // Reference - // - - if (t == typeof(AasClassMapperHintedReference) - && sme is Aas.ReferenceElement rfe) - { - // create instance - var rfeObj = new AasClassMapperHintedReference() - { - Value = rfe.Value, - ValueHint = lambdaLookupReference?.Invoke(rfe.Value), - __Info__ = new AasClassMapperInfo(sme) - }; - - // set it - f.SetValue(obj, rfeObj); - - // done - return; - } - - // - // Relation - // - - if (t == typeof(AasClassMapperHintedRelation) - && sme is Aas.RelationshipElement rle) - { - // create instance - var rleObj = new AasClassMapperHintedRelation() - { - First = rle.First, - FirstHint = lambdaLookupReference?.Invoke(rle.First), - Second = rle.Second, - SecondHint = lambdaLookupReference?.Invoke(rle.Second), - __Info__ = new AasClassMapperInfo(sme) - }; - - // set it - f.SetValue(obj, rleObj); - - // done - return; - } - - // - // Default - // - - { - AdminShellUtil.SetFieldLazyValue(f, obj, sme.ValueAsText()); - } - } - - public static void AddToListLazySme(FieldInfo f, object obj, Aas.ISubmodelElement sme, - Func lambdaLookupReference = null) - { - // access - if (f == null || obj == null || sme == null) - return; - - // identify type - var t = AdminShellUtil.GetTypeOrUnderlyingType(f.FieldType); - var tGen = AdminShellUtil.GetTypeOrUnderlyingType(f.FieldType, resolveGeneric: true); - - // - // Range - // - - if (t.IsGenericType - && t.GetGenericTypeDefinition() == typeof(AasClassMapperRange<>) - && sme is Aas.IRange rng) - { - // create generic instance - var rngObj = CreateRangeObjectSpecific(t.GenericTypeArguments[0], sme); - - // add it - var listObj = f.GetValue(obj); - listObj.GetType().GetMethod("Add").Invoke(listObj, new[] { rngObj }); - - // ok - return; - } - - // - // Reference - // - - if (tGen == typeof(AasClassMapperHintedReference) - && sme is Aas.ReferenceElement rfe) - { - // create instance - var rfeObj = new AasClassMapperHintedReference() - { - Value = rfe.Value, - ValueHint = lambdaLookupReference?.Invoke(rfe.Value), - __Info__ = new AasClassMapperInfo(sme) - }; - - // add it - var listObj = f.GetValue(obj); - listObj.GetType().GetMethod("Add").Invoke(listObj, new[] { rfeObj }); - - // done - return; - } - - // - // Relation - // - - if (tGen == typeof(AasClassMapperHintedRelation) - && sme is Aas.RelationshipElement rle) - { - // create instance - var rleObj = new AasClassMapperHintedRelation() - { - First = rle.First, - FirstHint = lambdaLookupReference?.Invoke(rle.First), - Second = rle.Second, - SecondHint = lambdaLookupReference?.Invoke(rle.Second), - __Info__ = new AasClassMapperInfo(sme) - }; - - // add it - var listObj = f.GetValue(obj); - listObj.GetType().GetMethod("Add").Invoke(listObj, new[] { rleObj }); - - // done - return; - } - - // - // Default - // - - { - AdminShellUtil.AddToListLazyValue(obj, sme.ValueAsText()); - } - } - - private static void ParseAasElemFillData(ElemAttrInfo eai, Aas.ISubmodelElement sme, - Func lambdaLookupReference = null) - { - // access - if (eai?.Fi == null || eai.Attr == null || sme == null) - return; - - if (sme?.IdShort == "MapRel01") - { ; } - - // straight? - if (!sme.IsStructured()) - { - if (eai.Attr.Card == AasxPredefinedCardinality.One) - { - // scalar value - SetFieldLazyFromSme(eai.Fi, eai.Obj, sme, lambdaLookupReference); - } - else - if (eai.Attr.Card == AasxPredefinedCardinality.ZeroToOne) - { - // sure to have a nullable type - SetFieldLazyFromSme(eai.Fi, eai.Obj, sme, lambdaLookupReference); - } - else - if ((eai.Attr.Card == AasxPredefinedCardinality.ZeroToMany - || eai.Attr.Card == AasxPredefinedCardinality.OneToMany) - // && eai.Obj.GetType().IsGenericType - // && eai.Obj.GetType().GetGenericTypeDefinition() == typeof(List<>)) - && eai.Fi.FieldType.IsGenericType - && eai.Fi.FieldType.GetGenericTypeDefinition() == typeof(List<>)) - { - // sure to have a (instantiated) List - AddToListLazySme(eai.Fi, eai.Obj, sme, lambdaLookupReference); - } - } - else - { - if (eai.Attr.Card == AasxPredefinedCardinality.One) - { - // assume a already existing object - var childObj = eai.Fi.GetValue(eai.Obj); - - // recurse to fill in - ParseAasElemsToObject(sme, childObj, lambdaLookupReference); - } - else - if (eai.Attr.Card == AasxPredefinedCardinality.ZeroToOne) - { - // get value first, shall not be present - var childObj = eai.Fi.GetValue(eai.Obj); - if (childObj != null) - throw new Exception( - $"ParseAasElemFillData: [0..1] instance for {eai.Fi.FieldType.Name}> already present!"); - - // ok, make new, add - childObj = Activator.CreateInstance(eai.Fi.FieldType); - eai.Fi.SetValue(eai.Obj, childObj); - - // recurse to fill in - ParseAasElemsToObject(sme, childObj, lambdaLookupReference); - } - else - if ((eai.Attr.Card == AasxPredefinedCardinality.ZeroToMany - || eai.Attr.Card == AasxPredefinedCardinality.OneToMany) - && eai.Fi.FieldType.IsGenericType - && eai.Fi.FieldType.GetGenericTypeDefinition() == typeof(List<>) - && eai.Fi.FieldType.GenericTypeArguments.Length > 0 - && eai.Fi.FieldType.GenericTypeArguments[0] != null) - { - // create a new object instance - var childObj = Activator.CreateInstance(eai.Fi.FieldType.GenericTypeArguments[0]); - - // add to list - var listObj = eai.Fi.GetValue(eai.Obj); - listObj.GetType().GetMethod("Add").Invoke(listObj, new [] { childObj }); - - // recurse to fill in - ParseAasElemsToObject(sme, childObj, lambdaLookupReference); - } - - // recurse - - } - } - - /// - /// Parse information from the AAS elements (within) root to the - /// attributed class referenced by obj. Reflection dictates the - /// recursion into sub-classes. - /// - public static void ParseAasElemsToObject(Aas.IReferable root, object obj, - Func lambdaLookupReference = null) - { - // access - if (root == null || obj == null) - return; - - // collect information driven by reflection - var eais = new List(); - - // find fields for this object - var t = obj.GetType(); - var l = t.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - foreach (var f in l) - { - // special case - if (f.FieldType == typeof(AasClassMapperInfo)) - { - var info = new AasClassMapperInfo() { Referable = root }; - f.SetValue(obj, info); - continue; - } - - // store for a bit later processing - var a = f.GetCustomAttribute(); - if (a != null) - { - eais.Add(new ElemAttrInfo() { Obj = obj, Fi = f, Attr = a }); - } - } - - // now try to fill information - foreach (var eai in eais) - { - // try find sme in Rf - foreach (var x in root.DescendOnce()) - if (x is Aas.ISubmodelElement sme) - { - var hit = sme?.SemanticId?.MatchesExactlyOneKey( - new Aas.Key(Aas.KeyTypes.GlobalReference, eai?.Attr?.Cd), - matchMode: MatchMode.Relaxed) == true; - - if (hit && eai?.Attr?.SupplSemId?.HasContent() == true) - hit = hit && sme?.SupplementalSemanticIds?.MatchesAnyWithExactlyOneKey( - new Aas.Key(Aas.KeyTypes.GlobalReference, eai?.Attr?.SupplSemId), - matchMode: MatchMode.Relaxed) == true; - - if (hit) - ParseAasElemFillData(eai, sme, lambdaLookupReference); - } - - } - } - } -} \ No newline at end of file