properites.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. import { Node } from "@vue-flow/core";
  2. // 功能块类别
  3. export interface FunctionTypeModel {
  4. id: string;
  5. moduleName: string;
  6. moduleType: string;
  7. functions: AutoTestNodeData[]; //指的是功能模块 不是函数
  8. }
  9. export enum ExcelTypeName {
  10. shuxing = "shuxing", //如果是属性,每一个都有 properties都有仪器名称,就不用在properties里再加一个仪器名称了, 在编辑节点时候,右侧给通过方法加上
  11. fangfare = "fangfare",
  12. tongyong = "tongyong",
  13. }
  14. // 功能块模型
  15. interface InformationModel {
  16. nodeName?: string; // 节点名称 lingzong说要有
  17. // 保留类型的信息以便展示
  18. functionType: ExcelTypeName;
  19. functionTypeId: string;
  20. functionName: string;
  21. properties?: InforPropertyModel[]; //编辑node节点的时候根据这个数组展示右侧的信息
  22. }
  23. // 功能块模型有哪些属性对应的类 属性名称 初始值 数值类型 下限 上限 输入/输出
  24. export interface InforPropertyModel {
  25. proName: string;
  26. defaultValue?: string;
  27. proType?: "text" | "enum" | "number"; //text enum number
  28. minValue?: string;
  29. maxValue?: string;
  30. inputOrOutput?: "input" | "output";
  31. bindValue?: string; //这个是el-form 会绑定的值
  32. bindCode?: string; // //编号
  33. bindLabel?: string; //这个是el-mention 会绑定的值 然后将id给 bindCode
  34. }
  35. interface HJNodeData2 {
  36. label: string;
  37. isSelected?: boolean;
  38. isDragging?: boolean;
  39. information: InformationModel;
  40. }
  41. // 这个类型里面的label 展示的是对应的FunctionTypeModel的名称, 以便在Node.vue中的header中展示
  42. export interface AutoTestNodeData extends Partial<Node> {
  43. data: HJNodeData2;
  44. }
  45. export const propertyData = ref<FunctionTypeModel[]>([
  46. {
  47. id: "1",
  48. name: "信号源",
  49. functions: [
  50. {
  51. type: "universal",
  52. data: {
  53. label: "信号源",
  54. information: {
  55. functionType: ExcelTypeName.shuxing,
  56. functionTypeId: "1",
  57. functionName: "查询仪器标识符",
  58. properties: [
  59. {
  60. proName: "标识符",
  61. },
  62. ],
  63. },
  64. },
  65. },
  66. {
  67. type: "universal",
  68. data: {
  69. label: "信号源",
  70. information: {
  71. functionType: ExcelTypeName.shuxing,
  72. functionTypeId: "1",
  73. functionName: "设置仪器复位",
  74. },
  75. },
  76. },
  77. {
  78. type: "universal",
  79. data: {
  80. label: "信号源",
  81. information: {
  82. functionType: ExcelTypeName.shuxing,
  83. functionTypeId: "1",
  84. functionName: "指令完成查询",
  85. },
  86. },
  87. },
  88. {
  89. type: "universal",
  90. data: {
  91. label: "信号源",
  92. information: {
  93. functionType: ExcelTypeName.shuxing,
  94. functionTypeId: "1",
  95. functionName: "设置频率",
  96. properties: [
  97. {
  98. proName: "频率(Hz)",
  99. },
  100. ],
  101. },
  102. },
  103. },
  104. {
  105. type: "universal",
  106. data: {
  107. label: "信号源",
  108. information: {
  109. functionType: ExcelTypeName.shuxing,
  110. functionTypeId: "1",
  111. functionName: "设置频率",
  112. properties: [
  113. {
  114. proName: "频率(Hz)",
  115. },
  116. ],
  117. },
  118. },
  119. },
  120. {
  121. type: "universal",
  122. data: {
  123. label: "信号源",
  124. information: {
  125. functionType: ExcelTypeName.shuxing,
  126. functionTypeId: "1",
  127. functionName: "设置功率",
  128. },
  129. },
  130. },
  131. {
  132. type: "universal",
  133. data: {
  134. label: "信号源",
  135. information: {
  136. functionType: ExcelTypeName.shuxing,
  137. functionTypeId: "1",
  138. functionName: "设置输出开",
  139. },
  140. },
  141. },
  142. {
  143. type: "universal",
  144. data: {
  145. label: "信号源",
  146. information: {
  147. functionType: ExcelTypeName.shuxing,
  148. functionTypeId: "1",
  149. functionName: "设置输出关",
  150. },
  151. },
  152. },
  153. {
  154. type: "universal",
  155. data: {
  156. label: "信号源",
  157. information: {
  158. functionType: ExcelTypeName.shuxing,
  159. functionTypeId: "1",
  160. functionName: "设置脉冲调制",
  161. properties: [
  162. {
  163. proName: "脉宽(us)",
  164. },
  165. {
  166. proName: "周期(us)",
  167. },
  168. ],
  169. },
  170. },
  171. },
  172. {
  173. type: "universal",
  174. data: {
  175. label: "信号源",
  176. information: {
  177. functionType: ExcelTypeName.shuxing,
  178. functionTypeId: "1",
  179. functionName: "设置调制开",
  180. },
  181. },
  182. },
  183. {
  184. type: "universal",
  185. data: {
  186. label: "信号源",
  187. information: {
  188. functionType: ExcelTypeName.shuxing,
  189. functionTypeId: "1",
  190. functionName: "设置调制关",
  191. },
  192. },
  193. },
  194. ],
  195. },
  196. {
  197. id: "2",
  198. name: "频谱仪",
  199. functions: [
  200. {
  201. type: "universal",
  202. data: {
  203. label: "频谱仪",
  204. information: {
  205. functionType: ExcelTypeName.shuxing,
  206. functionTypeId: "2",
  207. functionName: "查询仪器标识符",
  208. properties: [
  209. {
  210. proName: "标识符",
  211. },
  212. ],
  213. },
  214. },
  215. },
  216. {
  217. type: "universal",
  218. data: {
  219. label: "频谱仪",
  220. information: {
  221. functionType: ExcelTypeName.shuxing,
  222. functionTypeId: "2",
  223. functionName: "设置仪器复位",
  224. },
  225. },
  226. },
  227. {
  228. type: "universal",
  229. data: {
  230. label: "频谱仪",
  231. information: {
  232. functionType: ExcelTypeName.shuxing,
  233. functionTypeId: "2",
  234. functionName: "指令完成查询",
  235. },
  236. },
  237. },
  238. {
  239. type: "universal",
  240. data: {
  241. label: "频谱仪",
  242. information: {
  243. functionType: ExcelTypeName.shuxing,
  244. functionTypeId: "2",
  245. functionName: "关闭仪器自检",
  246. },
  247. },
  248. },
  249. {
  250. type: "universal",
  251. data: {
  252. label: "频谱仪",
  253. information: {
  254. functionType: ExcelTypeName.shuxing,
  255. functionTypeId: "2",
  256. functionName: "设置中心频率",
  257. properties: [
  258. {
  259. proName: "频率(Hz)",
  260. },
  261. ],
  262. },
  263. },
  264. },
  265. {
  266. type: "universal",
  267. data: {
  268. label: "频谱仪",
  269. information: {
  270. functionType: ExcelTypeName.shuxing,
  271. functionTypeId: "2",
  272. functionName: "读中心频率",
  273. properties: [
  274. {
  275. proName: "频率(Hz)",
  276. },
  277. ],
  278. },
  279. },
  280. },
  281. {
  282. type: "universal",
  283. data: {
  284. label: "频谱仪",
  285. information: {
  286. functionType: ExcelTypeName.shuxing,
  287. functionTypeId: "2",
  288. functionName: "设置起始频率",
  289. properties: [
  290. {
  291. proName: "频率(Hz)",
  292. },
  293. ],
  294. },
  295. },
  296. },
  297. {
  298. type: "universal",
  299. data: {
  300. label: "频谱仪",
  301. information: {
  302. functionType: ExcelTypeName.shuxing,
  303. functionTypeId: "2",
  304. functionName: "读起始频率",
  305. properties: [
  306. {
  307. proName: "频率(Hz)",
  308. },
  309. ],
  310. },
  311. },
  312. },
  313. {
  314. type: "universal",
  315. data: {
  316. label: "频谱仪",
  317. information: {
  318. functionType: ExcelTypeName.shuxing,
  319. functionTypeId: "2",
  320. functionName: "设置截止频率",
  321. properties: [
  322. {
  323. proName: "频率(Hz)",
  324. },
  325. ],
  326. },
  327. },
  328. },
  329. {
  330. type: "universal",
  331. data: {
  332. label: "频谱仪",
  333. information: {
  334. functionType: ExcelTypeName.shuxing,
  335. functionTypeId: "2",
  336. functionName: "读截止频率",
  337. properties: [
  338. {
  339. proName: "频率(Hz)",
  340. },
  341. ],
  342. },
  343. },
  344. },
  345. {
  346. type: "universal",
  347. data: {
  348. label: "频谱仪",
  349. information: {
  350. functionType: ExcelTypeName.shuxing,
  351. functionTypeId: "2",
  352. functionName: "设置扫描带宽SPAN",
  353. properties: [
  354. {
  355. proName: "SPAN(Hz)",
  356. },
  357. ],
  358. },
  359. },
  360. },
  361. {
  362. type: "universal",
  363. data: {
  364. label: "频谱仪",
  365. information: {
  366. functionType: ExcelTypeName.shuxing,
  367. functionTypeId: "2",
  368. functionName: "读扫描带宽SPAN",
  369. properties: [
  370. {
  371. proName: "SPAN(Hz)",
  372. },
  373. ],
  374. },
  375. },
  376. },
  377. {
  378. type: "universal",
  379. data: {
  380. label: "频谱仪",
  381. information: {
  382. functionType: ExcelTypeName.shuxing,
  383. functionTypeId: "2",
  384. functionName: " 设置全SPAN",
  385. },
  386. },
  387. },
  388. {
  389. type: "universal",
  390. data: {
  391. label: "频谱仪",
  392. information: {
  393. functionType: ExcelTypeName.shuxing,
  394. functionTypeId: "2",
  395. functionName: "设置参考电平REF",
  396. properties: [
  397. {
  398. proName: "REF(dB)",
  399. },
  400. ],
  401. },
  402. },
  403. },
  404. {
  405. type: "universal",
  406. data: {
  407. label: "频谱仪",
  408. information: {
  409. functionType: ExcelTypeName.shuxing,
  410. functionTypeId: "2",
  411. functionName: "读参考电平REF",
  412. properties: [
  413. {
  414. proName: "REF(dB)",
  415. },
  416. ],
  417. },
  418. },
  419. },
  420. {
  421. type: "universal",
  422. data: {
  423. label: "频谱仪",
  424. information: {
  425. functionType: ExcelTypeName.shuxing,
  426. functionTypeId: "2",
  427. functionName: "设置参考电平REF自动",
  428. },
  429. },
  430. },
  431. {
  432. type: "universal",
  433. data: {
  434. label: "频谱仪",
  435. information: {
  436. functionType: ExcelTypeName.shuxing,
  437. functionTypeId: "2",
  438. functionName: "设置分辨率带宽RBW",
  439. properties: [
  440. {
  441. proName: "RBW(MHz)",
  442. },
  443. ],
  444. },
  445. },
  446. },
  447. {
  448. type: "universal",
  449. data: {
  450. label: "频谱仪",
  451. information: {
  452. functionType: ExcelTypeName.shuxing,
  453. functionTypeId: "2",
  454. functionName: "读分辨率带宽RBW",
  455. properties: [
  456. {
  457. proName: "RBW(MHz)",
  458. },
  459. ],
  460. },
  461. },
  462. },
  463. {
  464. type: "universal",
  465. data: {
  466. label: "频谱仪",
  467. information: {
  468. functionType: ExcelTypeName.shuxing,
  469. functionTypeId: "2",
  470. functionName: "设置视频带宽VBW",
  471. properties: [
  472. {
  473. proName: "RBW(MHz)",
  474. },
  475. ],
  476. },
  477. },
  478. },
  479. {
  480. type: "universal",
  481. data: {
  482. label: "频谱仪",
  483. information: {
  484. functionType: ExcelTypeName.shuxing,
  485. functionTypeId: "2",
  486. functionName: "读视频带宽VBW",
  487. properties: [
  488. {
  489. proName: "RBW(MHz)",
  490. },
  491. ],
  492. },
  493. },
  494. },
  495. {
  496. type: "universal",
  497. data: {
  498. label: "频谱仪",
  499. information: {
  500. functionType: ExcelTypeName.shuxing,
  501. functionTypeId: "2",
  502. functionName: "设置分辨率带宽RBW自动",
  503. },
  504. },
  505. },
  506. {
  507. type: "universal",
  508. data: {
  509. label: "频谱仪",
  510. information: {
  511. functionType: ExcelTypeName.shuxing,
  512. functionTypeId: "2",
  513. functionName: "设置视频带宽VBW自动",
  514. },
  515. },
  516. },
  517. {
  518. type: "universal",
  519. data: {
  520. label: "频谱仪",
  521. information: {
  522. functionType: ExcelTypeName.shuxing,
  523. functionTypeId: "2",
  524. functionName: "打开MARK",
  525. properties: [
  526. {
  527. proName: "MARK索引",
  528. },
  529. ],
  530. },
  531. },
  532. },
  533. {
  534. type: "universal",
  535. data: {
  536. label: "频谱仪",
  537. information: {
  538. functionType: ExcelTypeName.shuxing,
  539. functionTypeId: "2",
  540. functionName: "关闭MARK",
  541. properties: [
  542. {
  543. proName: "MARK索引",
  544. },
  545. ],
  546. },
  547. },
  548. },
  549. {
  550. type: "universal",
  551. data: {
  552. label: "频谱仪",
  553. information: {
  554. functionType: ExcelTypeName.shuxing,
  555. functionTypeId: "2",
  556. functionName: "关闭所有MARK",
  557. },
  558. },
  559. },
  560. {
  561. type: "universal",
  562. data: {
  563. label: "频谱仪",
  564. information: {
  565. functionType: ExcelTypeName.shuxing,
  566. functionTypeId: "2",
  567. functionName: "设置MARK频率",
  568. properties: [
  569. {
  570. proName: "频率(MHz)",
  571. },
  572. ],
  573. },
  574. },
  575. },
  576. {
  577. type: "universal",
  578. data: {
  579. label: "频谱仪",
  580. information: {
  581. functionType: ExcelTypeName.shuxing,
  582. functionTypeId: "2",
  583. functionName: "读MARK功率",
  584. properties: [
  585. {
  586. proName: "功率(dBm)",
  587. },
  588. ],
  589. },
  590. },
  591. },
  592. {
  593. type: "universal",
  594. data: {
  595. label: "频谱仪",
  596. information: {
  597. functionType: ExcelTypeName.shuxing,
  598. functionTypeId: "2",
  599. functionName: "读MARK频率",
  600. properties: [
  601. {
  602. proName: "频率(MHz)",
  603. },
  604. ],
  605. },
  606. },
  607. },
  608. {
  609. type: "universal",
  610. data: {
  611. label: "频谱仪",
  612. information: {
  613. functionType: ExcelTypeName.shuxing,
  614. functionTypeId: "2",
  615. functionName: "设置扫描点数",
  616. properties: [
  617. {
  618. proName: "点数",
  619. },
  620. ],
  621. },
  622. },
  623. },
  624. {
  625. type: "universal",
  626. data: {
  627. label: "频谱仪",
  628. information: {
  629. functionType: ExcelTypeName.shuxing,
  630. functionTypeId: "2",
  631. functionName: "读扫描点数",
  632. properties: [
  633. {
  634. proName: "点数",
  635. },
  636. ],
  637. },
  638. },
  639. },
  640. {
  641. type: "universal",
  642. data: {
  643. label: "频谱仪",
  644. information: {
  645. functionType: ExcelTypeName.shuxing,
  646. functionTypeId: "2",
  647. functionName: "设置最大保持",
  648. },
  649. },
  650. },
  651. {
  652. type: "universal",
  653. data: {
  654. label: "频谱仪",
  655. information: {
  656. functionType: ExcelTypeName.shuxing,
  657. functionTypeId: "2",
  658. functionName: "取消最大保持",
  659. },
  660. },
  661. },
  662. {
  663. type: "universal",
  664. data: {
  665. label: "频谱仪",
  666. information: {
  667. functionType: ExcelTypeName.shuxing,
  668. functionTypeId: "2",
  669. functionName: "标记峰值",
  670. properties: [
  671. {
  672. proName: "MARK索引",
  673. },
  674. ],
  675. },
  676. },
  677. },
  678. {
  679. type: "universal",
  680. data: {
  681. label: "频谱仪",
  682. information: {
  683. functionType: ExcelTypeName.shuxing,
  684. functionTypeId: "2",
  685. functionName: "标记次峰值",
  686. properties: [
  687. {
  688. proName: "MARK索引",
  689. },
  690. ],
  691. },
  692. },
  693. },
  694. {
  695. type: "universal",
  696. data: {
  697. label: "频谱仪",
  698. information: {
  699. functionType: ExcelTypeName.shuxing,
  700. functionTypeId: "2",
  701. functionName: "标记左峰值",
  702. properties: [
  703. {
  704. proName: "MARK索引",
  705. },
  706. ],
  707. },
  708. },
  709. },
  710. {
  711. type: "universal",
  712. data: {
  713. label: "频谱仪",
  714. information: {
  715. functionType: ExcelTypeName.shuxing,
  716. functionTypeId: "2",
  717. functionName: "标记右峰值",
  718. properties: [
  719. {
  720. proName: "MARK索引",
  721. },
  722. ],
  723. },
  724. },
  725. },
  726. {
  727. type: "universal",
  728. data: {
  729. label: "频谱仪",
  730. information: {
  731. functionType: ExcelTypeName.shuxing,
  732. functionTypeId: "2",
  733. functionName: "标记中心频率",
  734. properties: [
  735. {
  736. proName: "MARK索引",
  737. },
  738. ],
  739. },
  740. },
  741. },
  742. {
  743. type: "universal",
  744. data: {
  745. label: "频谱仪",
  746. information: {
  747. functionType: ExcelTypeName.shuxing,
  748. functionTypeId: "2",
  749. functionName: "读曲线Y值",
  750. properties: [
  751. {
  752. proName: "MARK索引",
  753. },
  754. {
  755. proName: "Y值",
  756. },
  757. ],
  758. },
  759. },
  760. },
  761. ],
  762. },
  763. ]);