GeoGeBra C1
这个提交包含在:
15
GeoGeBra.ts
15
GeoGeBra.ts
@ -1,4 +1,5 @@
|
||||
import * as Core from "./Core"
|
||||
import * as fs from "fs";
|
||||
var GGB = require("node-geogebra")
|
||||
var Pool = new GGB.GGBPool({plotters:1,ggb:'local'});
|
||||
var PoolReady:Boolean = false;
|
||||
@ -11,9 +12,11 @@ Core.AddListener((c,i)=>{
|
||||
if(i.message.substring(0,2)!="绘图"){return};
|
||||
var Command = i.message.replace("绘图","");
|
||||
Plotter.evalGGBScript([Command]);
|
||||
Core.frame.SendMsg(c,i,"[GeoGeBra]执行完成,正在渲染。");
|
||||
Core.frame.SendImg(c,i,``);
|
||||
(Plotter.export64("png") as Promise<string>).then((v)=>{
|
||||
Core.frame.SendImg(c,i,`dara:image/png;${v}`);
|
||||
})
|
||||
})
|
||||
Core.frame.SendMsg(c, i, "[GeoGeBra]执行完成,正在渲染。");
|
||||
Core.frame.SendImg(c, i, "");
|
||||
(Plotter.export("png") as Promise<Buffer>).then(function (v) {
|
||||
fs.writeFile("/home/pi/AI/temp/img.png",v,()=>{
|
||||
Core.frame.SendImg(c, i, "/home/pi/AI/temp/img.png");
|
||||
});
|
||||
});
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户