diff --git a/default.aproj b/default.aproj
index 215c7d4..8dba383 100644
--- a/default.aproj
+++ b/default.aproj
@@ -5,6 +5,7 @@
+
diff --git a/dlg/about.aardio b/dlg/about.aardio
new file mode 100644
index 0000000..7b4457d
--- /dev/null
+++ b/dlg/about.aardio
@@ -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;
\ No newline at end of file
diff --git a/main.aardio b/main.aardio
index 1484db2..3905991 100644
--- a/main.aardio
+++ b/main.aardio
@@ -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};
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};
+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};
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};
@@ -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};
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};
-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 win.timer;
-var boot_count = 0;//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){//显示日志
var nowtime = time();
@@ -48,7 +43,7 @@ Display = function(str){//显示日志
mainForm.edit.print(tostring(nowtime) + " " + str);
}
//遍历目录
-import console;
+//import console;
/*
import fsys.fileInfo;
info = fsys.fileInfo("C:\Users\fcb19\Desktop\dll\libusb-1.0.dll");
@@ -211,7 +206,6 @@ mainForm.btnFlash.oncommand = function(id,event){
Display("开始刷写流程");
starttime = time.now();
//timer_bootcount.enable();
- boot_count = 0;
DiagBootReq();
@@ -243,8 +237,8 @@ mainForm.btnReadF199.oncommand = function(id,event){
}
-var frmChild = win.loadForm("\dlg\诊断子窗口.aardio");
-frmChild.show(false);
+//var frmChild = win.loadForm("\dlg\诊断子窗口.aardio");
+//frmChild.show(false);
mainForm.btnDiag1003.oncommand = function(id,event){
Diag10Req(0x03);
}
@@ -265,13 +259,33 @@ mainForm.radiobutton.oncommand = function(id,event){
}
mainForm.radiobutton2.oncommand = function(id,event){
- if(mainForm.radiobutton.checked){
+ if(mainForm.radiobutton2.checked){
::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;
-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();
return win.loopMessage();
\ No newline at end of file
diff --git a/user/CanThread.aardio b/user/CanThread.aardio
index 8bc67ed..48642e0 100644
--- a/user/CanThread.aardio
+++ b/user/CanThread.aardio
@@ -52,6 +52,12 @@ FuncLoopMsg = function(msg){
case 106 {
FuncSetCANID(msg.wParam,msg.lParam);
}
+ case 107 {
+ FuncSendMsg(msg.wParam);
+ }
+ case 109 {
+ win.quitMessage();
+ }
case 110 {//readDID
FuncReadDID(msg.wParam);
}
@@ -78,6 +84,17 @@ FuncSetCANID = function(req,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(){