App.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script setup lang="ts">
  2. import TheModeler from './components/TheModeler.vue'
  3. import TheDetail from './components/TheDetail.vue'
  4. import TheParent from './components/TheParent.vue'
  5. import TheEditor from './components/TheEditor.vue'
  6. import TheDynamics from './components/TheDynamics.vue'
  7. import { ServerConfig } from '@/util/sconfig'
  8. import TheModels from './components/TheModels.vue'
  9. import { useStore } from './util/store';
  10. import { AddressSpace } from './ua/AddressSpace';
  11. import { assert } from './util/assert';
  12. async function load(): Promise<AddressSpace> {
  13. const files=['nodesets/Opc.Ua.NodeSet2.xml',
  14. 'nodesets/Opc.Ua.Di.NodeSet2.xml',
  15. 'nodesets/Opc.Ua.Ia.NodeSet2.xml',
  16. 'nodesets/Opc.Ua.Machinery.NodeSet2.xml',
  17. 'nodesets/Opc.Ua.MachineTool.Nodeset2.xml',
  18. 'nodesets/emco_machine_tools.xml']
  19. const as=await AddressSpace.load(files);
  20. return as;
  21. }
  22. const loadData = async () => {
  23. const store = useStore();
  24. store.sConfig = new ServerConfig();
  25. store.addressSpace=await load();
  26. assert(store.addressSpace)
  27. const rootNode=store.addressSpace.findNode("ns=0;i=84");
  28. assert(rootNode)
  29. store.rootNode=rootNode;
  30. }
  31. loadData();
  32. </script>
  33. <template>
  34. <div class="container text-left">
  35. <div class="row align-items-start">
  36. <div class="col col-6">
  37. <TheModels />
  38. <TheModeler />
  39. </div>
  40. <div class="col col-6">
  41. <TheParent />
  42. <TheDetail />
  43. <TheEditor />
  44. <TheDynamics />
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <style>
  50. </style>