1067 lines
40 KiB
QML
1067 lines
40 KiB
QML
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Dialogs
|
|
import QtQuick.Layouts
|
|
|
|
import "./common"
|
|
// import "./Style"
|
|
Item {
|
|
id: self
|
|
property var cmdModel: ListModel{}
|
|
property var cmdLstModel: ListModel{}
|
|
property var editingLst: false
|
|
signal logTabViewDoubleClick
|
|
|
|
signal updateSorts
|
|
signal copyCmdClick(var row)
|
|
signal changeType(var type)
|
|
|
|
signal logExplorerClick // Explorer中查看日志
|
|
signal logCleanClick // 清空日志
|
|
signal createLstDialogAcceptClick
|
|
signal createLstClick
|
|
signal inserLstClick
|
|
signal deleteLstClick(var cmdLstId)
|
|
signal deleteCmdClick(var row)
|
|
signal signalInserLstClick(var cmdId)
|
|
signal jsBtnClick
|
|
|
|
signal checkSelectAll(var isSelect)
|
|
signal createCmdDialogAcceptClick
|
|
signal cmdCreateClick
|
|
signal cmdEditClick(var cmdId)
|
|
signal runCmdClick(var cmdId)
|
|
|
|
signal cmdLstCreateClick
|
|
signal cmdLstBackClick
|
|
signal cmdLstEditClick(var model)
|
|
signal cmdLstSaveClick(var cmdLstId)
|
|
signal runLstCmdClick(var cmdLstId)
|
|
signal runStopLstCmdClick(var cmdLstId)
|
|
property alias _logTableView: logTableView
|
|
property alias _cbCmdSelectAll: cbCmdSelectAll
|
|
property alias _createLstDialog: createLstDialog
|
|
property alias _tfLstName: tfLstName
|
|
property alias _tfLstRemark: tfLstRemark
|
|
property alias _editlst: editlst
|
|
property alias _cbCmdInstrument: cbCmdInstrument
|
|
property alias _cbCmdType : cbCmdType
|
|
property alias _cbCmdModule : cbCmdModule
|
|
property alias _tfCmdName : tfCmdName
|
|
property alias _tfCmdWord : tfCmdWord
|
|
property alias _teCmdData : teCmdData
|
|
property alias _tfCs : tfCs
|
|
property alias _tfYdcd : tfYdcd
|
|
property alias _cbEncode : cbEncode
|
|
property alias _cbDecode : cbDecode
|
|
property alias _sendCheck : sendCheck
|
|
property alias _receiveCheck : receiveCheck
|
|
property alias _createCmdDialog: createCmdDialog
|
|
property alias _cmdTableView: cmdTableView
|
|
property alias _cmdLstTableView: cmdLstTableView
|
|
property var jsText : "" // base64编码
|
|
property alias _tfYmsm : tfYmsm
|
|
property var rowWidth : 600
|
|
property var rowHeight : 30
|
|
|
|
SplitView {
|
|
orientation: Qt.Horizontal
|
|
id: views
|
|
anchors.fill: parent
|
|
|
|
Item {
|
|
width: 500
|
|
Layout.maximumWidth: 900
|
|
Rectangle{
|
|
id: cmdTitle
|
|
anchors.left : parent.left
|
|
height: 40
|
|
anchors.top: parent.top
|
|
anchors.right: parent.right
|
|
border.width: 1
|
|
color: "#f3f3f3"
|
|
border.color: "lightgray"
|
|
Row
|
|
{
|
|
x: 5
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: 5
|
|
|
|
QxText {
|
|
id: ttCmd
|
|
x: 5
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: editingLst ? "待插入指令" : "指令"
|
|
color: editingLst ? "#0089ff" : "black"
|
|
font.bold: true
|
|
font.pointSize: 11
|
|
}
|
|
|
|
|
|
QxTitleButton{
|
|
text: "创建"
|
|
visible: !editingLst && isAdmin
|
|
enabled: !lstRunning
|
|
onClicked: cmdCreateClick()
|
|
}
|
|
QxTitleButton{
|
|
text: "插入"
|
|
visible: editingLst && isAdmin
|
|
onClicked: inserLstClick()
|
|
}
|
|
|
|
QxTitleButton{
|
|
text: "编辑"
|
|
enabled: cmdTableView.currentRow > -1 && !lstRunning
|
|
visible: !editingLst && isAdmin
|
|
onClicked: cmdEditClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
QxTitleButton{
|
|
text: "运行"
|
|
visible: !editingLst
|
|
enabled: cmdTableView.currentRow > -1 && !hasCheck() && comIsOpen && !lstRunning
|
|
onClicked: runCmdClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
}
|
|
}
|
|
|
|
Item
|
|
{
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.top: cmdTitle.bottom
|
|
anchors.bottom: parent.bottom
|
|
TableView {
|
|
id: cmdTableView
|
|
|
|
anchors.fill: parent
|
|
property int fromIndex: 0;
|
|
property int toIndex: 0;
|
|
// headerDelegate: Rectangle{
|
|
// anchors.top: parent.top
|
|
// width: parent.width
|
|
// height: 25
|
|
// color: "white"
|
|
// QxText {
|
|
// anchors.centerIn: parent
|
|
// font.pointSize: 10
|
|
// text: styleData.value
|
|
// }
|
|
|
|
// ComboBox{
|
|
// visible: styleData.value === "combox"
|
|
// width: colCmdType.width
|
|
// height: parent.height
|
|
// anchors.left: parent.right
|
|
// model: searchTypes// ["全部","AGR","ABOX","ASM","IFB","CGR"]
|
|
// onCurrentTextChanged: {
|
|
// if( styleData.value === "combox")
|
|
// changeType(currentText)
|
|
// }
|
|
// }
|
|
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.value !== ""
|
|
// color: "lightgray"
|
|
// }
|
|
// Rectangle{
|
|
// y: parent.height
|
|
// width: parent.width
|
|
// height: 1
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
// rowDelegate: Rectangle{
|
|
// height: 20
|
|
// color : styleData.row ===cmdTableView.currentRow ?"#beebff": ( (styleData.row %2 == 0) ? "#f2f2f2": "white" )
|
|
// }
|
|
// itemDelegate: Item {
|
|
// clip: true
|
|
// CheckBox{
|
|
// id: cb
|
|
// visible: styleData.role === "checked"
|
|
// anchors.centerIn: parent
|
|
// checked: styleData.row > -1 ? model.checked : false
|
|
// Connections{
|
|
// target: self
|
|
// function onCheckSelectAll(isSelect){
|
|
// if(styleData.row > -1)
|
|
// model.checked = isSelect
|
|
// }
|
|
// }
|
|
// MouseArea{
|
|
// anchors.fill: parent
|
|
// onClicked: {
|
|
// if(styleData.row > -1)
|
|
// model.checked = !model.checked
|
|
// }
|
|
// }
|
|
// }
|
|
// QxText {
|
|
// visible: styleData.role !== "checked" && styleData.role !== "id"
|
|
// x: 5
|
|
// anchors.verticalCenter: parent.verticalCenter
|
|
// color: "black"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// text: !!styleData.value ? styleData.value : ""
|
|
// }
|
|
// QxText {
|
|
// visible: styleData.role === "id"
|
|
// x: 5
|
|
// anchors.centerIn: parent
|
|
// color: "#999"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// text: styleData.row + 1
|
|
// }
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.role !== "checked"
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
onDoubleClicked:{
|
|
if(editingLst)
|
|
signalInserLstClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
|
|
CheckBox{
|
|
id: cbCmdSelectAll
|
|
x: 5
|
|
y: 6
|
|
text: "全选"
|
|
visible: editingLst
|
|
onCheckedChanged: checkSelectAll(checked)
|
|
}
|
|
// TableViewColumn {
|
|
// title: ""
|
|
// role: "checked"
|
|
// visible: editingLst
|
|
// width: 50
|
|
// }
|
|
// TableViewColumn {
|
|
// title: "序号"
|
|
// role: "id"
|
|
// width: 50
|
|
// visible: !editingLst
|
|
// }
|
|
// TableViewColumn {
|
|
// title: "combox"
|
|
// width: 1
|
|
// }
|
|
// TableViewColumn {
|
|
// id: colCmdType
|
|
// title: "类型"
|
|
// role: "type"
|
|
// width: 60
|
|
// }
|
|
// TableViewColumn {
|
|
// title: "名称"
|
|
// role: "name"
|
|
// width: (cmdTableView.width-182)/2
|
|
// }
|
|
// TableViewColumn {
|
|
// title: "备注"
|
|
// role: "remark"
|
|
// width: (cmdTableView.width-182)/2
|
|
// }
|
|
MouseArea{
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
anchors.top: parent.top
|
|
property var headerHight: 25
|
|
property var scrollBarWidth: cmdTableView.width - cmdTableView.contentItem.width
|
|
anchors.rightMargin: scrollBarWidth
|
|
anchors.topMargin: headerHight
|
|
acceptedButtons: Qt.AllButtons
|
|
visible: !editingLst
|
|
onPressed: {
|
|
|
|
cmdTableView.currentRow = cmdTableView.rowAt(1, mouseY +headerHight)
|
|
|
|
if( mouse.buttons == Qt.RightButton )
|
|
{
|
|
if(!editingLst && cmdTableView.currentRow != -1)
|
|
menuCmd.popup()
|
|
}
|
|
else
|
|
{
|
|
if(searchType === "全部")
|
|
{
|
|
if(cmdTableView.currentRow > -1)
|
|
{
|
|
parent.fromIndex = cmdTableView.currentRow;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
onReleased: {
|
|
if(searchType === "全部")
|
|
{
|
|
updateSorts()
|
|
}
|
|
}
|
|
onPositionChanged: {
|
|
if(searchType === "全部")
|
|
{
|
|
var lastIndex = cmdTableView.rowAt(1 , mouseY +headerHight)
|
|
if ((lastIndex < 0) || (lastIndex > cmdModel.count))
|
|
return ;
|
|
if (cmdTableView.currentRow !== lastIndex){
|
|
cmdModel.move(cmdTableView.currentRow, lastIndex, 1);
|
|
}
|
|
parent.toIndex = lastIndex;
|
|
}
|
|
}
|
|
onDoubleClicked: runCmdClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
model: cmdModel
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
Item{
|
|
Layout.fillWidth: true
|
|
Layout.minimumWidth: 180
|
|
TableView {
|
|
id: cmdLstTableView
|
|
y: 40
|
|
width: parent.width
|
|
height: editingLst ? 0 : parent.height/2
|
|
// headerDelegate: Rectangle{
|
|
// anchors.top: parent.top
|
|
// width: parent.width
|
|
// height: 25
|
|
// color: "white"
|
|
// QxText {
|
|
// anchors.centerIn: parent
|
|
// font.pointSize: 10
|
|
// text: styleData.value
|
|
// }
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.value !== "序号"
|
|
// color: "lightgray"
|
|
// }
|
|
// Rectangle{
|
|
// y: parent.height
|
|
// width: parent.width
|
|
// height: 1
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
// rowDelegate: Rectangle{
|
|
// height: 20
|
|
// color : styleData.row === cmdLstTableView.currentRow ? "#beebff": ( (styleData.row %2 == 0) ? "#f2f2f2": "white" )
|
|
// }
|
|
|
|
// itemDelegate: Item {
|
|
// clip: true
|
|
// QxText {
|
|
// anchors.centerIn: parent
|
|
// color: "#999999"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// visible: styleData.role === "id"
|
|
// text: styleData.row+1
|
|
// }
|
|
// QxText {
|
|
// x: 5
|
|
// anchors.verticalCenter: parent.verticalCenter
|
|
// color: "black"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// visible: styleData.role !== "id" && styleData.role !== "status"
|
|
// text: styleData.value
|
|
// }
|
|
// QxText {
|
|
// x: 5
|
|
// anchors.verticalCenter: parent.verticalCenter
|
|
// color: "black"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// visible: styleData.role === "status"
|
|
// text: styleData.value === "0" ? "" : "运行中"
|
|
// }
|
|
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
Rectangle{
|
|
anchors.left : parent.left
|
|
height: 40
|
|
anchors.bottom: parent.top
|
|
anchors.right: parent.right
|
|
border.width: 1
|
|
color: "#f3f3f3"
|
|
border.color: "lightgray"
|
|
Row
|
|
{
|
|
x: 5
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: 5
|
|
|
|
QxText {
|
|
id: ttLst
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: editingLst ? "编辑队列" : "队列"
|
|
color: editingLst ? "#0089ff" : "black"
|
|
font.bold: true
|
|
font.pointSize: 11
|
|
}
|
|
QxTitleButton{
|
|
text: "创建"
|
|
visible: !editingLst && isAdmin
|
|
enabled: !lstRunning
|
|
onClicked: cmdLstCreateClick()
|
|
}
|
|
QxTitleButton{
|
|
text: "返回"
|
|
visible: editingLst
|
|
onClicked:
|
|
{
|
|
editingLst = false
|
|
editlst._readonly = !editingLst
|
|
cmdLstBackClick()
|
|
}
|
|
}
|
|
QxTitleButton{
|
|
text: editingLst ? "保存" : "编辑"
|
|
visible: isAdmin
|
|
enabled: !lstRunning && (!editingLst ? cmdLstTableView.currentRow > -1 : true)
|
|
onClicked: {
|
|
|
|
if(editingLst)
|
|
{
|
|
editingLst = false
|
|
editlst._readonly = !editingLst
|
|
cmdLstSaveClick(cmdLstModel.get(cmdLstTableView.currentRow).id)
|
|
}
|
|
else
|
|
{
|
|
editingLst = true
|
|
editlst._readonly = !editingLst
|
|
cmdLstEditClick(cmdLstModel.get(cmdLstTableView.currentRow))
|
|
}
|
|
}
|
|
}
|
|
QxTitleButton{
|
|
visible: !editingLst
|
|
width: 100
|
|
enabled: !lstRunning && cmdLstTableView.currentRow > -1 && comIsOpen
|
|
text: "运行"
|
|
onClicked: runLstCmdClick( cmdLstTableView.currentRow )
|
|
}
|
|
QxTitleButton{
|
|
visible: !editingLst
|
|
width: 100
|
|
enabled: lstRunning && cmdLstTableView.currentRow > -1
|
|
text: "结束"
|
|
onClicked: runStopLstCmdClick( cmdLstTableView.currentRow )
|
|
}
|
|
}
|
|
}
|
|
|
|
// TableViewColumn {
|
|
// id: lstNoCol
|
|
// title: "序号"
|
|
// role: "id"
|
|
// width: 60
|
|
// }
|
|
// TableViewColumn {
|
|
// id: lstNameCol
|
|
// title: "名称"
|
|
// role: "name"
|
|
// width: (cmdLstTableView.width - lstNoCol.width - lstStatusCol.width - 2 ) /4
|
|
// }
|
|
// TableViewColumn {
|
|
// id: lstLoopCol
|
|
// title: "循环次数"
|
|
// role: "repeat_nums"
|
|
// width: (cmdLstTableView.width - lstNoCol.width - lstStatusCol.width - 2 ) /4
|
|
// }
|
|
// TableViewColumn {
|
|
// id: lstDelayCol
|
|
// title: "间隔时间(ms)"
|
|
// role: "queue_delay"
|
|
// width: (cmdLstTableView.width - lstNoCol.width - lstStatusCol.width - 2 ) /4
|
|
// }
|
|
// TableViewColumn {
|
|
// id: lstTypeCol
|
|
// title: "备注"
|
|
// role: "remark"
|
|
// width: (cmdLstTableView.width - lstNoCol.width - lstStatusCol.width - 2 ) /4
|
|
// }
|
|
// TableViewColumn {
|
|
// id: lstStatusCol
|
|
// title: "状态"
|
|
// role: "status"
|
|
// width: 120
|
|
// }
|
|
MouseArea{
|
|
acceptedButtons: Qt.AllButtons
|
|
property var scrollBarWidth: cmdLstTableView.width - cmdLstTableView.contentItem.width
|
|
anchors.top: parent.top
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
anchors.rightMargin: scrollBarWidth
|
|
onPressed: {
|
|
if(lstRunning)
|
|
return
|
|
cmdLstTableView.currentRow = cmdLstTableView.rowAt(1 , mouseY )
|
|
if( mouse.buttons == Qt.RightButton )
|
|
{
|
|
if(cmdLstTableView.currentRow > -1)
|
|
menuLstCmd.popup()
|
|
}
|
|
}
|
|
onClicked: {
|
|
editingLst = false
|
|
editlst._readonly = !editingLst
|
|
if(cmdLstTableView.currentRow > -1)
|
|
cmdLstEditClick(cmdLstModel.get(cmdLstTableView.currentRow))
|
|
}
|
|
onDoubleClicked: {
|
|
if(cmdLstTableView.currentRow > -1)
|
|
runLstCmdClick( cmdLstTableView.currentRow )
|
|
}
|
|
}
|
|
model: cmdLstModel
|
|
}
|
|
Item {
|
|
anchors.top: cmdLstTableView.bottom
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
EditLst{ id: editlst }
|
|
}
|
|
}
|
|
|
|
Item{
|
|
width: 500
|
|
Layout.minimumWidth: 370
|
|
TableView {
|
|
id: logTableView
|
|
y: 40
|
|
width: parent.width < 0 ? 0 : parent.width
|
|
height: parent.height-40 < 0 ? 0 : parent.height-40
|
|
// headerDelegate: Rectangle{
|
|
// anchors.top: parent.top
|
|
// width: parent.width
|
|
// height: 25
|
|
// color: "white"
|
|
// QxText {
|
|
// anchors.centerIn: parent
|
|
// font.pointSize: 10
|
|
// text: styleData.value
|
|
// }
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.value !== "序号"
|
|
// color: "lightgray"
|
|
// }
|
|
// Rectangle{
|
|
// y: parent.height
|
|
// width: parent.width
|
|
// height: 1
|
|
// color: "lightgray"
|
|
// }
|
|
|
|
// }
|
|
// rowDelegate: Rectangle{
|
|
// height: styleData.row >= 0 ?( logModel.get(styleData.row).conetxt.indexOf('[DEBUG]') > -1 ? (debugStatus.checked ?tempTe.height:0) : tempTe.height):tempTe.height
|
|
// color : "white"
|
|
// TextEdit{
|
|
// id: tempTe
|
|
// width: logValueCol.width
|
|
// visible: false
|
|
// text: styleData.row >= 0 ? logModel.get(styleData.row).conetxt: ""
|
|
// font.pointSize: 10
|
|
// font.family: "微软雅黑"
|
|
// font.weight: Font.ExtraLight
|
|
// wrapMode: TextEdit.WrapAnywhere
|
|
// readOnly: true
|
|
// selectByMouse: true
|
|
// }
|
|
// }
|
|
// itemDelegate: Item {
|
|
// clip: true
|
|
// QxText {
|
|
// visible: styleData.role === "id"
|
|
// anchors.centerIn: parent
|
|
// color: "#999999"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// text: styleData.row+1
|
|
// }
|
|
// QxText {
|
|
// visible: styleData.role === "time"
|
|
// x: 5
|
|
// anchors.verticalCenter: parent.verticalCenter
|
|
// color: "#333333"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// text: styleData.value
|
|
// }
|
|
// TextEdit {
|
|
// visible: styleData.role === "conetxt"
|
|
// x: 5
|
|
// property var regex: /^\[[^[\]]*\]/
|
|
// anchors.fill: parent
|
|
// text: styleData.value.replace(/^\[[^[\]]*\]/, '').replace(/^\[[^[\]]*\]/, '')
|
|
// color: styleData.value.match(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)?styleData.value.match(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)[0]:"black"
|
|
// font.pointSize: 10
|
|
// font.family: "微软雅黑"
|
|
// font.weight: Font.ExtraLight
|
|
// wrapMode: TextEdit.WrapAnywhere
|
|
// readOnly: true
|
|
// selectByMouse: true
|
|
// }
|
|
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// color: "lightgray"
|
|
// }
|
|
// Rectangle{
|
|
// y: parent.height-1
|
|
// width: parent.width
|
|
// height: 1
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
Rectangle{
|
|
anchors.left : parent.left
|
|
height: 40
|
|
anchors.bottom: parent.top
|
|
anchors.right: parent.right
|
|
border.width: 1
|
|
color: "#f3f3f3"
|
|
border.color: "lightgray"
|
|
Row{
|
|
|
|
x: 5
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: 5
|
|
QxText {
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: "日志"
|
|
font.pointSize: 11
|
|
|
|
}
|
|
QxTitleButton{
|
|
text: "目录"
|
|
visible: !editingLst
|
|
onClicked: logExplorerClick()
|
|
}
|
|
QxTitleButton{
|
|
text: "清空"
|
|
visible: !editingLst
|
|
onClicked: logCleanClick()
|
|
}
|
|
Item{
|
|
width: 100
|
|
height: 1
|
|
}
|
|
|
|
}
|
|
Row
|
|
{
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: 5
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: 2
|
|
QxText {
|
|
text: "调试信息"
|
|
}
|
|
Switch {
|
|
id: debugStatus
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
checked: true
|
|
}
|
|
QxText {
|
|
text: debugStatus.checked ? "开" : "关"
|
|
}
|
|
}
|
|
}
|
|
|
|
// TableViewColumn {
|
|
// id: logNoCol
|
|
// title: "序号"
|
|
// role: "id"
|
|
// width: 50
|
|
// }
|
|
// TableViewColumn {
|
|
// id: logTimeCol
|
|
// title: "时间"
|
|
// role: "time"
|
|
// width: 150
|
|
// }
|
|
// TableViewColumn {
|
|
// id: logValueCol
|
|
// title: "内容"
|
|
// role: "conetxt"
|
|
// width: logTableView.width-logNoCol.width -logTimeCol.width - 20
|
|
// }
|
|
MouseArea{
|
|
anchors.top: parent.top
|
|
anchors.bottom: parent.bottom
|
|
anchors.left: parent.left
|
|
width: logTableView.contentItem.width
|
|
onDoubleClicked: logTabViewDoubleClick()
|
|
}
|
|
model: logModel
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
Dialog {
|
|
id: createLstDialog
|
|
title: "创建队列"
|
|
standardButtons: Dialog.NoButton
|
|
|
|
width: 350
|
|
height: 200
|
|
|
|
Column
|
|
{
|
|
anchors.centerIn: parent
|
|
spacing: 30
|
|
|
|
Item{
|
|
width: 300
|
|
height: 30
|
|
|
|
QxText{text: "队列名称"}
|
|
QxTextField{id: tfLstName;anchors.right: parent.right;width: 200;height: 30}
|
|
}
|
|
|
|
Item{
|
|
width: 300
|
|
height: 30
|
|
QxText{text:"备注"}
|
|
QxTextField{id: tfLstRemark;anchors.right: parent.right;width: 200;height: 30}
|
|
}
|
|
|
|
Row
|
|
{
|
|
width: 300
|
|
height: 30
|
|
|
|
spacing: 100
|
|
|
|
Button
|
|
{
|
|
text: "确认"
|
|
//style: ButtonStyle{}
|
|
onClicked: createLstDialog.accept()
|
|
}
|
|
Button
|
|
{
|
|
text: "取消"
|
|
//style: ButtonStyle{}
|
|
onClicked: createLstDialog.reject()
|
|
}
|
|
}
|
|
}
|
|
onAccepted: createLstDialogAcceptClick()
|
|
|
|
}
|
|
|
|
Dialog {
|
|
id: createCmdDialog
|
|
title: "创建指令"
|
|
standardButtons: Dialog.NoButton
|
|
visible: false
|
|
width: 600
|
|
height: 650
|
|
Column
|
|
{
|
|
anchors.centerIn: parent
|
|
spacing: 5
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text: "所属仪器"}
|
|
ComboBox{id: cbCmdInstrument;model:selectTypes;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text: "指令分类"}
|
|
ComboBox{id: cbCmdType;model:selectTypes;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text: "被测模块"}
|
|
ComboBox{id: cbCmdModule;model:selectTypes;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text: "指令名称"}
|
|
QxTextField{id: tfCmdName;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"指令字"}
|
|
QxRegTextField{id:tfCmdWord;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: 200
|
|
QxText{text:"指令数据"}
|
|
QxTextArea{id:teCmdData;
|
|
anchors.right: parent.right;width: 500;height: 200}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
Item{
|
|
width: rowWidth/2-10
|
|
height: rowHeight
|
|
anchors.left: parent.left
|
|
QxText{text:"超时"}
|
|
QxTextField{id:tfCs; x: 138; y: 0;anchors.right: parent.right;width: 160;height: 30 ;anchors.rightMargin: 30}
|
|
QxText{anchors.left: tfCs.right;text:"ms" ;anchors.leftMargin: 5}
|
|
}
|
|
Item{
|
|
width: rowWidth/2-15
|
|
height: rowHeight
|
|
anchors.right: parent.right
|
|
QxText{text:"应答长度"}
|
|
QxTextField{id:tfYdcd; y: 0;anchors.right: parent.right;width: 180;height: 30 ;}
|
|
|
|
}
|
|
}
|
|
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"编码"}
|
|
ComboBox{id: cbEncode;model:codec_display_lists;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"解码"}
|
|
ComboBox{id: cbDecode; model:codec_display_lists;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"发送校验"}
|
|
ComboBox{id: sendCheck;model:check_display_lists;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"接收校验"}
|
|
ComboBox{id: receiveCheck;model:check_display_lists;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"脚本"}
|
|
Button{
|
|
id:jsBtn;text:"编辑";anchors.right: parent.right;width: 100;height: 30
|
|
onClicked: jsBtnClick()
|
|
}
|
|
}
|
|
Item{
|
|
width: rowWidth
|
|
height: rowHeight
|
|
QxText{text:"备注"}
|
|
QxTextField{id:tfYmsm;anchors.right: parent.right;width: 500;height: 30}
|
|
}
|
|
Row
|
|
{
|
|
anchors.right: parent.right
|
|
spacing: 20
|
|
Button
|
|
{
|
|
text: "确认"
|
|
//style: ButtonStyle{}
|
|
onClicked: createCmdDialog.accept()
|
|
}
|
|
Button
|
|
{
|
|
text: "取消"
|
|
//style: ButtonStyle{}
|
|
onClicked: createCmdDialog.reject()
|
|
}
|
|
}
|
|
}
|
|
onAccepted: createCmdDialogAcceptClick()
|
|
}
|
|
|
|
Dialog {
|
|
id: removeCmdDlg
|
|
property var msg: ""
|
|
title: "删除指令"
|
|
standardButtons: Dialog.NoButton
|
|
Column
|
|
{
|
|
anchors.centerIn: parent
|
|
spacing: 10
|
|
QxText {
|
|
text: "删除指令:\n" + removeCmdDlg.msg
|
|
}
|
|
Row
|
|
{
|
|
anchors.right: parent.right
|
|
|
|
spacing: 20
|
|
Button
|
|
{
|
|
text: "是"
|
|
//style: ButtonStyle{}
|
|
onClicked: removeCmdDlg.accept()
|
|
}
|
|
Button
|
|
{
|
|
text: "否"
|
|
//style: ButtonStyle{}
|
|
onClicked: removeCmdDlg.reject()
|
|
}
|
|
}
|
|
}
|
|
visible: false
|
|
width: 300
|
|
height: 100
|
|
onAccepted: deleteCmdClick(cmdTableView.currentRow)
|
|
}
|
|
|
|
Menu {
|
|
id: menuCmd
|
|
MenuItem {
|
|
id: editMt
|
|
text: "编辑指令"
|
|
enabled: !lstRunning
|
|
visible: !editingLst && cmdTableView.currentRow != -1 && isAdmin
|
|
onTriggered: cmdEditClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
MenuItem {
|
|
id: copyMt
|
|
text: "创建副本"
|
|
enabled: !lstRunning
|
|
visible: !editingLst && cmdTableView.currentRow != -1 && isAdmin
|
|
onTriggered: copyCmdClick(cmdTableView.currentRow)
|
|
}
|
|
MenuItem {
|
|
id: sendMt
|
|
text: "运行指令"
|
|
enabled: !lstRunning
|
|
visible: !editingLst && cmdTableView.currentRow != -1
|
|
onTriggered: runCmdClick(cmdModel.get(cmdTableView.currentRow).id)
|
|
}
|
|
MenuItem {
|
|
id: delCmdMt
|
|
text: "删除指令"
|
|
enabled: !lstRunning
|
|
visible: !editingLst && cmdTableView.currentRow > -1 && isAdmin
|
|
onTriggered:{
|
|
removeCmdDlg.msg = cmdModel.get(cmdTableView.currentRow).name
|
|
removeCmdDlg.visible = true
|
|
}
|
|
}
|
|
|
|
|
|
// MenuSeparator {visible: sendMt.visible && createMt.visible}
|
|
|
|
// MenuItem {
|
|
// id: insertMt
|
|
// visible: hasCheck()
|
|
// text: "插入队列"
|
|
// onTriggered: inserLstClick()
|
|
// }
|
|
|
|
}
|
|
Dialog {
|
|
id: removeCmdLstDlg
|
|
property var msg: ""
|
|
title: "删除队列"
|
|
standardButtons: Dialog.NoButton
|
|
Column
|
|
{
|
|
anchors.centerIn: parent
|
|
spacing: 10
|
|
QxText {
|
|
text: "删除队列:\n" + removeCmdLstDlg.msg
|
|
}
|
|
Row
|
|
{
|
|
anchors.right: parent.right
|
|
|
|
spacing: 20
|
|
Button
|
|
{
|
|
text: "是"
|
|
//style: ButtonStyle{}
|
|
onClicked: removeCmdLstDlg.accept()
|
|
}
|
|
Button
|
|
{
|
|
text: "否"
|
|
//style: ButtonStyle{}
|
|
onClicked: removeCmdLstDlg.reject()
|
|
}
|
|
}
|
|
}
|
|
visible: false
|
|
width: 300
|
|
height: 100
|
|
onAccepted: deleteLstClick(cmdLstModel.get(cmdLstTableView.currentRow).id)
|
|
}
|
|
Menu{
|
|
id: menuLstCmd
|
|
MenuItem {
|
|
id: editCmdLstMt
|
|
enabled: !lstRunning
|
|
visible: cmdLstTableView.currentRow > -1 && isAdmin
|
|
text: "编辑队列"
|
|
onTriggered: {
|
|
editingLst = true
|
|
editlst._readonly = !editingLst
|
|
cmdLstEditClick(cmdLstModel.get(cmdLstTableView.currentRow))
|
|
}
|
|
}
|
|
MenuItem {
|
|
id: runCmdLstMt
|
|
enabled: !lstRunning
|
|
visible: cmdLstTableView.currentRow > -1
|
|
text: "运行队列"
|
|
onTriggered: runLstCmdClick( cmdLstTableView.currentRow )
|
|
}
|
|
MenuItem {
|
|
id: delCmdLstMt
|
|
enabled: !lstRunning
|
|
visible: cmdLstTableView.currentRow > -1 && isAdmin
|
|
text: "删除队列"
|
|
onTriggered: {
|
|
removeCmdLstDlg.msg = cmdLstModel.get(cmdLstTableView.currentRow).name
|
|
removeCmdLstDlg.visible = true
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|