From e06dffc932cefdf4343ea255c89c40e8ad6bc833 Mon Sep 17 00:00:00 2001 From: sunbeam Date: Tue, 5 Jul 2022 13:23:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- default.aproj | 6 ++++-- main.aardio | 13 +++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/default.aproj b/default.aproj index 7dd0904..fd5411f 100644 --- a/default.aproj +++ b/default.aproj @@ -1,7 +1,9 @@  - + - + + + diff --git a/main.aardio b/main.aardio index 1938925..31c6b41 100644 --- a/main.aardio +++ b/main.aardio @@ -63,24 +63,17 @@ mainForm.btnFresh.oncommand = function(id,event){ else { var allhw = CANHw.GetAvailableHW(); for(i=1;#allhw;1){ - mainForm.cbbDev.add(allhw[i].name); + mainForm.cbbDev.add(allhw[i].name);//将硬件添加到下拉框中 } } mainForm.cbbDev.selIndex = 1 ::PostThreadMessage(thrdId,100,0,0)//自定义消息 } +//连接按键 mainForm.btnConnect.oncommand = function(id,event){ + //发送线程消息,thrdId为线程ID,101为自定义消息号,后两个为消息携带的参数 ::PostThreadMessage(thrdId,101,mainForm.cbbDev.selIndex,mainForm.cbbChannel.selIndex - 1)//自定义消息 - /* - var ret = CANHw.OpenDevice(mainForm.cbbDev.selIndex,mainForm.cbbChannel.selIndex - 1);//通道为0和1 - if(ret == 0){ - Display("连接成功"); - } - else { - Display("连接失败"); - } - */ } //CAN通讯线程