properites.ts 18 KB

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