瀏覽代碼

频谱仪数据。

jiaxiaoqiang 3 月之前
父節點
當前提交
86e64587e2

+ 12 - 4
src/views/modules/project-config/com/function-col.vue

@@ -16,16 +16,20 @@ const handleChange = (val: any) => {
 };
 
 const test = (data) => {
-  console.log("test", data);
+  console.log("test", data?.data?.information?.properties);
 };
 </script>
 
 <template>
   <div class="function-col">
     <TitleHeader> 添加功能模块</TitleHeader>
-    <el-collapse v-model="activeNames" @change="handleChange">
+    <el-collapse
+      v-model="activeNames"
+      @change="handleChange"
+      class="collapse-container"
+    >
       <el-collapse-item
-        name="1"
+        :name="funType.name"
         v-for="(funType, index) in propertyData"
         :key="funType.id"
         :title="funType.name"
@@ -53,12 +57,16 @@ const test = (data) => {
   height: calc(100vh - $main-header-height);
   background-color: $hj-black-2;
 }
+.collapse-container {
+  height: calc(100vh - $main-header-height - 65px);
+  overflow-y: auto;
+}
 .drag-container {
   display: flex;
   flex-direction: column;
   justify-content: start;
   align-items: center;
-  height: 100%;
+
   width: 100%;
   background-color: $hj-black-2;
   padding: 12px 11px;

+ 691 - 8
src/views/modules/project-config/configs/properites.ts

@@ -9,14 +9,19 @@ interface FunctionTypeModel {
   name: string;
   functions: AutoTestNodeData[]; //指的是功能模块 不是函数
 }
+export enum ExcelTypeName {
+  shuxing = "shuxing", //如果是属性,每一个都有 properties都有仪器名称,就不用在properties里再加一个仪器名称了, 在编辑节点时候,右侧给通过方法加上
+  fangfare = "fangfare",
+  tongyong = "tongyong",
+}
 // 功能块模型
 interface InformationModel {
   // 保留类型的信息以便展示
-  functionType: string;
+  functionType: ExcelTypeName;
   functionTypeId: string;
 
   functionName: string;
-  properties: InforPropertyModel[];
+  properties?: InforPropertyModel[]; //编辑node节点的时候根据这个数组展示右侧的信息
 }
 // 功能块模型有哪些属性对应的类 属性名称	初始值	数值类型	下限	上限	输入/输出
 interface InforPropertyModel {
@@ -26,7 +31,7 @@ interface InforPropertyModel {
   minValue?: string;
   maxValue?: string;
   inputOrOutput?: "input" | "output";
-  value?: string;
+  bindValue?: string; //这个是el-form 会绑定的值
 }
 
 type HJNodeData2 = Omit<HJNodeDataModel, "information"> & {
@@ -48,15 +53,67 @@ export const propertyData = ref<FunctionTypeModel[]>([
         data: {
           label: "信号源",
           information: {
-            functionType: "信号源",
+            functionType: ExcelTypeName.shuxing,
             functionTypeId: "1",
             functionName: "查询仪器标识符",
             properties: [
               {
-                proName: "仪器名称",
+                proName: "标识符",
               },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置仪器复位",
+          },
+        },
+      },
+
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "指令完成查询",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置频率",
+            properties: [
               {
-                proName: "标识符",
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
               },
             ],
           },
@@ -67,12 +124,638 @@ export const propertyData = ref<FunctionTypeModel[]>([
         data: {
           label: "信号源",
           information: {
-            functionType: "信号源",
+            functionType: ExcelTypeName.shuxing,
             functionTypeId: "1",
+            functionName: "设置功率",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置输出开",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置输出关",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置脉冲调制",
+            properties: [
+              {
+                proName: "脉宽(us)",
+              },
+              {
+                proName: "周期(us)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置调制开",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "信号源",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "1",
+            functionName: "设置调制关",
+          },
+        },
+      },
+    ],
+  },
+
+  {
+    id: "2",
+    name: "频谱仪",
+    functions: [
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "查询仪器标识符",
+            properties: [
+              {
+                proName: "标识符",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
             functionName: "设置仪器复位",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "指令完成查询",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭仪器自检",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置中心频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读中心频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置起始频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读起始频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置截止频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读截止频率",
+            properties: [
+              {
+                proName: "频率(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置扫描带宽SPAN",
+            properties: [
+              {
+                proName: "SPAN(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读扫描带宽SPAN",
+            properties: [
+              {
+                proName: "SPAN(Hz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "  设置全SPAN",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置参考电平REF",
             properties: [
               {
-                proName: "仪器名称",
+                proName: "REF(dB)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读参考电平REF",
+            properties: [
+              {
+                proName: "REF(dB)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置参考电平REF自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置分辨率带宽RBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读分辨率带宽RBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置视频带宽VBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读视频带宽VBW",
+            properties: [
+              {
+                proName: "RBW(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置分辨率带宽RBW自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置视频带宽VBW自动",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "打开MARK",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭MARK",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "关闭所有MARK",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置MARK频率",
+            properties: [
+              {
+                proName: "频率(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读MARK功率",
+            properties: [
+              {
+                proName: "功率(dBm)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读MARK频率",
+            properties: [
+              {
+                proName: "频率(MHz)",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置扫描点数",
+            properties: [
+              {
+                proName: "点数",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读扫描点数",
+            properties: [
+              {
+                proName: "点数",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "设置最大保持",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "取消最大保持",
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记次峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记左峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记右峰值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "标记中心频率",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+            ],
+          },
+        },
+      },
+      {
+        type: "universal",
+        data: {
+          label: "频谱仪",
+          information: {
+            functionType: ExcelTypeName.shuxing,
+            functionTypeId: "2",
+            functionName: "读曲线Y值",
+            properties: [
+              {
+                proName: "MARK索引",
+              },
+              {
+                proName: "Y值",
               },
             ],
           },