增加更改履历,增加点亮功能,修复右侧ID无法切换,修复无法完全关闭

This commit is contained in:
sunbeam 2023-03-21 10:26:14 +08:00
parent 8f8a09bfc9
commit f7edb129f1
4 changed files with 69 additions and 13 deletions

View File

@ -5,6 +5,7 @@
<file name="icon.ico" path="res\icon.ico" comment="res\icon.ico"/> <file name="icon.ico" path="res\icon.ico" comment="res\icon.ico"/>
</folder> </folder>
<folder name="窗体文件" path="dlg" comment="目录" embed="true" local="false" ignored="false"> <folder name="窗体文件" path="dlg" comment="目录" embed="true" local="false" ignored="false">
<file name="about.aardio" path="dlg\about.aardio" comment="dlg\about.aardio"/>
<file name="诊断子窗口.aardio" path="dlg\诊断子窗口.aardio" comment="dlg\诊断子窗口.aardio"/> <file name="诊断子窗口.aardio" path="dlg\诊断子窗口.aardio" comment="dlg\诊断子窗口.aardio"/>
</folder> </folder>
<folder name="user" path="user" embed="true" comment="目录" local="false" ignored="false"> <folder name="user" path="user" embed="true" comment="目录" local="false" ignored="false">

24
dlg/about.aardio Normal file
View File

@ -0,0 +1,24 @@
import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=499;bottom=399;border="thin";mode="popup";title=false)
winform.add(
button={cls="button";text="确定";left=359;top=346;right=471;bottom=387;z=1};
static={cls="static";text="Static";left=21;top=17;right=458;bottom=340;transparent=1;z=2}
)
/*}}*/
更新履历 = /*
V0.1_20230220: 初版
V0.2_20230221: 修复右板无法刷写,增加点亮功能,增加更改履历
V0.3_20230221: 修复关闭界面后程序没有完全关闭的问题
*/
winform.button.oncommand = function(id,event){
winform.close();
}
winform.static.text = 更新履历;
winform.show();
win.loopMessage();
return winform;

View File

@ -15,6 +15,7 @@ btnReadF199={cls="button";text="读取F199";left=192;top=261;right=284;bottom=28
btnReadHw={cls="button";text="硬件版本号";left=98;top=261;right=190;bottom=289;z=12}; btnReadHw={cls="button";text="硬件版本号";left=98;top=261;right=190;bottom=289;z=12};
btnReadSw={cls="button";text="软件版本号";left=4;top=261;right=96;bottom=289;z=10}; btnReadSw={cls="button";text="软件版本号";left=4;top=261;right=96;bottom=289;z=10};
btnTest={cls="button";text="停止";left=277;top=400;right=376;bottom=428;z=11}; btnTest={cls="button";text="停止";left=277;top=400;right=376;bottom=428;z=11};
button={cls="button";text="点亮";left=6;top=304;right=94;bottom=332;z=26};
cbbChannel={cls="combobox";left=58;top=64;right=191;bottom=90;edge=1;items={};mode="dropdown";z=3}; cbbChannel={cls="combobox";left=58;top=64;right=191;bottom=90;edge=1;items={};mode="dropdown";z=3};
cbbDev={cls="combobox";left=58;top=27;right=191;bottom=53;edge=1;items={};mode="dropdown";z=1}; cbbDev={cls="combobox";left=58;top=27;right=191;bottom=53;edge=1;items={};mode="dropdown";z=1};
edFile={cls="richedit";left=8;top=131;right=371;bottom=209;border=1;disabled=1;edge=1;multiline=1;wrap=1;z=14}; edFile={cls="richedit";left=8;top=131;right=371;bottom=209;border=1;disabled=1;edge=1;multiline=1;wrap=1;z=14};
@ -26,7 +27,7 @@ static={cls="static";text="设备";left=1;top=28;right=61;bottom=52;align="cente
static2={cls="static";text="通道";left=1;top=66;right=61;bottom=90;align="center";center=1;transparent=1;z=7}; static2={cls="static";text="通道";left=1;top=66;right=61;bottom=90;align="center";center=1;transparent=1;z=7};
static3={cls="static";text="刷写进度";left=389;top=408;right=442;bottom=428;transparent=1;z=16}; static3={cls="static";text="刷写进度";left=389;top=408;right=442;bottom=428;transparent=1;z=16};
static4={cls="static";text="烧录APP";left=13;top=108;right=85;bottom=132;center=1;transparent=1;z=17}; static4={cls="static";text="烧录APP";left=13;top=108;right=85;bottom=132;center=1;transparent=1;z=17};
static5={cls="static";text="V0.1_20230320";left=545;top=1;right=689;bottom=17;align="right";center=1;transparent=1;z=18} static5={cls="static";text="V0.3_20230321";left=545;top=1;right=689;bottom=17;align="right";center=1;notify=1;transparent=1;z=18}
) )
/*}}*/ /*}}*/
@ -34,13 +35,7 @@ import win;
import usb2canfd; import usb2canfd;
import win.timer; import win.timer;
var boot_count = 0;//boot时间计数器
var bootstate = false;//boot状态标志 var bootstate = false;//boot状态标志
var starttime = time.now();
timer_bootcount = win.timer(mainForm,100);
timer_bootcount.onTimer = function(){//boot时间定时器100ms间隔
boot_count++;
}
Display = function(str){//显示日志 Display = function(str){//显示日志
var nowtime = time(); var nowtime = time();
@ -48,7 +43,7 @@ Display = function(str){//显示日志
mainForm.edit.print(tostring(nowtime) + " " + str); mainForm.edit.print(tostring(nowtime) + " " + str);
} }
//遍历目录 //遍历目录
import console; //import console;
/* /*
import fsys.fileInfo; import fsys.fileInfo;
info = fsys.fileInfo("C:\Users\fcb19\Desktop\dll\libusb-1.0.dll"); info = fsys.fileInfo("C:\Users\fcb19\Desktop\dll\libusb-1.0.dll");
@ -211,7 +206,6 @@ mainForm.btnFlash.oncommand = function(id,event){
Display("开始刷写流程"); Display("开始刷写流程");
starttime = time.now(); starttime = time.now();
//timer_bootcount.enable(); //timer_bootcount.enable();
boot_count = 0;
DiagBootReq(); DiagBootReq();
@ -243,8 +237,8 @@ mainForm.btnReadF199.oncommand = function(id,event){
} }
var frmChild = win.loadForm("\dlg\诊断子窗口.aardio"); //var frmChild = win.loadForm("\dlg\诊断子窗口.aardio");
frmChild.show(false); //frmChild.show(false);
mainForm.btnDiag1003.oncommand = function(id,event){ mainForm.btnDiag1003.oncommand = function(id,event){
Diag10Req(0x03); Diag10Req(0x03);
} }
@ -265,13 +259,33 @@ mainForm.radiobutton.oncommand = function(id,event){
} }
mainForm.radiobutton2.oncommand = function(id,event){ mainForm.radiobutton2.oncommand = function(id,event){
if(mainForm.radiobutton.checked){ if(mainForm.radiobutton2.checked){
::PostThreadMessage(thrdId,106,0x710,0x610);//自定义消息 ::PostThreadMessage(thrdId,106,0x710,0x610);//自定义消息
} }
} }
mainForm.button.oncommand = function(id,event){
::PostThreadMessage(thrdId,107,1,0);//自定义消息
}
aboutcounter = 0;
mainForm.static5.oncommand = function(id,event){
aboutcounter++;
if(aboutcounter >= 5){
aboutcounter = 0;
var frmChild = mainForm.loadForm("\dlg\about.aardio");
frmChild.doModal(mainForm);
}
}
mainForm.text += mainForm.static5.text; mainForm.text += mainForm.static5.text;
thrdHandle,thrdId = thread.create( CanThread ) mainForm.onClose = function(hwnd,message,wParam,lParam){
//::PostThreadMessage(thrdId,109,0,0);//自定义消息
//sleep(20);
raw.closehandle(thrdHandle)
}
thrdHandle,thrdId = thread.create( CanThread );
mainForm.show(); mainForm.show();
return win.loopMessage(); return win.loopMessage();

View File

@ -52,6 +52,12 @@ FuncLoopMsg = function(msg){
case 106 { case 106 {
FuncSetCANID(msg.wParam,msg.lParam); FuncSetCANID(msg.wParam,msg.lParam);
} }
case 107 {
FuncSendMsg(msg.wParam);
}
case 109 {
win.quitMessage();
}
case 110 {//readDID case 110 {//readDID
FuncReadDID(msg.wParam); FuncReadDID(msg.wParam);
} }
@ -78,6 +84,17 @@ FuncSetCANID = function(req,resp){
DiagRespID = resp; DiagRespID = resp;
} }
FuncSendMsg = function(no){
select(no) {
case 1 {
var data = {0x00,0x00,0x40,0x00, 0x00,0x08,0x00,0x00};
CANHw.SendMsg(0x30,data);
}
else {
}
}
}
FuncFreshHw = function(){ FuncFreshHw = function(){