PageCalibration.qml 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  1. import QtQuick 2.15
  2. import QtQuick.Layouts 1.3
  3. import QtQuick.Controls 1.2
  4. //import QtQuick 2.11
  5. //import QtQuick.Layouts 1.3
  6. //import QtQuick.Controls 2.14
  7. //import QtQuick.Controls.Styles 1.2
  8. import QtQuick.Controls.Styles 1.4
  9. import Qt.labs.qmlmodels 1.0
  10. //import QtQuick.LocalStorage 2.0
  11. //import io.qt.DataBaseModel 1.0
  12. import Qt.labs.platform 1.1
  13. import TService 1.0
  14. Item {
  15. id: root
  16. property var pagetype:rootitem.Page_Type_Testing
  17. property string title_str:"PID 参数整定"
  18. property var volume: [0,0,0,0,0]
  19. property var keeptime: [0,0,0,0,0]
  20. property var outermax: [0.0, 0.0, 0.0, 0.0, 0.0]
  21. property var outermini: [0.0, 0.0, 0.0, 0.0, 0.0]
  22. property var outerKp: [0.0, 0.0, 0.0, 0.0, 0.0]
  23. property var outerKi: [0.0, 0.0, 0.0, 0.0, 0.0]
  24. property var outerKd: [0.0, 0.0, 0.0, 0.0, 0.0]
  25. property var innermax: [0.0, 0.0, 0.0, 0.0, 0.0]
  26. property var innermini: [0.0, 0.0, 0.0, 0.0, 0.0]
  27. property var innerKp: [0.0, 0.0, 0.0, 0.0, 0.0]
  28. property var innerKi: [0.0, 0.0, 0.0, 0.0, 0.0]
  29. property var innerKd: [0.0, 0.0, 0.0, 0.0, 0.0]
  30. property var innermaxI: [0.0, 0.0, 0.0, 0.0, 0.0]
  31. property var innermaxIstep: [0.0, 0.0, 0.0, 0.0, 0.0]
  32. property var innermaxDstep: [0.0, 0.0, 0.0, 0.0, 0.0]
  33. property string background: "#d7e3bc"
  34. property string alterBackground: "white"
  35. property string highlight: "#e4f7d6"
  36. property string headerBkgnd: "#F0F0F0"
  37. property var normalG: Gradient {
  38. GradientStop { position: 0.0; color: "#c7d3ac" }
  39. GradientStop { position: 1.0; color: "#F0F0F0" }
  40. }
  41. property var hoverG: Gradient {
  42. GradientStop { position: 0.0; color: "white"; }
  43. GradientStop { position: 1.0; color: "#d7e3bc"; }
  44. }
  45. property var pressG: Gradient {
  46. GradientStop { position: 0.0; color: "#d7e3bc"; }
  47. GradientStop { position: 1.0; color: "white"; }
  48. }
  49. function set_paras(){
  50. var Jsonobj={}
  51. var itemArrayJson=[]
  52. var j=0;
  53. for(var i = 0; i<param_model.count; i++){
  54. var row_record = param_model.get(i)
  55. if(row_record.volume > 0){
  56. var item={}
  57. item.max_volume = row_record.volume
  58. item.keep_time = row_record.time
  59. item.outermax = row_record.out_max
  60. item.outermin = row_record.out_min
  61. item.outerkp = row_record.out_kp
  62. item.outerki = row_record.out_ki
  63. item.outerkd = row_record.out_kd
  64. item.innermax = row_record.inner_max
  65. item.innermin =row_record.inner_min
  66. item.innerkp = row_record.inner_kp
  67. item.innerki = row_record.inner_ki
  68. item.innerkd = row_record.inner_kd
  69. item.innermaxI = row_record.inner_maxI
  70. item.innerIstep = row_record.inner_maxIstep
  71. item.innerDstep = row_record.inner_maxDstep
  72. itemArrayJson[j] = item
  73. j++
  74. }
  75. }
  76. Jsonobj.pids = itemArrayJson
  77. CalibrationPara.set_paras(JSON.stringify(Jsonobj) );
  78. }
  79. function update_paras(index, item){
  80. param_model.append({
  81. "idx":index,
  82. "volume":item.max_volume,
  83. "time":item.keep_time,
  84. "out_max":item.outermax,
  85. "out_min":item.outermin,
  86. "out_kp":item.outerkp,
  87. "out_ki":item.outerki,
  88. "out_kd":item.outerkd,
  89. "inner_max":item.innermax,
  90. "inner_min":item.innermin,
  91. "inner_kp":item.innerkp,
  92. "inner_ki":item.innerki,
  93. "inner_kd":item.innerkd,
  94. "inner_maxI":item.innermaxI,
  95. "inner_maxIstep":item.innerIstep,
  96. "inner_maxDstep":item.innerDstep})
  97. }
  98. function clear_paras(index){
  99. if(index === 0){
  100. volume1.text = 0
  101. keep1.text = 0
  102. outmax1.text = 0
  103. outmini1.text = 0
  104. outp1.text = 0
  105. outi1.text = 0
  106. outd1.text = 0
  107. inmax1.text = 0
  108. inmini1.text = 0
  109. inp1.text = 0
  110. ini1.text = 0
  111. ind1.text = 0
  112. inmaxI1.text = 0
  113. inmaxIstep1.text = 0
  114. inmaxDstep1.text = 0
  115. }else if(index === 1){
  116. volume2.text = 0
  117. keep2.text = 0
  118. outmax2.text = 0
  119. outmini2.text = 0
  120. outp2.text = 0
  121. outi2.text = 0
  122. outd2.text = 0
  123. inmax2.text = 0
  124. inmini2.text = 0
  125. inp2.text = 0
  126. ini2.text = 0
  127. ind2.text = 0
  128. inmaxI2.text = 0
  129. inmaxIstep2.text = 0
  130. inmaxDstep2.text = 0
  131. }else if(index === 2){
  132. volume3.text = 0
  133. keep3.text = 0
  134. outmax3.text = 0
  135. outmini3.text = 0
  136. outp3.text = 0
  137. outi3.text = 0
  138. outd3.text = 0
  139. inmax3.text = 0
  140. inmini3.text = 0
  141. inp3.text = 0
  142. ini3.text = 0
  143. ind3.text = 0
  144. inmaxI3.text = 0
  145. inmaxIstep3.text = 0
  146. inmaxDstep3.text = 0
  147. }else if(index === 3){
  148. volume4.text = 0
  149. keep4.text = 0
  150. outmax4.text = 0
  151. outmini4.text = 0
  152. outp4.text = 0
  153. outi4.text = 0
  154. outd4.text = 0
  155. inmax4.text = 0
  156. inmini4.text = 0
  157. inp4.text = 0
  158. ini4.text = 0
  159. ind4.text = 0
  160. inmaxI4.text = 0
  161. inmaxIstep4.text = 0
  162. inmaxDstep4.text = 0
  163. }else if(index === 4){
  164. volume5.text = 0
  165. keep5.text = 0
  166. outmax5.text = 0
  167. outmini5.text = 0
  168. outp5.text = 0
  169. outi5.text = 0
  170. outd5.text = 0
  171. inmax5.text = 0
  172. inmini5.text = 0
  173. inp5.text = 0
  174. ini5.text = 0
  175. ind5.text = 0
  176. inmaxI5.text = 0
  177. inmaxIstep5.text = 0
  178. inmaxDstep5.text = 0
  179. }
  180. }
  181. function update_detail(){
  182. var jsonobj = CalibrationPara.get_paras();
  183. param_model.clear()
  184. for(var index= 0; index< jsonobj.count; index++){
  185. update_paras(index, jsonobj.pids[index])
  186. }
  187. }
  188. function get_role(column){
  189. var role = "idx"
  190. switch(column){
  191. case 1:
  192. role = "volume"
  193. break
  194. case 2:
  195. role = "time"
  196. break
  197. case 3:
  198. role = "out_max"
  199. break
  200. case 4:
  201. role = "out_min"
  202. break
  203. case 5:
  204. role = "out_kp"
  205. break
  206. case 6:
  207. role = "out_ki"
  208. break
  209. case 7:
  210. role = "out_kd"
  211. break
  212. case 8:
  213. role = "inner_max"
  214. break
  215. case 9:
  216. role = "inner_min"
  217. break
  218. case 10:
  219. role = "inner_kp"
  220. break
  221. case 11:
  222. role = "inner_ki"
  223. break
  224. case 12:
  225. role = "inner_kd"
  226. break
  227. case 13:
  228. role = "inner_maxI"
  229. break
  230. case 14:
  231. role = "inner_maxIstep"
  232. break
  233. case 15:
  234. role = "inner_maxDstep"
  235. break
  236. default:
  237. break
  238. }
  239. return role
  240. }
  241. DynamicGroupBox{
  242. id:groupbox
  243. anchors.centerIn: parent
  244. anchors.fill: parent
  245. title: title_str
  246. Column{
  247. Rectangle{
  248. id:param_rect
  249. //x:-10
  250. width: 1250
  251. height: 420
  252. //anchors.centerIn: parent
  253. color: "white"
  254. radius: 6
  255. border.color: "black"
  256. Text{
  257. id:text_title
  258. anchors.top: parent.top
  259. anchors.topMargin: 10
  260. anchors.horizontalCenter: parent.horizontalCenter
  261. font.bold: true
  262. font.pixelSize: 24
  263. text: "PID 参数标定"
  264. }
  265. Component{
  266. id:itemDelegateTextEdit
  267. TextField {
  268. anchors.verticalCenter: parent.verticalCenter
  269. text: styleData.value
  270. font.pointSize: 10
  271. //font.pixelSize: 24
  272. //font.bold: true
  273. horizontalAlignment: Text.AlignHCenter
  274. verticalAlignment: Text.AlignVCenter
  275. validator:RegExpValidator {
  276. regExp: /(-?[0-9]\d*((.\d+)*))*/
  277. // /(-?[0-9]\d*((.\d+)*))|(0.\d+)*/
  278. ///[0-9]*/
  279. }
  280. anchors.fill: parent
  281. onEditingFinished: {
  282. //console.log("row === "+styleData.row );
  283. //console.log("column=== "+styleData.column);
  284. //console.log("role === "+get_role(styleData.column));
  285. var role = get_role(styleData.column)
  286. if("idx" !== role){
  287. param_model.setProperty(styleData.row, get_role(styleData.column), Number(text))
  288. }
  289. }
  290. }
  291. }
  292. Component{
  293. id:itemDelegateText
  294. Text {
  295. anchors.verticalCenter: parent.verticalCenter
  296. color: styleData.selected?"#1E90FF":"#000000"
  297. elide: styleData.elideMode
  298. text: styleData.value
  299. font.pointSize: 10
  300. //font.pixelSize: 24
  301. //font.bold: true
  302. horizontalAlignment: Text.AlignHCenter
  303. verticalAlignment: Text.AlignVCenter
  304. anchors.fill: parent
  305. }
  306. }
  307. TableView{
  308. id:tableView
  309. //frameVisible: true
  310. width: parent.width
  311. focus: true
  312. //height: parent.height - 50
  313. anchors.top: text_title.bottom
  314. anchors.bottom: parent.bottom
  315. anchors.topMargin: 10
  316. TableViewColumn{role: "idx"; title: "ID"; width: 40; movable:false; delegate: itemDelegateText}
  317. TableViewColumn{role: "volume"; title: "容积≤(L)"; width: 120; movable:false; delegate: itemDelegateTextEdit}
  318. TableViewColumn{role: "time"; title: "稳压时间(秒)"; width: 120; movable:false; delegate: itemDelegateTextEdit}
  319. TableViewColumn{role: "out_max"; title: "外环max"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  320. TableViewColumn{role: "out_min"; title: "外环min"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  321. TableViewColumn{role: "out_kp"; title: "外环KP"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  322. TableViewColumn{role: "out_ki"; title: "外环KI"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  323. TableViewColumn{role: "out_kd"; title: "外环KD"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  324. TableViewColumn{role: "inner_max"; title: "内环max"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  325. TableViewColumn{role: "inner_min"; title: "内环min"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  326. TableViewColumn{role: "inner_kp"; title: "内环KP"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  327. TableViewColumn{role: "inner_ki"; title: "内环KI"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  328. TableViewColumn{role: "inner_kd"; title: "内环KD"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  329. TableViewColumn{role: "inner_maxI"; title: "内环maxI"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  330. TableViewColumn{role: "inner_maxIstep"; title: "内环Istep"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  331. TableViewColumn{role: "inner_maxDstep"; title: "内环Rstep"; width: 80; movable:false; delegate: itemDelegateTextEdit}
  332. //model: modelItems
  333. headerDelegate: Rectangle{
  334. implicitWidth: 16
  335. implicitHeight: 24
  336. gradient: styleData.pressed ? selftest_root.pressG : (styleData.containsMouse ? root.hoverG: root.normalG)
  337. border.color: "gray"
  338. border.width: 1
  339. Text{
  340. anchors.verticalCenter: parent.verticalCenter
  341. anchors.left: parent.left
  342. anchors.leftMargin: 4
  343. anchors.right: parent.right
  344. anchors.rightMargin: 4
  345. text: styleData.value
  346. color: styleData.pressed ?"red" : "blue"
  347. horizontalAlignment: Text.AlignHCenter
  348. verticalAlignment: Text.AlignVCenter
  349. font.bold: true
  350. }
  351. }
  352. rowDelegate: Rectangle{
  353. height: 32
  354. //border.color: "gray"
  355. //color: styleData.selected?"#f0b0b0af":(styleData.alternate?"#c3c3c0":"#c0c0c3")
  356. color: styleData.selected ? root.highlight : root.alterBackground
  357. }
  358. itemDelegate: Rectangle {
  359. height: 28
  360. //border.color: "gray"
  361. color: "transparent"
  362. Text {
  363. //anchors.centerIn: parent
  364. //anchors.left: parent.left
  365. anchors.leftMargin: 6
  366. anchors.verticalCenter: parent.verticalCenter
  367. //color: styleData.textColor
  368. color: styleData.selected ? "red" : styleData.textColor
  369. text: styleData.value
  370. verticalAlignment: Text.AlignVCenter
  371. font.pointSize: 13
  372. }
  373. }
  374. model:ListModel{
  375. id: param_model
  376. }
  377. }
  378. }
  379. Rectangle{
  380. id:button_rect
  381. //x:-10
  382. width: 1250
  383. height: 60
  384. color: "transparent"
  385. Row{
  386. spacing:30
  387. anchors.fill: parent
  388. UserButton {
  389. id: refresh_button;
  390. text: "刷新";
  391. font.pixelSize: 20
  392. anchors.verticalCenter: parent.verticalCenter
  393. width: 120
  394. height: 45
  395. onClicked: {
  396. update_detail()
  397. }
  398. }
  399. UserButton {
  400. id: save_button;
  401. text: "保存";
  402. font.pixelSize: 20
  403. anchors.verticalCenter: parent.verticalCenter
  404. width: 120
  405. height: 45
  406. onClicked: {
  407. set_paras()
  408. }
  409. }
  410. }
  411. }
  412. }
  413. /*
  414. Column{
  415. //spacing:10
  416. anchors.centerIn: parent
  417. width: 1200
  418. Row{
  419. width: parent.width
  420. height: 120
  421. spacing: 50
  422. Text { text: "1区参数 "; font.bold: true; font.pointSize: 12; }
  423. Column{
  424. //spacing:10
  425. Row{
  426. spacing:10
  427. InputLine{
  428. id:volume1
  429. paraName: "容积≤(L): "
  430. paraLength: 80
  431. onTextChanged: {
  432. volume[0] = Number(text)
  433. }
  434. }
  435. InputLine{
  436. id:keep1
  437. paraName: "保持时间(秒): "
  438. paraLength: 80
  439. onTextChanged: {
  440. keeptime[0] = Number(text)
  441. }
  442. }
  443. }
  444. Row{
  445. //spacing:10
  446. Text { text: "外环:"; font.bold: true; font.pointSize: 12; }
  447. InputLine{
  448. id:outmax1
  449. paraName: "Max:"
  450. paraLength: 60
  451. onTextChanged: {
  452. outermax[0] = Number(text)
  453. }
  454. }
  455. InputLine{
  456. id:outmini1
  457. paraName: "Mini:"
  458. paraLength: 60
  459. onTextChanged: {
  460. outermini[0] = Number(text)
  461. }
  462. }
  463. InputLine{
  464. id:outp1
  465. paraName: "Kp:"
  466. paraLength: 60
  467. onTextChanged: {
  468. outerKp[0] = Number(text)
  469. }
  470. }
  471. InputLine{
  472. id:outi1
  473. paraName: "Ki:"
  474. paraLength: 60
  475. onTextChanged: {
  476. outerKi[0] = Number(text)
  477. }
  478. }
  479. InputLine{
  480. id:outd1
  481. paraName: "Kd:"
  482. paraLength: 60
  483. onTextChanged: {
  484. outerKd[0] = Number(text)
  485. }
  486. }
  487. }
  488. Row{
  489. //spacing:10
  490. Text { text: "内环:"; font.bold: true; font.pointSize: 12; }
  491. InputLine{
  492. id:inmax1
  493. paraName: "Max:"
  494. paraLength: 60
  495. onTextChanged: {
  496. innermax[0] = Number(text)
  497. }
  498. }
  499. InputLine{
  500. id:inmini1
  501. paraName: "Mini:"
  502. paraLength: 60
  503. onTextChanged: {
  504. innermini[0] = Number(text)
  505. }
  506. }
  507. InputLine{
  508. id:inp1
  509. paraName: "Kp:"
  510. paraLength: 60
  511. onTextChanged: {
  512. innerKp[0] = Number(text)
  513. }
  514. }
  515. InputLine{
  516. id:ini1
  517. paraName: "Ki:"
  518. paraLength: 60
  519. onTextChanged: {
  520. innerKi[0] = Number(text)
  521. }
  522. }
  523. InputLine{
  524. id:ind1
  525. paraName: "Kd:"
  526. paraLength: 60
  527. onTextChanged: {
  528. innerKd[0] = Number(text)
  529. }
  530. }
  531. InputLine{
  532. id:inmaxI1
  533. paraName: "maxI:"
  534. paraLength: 60
  535. onTextChanged: {
  536. innermaxI[0] = Number(text)
  537. }
  538. }
  539. InputLine{
  540. id:inmaxIstep1
  541. paraName: "maxIstep:"
  542. paraLength: 60
  543. onTextChanged: {
  544. innermaxIstep[0] = Number(text)
  545. }
  546. }
  547. InputLine{
  548. id:inmaxDstep1
  549. paraName: "maxDstep:"
  550. paraLength: 60
  551. onTextChanged: {
  552. innermaxDstep[0] = Number(text)
  553. }
  554. }
  555. }
  556. }
  557. }
  558. Row{
  559. width: parent.width
  560. height: 120
  561. spacing: 50
  562. Text { text: "2区参数 "; font.bold: true; font.pointSize: 12; }
  563. Column{
  564. //spacing:10
  565. Row{
  566. spacing:10
  567. InputLine{
  568. id:volume2
  569. paraName: "容积≤(L): "
  570. paraLength: 80
  571. onTextChanged: {
  572. volume[1] = Number(text)
  573. }
  574. }
  575. InputLine{
  576. id:keep2
  577. paraName: "保持时间(秒): "
  578. paraLength: 80
  579. onTextChanged: {
  580. keeptime[1] = Number(text)
  581. }
  582. }
  583. }
  584. Row{
  585. //spacing:30
  586. Text { text: "外环:"; font.bold: true; font.pointSize: 12; }
  587. InputLine{
  588. id:outmax2
  589. paraName: "Max:"
  590. paraLength: 60
  591. onTextChanged: {
  592. outermax[1] = Number(text)
  593. }
  594. }
  595. InputLine{
  596. id:outmini2
  597. paraName: "Mini:"
  598. paraLength: 60
  599. onTextChanged: {
  600. outermini[1] = Number(text)
  601. }
  602. }
  603. InputLine{
  604. id:outp2
  605. paraName: "Kp:"
  606. paraLength: 60
  607. onTextChanged: {
  608. outerKp[1] = Number(text)
  609. }
  610. }
  611. InputLine{
  612. id:outi2
  613. paraName: "Ki:"
  614. paraLength: 60
  615. onTextChanged: {
  616. outerKi[1] = Number(text)
  617. }
  618. }
  619. InputLine{
  620. id:outd2
  621. paraName: "Kd:"
  622. paraLength: 60
  623. onTextChanged: {
  624. outerKd[1] = Number(text)
  625. }
  626. }
  627. }
  628. Row{
  629. //spacing:30
  630. Text { text: "内环:"; font.bold: true; font.pointSize: 12; }
  631. InputLine{
  632. id:inmax2
  633. paraName: "Max:"
  634. paraLength: 60
  635. onTextChanged: {
  636. innermax[1] = Number(text)
  637. }
  638. }
  639. InputLine{
  640. id:inmini2
  641. paraName: "Mini:"
  642. paraLength: 60
  643. onTextChanged: {
  644. innermini[1] = Number(text)
  645. }
  646. }
  647. InputLine{
  648. id:inp2
  649. paraName: "Kp:"
  650. paraLength: 60
  651. onTextChanged: {
  652. innerKp[1] = Number(text)
  653. }
  654. }
  655. InputLine{
  656. id:ini2
  657. paraName: "Ki:"
  658. paraLength: 60
  659. onTextChanged: {
  660. innerKi[1] = Number(text)
  661. }
  662. }
  663. InputLine{
  664. id:ind2
  665. paraName: "Kd:"
  666. paraLength: 60
  667. onTextChanged: {
  668. innerKd[1] = Number(text)
  669. }
  670. }
  671. InputLine{
  672. id:inmaxI2
  673. paraName: "maxI:"
  674. paraLength: 60
  675. onTextChanged: {
  676. innermaxI[1] = Number(text)
  677. }
  678. }
  679. InputLine{
  680. id:inmaxIstep2
  681. paraName: "maxIstep:"
  682. paraLength: 60
  683. onTextChanged: {
  684. innermaxIstep[1] = Number(text)
  685. }
  686. }
  687. InputLine{
  688. id:inmaxDstep2
  689. paraName: "maxDstep:"
  690. paraLength: 60
  691. onTextChanged: {
  692. innermaxDstep[1] = Number(text)
  693. }
  694. }
  695. }
  696. }
  697. }
  698. Row{
  699. width: parent.width
  700. height: 120
  701. spacing: 50
  702. Text { text: "3区参数 "; font.bold: true; font.pointSize: 12; }
  703. Column{
  704. //spacing:10
  705. Row{
  706. spacing:10
  707. InputLine{
  708. id:volume3
  709. paraName: "容积≤(L): "
  710. paraLength: 80
  711. onTextChanged: {
  712. volume[2] = Number(text)
  713. }
  714. }
  715. InputLine{
  716. id:keep3
  717. paraName: "保持时间(秒): "
  718. paraLength: 80
  719. onTextChanged: {
  720. keeptime[2] = Number(text)
  721. }
  722. }
  723. }
  724. Row{
  725. //spacing:30
  726. Text { text: "外环:"; font.bold: true; font.pointSize: 12; }
  727. InputLine{
  728. id:outmax3
  729. paraName: "Max:"
  730. paraLength: 60
  731. onTextChanged: {
  732. outermax[2] = Number(text)
  733. }
  734. }
  735. InputLine{
  736. id:outmini3
  737. paraName: "Mini:"
  738. paraLength: 60
  739. onTextChanged: {
  740. outermini[2] = Number(text)
  741. }
  742. }
  743. InputLine{
  744. id:outp3
  745. paraName: "Kp:"
  746. paraLength: 60
  747. onTextChanged: {
  748. outerKp[2] = Number(text)
  749. }
  750. }
  751. InputLine{
  752. id:outi3
  753. paraName: "Ki:"
  754. paraLength: 60
  755. onTextChanged: {
  756. outerKi[2] = Number(text)
  757. }
  758. }
  759. InputLine{
  760. id:outd3
  761. paraName: "Kd:"
  762. paraLength: 60
  763. onTextChanged: {
  764. outerKd[2] = Number(text)
  765. }
  766. }
  767. }
  768. Row{
  769. //spacing:30
  770. Text { text: "内环:"; font.bold: true; font.pointSize: 12; }
  771. InputLine{
  772. id:inmax3
  773. paraName: "Max:"
  774. paraLength: 60
  775. onTextChanged: {
  776. innermax[2] = Number(text)
  777. }
  778. }
  779. InputLine{
  780. id:inmini3
  781. paraName: "Mini:"
  782. paraLength: 60
  783. onTextChanged: {
  784. innermini[2] = Number(text)
  785. }
  786. }
  787. InputLine{
  788. id:inp3
  789. paraName: "Kp:"
  790. paraLength: 60
  791. onTextChanged: {
  792. innerKp[2] = Number(text)
  793. }
  794. }
  795. InputLine{
  796. id:ini3
  797. paraName: "Ki:"
  798. paraLength: 60
  799. onTextChanged: {
  800. innerKi[2] = Number(text)
  801. }
  802. }
  803. InputLine{
  804. id:ind3
  805. paraName: "Kd:"
  806. paraLength: 60
  807. onTextChanged: {
  808. innerKd[2] = Number(text)
  809. }
  810. }
  811. InputLine{
  812. id:inmaxI3
  813. paraName: "maxI:"
  814. paraLength: 60
  815. onTextChanged: {
  816. innermaxI[2] = Number(text)
  817. }
  818. }
  819. InputLine{
  820. id:inmaxIstep3
  821. paraName: "maxIstep:"
  822. paraLength: 60
  823. onTextChanged: {
  824. innermaxIstep[2] = Number(text)
  825. }
  826. }
  827. InputLine{
  828. id:inmaxDstep3
  829. paraName: "maxDstep:"
  830. paraLength: 60
  831. onTextChanged: {
  832. innermaxDstep[2] = Number(text)
  833. }
  834. }
  835. }
  836. }
  837. }
  838. Row{
  839. width: parent.width
  840. height: 120
  841. spacing: 50
  842. Text { text: "4区参数 "; font.bold: true; font.pointSize: 12; }
  843. Column{
  844. //spacing:10
  845. Row{
  846. spacing:10
  847. InputLine{
  848. id:volume4
  849. paraName: "容积≤(L): "
  850. paraLength: 80
  851. onTextChanged: {
  852. volume[3] = Number(text)
  853. }
  854. }
  855. InputLine{
  856. id:keep4
  857. paraName: "保持时间(秒): "
  858. paraLength: 80
  859. onTextChanged: {
  860. keeptime[3] = Number(text)
  861. }
  862. }
  863. }
  864. Row{
  865. //spacing:30
  866. Text { text: "外环:"; font.bold: true; font.pointSize: 12; }
  867. InputLine{
  868. id:outmax4
  869. paraName: "Max:"
  870. paraLength: 60
  871. onTextChanged: {
  872. outermax[3] = Number(text)
  873. }
  874. }
  875. InputLine{
  876. id:outmini4
  877. paraName: "Mini:"
  878. paraLength: 60
  879. onTextChanged: {
  880. outermini[3] = Number(text)
  881. }
  882. }
  883. InputLine{
  884. id:outp4
  885. paraName: "Kp:"
  886. paraLength: 60
  887. onTextChanged: {
  888. outerKp[3] = Number(text)
  889. }
  890. }
  891. InputLine{
  892. id:outi4
  893. paraName: "Ki:"
  894. paraLength: 60
  895. onTextChanged: {
  896. outerKi[3] = Number(text)
  897. }
  898. }
  899. InputLine{
  900. id:outd4
  901. paraName: "Kd:"
  902. paraLength: 60
  903. onTextChanged: {
  904. outerKd[3] = Number(text)
  905. }
  906. }
  907. }
  908. Row{
  909. //spacing:30
  910. Text { text: "内环:"; font.bold: true; font.pointSize: 12; }
  911. InputLine{
  912. id:inmax4
  913. paraName: "Max:"
  914. paraLength: 60
  915. onTextChanged: {
  916. innermax[3] = Number(text)
  917. }
  918. }
  919. InputLine{
  920. id:inmini4
  921. paraName: "Mini:"
  922. paraLength: 60
  923. onTextChanged: {
  924. innermini[3] = Number(text)
  925. }
  926. }
  927. InputLine{
  928. id:inp4
  929. paraName: "Kp:"
  930. paraLength: 60
  931. onTextChanged: {
  932. innerKp[3] = Number(text)
  933. }
  934. }
  935. InputLine{
  936. id:ini4
  937. paraName: "Ki:"
  938. paraLength: 60
  939. onTextChanged: {
  940. innerKi[3] = Number(text)
  941. }
  942. }
  943. InputLine{
  944. id:ind4
  945. paraName: "Kd:"
  946. paraLength: 60
  947. onTextChanged: {
  948. innerKd[3] = Number(text)
  949. }
  950. }
  951. InputLine{
  952. id:inmaxI4
  953. paraName: "maxI:"
  954. paraLength: 60
  955. onTextChanged: {
  956. innermaxI[3] = Number(text)
  957. }
  958. }
  959. InputLine{
  960. id:inmaxIstep4
  961. paraName: "maxIstep:"
  962. paraLength: 60
  963. onTextChanged: {
  964. innermaxIstep[3] = Number(text)
  965. }
  966. }
  967. InputLine{
  968. id:inmaxDstep4
  969. paraName: "maxDstep:"
  970. paraLength: 60
  971. onTextChanged: {
  972. innermaxDstep[3] = Number(text)
  973. }
  974. }
  975. }
  976. }
  977. }
  978. Row{
  979. width: parent.width
  980. height: 120
  981. spacing: 50
  982. Text { text: "5区参数 "; font.bold: true; font.pointSize: 12; }
  983. Column{
  984. //spacing:10
  985. Row{
  986. spacing:10
  987. InputLine{
  988. id:volume5
  989. paraName: "容积≤(L): "
  990. paraLength: 80
  991. onTextChanged: {
  992. volume[4] = Number(text)
  993. }
  994. }
  995. InputLine{
  996. id:keep5
  997. paraName: "保持时间(秒): "
  998. paraLength: 80
  999. onTextChanged: {
  1000. keeptime[4] = Number(text)
  1001. }
  1002. }
  1003. }
  1004. Row{
  1005. //spacing:30
  1006. Text { text: "外环:"; font.bold: true; font.pointSize: 12; }
  1007. InputLine{
  1008. id:outmax5
  1009. paraName: "Max:"
  1010. paraLength: 60
  1011. onTextChanged: {
  1012. outermax[4] = Number(text)
  1013. }
  1014. }
  1015. InputLine{
  1016. id:outmini5
  1017. paraName: "Mini:"
  1018. paraLength: 60
  1019. onTextChanged: {
  1020. outermini[4] = Number(text)
  1021. }
  1022. }
  1023. InputLine{
  1024. id:outp5
  1025. paraName: "Kp:"
  1026. paraLength: 60
  1027. onTextChanged: {
  1028. outerKp[4] = Number(text)
  1029. }
  1030. }
  1031. InputLine{
  1032. id:outi5
  1033. paraName: "Ki:"
  1034. paraLength: 60
  1035. onTextChanged: {
  1036. outerKi[4] = Number(text)
  1037. }
  1038. }
  1039. InputLine{
  1040. id:outd5
  1041. paraName: "Kd:"
  1042. paraLength: 60
  1043. onTextChanged: {
  1044. outerKd[4] = Number(text)
  1045. }
  1046. }
  1047. }
  1048. Row{
  1049. //spacing:30
  1050. Text { text: "内环:"; font.bold: true; font.pointSize: 12; }
  1051. InputLine{
  1052. id:inmax5
  1053. paraName: "Max:"
  1054. paraLength: 60
  1055. onTextChanged: {
  1056. innermax[4] = Number(text)
  1057. }
  1058. }
  1059. InputLine{
  1060. id:inmini5
  1061. paraName: "Mini:"
  1062. paraLength: 60
  1063. onTextChanged: {
  1064. innermini[4] = Number(text)
  1065. }
  1066. }
  1067. InputLine{
  1068. id:inp5
  1069. paraName: "Kp:"
  1070. paraLength: 60
  1071. onTextChanged: {
  1072. innerKp[4] = Number(text)
  1073. }
  1074. }
  1075. InputLine{
  1076. id:ini5
  1077. paraName: "Ki:"
  1078. paraLength: 60
  1079. onTextChanged: {
  1080. innerKi[4] = Number(text)
  1081. }
  1082. }
  1083. InputLine{
  1084. id:ind5
  1085. paraName: "Kd:"
  1086. paraLength: 60
  1087. onTextChanged: {
  1088. innerKd[4] = Number(text)
  1089. }
  1090. }
  1091. InputLine{
  1092. id:inmaxI5
  1093. paraName: "maxI:"
  1094. paraLength: 60
  1095. onTextChanged: {
  1096. innermaxI[4] = Number(text)
  1097. }
  1098. }
  1099. InputLine{
  1100. id:inmaxIstep5
  1101. paraName: "maxIstep:"
  1102. paraLength: 60
  1103. onTextChanged: {
  1104. innermaxIstep[4] = Number(text)
  1105. }
  1106. }
  1107. InputLine{
  1108. id:inmaxDstep5
  1109. paraName: "maxDstep:"
  1110. paraLength: 60
  1111. onTextChanged: {
  1112. innermaxDstep[4] = Number(text)
  1113. }
  1114. }
  1115. }
  1116. }
  1117. }
  1118. Row{
  1119. spacing:30
  1120. UserButton {
  1121. id: refresh_button;
  1122. text: "刷新";
  1123. font.pixelSize: 20
  1124. anchors.verticalCenter: parent.verticalCenter
  1125. width: 120
  1126. height: 45
  1127. onClicked: {
  1128. update_detail()
  1129. }
  1130. }
  1131. UserButton {
  1132. id: save_button;
  1133. text: "保存";
  1134. font.pixelSize: 20
  1135. anchors.verticalCenter: parent.verticalCenter
  1136. width: 120
  1137. height: 45
  1138. onClicked: {
  1139. set_paras()
  1140. }
  1141. }
  1142. }
  1143. }
  1144. */
  1145. }
  1146. Component.onCompleted: {
  1147. update_detail()
  1148. }
  1149. }