-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
4,739 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//pkg 包管理 | ||
import julia; | ||
import julia.process; | ||
|
||
namespace julia.pkg; | ||
|
||
add = function(name){ | ||
if(!..julia.import(name)){ | ||
..julia.process.exec(`import Pkg | ||
Pkg.add(ARGS[1])`,name).waitOne() | ||
return ..julia.import(name); | ||
} | ||
} | ||
|
||
setServer = function(url){ | ||
..string.setenv("JULIA_PKG_SERVER",url); | ||
} | ||
|
||
setServer("https://mirrors.sjtug.sjtu.edu.cn/julia"); | ||
|
||
/*****intellisense(julia.pkg) | ||
add(__) = 添加参数 @1 指定的模块。\n参数 @1 用一个字符串指定模块名。\n如果模块无法导入则安装模块。\n否则安装模块,安装成功则导入模块。\n成功返回模块对象 | ||
add() = !juliaModule. | ||
setServer(_) = 设置镜像服务器。\n参数 @1 用一个字符串指定镜像服务器地址 | ||
end intellisense*****/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//process 进程 | ||
import julia.lib; | ||
import string.cmdline; | ||
import process; | ||
import process.popen; | ||
|
||
namespace julia; | ||
|
||
var exePath = ..io.joinpath(..string.getenv("JULIA_BINDIR"),"julia.exe"); | ||
|
||
class process{ | ||
ctor(...){{ | ||
|
||
var err; | ||
this,err = ..process(exePath,..string.cmdline.arguments(...),{workDir=workDir}); | ||
if(!this) error(err,2); | ||
}}; | ||
} | ||
|
||
process.workDir = ..io.fullpath("/"); | ||
|
||
process.popen = function(...){ | ||
var err; | ||
var prcs,err = ..process.popen(exePath,..string.cmdline.arguments(...),{workDir=workDir}); | ||
if(!prcs) error(err,2); | ||
|
||
prcs.codepage = 65001; | ||
prcs.killOnExit(); | ||
return prcs; | ||
} | ||
|
||
process.eval = function(code,...){ | ||
var args = ..string.cmdline.arguments(...); | ||
if( type.isString(code) && ..string.find(code,'^<\xEF\xBB\xBF>?\\s*<\\?\\>>|<\\<\\?>') ){ | ||
var err; | ||
code,err = ..string.loadcode(code); | ||
if(err) error(err,2); | ||
} | ||
|
||
..table.unshift(args,"-E",code); | ||
var prcs = process.popen(args); | ||
if(prcs){ | ||
return prcs.readAll() | ||
} | ||
} | ||
|
||
process.exec = function(code,...){ | ||
var args = ..string.cmdline.arguments(...); | ||
if( type.isString(code) && ..string.find(code,'^<\xEF\xBB\xBF>?\\s*<\\?\\>>|<\\<\\?>') ){ | ||
var err; | ||
code,err = ..string.loadcode(code); | ||
if(err) error(err,2); | ||
} | ||
|
||
..table.unshift(args,"-e",code); | ||
return process(args); | ||
} | ||
|
||
/*****intellisense() | ||
julia.process(__) = 创建 Julia 进程,打开控制台窗口。\n返回进程( process )对象。\n可以用一个字符串参数指定多个启动参数,用空格分隔多个参数,\n也可以传入多个参数由 aardio 自动合并(空格分隔参数),\n合并多参数时,单参数含空格或需转义时自动加双引号并自动转义 | ||
julia.process.popen(__) = 创建 Julia 进程,不打开控制台窗口。\n返回进程管道( process.popen )对象。\n主进程退出时此函数创建的 Julia 进程会自动退出。\n可以用一个字符串参数指定多个启动参数,用空格分隔多个参数,\n也可以传入多个参数由 aardio 自动合并(空格分隔参数),\n合并多参数时,单参数含空格或需转义时自动加双引号并自动转义 | ||
julia.process.eval(__) = 创建 Julia 进程执行参数指定的 Julia 代码。\n不打开控制台窗口,返回进程所有输出以及表达式的值。\n主进程退出时此函数创建的 Julia 进程会自动退出。\n\n也可以传入多个参数由 aardio 自动合并(空格分隔参数),\n合并多参数时,单参数含空格或需转义时自动加双引号并自动转义。\n在 Julia 代码中可以用 ARGS 获取参数 | ||
julia.process.exec(__) = 创建 Julia 进程执行参数指定的 Julia 代码。\n打开新的控制台窗口。返回进程( process )对象。\n也可以传入多个参数由 aardio 自动合并(空格分隔参数),\n合并多参数时,单参数含空格或需转义时自动加双引号并自动转义。\n在 Julia 代码中可以用 ARGS 获取参数 | ||
julia.process() = !process. | ||
julia.process.popen() = !process_popen. | ||
julia.process.exec() = !process. | ||
end intellisense*****/ | ||
|
122 changes: 122 additions & 0 deletions
122
aardio/download/lib/process.adb.tar/adb/connecter.aardio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
//connecter 连接 | ||
import win.ui; | ||
import process.adb; | ||
import process.adb.qrCode; | ||
import win.ui.atom; | ||
|
||
namespace process.adb; | ||
|
||
class connecter{ | ||
ctor(parent,tParam){ | ||
/*DSG{{*/ | ||
this = ..win.form(text="正在等待安卓手机连接 ……";right=564;bottom=593;bgcolor=16777215;exmode="none";mode="popup";parent=parent) | ||
this.add( | ||
button={cls="button";text="连接到 ...";left=299;top=542;right=530;bottom=575;db=1;disabled=1;dr=1;z=5}; | ||
edit={cls="edit";left=19;top=382;right=544;bottom=535;db=1;dl=1;dr=1;edge=1;hscroll=1;multiline=1;vscroll=1;z=2}; | ||
editPort={cls="edit";left=158;top=546;right=274;bottom=573;db=1;dr=1;edge=1;num=1;z=3}; | ||
plus={cls="plus";left=19;top=20;right=544;bottom=361;db=1;dl=1;dr=1;dt=1;repeat="scale";z=1}; | ||
static={cls="static";text="请输入连接端口:";left=9;top=550;right=139;bottom=574;align="right";db=1;dr=1;transparent=1;z=4} | ||
) | ||
/*}}*/ | ||
|
||
if(..process.adb.isConnected()){ | ||
this.close();//关闭窗口,避免程序不退出 | ||
return true; | ||
} | ||
|
||
this.findAdbDevice = function(){ | ||
|
||
if(!this.lastAddress) { | ||
this.lastAddress = ..process.adb.lastAddress(); | ||
if(#this.lastAddress){ | ||
this.edit.print("正在连接:" + this.lastAddress); | ||
} | ||
} | ||
|
||
|
||
//尝试无线连接 | ||
if(!..process.adb.findDevice()) { | ||
..process.adb.connect() | ||
} | ||
|
||
//如果连接成功 | ||
if( ..process.adb.isConnected()){ | ||
|
||
this.button.disabledText = null; | ||
|
||
this.endModal(true); | ||
|
||
//退出定时器 | ||
return false; | ||
} | ||
} | ||
|
||
this.show(); | ||
this.button.disabledText = {"✶";"✸";"✹";"✺";"✹";"✷"} | ||
|
||
|
||
/* | ||
下面是配对代码,只有首次连接需要配对。 | ||
*/ | ||
this.button.oncommand = function(id,event){ | ||
|
||
//无线连接手机 | ||
var str = ..process.adb.connect(owner.adbInfo.addr + ":" + this.editPort.text); | ||
if(str){ | ||
|
||
var addr = ..process.adb.tcpip("5555",true); | ||
if( addr ){ | ||
this.edit.print("已开启无线调试固定端口,连接地址:",addr); | ||
this.edit.print("已自动保存连接地址,之后可以免参数调用连接手机。" ); | ||
|
||
this.findAdbDevice(); | ||
} | ||
} | ||
else { | ||
this.msgboxErr("连接失败,请输入正确端口") | ||
} | ||
} | ||
|
||
//配对成功回调此函数 | ||
this.onAdbPair = function(info){ | ||
if(info){ | ||
if(this.findDeviceTimerId){ | ||
this.clearInterval(this.findDeviceTimerId); | ||
this.findDeviceTimerId = null; | ||
} | ||
|
||
this.edit.print(""); | ||
this.edit.print("配对成功:",info); | ||
this.edit.print("请输入手机开发设置显示的无线调试端口号,点击连接。"); | ||
this.button.adbInfo = info; | ||
this.button.disabledText = null; | ||
|
||
this.button.text = "连接到:" + info.addr; | ||
} | ||
|
||
return true;//返回 false 停止此二维码的自动配对 | ||
} | ||
|
||
//生成配对二维码 | ||
var qrBmp = ..process.adb.qrCode(this ); | ||
this.plus.setBackground(qrBmp.copyBitmap(this.plus.width)); | ||
|
||
this.edit.text = /* | ||
手机与电脑连接到同一无线局域网, | ||
然后打开安卓手机 > 设置 > 找到手机版本号连续点按显示开发者选项。 | ||
然后打开安卓手机 > 设置 > 开发者选项 > 无线调试 > 扫二维码配对。 | ||
*/ | ||
this.edit.print(""); | ||
|
||
if(this.findAdbDevice()!==false){ | ||
this.findDeviceTimerId = this.setInterval( this.findAdbDevice ,2000 ); | ||
} | ||
|
||
return this.doModal(); | ||
}; | ||
} | ||
|
||
if( !owner ) ..process.adb.connecter(); | ||
/**intellisense() | ||
process.adb.connecter() = 安卓手机连接向导。\n连接成功返回 true 。\n无连接或连接失败显示二维码配对与连接向导。\n连接失败返回 false。\n!this. | ||
end intellisense**/ |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
aardio/download/lib/soImage.tar/soImage/directX/.build/main.aardio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ide; | ||
import fsys; | ||
|
||
var publisDir = ide.getPublisDir(); | ||
if(!#publisDir)return; | ||
|
||
var pubDir = fsys.joinpath(publisDir,"\lib\soImage\directX\.res\" ); | ||
if( ! io.exist(pubDir) ){ | ||
var libPath,libDir = io.libpath("soImage.directX") | ||
..fsys.createDir(pubDir); | ||
..fsys.copy( fsys.joinpath(libDir,"\.res\d3dx9_43.dll") ,pubDir,0x10/*_FOF_NOCONFIRMATION*/ | 0x200/*_FOF_NOCONFIRMMKDIR*/); | ||
} |
Binary file not shown.
Oops, something went wrong.