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