DynamicNode.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. export class DynamicNode {
  2. public ident: string;
  3. public namespaceUri: string;
  4. public parentNodeId : string;
  5. public checkInterval :number;
  6. public nodeClass : string;
  7. public typeNodeId : string;
  8. public name : string;
  9. public startIndex:number;
  10. public mandatory: string[]=[];
  11. public optionals?: string[]=[];
  12. public o_check?: boolean[]=[];
  13. public nodeVersionId?: string;
  14. constructor(options: DynamicNodeOptions) {
  15. this.ident = options.ident;
  16. this.namespaceUri = options.namespaceUri;
  17. this.parentNodeId = options.parentNodeId;
  18. this.checkInterval = options.checkInterval;
  19. this.nodeClass = options.nodeClass;
  20. this.typeNodeId = options.typeNodeId;
  21. this.name = options.name;
  22. this.startIndex = options.startIndex;
  23. }
  24. toPlainObject():any{
  25. return {
  26. ident: this.ident,
  27. namespaceUri: this.namespaceUri,
  28. parentNodeId : this.parentNodeId,
  29. checkInterval : this.checkInterval,
  30. nodeClass : this.nodeClass,
  31. typeNodeId : this.typeNodeId,
  32. name : this.name,
  33. startIndex: this.startIndex,
  34. mandatory: this.mandatory,
  35. optionals: this.optionals,
  36. nodeVersionId: this.nodeVersionId
  37. }
  38. }
  39. }
  40. export class ComponentPair{
  41. public name: string;
  42. public flag: boolean;
  43. constructor(name = "MyName", flag = false){
  44. this.name = name;
  45. this.flag = flag;
  46. }
  47. }
  48. export interface DynamicNodeOptions {
  49. ident:string;
  50. namespaceUri:string;
  51. parentNodeId:string;
  52. checkInterval:number;
  53. nodeClass:string;
  54. typeNodeId:string;
  55. name:string;
  56. startIndex:number;
  57. }