| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923 |
- /****************************************************************************
- **
- ** Copyright (C) 2021 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of Qt Quick Studio Components.
- **
- ** $QT_BEGIN_LICENSE:GPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** GNU General Public License Usage
- ** Alternatively, this file may be used under the terms of the GNU
- ** General Public License version 3 or (at your option) any later version
- ** approved by the KDE Free Qt Foundation. The licenses are as published by
- ** the Free Software Foundation and appearing in the file LICENSE.GPL3
- ** included in the packaging of this file. Please review the following
- ** information to ensure the GNU General Public License requirements will
- ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
- import QtQuick
- import QtQuick.Window
- import QtQuick.Controls
- //import IOT_UI
- Window {
- id: window
- width: Qt.platform.os === "android" ? Screen.width: 1280
- height: Qt.platform.os === "android"? Screen.height: 800
- // minimumWidth: 1280
- // minimumHeight: 800
- visible: true
- title: "Application iot"
- Login {
- id: loginScreen
- width: Qt.platform.os === "android" ? Screen.width: 1280
- height: Qt.platform.os === "android"? Screen.height: 800
- color: "#051f58"
- radius: 8
- visible: true
- Component.onCompleted: {
- timer_time.start()
- }
- loginbtn.onClicked: {
- login_start()
- }
- timer_time.onTriggered:
- {
- element.text = currentDateTime();
- }
- function login_start()
- {
- //console.log("initdata:",myClass.getdata_JsonArray())
- if(loginpwd.text==="8888")
- {
- mainScreen.visible = true
- loginScreen.visible = false
- }
- else if(loginpwd.text==="0000")
- {
- sql_Screen.visible = true
- mainScreen.visible = false
- loginScreen.visible = false
- }
- else
- {
- loginpwd.text="密码输入错误"
- }
- }
- //当前时间
- function currentDateTime(){
- return Qt.formatDateTime(new Date(), "yyyy-MM-dd hh:mm:ss");
- }
- }
- SqlScreen {
- id: sql_Screen
- width: Qt.platform.os === "android" ? Screen.width: 1280
- height: Qt.platform.os === "android"? Screen.height: 800
- visible: false
- }
- Screen01 {
- id: mainScreen
- width: Qt.platform.os === "android" ? Screen.width: 1280
- height: Qt.platform.os === "android"? Screen.height: 800
- visible: false
- z: 1
- recDataPage.onWidthChanged: {
- if(recDataPage.width <= 524) recDataPage.width = 524
- else if(recDataPage.width >= 600) recDataPage.width = 600
- }
- function recDataDisplay(recByte) {
- // 停止显示是否选中
- if (rxEN_btn.highlighted) {
- // ASCII/HEX显示 和 日志显示 在后者函数的两个参数里
- recDataEdit.insert(recDataEdit.length, myClass.get_recData(myClass.get_pageIndex(), rxCode_btn.text, displayDate_btn.highlighted))
- }
- rxByteText.text = recByte
- }
- function recDataMessage()
- {
- }
- function sendDataDisplay(sendByte) {
- txByteText.text = sendByte
- if (txEN_btn.highlighted) {
- recDataEdit.insert(recDataEdit.length, myClass.get_sendData(rxCode_btn.text, displayDate_btn.highlighted))
- }
- }
- slider_color.onMoved: {
- serial_ip_page.color = Qt.rgba((slider_color.value % 5 / 5.0).toFixed(1), (slider_color.value % 25 / 5 / 5.0).toFixed(1), (slider_color.value / 25 / 5.0).toFixed(1), 1)
- if(slider_color.value === 0.0 || slider_color.value === 125.0)
- {
- serial_ip_page.color = "#20000000"
- }
- //console.log(slider_color.value, (slider_color.value % 5 / 5.0).toFixed(1), (slider_color.value % 25 / 5 / 5.0).toFixed(1), (slider_color.value / 25 / 5.0).toFixed(1))
- }
- data_originEdit.onTextChanged: {
- myClass.on_originData_textChanged(data_originEdit.getText(0, data_originEdit.length))
- data_englishByteTextinput.text = myClass.get_enBytes()
- data_chineseByteTextinput.text = myClass.get_zh_cnBytes()
- }
- data_changeBtn.onClicked: {
- data_originEdit.textFormat = TextEdit.PlainText
- data_originEdit.text = myClass.on_changeBtn_clicked(data_originEdit.getText(0, data_originEdit.length), data_codeCombo.currentIndex)
- }
- data_fine2Btn.onClicked: {
- data_originEdit.textFormat = TextEdit.AutoText
- data_originEdit.text = myClass.on_findBtn2_clicked(data_originEdit.getText(0, data_originEdit.length), data_target1Edit.getText(0, data_target1Edit.length))
- }
- data_fine1Btn.onClicked: {
- data_originEdit.textFormat = TextEdit.AutoText
- data_originEdit.text = myClass.on_findBtn1_clicked(data_originEdit.getText(0, data_originEdit.length), data_target1Edit.getText(0, data_target1Edit.length))
- }
- data_deleta2Btn.onClicked: {
- data_originEdit.textFormat = TextEdit.AutoText
- data_originEdit.text = myClass.on_deleteBtn2_clicked(data_originEdit.getText(0, data_originEdit.length), data_target1Edit.getText(0, data_target1Edit.length), data_target2Edit.getText(0, data_target2Edit.length))
- }
- data_deleta1Btn.onClicked: {
- //console.log(data_originEdit.getText(0, data_originEdit.length))
- data_originEdit.textFormat = TextEdit.AutoText
- data_originEdit.text = myClass.on_deleteBtn1_clicked(data_originEdit.getText(0, data_originEdit.length), data_target1Edit.getText(0, data_target1Edit.length), data_target2Edit.getText(0, data_target2Edit.length))
- }
- data_target2TitleMouse.onClicked: {
- myClass.on_targetTitle2_clicked()
- }
- data_target1TitleMouse.onClicked: {
- myClass.on_targetTitle1_clicked()
- }
- data_originTitleMouse.onClicked: {
- myClass.on_originTitle_clicked()
- }
- data_target2Mouse.onWheel: function(wheel){
- if (wheel.angleDelta.y > 0) {
- data_vbar3.decrease()
- }
- else {
- data_vbar3.increase()
- }
- }
- data_target1Mouse.onWheel: function(wheel){
- if (wheel.angleDelta.y > 0) {
- data_vbar2.decrease()
- }
- else {
- data_vbar2.increase()
- }
- }
- data_originMouse.onWheel: function(wheel){
- if (wheel.angleDelta.y > 0) {
- data_vbar1.decrease()
- }
- else {
- data_vbar1.increase()
- }
- }
- data_target2Mouse.onClicked: {
- data_target2Edit.forceActiveFocus()
- }
- data_target1Mouse.onClicked: {
- data_target1Edit.forceActiveFocus()
- }
- data_originMouse.onClicked: {
- data_originEdit.forceActiveFocus()
- }
- /****************************serial ip*********************************/
- ip_switch.onClicked: {
- if(ip_switch.checked)
- {
- ip_nameCombo.enabled = false
- ip_myAddrText.enabled = false
- ip_myPortText.enabled = false
- ip_otherAddrText.enabled = false
- ip_otherPortText.enabled = false
- }
- else
- {
- ip_nameCombo.enabled = true
- ip_myAddrText.enabled = true
- ip_myPortText.enabled = true
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- }
- myClass.on_ipSwitch_clicked(ip_switch.checked, ip_myAddrText.text, ip_myPortText.text, ip_otherAddrText.text, ip_otherPortText.text);
- }
- subButton.onClicked: {
- myClass.on_subButton_clicked(subField.text);
- }
- ip_nameCombo.onCurrentIndexChanged: {
- myClass.set_pageIndex(ip_nameCombo.currentIndex+2)
- txByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2)
- rxByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2-1)
- switch(ip_nameCombo.currentIndex)
- {
- case 0: //TCP Client
- ip_myAddrText.enabled = false
- ip_myPortText.enabled = false
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- break;
- case 1: //TCP Server
- ip_myAddrText.enabled = true
- ip_myPortText.enabled = true
- ip_otherAddrText.enabled = false
- ip_otherPortText.enabled = false
- break;
- case 2: //UDP
- ip_myAddrText.enabled = true
- ip_myPortText.enabled = true
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- break;
- case 3: //MQTT
- ip_myAddrText.enabled = false
- ip_myPortText.enabled = false
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- break;
- }
- }
- txClearBtn.onClicked: {
- myClass.clear_RxTxByte(myClass.get_pageIndex()*2)
- txByteText.text = 0
- }
- rxClearBtn.onClicked: {
- myClass.clear_RxTxByte(myClass.get_pageIndex()*2-1)
- rxByteText.text = 0
- }
- serial_nameCombo.onPressedChanged: {
- serial_nameCombo.model = myClass.get_serialName()
- }
- serial_nameCombo.onCurrentTextChanged: {
- if(serial_nameCombo.currentIndex >= 0)
- {
- serial_descriptionLab.text = myClass.get_serialDescription(serial_nameCombo.currentIndex)
- }
- }
- txAutoSend_btn.onClicked: {
- if(serial_switch.checked || ip_switch.checked)
- {
- txAutoSend_btn.highlighted = !txAutoSend_btn.highlighted
- myClass.on_autoSend_clicked(txAutoSend_btn.highlighted, autoSendTime.text)
- }
- else
- {
- serial_switch.highlighted = true
- ip_switch.highlighted = true
- }
- }
- serial_switch.onCheckedChanged: {
- serial_switch.highlighted = false
- if(serial_switch.checked)
- {
- serial_nameCombo.enabled = false
- serial_boudCombo.enabled = false
- serial_checkBitCombo.enabled = false
- serial_dataBitCombo.enabled = false
- serial_stopBitCombo.enabled = false
- }
- else
- {
- serial_nameCombo.enabled = true
- serial_boudCombo.enabled = true
- serial_checkBitCombo.enabled = true
- serial_dataBitCombo.enabled = true
- serial_stopBitCombo.enabled = true
- }
- myClass.on_serial_switch_clicked(serial_switch.checked, serial_nameCombo.currentText, serial_boudCombo.currentText)
- }
- txSend_btn.onClicked: {
- if(serial_switch.checked || ip_switch.checked)
- {
- myClass.set_sendDate(myClass.get_pageIndex(), sendDataEdit.getText(0, sendDataEdit.length), txSuffixCombo.currentIndex, txCode_btn.text)
- }
- else
- {
- serial_switch.highlighted = true
- ip_switch.highlighted = true
- }
- }
- txClear_btn.onClicked: {
- sendDataEdit.clear()
- }
- txCode_btn.onClicked: {
- txCode_btn.text = txCode_btn.text !== "ASCII" ? "ASCII" : "HEX"
- }
- rxClear_btn.onClicked: {
- recDataEdit.clear()
- }
- saveFile_btn.onClicked: {
- myClass.on_save_file_clicked(recDataEdit.getText(0, recDataEdit.length))
- }
- displayDate_btn.onClicked: {
- displayDate_btn.highlighted = !displayDate_btn.highlighted
- }
- // 文本变化就滑动滑动条到底
- recDataEdit.onTextChanged: {
- vbar1.increase()
- }
- recDataMouse.onClicked: {
- // MouseArea点击后将焦点给到TextEdit
- recDataEdit.forceActiveFocus()
- }
- recDataMouse.onWheel: function(wheel){
- // 鼠标滚轮位置
- if (wheel.angleDelta.y > 0) {
- // ScrollBar移动
- vbar1.decrease()
- }
- else {
- vbar1.increase()
- }
- }
- sendDataMouse.onClicked: {
- sendDataEdit.forceActiveFocus()
- }
- sendDataMouse.onWheel: function(wheel){
- console.log(wheel.angleDelta.y)
- if (wheel.angleDelta.y > 0) {
- vbar2.decrease()
- }
- else {
- vbar2.increase()
- }
- }
- rxCode_btn.onClicked: {
- rxCode_btn.text = rxCode_btn.text !== "ASCII" ? "ASCII" : "HEX"
- }
- txEN_btn.onClicked: {
- txEN_btn.highlighted = !txEN_btn.highlighted
- }
- rxEN_btn.onClicked: {
- rxEN_btn.highlighted = !rxEN_btn.highlighted
- }
- tabBar.onCurrentIndexChanged: {
- switch(tabBar.currentIndex)
- {
- case 0:
- // visible显示/隐藏
- myMouseArea.visible = true
- serial_leftSidePage.visible = true
- ip_leftSidePage.visible = false
- data_page.visible = false
- test_page.visible = false
- myClass.set_pageIndex(tabBar.currentIndex+1)
- txByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2)
- rxByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2-1)
- break
- case 1:
- myMouseArea.visible = true
- serial_leftSidePage.visible = false
- ip_leftSidePage.visible = true
- data_page.visible = false
- test_page.visible = false
- myClass.set_pageIndex(ip_nameCombo.currentIndex+2)
- txByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2)
- rxByteText.text = myClass.get_RxTxByte(myClass.get_pageIndex()*2-1)
- switch(ip_nameCombo.currentIndex)
- {
- case 0:
- ip_myAddrText.enabled = false
- ip_myPortText.enabled = false
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- break;
- case 1:
- ip_myAddrText.enabled = true
- ip_myPortText.enabled = true
- ip_otherAddrText.enabled = false
- ip_otherPortText.enabled = false
- break;
- case 2:
- ip_myAddrText.enabled = true
- ip_myPortText.enabled = true
- ip_otherAddrText.enabled = true
- ip_otherPortText.enabled = true
- break;
- }
- break
- case 2:
- myMouseArea.visible = false
- data_page.visible = true
- test_page.visible = false
- break
- case 3:
- myMouseArea.visible = false
- data_page.visible = false
- test_page.visible = true
- break
- }
- }
- /*********************************************快捷内容框内容本地存储**************************************************/
- // shortcut_CtrlText1.onTextChanged: {
- // myClass.shortcut_data_save(1, shortcut_CtrlText1.text)
- // }
- // shortcut_CtrlText2.onTextChanged: {
- // myClass.shortcut_data_save(2, shortcut_CtrlText2.text)
- // }
- // shortcut_CtrlText3.onTextChanged: {
- // myClass.shortcut_data_save(3, shortcut_CtrlText3.text)
- // }
- // shortcut_CtrlText4.onTextChanged: {
- // myClass.shortcut_data_save(4, shortcut_CtrlText4.text)
- // }
- // shortcut_CtrlText5.onTextChanged: {
- // myClass.shortcut_data_save(5, shortcut_CtrlText5.text)
- // }
- // shortcut_AltText1.onTextChanged: {
- // myClass.shortcut_data_save(6, shortcut_AltText1.text)
- // }
- // shortcut_AltText2.onTextChanged: {
- // myClass.shortcut_data_save(7, shortcut_AltText2.text)
- // }
- // shortcut_AltText3.onTextChanged: {
- // myClass.shortcut_data_save(8, shortcut_AltText3.text)
- // }
- // shortcut_AltText4.onTextChanged: {
- // myClass.shortcut_data_save(9, shortcut_AltText4.text)
- // }
- // shortcut_AltText5.onTextChanged: {
- // myClass.shortcut_data_save(10, shortcut_AltText5.text)
- // }
- // shortcut_Texta.onTextChanged: {
- // myClass.shortcut_data_save(11, shortcut_Texta.text)
- // }
- // shortcut_Textb.onTextChanged: {
- // myClass.shortcut_data_save(12, shortcut_Textb.text)
- // }
- // shortcut_Textc.onTextChanged: {
- // myClass.shortcut_data_save(13, shortcut_Textc.text)
- // }
- // shortcut_Textd.onTextChanged: {
- // myClass.shortcut_data_save(14, shortcut_Textd.text)
- // }
- // shortcut_Texte.onTextChanged: {
- // myClass.shortcut_data_save(15, shortcut_Texte.text)
- // }
- // shortcut_Textf.onTextChanged: {
- // myClass.shortcut_data_save(16, shortcut_Textf.text)
- // }
- // shortcut_Textg.onTextChanged: {
- // myClass.shortcut_data_save(17, shortcut_Textg.text)
- // }
- // shortcut_Texth.onTextChanged: {
- // myClass.shortcut_data_save(18, shortcut_Texth.text)
- // }
- // shortcut_Texti.onTextChanged: {
- // myClass.shortcut_data_save(19, shortcut_Texti.text)
- // }
- /*********************************************快捷内容发送按键**************************************************/
- shortcut_Btn1.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_CtrlText1.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn2.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_CtrlText2.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn3.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_CtrlText3.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn4.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_CtrlText4.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn5.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_CtrlText5.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn6.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_AltText1.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn7.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_AltText2.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn8.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_AltText3.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn9.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_AltText4.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn10.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_AltText5.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn11.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Texta.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn12.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Textb.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn13.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Textc.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn14.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Textd.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn15.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Texte.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn16.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Textf.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn17.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Textg.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn18.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Texth.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- shortcut_Btn19.onClicked: {
- myClass.set_sendDate(myClass.get_pageIndex(), shortcut_Texti.text, txSuffixCombo.currentIndex, txCode_btn.text)
- }
- /*********************************************快捷方式/快捷键**************************************************/
- Shortcut {
- sequence: "Ctrl+Q"
- onActivated: mainScreen.txCode_btn.clicked()
- }
- Shortcut {
- sequence: "Ctrl+W"
- onActivated: mainScreen.sendDataEdit.clear()
- }
- Shortcut {
- sequence: "Ctrl+E"
- onActivated: mainScreen.txSend_btn.clicked()
- }
- Shortcut {
- sequence: "Ctrl+R"
- onActivated: mainScreen.txAutoSend_btn.clicked()
- }
- Shortcut {
- sequence: "Alt+1"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_AltText1.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Alt+2"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_AltText2.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Alt+3"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_AltText3.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Alt+4"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_AltText4.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Alt+5"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_AltText5.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+1"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_CtrlText1.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+2"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_CtrlText2.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+3"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_CtrlText3.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+4"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_CtrlText4.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+5"
- onActivated: myClass.set_sendDate(myClass.get_pageIndex(), mainScreen.shortcut_CtrlText5.text, mainScreen.txSuffixCombo.currentIndex, mainScreen.txCode_btn.text)
- }
- Shortcut {
- sequence: "Ctrl+="
- onActivated: mainScreen.recDataEdit.font.pixelSize++
- }
- Shortcut {
- sequence: "Ctrl+-"
- onActivated: mainScreen.recDataEdit.font.pixelSize--
- }
- /*********************************************详情显示 hover**************************************************/
- shortcut_titleTextMouse.onEntered: {
- hoverDescriptionText.text = "切换编码:Ctrl+Q\n清除内容:Ctrl+W\n单次发送:Ctrl+E\n自动发送:Ctrl+R\n输入内容:Ctrl+序号\n输入内容:Alt+序号"
- hoverDescriptionPage.x = myMouseArea.mouseX - hoverDescriptionText.width
- hoverDescriptionPage.y = myMouseArea.mouseY
- hoverDescriptionPage.visible = true
- }
- shortcut_titleTextMouse.onExited: {
- hoverDescriptionPage.visible = false
- }
- rxClearBtn.onHoveredChanged: {
- if(rxClearBtn.hovered)
- {
- hoverDescriptionText.text = "清零接收字节计数"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txClearBtn.onHoveredChanged: {
- if(txClearBtn.hovered)
- {
- hoverDescriptionText.text = "清零发送字节计数"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- rxCode_btn.onHoveredChanged: {
- if(rxCode_btn.hovered)
- {
- hoverDescriptionText.text = "接收编码方式"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- rxEN_btn.onHoveredChanged: {
- if(rxEN_btn.hovered)
- {
- hoverDescriptionText.text = "接收显示开关, 绿色为接收数据"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txEN_btn.onHoveredChanged: {
- if(txEN_btn.hovered)
- {
- hoverDescriptionText.text = "发送回显开关, 白色为回显数据"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- displayDate_btn.onHoveredChanged: {
- if(displayDate_btn.hovered)
- {
- hoverDescriptionText.text = "时间戳显示开关"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- saveFile_btn.onHoveredChanged: {
- if(saveFile_btn.hovered)
- {
- hoverDescriptionText.text = "接收区保存至文件"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- rxClear_btn.onHoveredChanged: {
- if(rxClear_btn.hovered)
- {
- hoverDescriptionText.text = "接收区清空"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- slider_color.onHoveredChanged: {
- if(slider_color.hovered)
- {
- hoverDescriptionText.text = "背景色滑动条"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txCode_btn.onHoveredChanged: {
- if(txCode_btn.hovered)
- {
- hoverDescriptionText.text = "发送编码方式"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txClear_btn.onHoveredChanged: {
- if(txClear_btn.hovered)
- {
- hoverDescriptionText.text = "发送区清空"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txSend_btn.onHoveredChanged: {
- if(txSend_btn.hovered)
- {
- hoverDescriptionText.text = "发送数据"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txAutoSend_btn.onHoveredChanged: {
- if(txAutoSend_btn.hovered)
- {
- hoverDescriptionText.text = "自动发送开关"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- autoSendTime.onHoveredChanged: {
- if(autoSendTime.hovered)
- {
- hoverDescriptionText.text = "自动发送时间/ms"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- txSuffixCombo.onHoveredChanged: {
- if(txSuffixCombo.hovered)
- {
- hoverDescriptionText.text = "发送数据后缀"
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- ip_myAddrText.onHoveredChanged: {
- if(ip_myAddrText.hovered)
- {
- switch(ip_nameCombo.currentIndex)
- {
- case 0: hoverDescriptionText.text = "不使用, 不可编辑"; break;
- case 1: hoverDescriptionText.text = "可不填, 默认本地IP地址"; break;
- case 2: hoverDescriptionText.text = "可不填, 默认本地IP地址"; break;
- }
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- ip_myPortText.onHoveredChanged: {
- if(ip_myPortText.hovered)
- {
- switch(ip_nameCombo.currentIndex)
- {
- case 0: hoverDescriptionText.text = "不使用, 不可编辑"; break;
- case 1: hoverDescriptionText.text = "监听端口号即本地端口号"; break;
- case 2: hoverDescriptionText.text = "监听端口号即本地端口号"; break;
- }
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- ip_otherAddrText.onHoveredChanged: {
- if(ip_otherAddrText.hovered)
- {
- switch(ip_nameCombo.currentIndex)
- {
- case 0: hoverDescriptionText.text = "服务器IP地址"; break;
- case 1: hoverDescriptionText.text = "不使用, 不可编辑"; break;
- case 2: hoverDescriptionText.text = "远程IP地址"; break;
- case 3: hoverDescriptionText.text = "服务器地址"; break;
- }
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- ip_otherPortText.onHoveredChanged: {
- if(ip_otherPortText.hovered)
- {
- switch(ip_nameCombo.currentIndex)
- {
- case 0: hoverDescriptionText.text = "服务器端口号"; break;
- case 1: hoverDescriptionText.text = "不使用, 不可编辑"; break;
- case 2: hoverDescriptionText.text = "远程端口号"; break;
- case 3: hoverDescriptionText.text = "端口号"; break;
- }
- hoverDescriptionPage.x = myMouseArea.mouseX
- hoverDescriptionPage.y = myMouseArea.mouseY - hoverDescriptionText.height
- hoverDescriptionPage.visible = true
- }
- else
- {
- hoverDescriptionPage.visible = false
- }
- }
- // 左侧边栏鼠标悬停
- // frame.onHoveredChanged: {
- // if(frame.hovered)
- // {
- // console.log("1111");
- // }
- // else
- // {
- // console.log("2222");
- // }
- // }
- }
- }
- /*##^##
- Designer {
- D{i:0;formeditorZoom:0.66}
- }
- ##^##*/
|