初版
This commit is contained in:
commit
c69dff744a
10
CAN上位机/default.aproj
Normal file
10
CAN上位机/default.aproj
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project ver="10" name="CAN上位机" libEmbed="true" icon="..." ui="website" output="CAN上位机.exe" CompanyName="单位名称" FileDescription="CAN上位机" LegalCopyright="Copyright (C) 作者 2024" ProductName="CAN上位机" InternalName="CAN上位机" FileVersion="0.0.0.1" ProductVersion="0.0.0.1" publishDir="/dist/" dstrip="false" local="false" ignored="false">
|
||||
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
|
||||
<folder name="资源文件" path="res" embed="true" local="false" ignored="false"/>
|
||||
<folder name="窗体文件" path="dlg" comment="目录" embed="true" local="false" ignored="false"/>
|
||||
<folder name="web" path="web" embed="true" comment="目录" local="false" ignored="false">
|
||||
<file name="index.html" path="web\index.html" comment="web\index.html"/>
|
||||
<file name="vue.js" path="web\vue.js" comment="web\vue.js"/>
|
||||
</folder>
|
||||
</project>
|
17
CAN上位机/lib/config.aardio
Normal file
17
CAN上位机/lib/config.aardio
Normal file
@ -0,0 +1,17 @@
|
||||
//config 配置文件
|
||||
import fsys.config;
|
||||
config = fsys.config("/config/");
|
||||
//config = fsys.config( io.appData("/软件作者/应用程序名/") );
|
||||
|
||||
//不需要序列化的配置名字前请添加下划线
|
||||
namespace config {
|
||||
__appName = "应用程序名";
|
||||
__website = "http://www.aardio.com/";
|
||||
}
|
||||
|
||||
/**intellisense(config)
|
||||
__appName = 应用程序名
|
||||
__website = 官方网站
|
||||
saveAll() = 写入所有配置到文件
|
||||
? = 获取值时指定不以下划线开始的配置表名称,\n返回一个可自动序列化到同名配置文件的表对象。\n如果此对象名以下划线开始,则可以正常读写值不会序列化为配置文件。\n否则不能对此对象直接赋值,只能对配置表对象的成员赋值。\n\n配置表可自动自文件加载,退出线程前自动序列化并存入文件。\n仅序列化以字符串、数值为键的元素,\n仅序列化值为字符串、数值、buffer 以及定义了 _serialize 元方法的成员。\n循环引用的值转换为 null,序列化时忽略成员函数\n!fsys_table.
|
||||
end intellisense**/
|
29
CAN上位机/main.aardio
Normal file
29
CAN上位机/main.aardio
Normal file
@ -0,0 +1,29 @@
|
||||
import win.ui;
|
||||
/*DSG{{*/
|
||||
mainForm = win.form(text="CAN上位机";right=757;bottom=467)
|
||||
mainForm.add()
|
||||
/*}}*/
|
||||
|
||||
import web.view2;
|
||||
import wsock.tcp.simpleHttpServer;
|
||||
import godking.message;
|
||||
wb = web.view2(mainForm,,,"--force-app-mode");
|
||||
//wb = web.view2(mainForm);
|
||||
wb.enableDefaultContextMenus(false);
|
||||
//wb.go("https://www.baidu.com/");
|
||||
wb.external = {
|
||||
showmsg = function(str){
|
||||
mainForm.msgOk("ok");
|
||||
//mainForm.msgOk(str);
|
||||
}
|
||||
test = function(){
|
||||
mainForm.msgOk("ok");
|
||||
}
|
||||
|
||||
}
|
||||
wb.go(wsock.tcp.simpleHttpServer.startUrl("\web\index.html"));
|
||||
|
||||
|
||||
|
||||
mainForm.show();
|
||||
return win.loopMessage();
|
36
CAN上位机/web/index.html
Normal file
36
CAN上位机/web/index.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=<device-width>, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="vue.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="msg()">按钮</button>
|
||||
<button onclick="aardio.showmsg('hello world')">按钮2</button>
|
||||
<button onclick="aardio.test()">按钮3</button>
|
||||
<div id="app">
|
||||
<!-- 差值语法 -->
|
||||
{{ message.toUpperCase() }}
|
||||
<br><input type="text" :value="message">
|
||||
</div>
|
||||
<div id="app">
|
||||
<input type="text" :value="message">
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
msg = function () {
|
||||
// alert('hello world');
|
||||
aardio.showmsg('hello world');
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
message: 'Hello Vue!!!'
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
11932
CAN上位机/web/vue.js
Normal file
11932
CAN上位机/web/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user