修改input通过光标焦点是否在input内控制是否更新数据,回车下发参数让input失去焦点更新数据
| | |
| | | "D01手动状态": "D01 Manual Status",
|
| | | "清除ID": "Clear ID",
|
| | | "ID": "ID",
|
| | | "A02ID": "ID",
|
| | | "B01ID": "ID",
|
| | | "B02ID": "ID",
|
| | | "A02ID": "A02ID",
|
| | | "B01ID": "B01ID",
|
| | | "B02ID": "B02ID",
|
| | | "D02手动状态": "D02 Manual Status",
|
| | | "D03手动状态": "D03 Manual Status",
|
| | | "D04手动状态": "D04 Manual Status",
|
| | |
| | | |
| | | |
| | | |
| | | this.$forceUpdate(); |
| | | |
| | | |
| | | if(obj.Abort){ |
| | | |
| | | |
| | | |
| | | |
| | | if (obj.Abort[0].length > 0) { |
| | | this.receivedData=obj.Abort[0][0]; |
| | |
| | | this.dialogFormVisible3 = true; |
| | | } |
| | | } |
| | | this.$forceUpdate(); |
| | | |
| | | }.bind(this); |
| | | //关闭事件 |
| | |
| | | v-model="item.value" |
| | | class="input-box" |
| | | :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" |
| | | @keyup.enter.native="submitDataToBackend"> |
| | | @keyup.enter.native="submitDataToBackend($event)"> |
| | | </el-input> |
| | | |
| | | <!-- <el-input v-if="item.type === '0'" |
| | |
| | | |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | | closeSocket () { |
| | | // 关闭 WebSocket 连接 |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log('提交以下数据到后端:', jsonString); |
| | | socket?.send(jsonString); |
| | | |
| | | event.target.blur(); // 取消输入框焦点 |
| | | |
| | | }, |
| | | initWebSocket () { |
| | |
| | | }; |
| | | |
| | | // 收到消息 |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | |
| | | const inputBox = document.querySelectorAll('.input-box'); |
| | | inputBox.forEach(box => { |
| | | box.addEventListener('mouseenter', () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener('mouseleave', () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll('.input-box'); |
| | | // inputBox.forEach(box => { |
| | | // box.addEventListener('mouseenter', () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener('mouseleave', () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | |
| | | // 添加判断条件:如果光标在输入框内,则不执行后续逻辑 |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | | const jsonData2 = this.jsonData; |
| | | |
| | | const parms = obj.params; |
| | |
| | | const fanzhuan2 = obj.fanzhuan2; |
| | | const xiaoche2 = obj.xiaoche2; |
| | | |
| | | if(parms && !isMouseInInputBox){ |
| | | |
| | | |
| | | if(parms){ |
| | | let index = 0; |
| | | for (let i = 0; i < jsonData2.length - 1; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (Array.isArray(fanzhuan) && Array.isArray(fanzhuan[0]) && fanzhuan[0][0] !== undefined) { |
| | | jsonData2[4][0]['value'] = fanzhuan[0][0]; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // // 添加判断条件:如果光标在输入框内,则不执行后续逻辑 |
| | | // if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | // return; |
| | | // } |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | jsonData2[9][0]['value'] = xiaoche2[0][0]; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 关闭事件 |
| | | socket.onclose = function () { |
| | | console.log("websocket已关闭"); |
| | |
| | | <el-input style="width:250px;" v-if="item.state != 0 && item.type === '0' && groupIndex === 0 && (itemIndex === 2)" readonly v-model="item.value"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | | <el-input style="width: 250px;" v-else-if="(item.state !== 0) && (item.type === '0') && (itemIndex === 2)" v-model="item.value" readonly class="input-box" ></el-input>
|
| | |
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1" v-model="item.value" @keyup.enter.native="A02start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1" v-model="item.value" @keyup.enter.native="A02start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 2" v-model="item.value" @keyup.enter.native="B01start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 2" v-model="item.value" @keyup.enter.native="B01start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 3" v-model="item.value" @keyup.enter.native="B02start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 3" v-model="item.value" @keyup.enter.native="B02start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0'" v-model="item.value"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" ></el-input>
|
| | |
| | |
|
| | |
|
| | | },
|
| | | A01start(){
|
| | | A01start(event){
|
| | |
|
| | | const data = [];
|
| | |
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | A02start(){
|
| | | A02start(event){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 1; i < 2; i++) {
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | B01start(){
|
| | | B01start(event){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 2; i < 3; i++) {
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | B02start(){
|
| | | B02start(event){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 3; i < 4; i++) {
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | submitDataToBackend (currentButtonName) {
|
| | | if (currentButtonName === 'A01启动' || currentButtonName === 'A01 Start') {
|
| | |
| | | };
|
| | |
|
| | | // 收到消息
|
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内
|
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内
|
| | |
|
| | | const inputBox = document.querySelectorAll('.input-box');
|
| | | inputBox.forEach(box => {
|
| | | box.addEventListener('mouseenter', () => {
|
| | | isMouseInInputBox = true;
|
| | | });
|
| | | box.addEventListener('mouseleave', () => {
|
| | | isMouseInInputBox = false;
|
| | | });
|
| | | });
|
| | | // const inputBox = document.querySelectorAll('.input-box');
|
| | | // inputBox.forEach(box => {
|
| | | // box.addEventListener('mouseenter', () => {
|
| | | // isMouseInInputBox = true;
|
| | | // });
|
| | | // box.addEventListener('mouseleave', () => {
|
| | | // isMouseInInputBox = false;
|
| | | // });
|
| | | // });
|
| | |
|
| | | socket.onmessage = (msg) => {
|
| | | if (!msg.data) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | |
|
| | | // 添加判断条件:如果光标在输入框内,则不执行后续逻辑
|
| | | if (document.activeElement.tagName.toLowerCase() === 'input') {
|
| | | return;
|
| | | }
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | |
| | | const weihuiling = obj.weihuiling;
|
| | |
|
| | |
|
| | | if(obj.zuhe1&& !isMouseInInputBox){
|
| | | if(obj.zuhe1){
|
| | |
|
| | | // console.log(obj);
|
| | |
|
| | |
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 && (itemIndex === 2)" readonly v-model="item.value"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 " v-model="item.value" @keyup.enter.native="A02start"
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 " v-model="item.value" @keyup.enter.native="A02start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | |
|
| | |
| | | },
|
| | |
|
| | |
|
| | | A01start(){
|
| | | A01start(event){
|
| | | const data = [];
|
| | |
|
| | | for (let i = 0; i < 1; i++) {
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | |
|
| | | event.target.blur(); // 取消输入框焦点
|
| | |
|
| | | },
|
| | | A02start(){
|
| | | A02start(event){
|
| | |
|
| | | const data = [];
|
| | |
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | //提交方法
|
| | | submitDataToBackend (currentButtonName) {
|
| | |
| | | };
|
| | |
|
| | | // 收到消息
|
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内
|
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内
|
| | |
|
| | | const inputBox = document.querySelectorAll('.input-box');
|
| | | inputBox.forEach(box => {
|
| | | box.addEventListener('mouseenter', () => {
|
| | | isMouseInInputBox = true;
|
| | | });
|
| | | box.addEventListener('mouseleave', () => {
|
| | | isMouseInInputBox = false;
|
| | | });
|
| | | });
|
| | | // const inputBox = document.querySelectorAll('.input-box');
|
| | | // inputBox.forEach(box => {
|
| | | // box.addEventListener('mouseenter', () => {
|
| | | // isMouseInInputBox = true;
|
| | | // });
|
| | | // box.addEventListener('mouseleave', () => {
|
| | | // isMouseInInputBox = false;
|
| | | // });
|
| | | // });
|
| | |
|
| | | socket.onmessage = (msg) => {
|
| | | if (!msg.data) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | |
|
| | | if (document.activeElement.tagName.toLowerCase() === 'input') {
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | | // console.log(obj)
|
| | |
| | |
|
| | |
|
| | |
|
| | | if (obj.zuhe1&& !isMouseInInputBox ) {
|
| | | if (obj.zuhe1 ) {
|
| | | // 执行更新逻辑
|
| | | for (let i = 0; i < 2; i++) {
|
| | | jsonData2[i].forEach((item, index) => {
|
| | |
| | | <el-input |
| | | v-if="item.type === '0' && groupIndex==15" |
| | | v-model="item.value" |
| | | @keyup.enter.native="timeout" |
| | | @keyup.enter.native="timeout($event)" |
| | | style="width: 300px" |
| | | class="input-box2" |
| | | ></el-input> |
| | |
| | | } |
| | | }, |
| | | //范围 0-100 |
| | | timeout(){ |
| | | timeout(event){ |
| | | |
| | | |
| | | const data3 = []; |
| | |
| | | // setTimeout(()=> |
| | | // window.location.reload(),2000 |
| | | // ) |
| | | |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | |
| | | |
| | |
| | | socket.onopen = function () { |
| | | console.log("websocket已打开"); |
| | | }; |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | let isUpdated = false; // 定义标志变量 |
| | | const inputBox = document.querySelectorAll('.input-box2'); |
| | | inputBox.forEach(box => { |
| | | box.addEventListener('mouseenter', () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener('mouseleave', () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll('.input-box2'); |
| | | // inputBox.forEach(box => { |
| | | // box.addEventListener('mouseenter', () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener('mouseleave', () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | // 收到消息 |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | |
| | | // const inputBox = document.querySelectorAll('.id'); |
| | | // const target = event.target; |
| | | |
| | | if (parms && !isMouseInInputBox) { |
| | | if (parms ) { |
| | | //急停按钮 |
| | | jsonData2[13][0].button.value = obj.jiting[0][0]; |
| | | jsonData2[14][0].button.value = obj.jiting[0][1]; |
| | |
| | | } |
| | | } |
| | | } |
| | | this.$forceUpdate(); |
| | | |
| | | //扫描枪扫码的ID |
| | | |
| | | jsonData2.forEach((item) => { |
| | |
| | | v-if="item.type === '0'" |
| | | v-model="item.value" |
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`" |
| | | @keyup.enter.native="submitDataToBackend" |
| | | @keyup.enter.native="submitDataToBackend($event)" |
| | | ></el-input> |
| | | <span v-if="item.unit" :name="item.unit">{{ item.unit }}</span> |
| | | |
| | |
| | | this.$set(dataGroup[itemIndex].button, "value", 1); // 点击按钮后将值改为1 |
| | | }, |
| | | //提交数据到后端 |
| | | submitDataToBackend() { |
| | | submitDataToBackend(event) { |
| | | const inputData = this.jsonData.map((dataGroup) => { |
| | | return dataGroup.map((item) => { |
| | | if (item.type === "0") { |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log('提交以下数据到后端:', jsonString); |
| | | socket?.send(jsonString); |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | initWebSocket() { |
| | | let viewname = "Positioning1"; |
| | |
| | | }; |
| | | |
| | | // 收到消息 |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | |
| | | const inputBox = document.querySelectorAll('.input-box'); |
| | | inputBox.forEach(box => { |
| | | box.addEventListener('mouseenter', () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener('mouseleave', () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll('.input-box'); |
| | | // inputBox.forEach(box => { |
| | | // box.addEventListener('mouseenter', () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener('mouseleave', () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | |
| | | |
| | | const parms = obj.params; |
| | | |
| | | if(parms && !isMouseInInputBox){ // 只有在鼠标不在输入框内时才更新数据 |
| | | if(parms ){ // 只有在鼠标不在输入框内时才更新数据 |
| | | // console.log(parms) |
| | | |
| | | let index = 0; |
| | |
| | | <el-input |
| | | v-if="item.type === '0' && groupIndex === 0" |
| | | v-model="item.value" |
| | | @keyup.enter.native="zuhe1" |
| | | @keyup.enter.native="zuhe1($event)" |
| | | class="input-box" |
| | | :class="{ |
| | | 'special-class': groupIndex === 0, |
| | |
| | | <el-input |
| | | v-else-if="item.type === '0' && groupIndex === 1" |
| | | v-model="item.value" |
| | | @keyup.enter.native="zuhe2" |
| | | @keyup.enter.native="zuhe2($event)" |
| | | class="input-box" |
| | | :class="{ |
| | | 'special-class': groupIndex === 0, |
| | |
| | | this.$set(dataGroup[itemIndex].button, "value", 1); |
| | | } |
| | | }, |
| | | zuhe1() { |
| | | zuhe1(event) { |
| | | const data = []; |
| | | |
| | | for (let i = 0; i < 1; i++) { |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log("所有Type为0的value:", jsonString); |
| | | socket?.send(jsonString); |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | zuhe2() { |
| | | zuhe2(event) { |
| | | const data2 = []; |
| | | |
| | | for (let i = 1; i < 2; i++) { |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log("所有Type为0的value:", jsonString); |
| | | socket?.send(jsonString); |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | submitDataToBackend(currentButtonName) { |
| | | const data = []; |
| | |
| | | console.log("websocket已打开"); |
| | | }; |
| | | |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | |
| | | const inputBox = document.querySelectorAll(".input-box"); |
| | | inputBox.forEach((box) => { |
| | | box.addEventListener("mouseenter", () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener("mouseleave", () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll(".input-box"); |
| | | // inputBox.forEach((box) => { |
| | | // box.addEventListener("mouseenter", () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener("mouseleave", () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | |
| | | // console.log(obj) |
| | | const weihuiling = obj.weihuiling; |
| | | const jsonData2 = this.jsonData; |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | if (obj.zuhe1 && !isMouseInInputBox) { |
| | | if (obj.zuhe1 ) { |
| | | //启动按钮 |
| | | |
| | | // 执行更新逻辑 |
| | |
| | | List<String> addressList1 = Arrays.asList(config.getProperty("Parameter2.id").split(",")); |
| | | |
| | | List<String> paramlist = S7control.getinstance().readStrings(addressList1); |
| | | |
| | | // System.out.println("addressList:" + paramlist); |
| | | |
| | | //手动状态 |
| | | List<String> addresses = Arrays.asList(config.getProperty("Parameter2.state").split(",")); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 检查布尔值列表是否为空 |
| | | if (!sValue.isEmpty()) { |
| | |
| | | System.out.println("Values " + sValue + " written to PLC at address " + addressList0); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | System.err.println("An error occurred while writing bit to PLC: " + e.getMessage()); |
| | | } |
| | |
| | | //终止继续按钮
|
| | | List<String> niuanaddressList3 = Arrays.asList(config.getProperty("Parameter2.stop").split(","));
|
| | | List<Boolean> anniuread = S7control.getinstance().readBits(niuanaddressList3);
|
| | |
|
| | | // Boolean[] value4 = { false, false};
|
| | | // List<Boolean> anniuread = new ArrayList<>(Arrays.asList(value4));
|
| | | // Boolean[] value5 = { true};
|
| | | // List<Boolean> resets = new ArrayList<>(Arrays.asList(value5));
|
| | | short[] anniuparams = new short[anniuread.size()];
|
| | | for (int i = 0; i < anniuread.size(); i++) {
|
| | | boolean value = anniuread.get(i);
|
| | |
| | | resets2[i] = value ? (short) 1 : (short) 0;
|
| | | }
|
| | |
|
| | | // System.out.println(resets);
|
| | | System.out.println(resets);
|
| | | for (short number : resets2) {
|
| | |
|
| | | if (number == 1) {
|
| | |
| | | |
| | | //new PlcHold().start(); |
| | | |
| | | new Plchome().start(); |
| | | |
| | | new Plcalarm().start(); |
| | | |
| | | new Plcsign().start(); |
| | | |
| | | |
| | | new Plcstate().start(); |
| | | new PlcPositioning1().start(); |
| | | |
| | | new PlcParameter2().start(); |
| | | |
| | | new PLCAutomaticParameterSetting().start(); |
| | | new PlcManualonePosition().start(); |
| | | new PlcManualonePosition2().start(); |
| | | new PlcServoManualone().start(); |
| | | new PLCManualJog().start(); |
| | | // new Plchome().start(); |
| | | // |
| | | // new Plcalarm().start(); |
| | | // |
| | | // new Plcsign().start(); |
| | | // |
| | | // |
| | | // new Plcstate().start(); |
| | | // new PlcPositioning1().start(); |
| | | // |
| | | // new PlcParameter2().start(); |
| | | // |
| | | // new PLCAutomaticParameterSetting().start(); |
| | | // new PlcManualonePosition().start(); |
| | | // new PlcManualonePosition2().start(); |
| | | // new PlcServoManualone().start(); |
| | | // new PLCManualJog().start(); |
| | | } |
| | | } |