From 08b58cc9e753d8310ae99fa61cbaf757f2f5a5d3 Mon Sep 17 00:00:00 2001 From: freefire <97975089@qq.com> Date: Tue, 14 Jan 2025 00:05:21 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=9B=B4=E6=96=B0pdf=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.aardio | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/main.aardio b/main.aardio index 8b32f8b..67ca479 100644 --- a/main.aardio +++ b/main.aardio @@ -6,7 +6,7 @@ mainForm.add( btnRun={cls="plus";text="生成pdf";left=891;top=661;right=991;bottom=691;align="left";border={color=-16777216;width=1};db=1;dr=1;font=LOGFONT(h=-16;name='微软雅黑');iconStyle={align="left";font=LOGFONT(h=-13;name='FontAwesome');padding={left=15}};iconText='\uF08B';textPadding={left=32};z=3}; btnSelectFile={cls="plus";text="数据源";left=786;top=661;right=886;bottom=691;align="left";border={top=1;right=1;bottom=1;color=-16777216};db=1;dr=1;font=LOGFONT(h=-16;name='微软雅黑');iconStyle={align="left";font=LOGFONT(h=-13;name='FontAwesome');padding={left=18}};iconText='\uF15C';textPadding={left=35};z=2}; editConsole={cls="richedit";left=10;top=510;right=990;bottom=650;bgcolor=4274224;color=15326936;db=1;dl=1;dr=1;hscroll=1;multiline=1;readonly=1;vscroll=1;z=5}; -editRScript={cls="edit";left=10;top=10;right=990;bottom=500;border=1;color=4473924;db=1;dl=1;dr=1;dt=1;hscroll=1;multiline=1;vscroll=1;z=4}; +editRScript={cls="edit";left=10;top=10;right=990;bottom=500;border=1;color=4473924;db=1;dl=1;dr=1;dt=1;font=LOGFONT(h=-16);hscroll=1;multiline=1;vscroll=1;z=4}; inputFile={cls="plus";left=10;top=661;right=786;bottom=691;align="right";border={left=1;top=1;bottom=1;color=-16736064};db=1;dl=1;dr=1;editable="edit";font=LOGFONT(h=-13);textPadding={left=5;top=8;right=5;bottom=2};z=1} ) /*}}*/ @@ -37,8 +37,8 @@ mainForm.btnRun.skin({ }); import console; -import process.r; import fsys.dlg; +import process.r; mainForm.editRScript.print($"\script\heatmap_script.R"); @@ -80,14 +80,21 @@ mainForm.btnRun.oncommand = function(id, event) { mainForm.editConsole.appendLink('\r\n'); mainForm.editConsole.appendText(out); - out_lines = string.split(out, '\r\n'); - if (out_lines[#out_lines] == outputFilePath) { - mainForm.editConsole.appendLink('\r\n'); - mainForm.editConsole.appendText( textColor = 0x37D437, point = 10, "热图已成功保存至:" + outputFilePath); + // 结果检查 + out_lines = string.split(out, '\r\n'); + if (!io.exist(outputFilePath) or out_lines[#out_lines] == "Execution halted") { + mainForm.editConsole.appendLink('\r\n'); + mainForm.editConsole.appendText( textColor = 0xC7C7FF, point = 10, "出错了!检查日志是否有错误说明"); } + else { + mainForm.editConsole.appendLink('\r\n'); + mainForm.editConsole.appendText( textColor = 0x37D437, point = 10, "热图已成功保存至(注意检查是否符合预期):"); + mainForm.editConsole.appendLink('\r\n'); + mainForm.editConsole.appendText( textColor = 0x37D437, point = 12, outputFilePath); + } + // 滚动到最后一行 mainForm.editConsole.vScroll(); - } //显示版本号