blob: d4369ff3863a397805464215e7665e4ead6cb173 [file] [log] [blame]
Constantin Ziesche857c7ab2020-02-25 11:24:51 +01001/*******************************************************************************
2* Copyright (c) 2020 Robert Bosch GmbH
3* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
4*
5* This program and the accompanying materials are made available under the
6* terms of the Eclipse Public License 2.0 which is available at
7* http://www.eclipse.org/legal/epl-2.0
8*
9* SPDX-License-Identifier: EPL-2.0
10*******************************************************************************/
11using BaSyx.Models.Core.Common;
12using Newtonsoft.Json;
13using System.Xml.Serialization;
14
15namespace BaSyx.Models.Export.EnvironmentDataSpecifications
16{
17 [XmlType("dataSpecificationIEC61360", Namespace = AssetAdministrationShellEnvironment_V1_0.IEC61360_NAMESPACE)]
18 public class EnvironmentDataSpecificationIEC61360_V1_0
19 {
20 [JsonProperty("preferredName")]
21 [XmlArray("preferredName")]
22 [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
23 public LangStringSet PreferredName { get; set; }
24
25 [JsonProperty("shortName")]
26 [XmlElement("shortName")]
27 public string ShortName { get; set; }
28
29 [JsonProperty("unit")]
30 [XmlElement("unit")]
31 public string Unit { get; set; }
32
33 [JsonProperty("unitId")]
34 [XmlElement("unitId")]
35 public EnvironmentReference_V1_0 UnitId { get; set; }
36
37 [JsonProperty("valueFormat")]
38 [XmlElement("valueFormat")]
39 public string ValueFormat { get; set; }
40
41 [JsonProperty("sourceOfDefinition")]
42 [XmlArray("sourceOfDefinition")]
43 [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
44 public LangStringSet SourceOfDefinition { get; set; }
45
46 [JsonProperty("symbol")]
47 [XmlElement("symbol")]
48 public string Symbol { get; set; }
49
50 [JsonProperty("dataType")]
51 [XmlElement("dataType")]
52 public string DataType { get; set; }
53
54 [JsonProperty("definition")]
55 [XmlArray("definition")]
56 [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
57 public LangStringSet Definition { get; set; }
Constantin Ziesche02817f12020-08-04 21:40:43 +020058
59 public bool ShouldSerializeSourceOfDefinition()
60 {
61 if (SourceOfDefinition == null || SourceOfDefinition.Count == 0)
62 return false;
63 else
64 return true;
65 }
66
67 public bool ShouldSerializeDefinition()
68 {
69 if (Definition == null || Definition.Count == 0)
70 return false;
71 else
72 return true;
73 }
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010074 }
75}