当前位置:网站首页>一款不错的工具:aardio
一款不错的工具:aardio
2022-04-23 14:23:00 【strongerHuang】
关注+星标公众号,不错过精彩内容
来源 |嵌入式大杂烩
今天为大家分一款活跃了17年的开发工具:aardio。
本期主角:aardio
aardio属于易用性极强的动态语言,但也是一种混合语言,可以罕见地、非常方便地操作静态类型,因此可以直接调用 C语言、C++ 等等静态语言的 API 接口函数。
aardio应用于桌面软件开发。aardio已经发展了 17年
, 一直保持非常活跃地更新。
aardio的特点:
良好的架构与语法
小、轻、快,轻便利索,体积仅 6.5MB,学习和使用成本极低
胶水能力极强
可以嵌入非常多的浏览器控件
不仅仅可以开发桌面软件,也可以用于开发网站
可以方便地通过拖拉传统控件创建程序
aardio官网:
https://www.aardio.com/
aardio的使用
aardio说白了就是一门编程语言,它很灵活且强大。下面一起通过实例来简单了解aardio。
首先,从aardio官网下载得到aardio开发包:
aardio的开发包非常小!里面的内容有:
其中,开发工具 aardio.exe
只有6MB!相对于其它如Qt Creator、VS等开发工具动不动就几个G,aardio.exe的小就是一大优势。
aardio.exe的界面如:
aardio专注于桌面软件开发。我们就来看一下如何使用aardio来写一个简单的 串口点灯上位机
。没错,这个我们之前有基于QT的手把手开发教程:易懂 | 手把手教你编写你的第一个上位机
本篇文章我们基于aardio来写一个,体验桌面软件快速开发!
首先,使用界面控件设计界面:
这些控件不是拖动过去的。而是 先点击鼠标左键选中某个控件
,再在设计区域 点击鼠标左键放置控件
。
然后,切换到代码视图编写代码:
import win.dlg.message;
import win.ui;
/*DSG{
{*//*}}*/
// 串口列表
import sys.comPort;
var comPorts = sys.comPort.list();
mainForm.combobox.items = comPorts;
mainForm.combobox.selIndex = 1;
import sio;
var sioPort;
// 打开串口
mainForm.openBtn.oncommand = function(id,event){
if(sioPort){
sioPort.close();
}
var err;
sioPort,err = sio.port(mainForm.combobox.selText);
if(!sioPort){
return mainForm.msgErr(err);
}
sioPort.ioctl(eval(mainForm.baudrateEdit.text),8,1);
mainForm.msgOk("已打开端口",1000)
}
// 关闭串口
mainForm.closeBtn.oncommand = function(id,event){
if(sioPort){
sioPort.close();
mainForm.msgOk("已关闭端口",1000);
}
}
// 点灯
mainForm.ledonBtn.oncommand = function(id,event){
if(!sioPort){
mainForm.openBtn.oncommand();
}
if( !sioPort.writeHex("01") ){
return mainForm.msgErr("发送失败");
}
else {
return mainForm.msgOk("发送ON成功",1000);
}
}
// 灭灯
mainForm.ledoffBtn.oncommand = function(id,event){
if(!sioPort){
mainForm.openBtn.oncommand();
}
if( !sioPort.writeHex("00") ){
return mainForm.msgErr("发送失败");
}
else {
return mainForm.msgOk("发送OFF成功",1000);
}
}
if(_ARGV.opt){
mainForm.edit.print(_ARGV.opt,_ARGV[#_ARGV]);
}
mainForm.edit.oncommand = function(id,event){
}
mainForm.static.oncommand = function(id,event){
}
mainForm.static2.oncommand = function(id,event){
}
mainForm.show();
return win.loopMessage();
代码比较短,大家应该都看得懂。
运行:
测试:
程序打包:
程序打包发布,点击这个按钮就可以,生成的可执行程序不依赖其它文件,有点强~
可以看到,对比之前易懂 | 手把手教你编写你的第一个上位机一文来说,使用aardio来写这个上位机要相对简单很多。无论是从代码量、步骤、程序打包。
从我写文的角度来看:写易懂 | 手把手教你编写你的第一个上位机这篇文章花了我近一周的业余时间;写这篇文章只花了两天的业余时间,包括去了解、学习aardio的时间~
aardio作为一门编程语言,其有一定的语法。相关例子:
例如:
但学过C的我们应该很容易可以看得懂。
aardio同样是一门胶水语言,能嵌入很多主流的编程语言:
aardio调用C语言函数:
aardio虽然主要是应用于桌面软件开发,但aardio还包含着许多其它内容:
每一块内容都有很丰富的例子,感兴趣的朋友可自行阅读学习。
本篇文章的上、下位机demo,可在公众号后台回复关键词:aardio
,即可获取。
如果觉得文章有帮助,麻烦帮忙点赞、收藏、转发,谢谢!
------------ END ------------
关注公众号回复“加群”按规则加入技术交流群,回复“1024”查看更多内容。
点击“阅读原文”查看更多分享。
版权声明
本文为[strongerHuang]所创,转载请带上原文链接,感谢
https://strongerhuang.blog.csdn.net/article/details/124357951
边栏推荐
- Nacos uses demo as configuration center (IV)
- Some little records~
- Mysql的安装过程(已经安装成功的步骤说明)
- Five ways of using synchronized to remove clouds and fog are introduced
- 电子秤称重系统设计,HX711压力传感器,51单片机(Proteus仿真、C程序、原理图、论文等全套资料)
- c语言在结构体传参时参数压栈问题
- ssh限制登录的四种手段
- 查找水仙花数-for循环实践
- js 进度条,显示加载进度
- AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc
猜你喜欢
基于单片机的DS18B20的数字温度监控报警系统设计【LCD1602显示+Proteus仿真+C程序+论文+按键设置等】
After entering the new company, the operation and maintenance engineer can understand the deployment of the system from the following items
顺序栈的基本操作
统信UOS PHP7.2.3升级至PHP7.2.24
MCU function signal generator, output four kinds of waveforms, adjustable frequency, schematic diagram, simulation and C program
AT89C51单片机的数字电压表开发,量程0~5V,proteus仿真,原理图PCB和C程序等
Nacos uses demo as configuration center (IV)
Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code
交通灯系统51单片机设计(附Proteus仿真、C程序、原理图及PCB、论文等全套资料)
C语言知识点精细详解——数据类型和变量【2】——整型变量与常量【1】
随机推荐
bc的用法
Basic regular expression
Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code
如何5分钟上手使用OCR
Four ways of SSH restricting login
时间复杂度计算举例
Gif to still image processing
Man man notes and @ reboot usage of crontab
AT89C51单片机的数字电压表开发,量程0~5V,proteus仿真,原理图PCB和C程序等
Electronic scale weighing system design, hx711 pressure sensor, 51 single chip microcomputer (proteus simulation, C program, schematic diagram, thesis and other complete data)
Nacos作为配置中心(四) 使用Demo
Redis源码分析之HSET流程与ziplist
Upgrade of openssh and modification of version number
Use of ansible and common modules
ssh限制登录的四种手段
初识STL
顺序栈的基本操作
差分隐私(背景介绍)
微信小程序轮播图swiper
ArrayList集合基本使用