properites.ts 18 KB

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