|
@@ -2,6 +2,7 @@ import {XMLParser, type X2jOptions} from 'fast-xml-parser';
|
|
import { UAObject } from './UAObject';
|
|
import { UAObject } from './UAObject';
|
|
import type { UABaseNode } from './UABaseNode';
|
|
import type { UABaseNode } from './UABaseNode';
|
|
import { UAVariable } from './UAVariable';
|
|
import { UAVariable } from './UAVariable';
|
|
|
|
+import { UAMethod } from './UAMethod';
|
|
import { NamespaceTable } from './NameSpaceTable';
|
|
import { NamespaceTable } from './NameSpaceTable';
|
|
import { Model } from './Model';
|
|
import { Model } from './Model';
|
|
import { XMLElem, type IToXML } from '@/util/XmlElem';
|
|
import { XMLElem, type IToXML } from '@/util/XmlElem';
|
|
@@ -9,6 +10,7 @@ import { XMLElem, type IToXML } from '@/util/XmlElem';
|
|
export class UANodeSet implements IToXML{
|
|
export class UANodeSet implements IToXML{
|
|
|
|
|
|
constructor(public fileName: string,
|
|
constructor(public fileName: string,
|
|
|
|
+ public uri: string,
|
|
public models: Model[],
|
|
public models: Model[],
|
|
public nodes: UABaseNode[],
|
|
public nodes: UABaseNode[],
|
|
public nameSpaceTable: NamespaceTable) {
|
|
public nameSpaceTable: NamespaceTable) {
|
|
@@ -59,6 +61,7 @@ export class UANodeSet implements IToXML{
|
|
case 'UANodeSet.UAObject.References.Reference':
|
|
case 'UANodeSet.UAObject.References.Reference':
|
|
case 'UANodeSet.UAObject':
|
|
case 'UANodeSet.UAObject':
|
|
case 'UANodeSet.UAVariable':
|
|
case 'UANodeSet.UAVariable':
|
|
|
|
+ case 'UANodeSet.UAMethod':
|
|
case 'UANodeSet.UAVariable.References.Reference':
|
|
case 'UANodeSet.UAVariable.References.Reference':
|
|
case 'UANodeSet.Models.Model':
|
|
case 'UANodeSet.Models.Model':
|
|
return true;
|
|
return true;
|
|
@@ -74,6 +77,7 @@ export class UANodeSet implements IToXML{
|
|
for(const xmlModel of xmlModels.Model) {
|
|
for(const xmlModel of xmlModels.Model) {
|
|
models.push(Model.fromXML(xmlModel));
|
|
models.push(Model.fromXML(xmlModel));
|
|
}
|
|
}
|
|
|
|
+ let uri = "xxx";
|
|
const nodes:UABaseNode[]=[];
|
|
const nodes:UABaseNode[]=[];
|
|
const xmlObjects=xmlObj['UANodeSet']['UAObject'];
|
|
const xmlObjects=xmlObj['UANodeSet']['UAObject'];
|
|
for(const xmlObject of xmlObjects) {
|
|
for(const xmlObject of xmlObjects) {
|
|
@@ -83,6 +87,10 @@ export class UANodeSet implements IToXML{
|
|
for(const xmlVariable of xmlVariables) {
|
|
for(const xmlVariable of xmlVariables) {
|
|
nodes.push(UAVariable.fromXML(xmlVariable));
|
|
nodes.push(UAVariable.fromXML(xmlVariable));
|
|
}
|
|
}
|
|
|
|
+ const xmlMethods=xmlObj['UANodeSet']['UAMethod'];
|
|
|
|
+ for(const xmlMethod of xmlMethods) {
|
|
|
|
+ nodes.push(UAMethod.fromXML(xmlMethod));
|
|
|
|
+ }
|
|
const uaNamespaceUris=xmlObj['UANodeSet']['NamespaceUris'];
|
|
const uaNamespaceUris=xmlObj['UANodeSet']['NamespaceUris'];
|
|
const nst=new NamespaceTable();
|
|
const nst=new NamespaceTable();
|
|
if(uaNamespaceUris) {
|
|
if(uaNamespaceUris) {
|
|
@@ -90,6 +98,6 @@ export class UANodeSet implements IToXML{
|
|
nst.addUri(nsUri['#text'])
|
|
nst.addUri(nsUri['#text'])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return new UANodeSet(fileName, models, nodes, nst);
|
|
|
|
|
|
+ return new UANodeSet(fileName, uri, models, nodes, nst);
|
|
}
|
|
}
|
|
}
|
|
}
|