App.vue 1.7 KB

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