Browse Source

fix warnings lint

dstrutzenberger 2 months ago
parent
commit
17d656874d

+ 3 - 19
src/components/TheDynamics.vue

@@ -4,14 +4,11 @@ import { computed, ref } from 'vue';
 import { UABaseNode } from '@/ua/UABaseNode';
 import { ReferenceTypeIds } from '@/ua/opcua_node_ids';
 import type { UAReferenceType } from '@/ua/UAReferenceType';
-import { ObjectTypeIds } from '@/ua/opcua_node_ids';
 import type { UAObjectType } from '@/ua/UAObjectType';
-import { VariableTypeIds } from '@/ua/opcua_node_ids';
 import type { UAVariableType } from '@/ua/UAVariableType';
-import { UAReference } from '@/ua/UAReference';
 import { UAObject } from '@/ua/UAObject';
 import { UAVariable } from '@/ua/UAVariable';
-import { DynamicNode, ComponentPair} from '@/ua/DynamicNode';
+import { DynamicNode} from '@/ua/DynamicNode';
 import { storeToRefs } from 'pinia';
 const store = useStore();
 
@@ -40,15 +37,6 @@ let opt = {
 let dynNode = new DynamicNode(opt);
 
 
-
-function filter(fnode: UABaseNode) {
-  if(selectedNode.value?.nodeClass==="Variable") {
-    if(fnode.nodeClass!="Object")
-      return true;
-  }
-  return false;
-}
-
 function getRefTypes():UABaseNode[] {
   let list=(store.addressSpace?.getSubTreeAsList("ns=0;i="+ReferenceTypeIds.HierarchicalReferences)||[]) as UAReferenceType[];
   list=list.filter((node) => node.isAbstract==false)
@@ -99,10 +87,8 @@ function getInstanceDecl(nid="ns=0;i=84"){
         mr = i.getModellingRule()||"";
       }
       if(mr == "Mandatory"){
-        const newItem = new ComponentPair(item.toNode.displayName , true);
         res_man.push(item.toNode.displayName);
       }else{
-        const newItem = new ComponentPair(item.toNode.displayName , false);
         res_opt.push(item.toNode.displayName);
       }
       dynNode.mandatory = res_man;
@@ -173,8 +159,6 @@ async function createDynamic() {
 
 
 const checked = ref("")
-const c_man = ref([])
-const c_opt = ref([])
 const typedef = ref("")
 
 
@@ -260,7 +244,7 @@ const typedef = ref("")
         </div>
         <div class="input-group mb-3">
           <ul class="no-bullets"><b>Mandatory Components</b>
-            <li v-for="item of getComponents(typedef).mandatory">
+            <li v-for="item of getComponents(typedef).mandatory" v-bind:key = item>
               <input type="checkbox" id="checkbox-digg-{{ item }}" :checked="true" :disabled="true">
               <label for="checkbox-digg-{{ item}}">{{ item}}</label>
             </li>
@@ -268,7 +252,7 @@ const typedef = ref("")
         </div>
         <div>
           <ul class="no-bullets"><b>Optional Components</b>
-            <li v-for="(item1,index) of getComponents(typedef).optionals" :key="typedef">
+            <li v-for="(item1,index) of getComponents(typedef).optionals" v-bind:key = item1>
               <input type="checkbox" id="checkbox-digg-{{ item1 }}" v-model="dynNode.o_check![index]" :value="item1" :checked="dynNode.o_check![index]">
               <label for="checkbox-digg-{{ item1 }}">{{ item1 }}</label>
             </li>

+ 2 - 2
src/components/TheModeler.vue

@@ -8,7 +8,7 @@ function selectNode(node: UABaseNode) {
   store.selectedNode=node;
 }
 
-function filter(node: UABaseNode) {
+function filter() {
   return false;
 }
 
@@ -24,7 +24,7 @@ function filter(node: UABaseNode) {
           v-if="store.rootNode!=null" 
           :model="store.rootNode" 
           @select-node="(node) => selectNode(node)" 
-          :filter-func="(node:UABaseNode) => filter(node)">
+          :filter-func="(node:UABaseNode) => filter()">
         </TreeItem>
       </ul>
     </p>

+ 2 - 2
src/components/TheParent.vue

@@ -13,7 +13,7 @@ const node = computed(() => {
 
 });
 
-function clickNode(clickedNode: UABaseNode) {
+function clickNode() {
   //TODO: replace parent references
   // node.value?.setParent(clickedNode, store.addressSpace?.findNode("ns=0;i="+ ReferenceTypeIds.HierarchicalReferences));
   parentDialogOpen.value=false;
@@ -67,7 +67,7 @@ function getRefTypes():UABaseNode[] {
     :open="parentDialogOpen" 
     :filter-func="(node: UABaseNode) => filter(node)"
     @cancel="parentDialogOpen = false" 
-    @select-node="(node) => clickNode(node)">
+    @select-node="(node) => clickNode()">
   </TheTreeDialog>
 </template>
 

+ 2 - 2
src/ua/UABaseNode.ts

@@ -62,9 +62,9 @@ export class UABaseNode implements IToXML{
         return null;
     }
 
-    setParent(node: UABaseNode, refType: String) {
+    //setParent(node: UABaseNode, refType: String) {
         
-    }
+    //}
 
     getParentRef(): UAReference|null{
         for(const ref of this.references) {

+ 0 - 2
src/ua/UAObjectType.ts

@@ -1,8 +1,6 @@
 import { XMLElem } from "@/util/XmlElem";
 import type { NamespaceTable } from "./NameSpaceTable";
 import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
-import type { UAObject } from "./UAObject";
-import type { UAVariable } from "./UAVariable";
 
 
 

+ 0 - 3
src/ua/UAVariableType.ts

@@ -1,9 +1,6 @@
 import { XMLElem } from "@/util/XmlElem";
 import type { NamespaceTable } from "./NameSpaceTable";
 import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
-import {DynamicNode, ComponentPair} from "./DynamicNode";
-import { aggregates } from '@/util/aggregates'
-import { UAVariable } from "./UAVariable";
 
 export class UAVariableType extends UABaseNode{
     public isAbstract: boolean;

+ 2 - 2
src/util/sconfig.ts

@@ -31,7 +31,7 @@ export class ServerConfig {
 
 
     addDynamic(dyn:DynamicNode){
-        this.dynamics?.forEach((dyn, idx)=>{
+        this.dynamics?.forEach((dyn)=>{
             if(dyn.ident == dyn.ident){
                 return false;
             }
@@ -51,7 +51,7 @@ export class ServerConfig {
     }
 
     toPlainObject(){
-        let obj = {
+        const obj = {
             manufacturerName: this.manufacturerName,
             productName: this.productName,
             softwareVersion: this.softwareVersion,