Skip to content
Snippets Groups Projects

Update to DCC Schema V3.2

Files

+ 49
24
@@ -2,7 +2,7 @@ import * as si from "./DSI";
import { XMLDate, XMLElement, XMLNumber, XMLBoolean, XMLList, INamespaced, ISchemaInformation, IAttributes } from "./BaseTypes";
import { ensureArray } from "./Util";
const schemaVersion = "3.1.2";
const schemaVersion = "3.2.0";
const namespace = "dcc";
const namespaceUrl = `https://ptb.de/${namespace}`;
const schemaLocation = `${namespaceUrl}/v${schemaVersion}/dcc.xsd`;
@@ -73,15 +73,17 @@ export class DigitalCalibrationCertificateType extends DCCXMLElement {
administrativeData: AdministrativeDataType;
measurementResults: MeasurementResultListType;
comment?: DCCXMLElement;
comment?: Comment;
document?: ByteDataType;
"ds:Signature"?: any;
constructor(el: Partial<DigitalCalibrationCertificateType> = {}) {
super(el);
this.administrativeData = new AdministrativeDataType(el.administrativeData);
this.measurementResults = new MeasurementResultListType(el.measurementResults);
if (el.comment) this.comment = new DCCXMLElement(el.comment);
if (el.comment) this.comment = new Comment(el.comment);
if (el.document) this.document = new ByteDataType(el.document);
if (el["ds:Signature"]) this["ds:Signature"] = el["ds:Signature"];
}
}
@@ -157,7 +159,7 @@ export class MeasurementResultListType extends DCCXMLElement {
/** The byteDataType defines a type which allows to add binary encoded files to the measurement result
* section. */
export class ByteDataType extends DCCXMLElement {
_attr: IIdAttributes;
_attr: IIdAndRefIdAndRefTypeAttributes;
name?: TextType;
description?: RichContentType;
@@ -227,7 +229,7 @@ export class PerformanceLocationType extends DCCXMLElement {
* Contains one or more item elements. */
export class ItemListType extends DCCXMLElement {
name?: TextType;
equipmentClass?: EquipmentClassType;
equipmentClass?: EquipmentClassType[];
description?: RichContentType;
owner?: ContactType;
identifications?: IdentificationListType;
@@ -236,7 +238,7 @@ export class ItemListType extends DCCXMLElement {
constructor(el: Partial<ItemListType> = {}) {
super(el);
if (el.name) this.name = new TextType(el.name);
if (el.equipmentClass) this.equipmentClass = new EquipmentClassType(el.equipmentClass);
if (el.equipmentClass) this.equipmentClass = ensureArray(el.equipmentClass).map((x) => new EquipmentClassType(x));
if (el.description) this.description = new RichContentType(el.description);
if (el.owner) this.owner = new ContactType(el.owner);
if (el.identifications) this.identifications = new IdentificationListType(el.identifications);
@@ -417,7 +419,7 @@ export class RichContentType extends DCCXMLElement {
/** List of measuring equipment and instruments */
export class MeasuringEquipmentListType extends DCCXMLElement {
name?: TextType;
equipmentClass?: EquipmentClassType;
equipmentClass?: EquipmentClassType[];
description?: RichContentType;
owner?: ContactType;
identifications?: IdentificationListType;
@@ -426,7 +428,7 @@ export class MeasuringEquipmentListType extends DCCXMLElement {
constructor(el: Partial<MeasuringEquipmentListType> = {}) {
super(el);
if (el.name) this.name = new TextType(el.name);
if (el.equipmentClass) this.equipmentClass = new EquipmentClassType(el.equipmentClass);
if (el.equipmentClass) this.equipmentClass = ensureArray(el.equipmentClass).map((x) => new EquipmentClassType(x));
if (el.description) this.description = new RichContentType(el.description);
if (el.owner) this.owner = new ContactType(el.owner);
if (el.identifications) this.identifications = new IdentificationListType(el.identifications);
@@ -436,7 +438,7 @@ export class MeasuringEquipmentListType extends DCCXMLElement {
/** Clear name(s) of the item(s) and identifier(s). */
export class EquipmentClassType extends DCCXMLElement {
_attr: IIdAttributes;
_attr: IIdAndRefTypeAttributes;
reference: DCCXMLElement;
classID: DCCXMLElement;
@@ -463,7 +465,7 @@ export class MeasuringEquipmentType extends DCCXMLElement {
_attr: IIdAndRefTypeAttributes;
name: TextType;
equipmentClass?: EquipmentClassType;
equipmentClass?: EquipmentClassType[];
description?: RichContentType;
certificate?: HashType;
manufacturer?: ContactNotStrictType;
@@ -474,7 +476,7 @@ export class MeasuringEquipmentType extends DCCXMLElement {
constructor(el: Partial<MeasuringEquipmentType> = {}) {
super(el);
this.name = new TextType(el.name);
if (el.equipmentClass) this.equipmentClass = new EquipmentClassType(el.equipmentClass);
if (el.equipmentClass) this.equipmentClass = ensureArray(el.equipmentClass).map((x) => new EquipmentClassType(x));
if (el.description) this.description = new RichContentType(el.description);
if (el.certificate) this.certificate = new HashType(el.certificate);
if (el.manufacturer) this.manufacturer = new ContactNotStrictType(el.manufacturer);
@@ -485,7 +487,7 @@ export class MeasuringEquipmentType extends DCCXMLElement {
}
export class HashType extends DCCXMLElement {
_attr: IIdAttributes;
_attr: IIdAndRefTypeAttributes;
referral: TextType;
referralID: DCCXMLElement;
@@ -548,6 +550,7 @@ export class PrimitiveQuantityType extends DCCXMLElement {
// region choice
noQuantity?: RichContentType;
charsXMLList?: DCCXMLList;
/** Metadata element definition for a real measurement quantity.
*
* The following statements of a real quantity are possible.
@@ -690,6 +693,7 @@ export class PrimitiveQuantityType extends DCCXMLElement {
// choice
if (el.noQuantity) this.noQuantity = new RichContentType(el.noQuantity);
else if (el.charsXMLList) this.charsXMLList = new DCCXMLList(el.charsXMLList);
else if (el.real) this.real = new si.RealQuantityType(el.real);
else if (el.hybrid) this.hybrid = new si.HybridType(el.hybrid);
else if (el.complex) this.complex = new si.ComplexQuantityType(el.complex);
@@ -700,10 +704,10 @@ export class PrimitiveQuantityType extends DCCXMLElement {
/** A item that is calibrated in this DCC. */
export class ItemType extends DCCXMLElement {
_attr: IIdAttributes;
_attr: IIdAndRefTypeAttributes;
name: TextType;
equipmentClass?: EquipmentClassType;
equipmentClass?: EquipmentClassType[];
description?: RichContentType;
installedSoftwares?: SoftwareListType;
manufacturer: ContactNotStrictType;
@@ -714,7 +718,7 @@ export class ItemType extends DCCXMLElement {
constructor(el: Partial<ItemType> = {}) {
super(el);
this.name = new TextType(el.name);
if (el.equipmentClass) this.equipmentClass = new EquipmentClassType(el.equipmentClass);
if (el.equipmentClass) this.equipmentClass = ensureArray(el.equipmentClass).map((x) => new EquipmentClassType(x));
if (el.description) this.description = new RichContentType(el.description);
if (el.installedSoftwares) this.installedSoftwares = new SoftwareListType(el.installedSoftwares);
this.manufacturer = new ContactNotStrictType(el.manufacturer);
@@ -752,7 +756,7 @@ export class IdentificationType extends DCCXMLElement {
/** A person responsible for a DCC. */
export class RespPersonType extends DCCXMLElement {
_attr: IIdAttributes;
_attr: IIdAndRefTypeAttributes;
person: ContactNotStrictType;
description?: RichContentType;
@@ -777,6 +781,8 @@ export class RespPersonType extends DCCXMLElement {
export class StatementMetaDataType extends DCCXMLElement {
_attr: IIdAndRefIdAndRefTypeAttributes;
name?: TextType;
description?: RichContentType;
countryCodeISO3166_1?: DCCXMLElement[];
convention?: DCCXMLElement;
traceable?: DCCXMLBoolean;
@@ -805,6 +811,8 @@ export class StatementMetaDataType extends DCCXMLElement {
constructor(el: Partial<StatementMetaDataType> = {}) {
super(el);
if (el.name) this.name = new TextType(el.name);
if (el.description) this.description = new RichContentType(el.description);
if (el.countryCodeISO3166_1) this.countryCodeISO3166_1 = ensureArray(el.countryCodeISO3166_1).map((x) => new DCCXMLElement(x));
if (el.convention) this.convention = new DCCXMLElement(el.convention);
if (el.traceable) this.traceable = new DCCXMLBoolean(el.traceable);
@@ -1218,7 +1226,6 @@ export class ListType extends DCCXMLElement {
// region choice
list?: ListType[];
quantity?: QuantityType[];
// endregion choice
constructor(el: Partial<ListType> = {}) {
@@ -1231,9 +1238,9 @@ export class ListType extends DCCXMLElement {
if (el.dateTime) this.dateTime = new DCCXMLDate(el.dateTime);
else if (el.dateTimeXMLList) this.dateTimeXMLList = new DCCXMLList(el.dateTimeXMLList);
// choice
// choice but maxOccurs = unbounded
if (el.list) this.list = ensureArray(el.list).map((x) => new ListType(x));
else if (el.quantity) this.quantity = ensureArray(el.quantity).map((x) => new QuantityType(x));
if (el.quantity) this.quantity = ensureArray(el.quantity).map((x) => new QuantityType(x));
if (el.usedMethods) this.usedMethods = new UsedMethodListType(el.usedMethods);
if (el.usedSoftware) this.usedSoftware = new SoftwareListType(el.usedSoftware);
@@ -1245,17 +1252,28 @@ export class ListType extends DCCXMLElement {
export class RelativeUncertaintyType extends DCCXMLElement {
// region choice
relativeUncertaintyXmlList?: si.RealListXMLListType;
relativeUncertaintySingle?: si.RealQuantityType;
relativeUncertaintyXmlList?: RelativeUncertaintyXmlList;
relativeUncertaintySingle?: RelativeUncertaintySingle;
// endregion choice
constructor(el: Partial<RelativeUncertaintyType> = {}) {
super(el);
// choice
if (el.relativeUncertaintyXmlList) this.relativeUncertaintyXmlList = new si.RealListXMLListType(el.relativeUncertaintyXmlList);
else if (el.relativeUncertaintySingle) this.relativeUncertaintySingle = new si.RealQuantityType(el.relativeUncertaintySingle);
if (el.relativeUncertaintyXmlList) this.relativeUncertaintyXmlList = new RelativeUncertaintyXmlList(el.relativeUncertaintyXmlList);
else if (el.relativeUncertaintySingle) this.relativeUncertaintySingle = new RelativeUncertaintySingle(el.relativeUncertaintySingle);
}
}
export class RelativeUncertaintyXmlList extends si.RealListXMLListType {
get ns(): string {
return DCC.namespace;
}
}
export class RelativeUncertaintySingle extends si.RealQuantityType {
get ns(): string {
return DCC.namespace;
}
}
@@ -1317,3 +1335,10 @@ export class PositionCoordinatesType extends DCCXMLElement {
if (el.positionCoordinate3) this.positionCoordinate3 = new si.RealQuantityType(el.positionCoordinate3);
}
}
export class Comment extends DCCXMLElement {
constructor(el: Partial<Comment | any>) {
super(el);
Object.assign(this, el);
}
}
Loading