refactor: 去掉 Kiva 循环测试与 SetDisplayInfo,强制结束/返厂加平台确认
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
using LessokajiWeaverUtilities.Utilities;
|
using LessokajiWeaverUtilities.Utilities;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SimpleLite;
|
using Simple3;
|
||||||
using SimpleLite.RCS;
|
using Simple3.RCS;
|
||||||
using SimpleLite.RCS.CarTypes;
|
using Simple3.RCS.CarTypes;
|
||||||
using SimpleLite.CADTools;
|
using Simple3.CADTools;
|
||||||
using SimpleLite.Props;
|
using Simple3.Props;
|
||||||
using SimpleLite.UI;
|
using Simple3.UI;
|
||||||
using SimpleCore;
|
using SimpleCore;
|
||||||
using SimpleCore.Compiler;
|
using SimpleCore.Compiler;
|
||||||
using SimpleCore.Extras;
|
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 页面")]
|
[MethodMember(Name = "进入小车管理界面", Description = "在浏览器中打开小车 Web 页面")]
|
||||||
public void OpenVehicleManagementPage()
|
public void OpenVehicleManagementPage()
|
||||||
@@ -353,7 +274,7 @@ namespace StandardScene.CarTypes
|
|||||||
[MethodMember(Name = "模拟电量", Description = "/")]
|
[MethodMember(Name = "模拟电量", Description = "/")]
|
||||||
public void SimarSoc()
|
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;
|
string value = InputBox.ResultValue;
|
||||||
try
|
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")]
|
[I18N.DocumentTranslation(Name = "Force Stop new", Description = "Stop car & reset clumsy", locale = "en")]
|
||||||
public new async void ForceStop()
|
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")]
|
[I18N.DocumentTranslation(Name = "Blown new", Description = "Car no longer refresh status and scheduling", locale = "en")]
|
||||||
public new void Blown()
|
public new void Blown()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user