From 0e1156bc5a5ce6242280bb53b09ef86ffa40cced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=85=86=E5=B0=89?= <228127304@qq.com> Date: Wed, 26 Aug 2026 11:21:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=20Kiva=20?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E6=B5=8B=E8=AF=95=E4=B8=8E=20SetDisplayInfo?= =?UTF-8?q?=EF=BC=8C=E5=BC=BA=E5=88=B6=E7=BB=93=E6=9D=9F/=E8=BF=94?= =?UTF-8?q?=E5=8E=82=E5=8A=A0=E5=B9=B3=E5=8F=B0=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- StandardScene.QrLidar/CarTypes/Kiva.cs | 103 ++++--------------------- 1 file changed, 14 insertions(+), 89 deletions(-) diff --git a/StandardScene.QrLidar/CarTypes/Kiva.cs b/StandardScene.QrLidar/CarTypes/Kiva.cs index 20046e9..eedf00d 100644 --- a/StandardScene.QrLidar/CarTypes/Kiva.cs +++ b/StandardScene.QrLidar/CarTypes/Kiva.cs @@ -1,11 +1,11 @@ -using LessokajiWeaverUtilities.Utilities; +using LessokajiWeaverUtilities.Utilities; using Newtonsoft.Json; -using SimpleLite; -using SimpleLite.RCS; -using SimpleLite.RCS.CarTypes; -using SimpleLite.CADTools; -using SimpleLite.Props; -using SimpleLite.UI; +using Simple3; +using Simple3.RCS; +using Simple3.RCS.CarTypes; +using Simple3.CADTools; +using Simple3.Props; +using Simple3.UI; using SimpleCore; using SimpleCore.Compiler; using SimpleCore.Extras; @@ -261,85 +261,6 @@ namespace StandardScene.CarTypes } } - private bool LoopTestRunning = false; - [MethodMember(Name = "循环测试")] - [I18N.DocumentTranslation(Name = "Loop Test", locale = "en")] - public async void LoopTest() - { - LoopTestRunning = true; - - var a = SimpleLib.GetAllSites().First(s => s.name == "A"); - var b = SimpleLib.GetAllSites().First(s => s.name == "B"); - - var plan1 = new SegmentPlan() { usingCar = this }; - plan1.fields["action"] = "fetch"; - plan1.FindRoute(SimpleLib.GetSite(GetLastSite()), a); - await plan1.Compile("fetch").Queue(); - - var plan2 = new SegmentPlan() { usingCar = this }; - plan2.fields["action"] = "go"; - plan2.FindRoute(SimpleLib.GetSite(GetLastSite()), b); - await plan2.Compile("go").Queue(); - - var plan3 = new SegmentPlan() { usingCar = this }; - plan3.fields["action"] = "put"; - plan3.FindRoute(SimpleLib.GetSite(GetLastSite()), a); - await plan3.Compile("put").Queue(); - - var plan4 = new SegmentPlan() { usingCar = this }; - plan4.fields["action"] = "go"; - plan4.FindRoute(SimpleLib.GetSite(GetLastSite()), b); - await plan4.Compile("go").Queue(); - - } - - [MethodMember(Name = "循环停止测试")] - [I18N.DocumentTranslation(Name = "Stop Loop Test", locale = "en")] - public void LoopTestStop() - { - LoopTestRunning = false; - } - public override string SetDisplayInfo() - { - try - { - var str = $"{name}({id})\n"; - status.enums.TryGetValue("ChassisMode", out var manual); - var ms = manual == "0" ? "自动" : "手动"; - status.enums.TryGetValue("Soc", out var soc); - str = $"{str}{ms}|soc:{soc}"; - var alarmStr = Commons.GetCarStatus(this, "AlarmInfo"); - if (alarmStr != "") - str = $"{str}|{alarmStr}"; - //if (status.enums.TryGetValue("mAlarm", out var mAlarm) && mAlarm != "") - // str = $"{str}|M:{mAlarm}"; - //var hasC = status.enums.TryGetValue("cAlarm", out var cAlarm) && cAlarm != ""; - //if (mAlarm != "" && hasC) - // str = $"{str}|"; - //if (hasC) - // str = $"{str}C:{cAlarm}"; - //var L_step = status.enums.TryGetValue("ls", out var ls) && ls != ""; - //if (L_step) - //{ - // str = $"{str}|ls:{ls}"; - //} - if (status.enums.TryGetValue("ElectricCurrent", out var electricCurrent) && - !string.IsNullOrEmpty(electricCurrent)) - { - var charging = float.Parse(electricCurrent) * 0.01f > 0 ? "充电中" : "未充电"; - str = $"{str}|charge:{charging}"; - } - - var thresSpeed = Commons.CarValue(this, "ThresSpeed"); - str = $"{str}{((thresSpeed <= 0) ? "|避障触发" : "")}"; - return str; - } - catch (Exception e) - { - Console.WriteLine(e); - return "bad car"; - } - } [MethodMember(Name = "进入小车管理界面", Description = "在浏览器中打开小车 Web 页面")] public void OpenVehicleManagementPage() @@ -353,7 +274,7 @@ namespace StandardScene.CarTypes [MethodMember(Name = "模拟电量", Description = "/")] public void SimarSoc() { - if (InputBox.ShowDialog("模拟电量", "模拟电量Soc", "0", InputBox.Buttons.OkCancel) == SimpleLite.DialogResult.Cancel) return; + if (InputBox.ShowDialog("模拟电量", "模拟电量Soc", "0", InputBox.Buttons.OkCancel) == Simple3.DialogResult.Cancel) return; string value = InputBox.ResultValue; try { @@ -373,7 +294,9 @@ namespace StandardScene.CarTypes - [MethodMember(Name = "立即强制结束new", Description = "立刻终止小车运行,重启C,并让小车下线")] + [MethodMember(Name = "立即强制结束new", Description = "立刻终止小车运行,重启C,并让小车下线", + RequiresPlatformConfirm = true, + ConfirmMessage = "确定强制结束该车上的作业并下线?")] [I18N.DocumentTranslation(Name = "Force Stop new", Description = "Stop car & reset clumsy", locale = "en")] public new async void ForceStop() { @@ -419,7 +342,9 @@ namespace StandardScene.CarTypes } } - [MethodMember(Name = "返厂检修new", Description = "不再刷新小车状态,当然也不再被调度")] + [MethodMember(Name = "返厂检修new", Description = "不再刷新小车状态,当然也不再被调度", + RequiresPlatformConfirm = true, + ConfirmMessage = "小车确实已经离开路径了么?确认返厂检修?")] [I18N.DocumentTranslation(Name = "Blown new", Description = "Car no longer refresh status and scheduling", locale = "en")] public new void Blown() {