初始化 shenyuxiang 分支
This commit is contained in:
@@ -1,21 +1 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CartActivator;
|
||||
using FundamentalLib;
|
||||
using MDCSToolBox.Medulla.Chassis;
|
||||
using MDCSToolBox.Medulla.Chassis.MultiWheel;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class AlarmRoutine : MultiWheelAlarmRoutine<DiverCartDefinition>
|
||||
{
|
||||
public override void SetOtherAlarms()
|
||||
{
|
||||
AddAlarm("左夹臂驱动报警", 2, () => cart.LeftArmErrorCode != 0);
|
||||
AddAlarm("右夹臂驱动报警", 2, () => cart.RightArmErrorCode != 0);
|
||||
//AddAlarm("夹臂不同步报警", 2, () => cart.ClampOutOfSync);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 驱动器、急停、夹臂等安全报警
|
||||
@@ -1,63 +1,37 @@
|
||||
using CartActivator;
|
||||
// 定义车型、上下层IO、参数和MCU初始化
|
||||
using CartActivator;
|
||||
using MCUSerialBridgeCLR;
|
||||
using MDCSToolBox.Medulla.Chassis.MultiWheel;
|
||||
using Medulla.Types;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
[UseLadderLogic(logic = typeof(AlarmRoutine), scanInterval = 50)]
|
||||
[UseLadderLogic(logic = typeof(MotorRoutine), scanInterval = 50)]
|
||||
[UseLadderLogic(logic = typeof(MCURoutine), scanInterval = 20)]
|
||||
[UseManualController(manualController = typeof(Remote))]
|
||||
public partial class DiverCartDefinition : MultiWheelCartDefinition
|
||||
public class DiverCartDefinition : MultiWheelCartDefinition
|
||||
{
|
||||
public DiverCommunication Embedded;
|
||||
#region 基本成员
|
||||
public MCUSerialBridge Bridge;
|
||||
[AsUpperIO(desc = "转弯半径")] public float Radius;
|
||||
#region MultiVehicleCoordination
|
||||
|
||||
[AsInitParam(desc = "遥控器最大线速度")]
|
||||
public float MaxManualSpeed = 0.3f;
|
||||
|
||||
[AsInitParam(desc = "遥控器最大角速度")]
|
||||
public float MaxManualAngularSpeed = 45f;
|
||||
|
||||
|
||||
[AsLowerIO(desc = "启用(手动)多车联动")] public bool MultiVehicleManualEnabled = false;
|
||||
[AsLowerIO(desc = "(手动)多车联动模式")] public int MultiVehicleManualMode = 0;
|
||||
|
||||
[AsUpperIO(desc = "多车联动:声光同步,-1未启动,0灭,1亮")] public int MultiVehicleLightSync = -1;
|
||||
|
||||
[AsLowerIO(desc = "多车联动模式-暂停")] public bool MultiVehicleHold = false;
|
||||
|
||||
[AsLowerIO(desc = "多车联动:遥控器Vx")] public float MultiVehicleManualVx = 0f;
|
||||
[AsLowerIO(desc = "多车联动:蟹行方向比例")] public float MultiVehicleManualVy = 0f;
|
||||
[AsLowerIO(desc = "多车联动:遥控器Vth")] public float MultiVehicleManualVth = 0f;
|
||||
|
||||
internal enum ManualControlMode
|
||||
{
|
||||
Normal = 0, // 正常模式
|
||||
Spin = 1, // 自旋模式
|
||||
Crab = 2, // 螃蟹模式
|
||||
}
|
||||
internal ManualControlMode TransmitterControlMode = ManualControlMode.Normal;
|
||||
internal DateTime TransmitterLastTime; // 物理遥控器计算两次实体遥控器指令之间的时间间隔
|
||||
#endregion
|
||||
[IOObjectMonitor(desc = "左前左轮下发速度")] public float SpeedLFL;
|
||||
[IOObjectMonitor(desc = "左前右轮下发速度")] public float SpeedLFR;
|
||||
[IOObjectMonitor(desc = "右前左轮下发速度")] public float SpeedRFL;
|
||||
[IOObjectMonitor(desc = "右前右轮下发速度")] public float SpeedRFR;
|
||||
[IOObjectMonitor(desc = "左后左轮下发速度")] public float SpeedLRL;
|
||||
[IOObjectMonitor(desc = "左后右轮下发速度")] public float SpeedLRR;
|
||||
[IOObjectMonitor(desc = "右后左轮下发速度")] public float SpeedRRL;
|
||||
[IOObjectMonitor(desc = "右后右轮下发速度")] public float SpeedRRR;
|
||||
//[AsUpperIO(desc = "左前左轮下发速度", timeOutReset = true)] public float SpeedLFL;
|
||||
//[AsUpperIO(desc = "左前右轮下发速度", timeOutReset = true)] public float SpeedLFR;
|
||||
//[AsUpperIO(desc = "右前左轮下发速度", timeOutReset = true)] public float SpeedRFL;
|
||||
//[AsUpperIO(desc = "右前右轮下发速度", timeOutReset = true)] public float SpeedRFR;
|
||||
//[AsUpperIO(desc = "左后左轮下发速度", timeOutReset = true)] public float SpeedLRL;
|
||||
//[AsUpperIO(desc = "左后右轮下发速度", timeOutReset = true)] public float SpeedLRR;
|
||||
//[AsUpperIO(desc = "右后左轮下发速度", timeOutReset = true)] public float SpeedRRL;
|
||||
//[AsUpperIO(desc = "右后右轮下发速度", timeOutReset = true)] public float SpeedRRR;
|
||||
|
||||
#region AsUpperIO
|
||||
[AsUpperIO(desc = "从M上复位")] public bool ResetFromM;
|
||||
[AsUpperIO(desc = "从M将驱动轮下使能")] public bool DisableFromM;
|
||||
[AsUpperIO(desc = "从C上复位")] public bool ResetFromC;
|
||||
[AsUpperIO(desc = "从C将驱动轮下使能")] public bool DisableFromC;
|
||||
#endregion
|
||||
|
||||
#region AsLowerIO
|
||||
[AsLowerIO(desc = "左前左轮实际位置")] public float LFLActualPos;
|
||||
[AsLowerIO(desc = "左前右轮实际位置")] public float LFRActualPos;
|
||||
[AsLowerIO(desc = "右前左轮实际位置")] public float RFLActualPos;
|
||||
@@ -66,99 +40,75 @@ namespace MedullaAdapter
|
||||
[AsLowerIO(desc = "左后右轮实际位置")] public float LRRActualPos;
|
||||
[AsLowerIO(desc = "右后左轮实际位置")] public float RRLActualPos;
|
||||
[AsLowerIO(desc = "右后右轮实际位置")] public float RRRActualPos;
|
||||
|
||||
[AsUpperIO(desc = "左夹臂下发速度", timeOutReset = true)] public float SpeedLeftArm;
|
||||
[AsUpperIO(desc = "右夹臂下发速度", timeOutReset = true)] public float SpeedRightArm;
|
||||
[AsUpperIO(desc = "左夹臂实际速度")] public float ActualSpeedLeftArm;
|
||||
[AsUpperIO(desc = "右夹臂实际速度")] public float ActualSpeedRightArm;
|
||||
[AsLowerIO(desc = "左夹臂状态字")] public int LeftArmStateCode;
|
||||
[AsLowerIO(desc = "右夹臂状态字")] public int RightArmStateCode;
|
||||
[AsLowerIO(desc = "左夹臂错误字")] public int LeftArmErrorCode;
|
||||
[AsLowerIO(desc = "右夹臂错误字")] public int RightArmErrorCode;
|
||||
[AsLowerIO(desc = "左夹臂电流")] public float LeftArmElectric;
|
||||
[AsLowerIO(desc = "右夹臂电流")] public float RightArmElectric;
|
||||
[AsLowerIO(desc = "左夹臂实际位置")] public float ActualPosLeftArm;
|
||||
[AsLowerIO(desc = "右夹臂实际位置")] public float ActualPosRightArm;
|
||||
[AsLowerIO(desc = "test")] public float test;
|
||||
[AsLowerIO(desc = "test1")] public byte test1;
|
||||
[AsLowerIO(desc = "test2")] public byte test2;
|
||||
[AsInitParam(desc = "test3")] public int test3=24;
|
||||
[IOObjectMonitor(desc = "灯光模式")] public int LightMode = 0;
|
||||
[AsInitParam(desc = "触发模式")] public int trigger = 0;
|
||||
|
||||
[AsInitParam(desc = "手动控制夹臂速度系数")] public float ManualArmSpeedFac = 1.0f;
|
||||
[AsInitParam(desc = "车号")][AsLowerIO] public int CarNum = 1;
|
||||
[AsInitParam(desc = "初始音量")] public int MusicVolume = 5;
|
||||
|
||||
[AsInitParam(desc = "左夹臂低限位")][AsLowerIO] public int LeftArmLowerPos = -10000;
|
||||
[AsInitParam(desc = "左夹臂高限位")][AsLowerIO] public int LeftArmUpperPos = 5927610;
|
||||
[AsInitParam(desc = "右夹臂低限位")][AsLowerIO] public int RightArmLowerPos = -17295;
|
||||
[AsInitParam(desc = "右夹臂高限位")][AsLowerIO] public int RightArmUpperPos = 5927610;
|
||||
|
||||
[AsInitParam(desc = "MCU端口号")] public string MCUPort = "COM4";
|
||||
|
||||
[AsLowerIO(desc = "陀螺仪角度")] public float GyrosTh;
|
||||
[AsLowerIO(desc = "电池健康状态")] public float SOH;
|
||||
|
||||
[AsLowerIO(desc = "左前左驱动器远程帧701")] public byte LFLRemoteCode = 0;
|
||||
[AsLowerIO(desc = "左前右驱动器远程帧702")] public byte LFRRemoteCode = 0;
|
||||
[AsLowerIO(desc = "右前左驱动器远程帧703")] public byte RFLRemoteCode = 0;
|
||||
[AsLowerIO(desc = "右前右驱动器远程帧704")] public byte RFRRemoteCode = 0;
|
||||
[AsLowerIO(desc = "左后左驱动器远程帧705")] public byte LRLRemoteCode = 0;
|
||||
[AsLowerIO(desc = "左后右驱动器远程帧706")] public byte LRRRemoteCode = 0;
|
||||
[AsLowerIO(desc = "右后左驱动器远程帧707")] public byte RRLRemoteCode = 0;
|
||||
[AsLowerIO(desc = "右后右驱动器远程帧708")] public byte RRRRemoteCode = 0;
|
||||
[AsLowerIO(desc = "左夹臂驱动器远程帧709")] public byte LArmRemoteCode = 0;
|
||||
[AsLowerIO(desc = "右夹臂驱动器远程帧70A")] public byte RArmRemoteCode = 0;
|
||||
[AsUpperIO(desc = "从M上复位")] public bool ResetFromM;
|
||||
[AsUpperIO(desc = "从M将驱动轮下使能")] public bool DisableFromM;
|
||||
[AsUpperIO(desc = "从C上复位")] public bool ResetFromC;
|
||||
[AsUpperIO(desc = "从C将驱动轮下使能")] public bool DisableFromC;
|
||||
[AsUpperIO(desc = "夹臂不同步报警")] public bool ClampOutOfSync;
|
||||
|
||||
internal ManualControlMode TransmitterControlMode = ManualControlMode.Normal;
|
||||
|
||||
[IOObjectMonitor] public float TransmitterSpeed = 0.3f;
|
||||
[AsLowerIO(desc = "驱动轮使能状态")] public bool WheelAbleState = true;
|
||||
[AsLowerIO(desc = "电池健康状态")] public float SOH;
|
||||
[AsInitParam(desc = "车号")][AsLowerIO] public int CarNum = 1;
|
||||
#endregion
|
||||
|
||||
#region 初始参数
|
||||
[AsInitParam(desc = "MCU端口号")] public string MCUPort = "COM4";
|
||||
[AsInitParam(desc = "遥控器速度上限")] public float TransmitterSpeedUpperLimit = 1.0f;
|
||||
[AsInitParam(desc = "遥控器速度下限")] public float TransmitterSpeedLowerLimit = 0.0f;
|
||||
internal DateTime TransmitterLastTime;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 监控参数
|
||||
[IOObjectMonitor(desc = "左前左轮PID修正后速度")] public float SpeedLFL;
|
||||
[IOObjectMonitor(desc = "左前右轮PID修正后速度")] public float SpeedLFR;
|
||||
[IOObjectMonitor(desc = "右前左轮PID修正后速度")] public float SpeedRFL;
|
||||
[IOObjectMonitor(desc = "右前右轮PID修正后速度")] public float SpeedRFR;
|
||||
[IOObjectMonitor(desc = "左后左轮PID修正后速度")] public float SpeedLRL;
|
||||
[IOObjectMonitor(desc = "左后右轮PID修正后速度")] public float SpeedLRR;
|
||||
[IOObjectMonitor(desc = "右后左轮PID修正后速度")] public float SpeedRRL;
|
||||
[IOObjectMonitor(desc = "右后右轮PID修正后速度")] public float SpeedRRR;
|
||||
[IOObjectMonitor(desc = "灯光模式")] public int LightMode = 0;
|
||||
[IOObjectMonitor(desc = "实体遥控器当前速度倍率")] public float TransmitterSpeed = 0.3f;
|
||||
[IOObjectMonitor(desc = "左前左驱动器远程帧701")] public byte LFLRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "左前右驱动器远程帧702")] public byte LFRRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "右前左驱动器远程帧703")] public byte RFLRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "右前右驱动器远程帧704")] public byte RFRRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "左后左驱动器远程帧705")] public byte LRLRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "左后右驱动器远程帧706")] public byte LRRRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "右后左驱动器远程帧707")] public byte RRLRemoteCode = 0;
|
||||
[IOObjectMonitor(desc = "右后右驱动器远程帧708")] public byte RRRRemoteCode = 0;
|
||||
#endregion
|
||||
|
||||
#region 操作按钮
|
||||
// M层单车硬件:向驱动轮发送复位请求。
|
||||
[IOObjectUtility]
|
||||
public void WheelReset()
|
||||
{
|
||||
ResetFromM = true;
|
||||
}
|
||||
|
||||
// M层单车硬件:向驱动轮发送下使能请求。
|
||||
[IOObjectUtility]
|
||||
public void WheelDisable()
|
||||
{
|
||||
DisableFromM = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void CommunicationInit()
|
||||
{
|
||||
if (GhostMode) return;
|
||||
|
||||
State = -1;
|
||||
Bridge = new MCUSerialBridge();
|
||||
//Step1:打开指定串口连接
|
||||
var err = Bridge.Open(MCUPort, 1000000u);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU Open FAILED: {0}", err.ToDescription());
|
||||
Console.WriteLine($"MCU Open FAILED: {err.ToDescription()}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU Open OK");
|
||||
}
|
||||
|
||||
//Step2:远程复位MCU
|
||||
err = Bridge.Reset();
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU Reset FAILED: {0}", err.ToDescription());
|
||||
Console.WriteLine($"MCU Reset FAILED: {err.ToDescription()}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -166,31 +116,28 @@ namespace MedullaAdapter
|
||||
Thread.Sleep(500);
|
||||
Console.WriteLine("MCU Reset OK");
|
||||
}
|
||||
|
||||
//Step3:GetVersion
|
||||
//Step3:获取MCU版本号
|
||||
err = Bridge.GetVersion(out var version, 100);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU GetVersion FAILED: {0}", err.ToDescription());
|
||||
Console.WriteLine($"MCU GetVersion FAILED: {err.ToDescription()}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU GetVersion OK: {0}", version.ToString());
|
||||
Console.WriteLine($"MCU GetVersion OK: {version}");
|
||||
}
|
||||
|
||||
//Step4:GetState
|
||||
//Step4:获取MCU状态
|
||||
err = Bridge.GetState(out var state, 100);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU GetState FAILED: {0}", err.ToDescription());
|
||||
Console.WriteLine($"MCU GetState FAILED: {err.ToDescription()}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU GetState OK: {0}", state.ToString());
|
||||
Console.WriteLine($"MCU GetState OK: {state}");
|
||||
}
|
||||
|
||||
//Step5:串口/CAN配置
|
||||
try
|
||||
{
|
||||
@@ -203,18 +150,15 @@ namespace MedullaAdapter
|
||||
for (int i = 0; i < ports.Count; i++)
|
||||
{
|
||||
if (ports[i] is SerialPortConfig s)
|
||||
Console.WriteLine("Port {0}: Serial, Baud={1}, ReceiveFrameMs={2}",
|
||||
i,
|
||||
s.Baud,
|
||||
s.ReceiveFrameMs);
|
||||
Console.WriteLine($"Port {i}: Serial, Baud={s.Baud}, ReceiveFrameMs={s.ReceiveFrameMs}");
|
||||
else if (ports[i] is CANPortConfig c)
|
||||
Console.WriteLine("Port {0}: CAN, Baud={1}, RetryTimeMs={2}", i, c.Baud, c.RetryTimeMs);
|
||||
Console.WriteLine($"Port {i}: CAN, Baud={c.Baud}, RetryTimeMs={c.RetryTimeMs}");
|
||||
}
|
||||
|
||||
var ret = Bridge.Configure(ports, 200);
|
||||
if (ret != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU Configure FAILED: {0}", ret.ToDescription());
|
||||
Console.WriteLine($"MCU Configure FAILED: {ret.ToDescription()}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -225,54 +169,11 @@ namespace MedullaAdapter
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Configure Exception: {0}", ex.Message);
|
||||
Console.WriteLine($"Configure Exception: {ex.Message}");
|
||||
return;
|
||||
}
|
||||
//MCUInterface<DiverCartDefinition>.Start(this);
|
||||
State = 0;
|
||||
}
|
||||
|
||||
internal void ManualControl(ManualControlMode mode, float x, float y, float frontDirection,
|
||||
float speedThreshold, TimeSpan? interval = null)
|
||||
{
|
||||
if (Chassis == null) return;
|
||||
|
||||
var speed = speedThreshold * y;
|
||||
var thPow = (float)Math.Pow(Math.Abs(x), ManualThetaPow) * Math.Sign(x);
|
||||
var frontTh = -thPow * MaxManualTheta;
|
||||
var rearTh = thPow * MaxManualTheta;
|
||||
switch (mode)
|
||||
{
|
||||
case ManualControlMode.Normal:
|
||||
ManualMode = 0;
|
||||
Chassis.DirectionAngle = frontDirection;
|
||||
Chassis.SendMotion(speed, frontTh, rearTh, interval);
|
||||
break;
|
||||
|
||||
case ManualControlMode.Sway:
|
||||
ManualMode = 1;
|
||||
Chassis.DirectionAngle = frontDirection;
|
||||
Chassis.SendMotion(speed, frontTh, -rearTh, interval);
|
||||
break;
|
||||
|
||||
case ManualControlMode.Crab:
|
||||
ManualMode = 2;
|
||||
Chassis.DirectionAngle = 90;
|
||||
Chassis.SendMotion(speed, frontTh, rearTh, interval);
|
||||
break;
|
||||
|
||||
case ManualControlMode.Spin:
|
||||
ManualMode = 3;
|
||||
Chassis.SendRotateMotion(speed * MaxAngularSpeed, interval);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal enum ManualControlMode
|
||||
{
|
||||
Normal = 0,
|
||||
Spin = 1,
|
||||
Crab = 2,
|
||||
Sway = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using FundamentalLib;
|
||||
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class DiverCommunication
|
||||
{
|
||||
private byte[] _receiveBytes ;
|
||||
private SerialPort _port;
|
||||
private int _state = 0;
|
||||
private List<byte> _receiveList = new List<byte>();
|
||||
private int _length = 0;
|
||||
|
||||
private MCUInterface<DiverCartDefinition> _interface;
|
||||
|
||||
public DiverCommunication(string name, int baudRate)
|
||||
{
|
||||
_interface = new MCUInterface<DiverCartDefinition>();
|
||||
_port = new SerialPort();
|
||||
_port.PortName = name; // 根据你的实际串口名称修改
|
||||
_port.BaudRate = baudRate;
|
||||
_port.Parity = Parity.None;
|
||||
_port.DataBits = 8;
|
||||
_port.StopBits = StopBits.One;
|
||||
_port.Handshake = Handshake.None;
|
||||
_port.Open();
|
||||
Console.WriteLine($"buffer:{_port.ReadBufferSize}");
|
||||
//_port.DataReceived += OnDataReceived;
|
||||
new Thread(() =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
try
|
||||
{
|
||||
int bytesToRead = _port.BytesToRead;
|
||||
if (bytesToRead > 0)
|
||||
{
|
||||
var readBuffer = new byte[bytesToRead];
|
||||
var start = DateTime.Now;
|
||||
_port.Read(readBuffer, 0, bytesToRead);
|
||||
var time1 = DateTime.Now - start;
|
||||
ProcessBuffer(readBuffer);
|
||||
var time2 = DateTime.Now - start;
|
||||
Hedingben.ToastText($"total time:{time2.TotalMilliseconds},read time:{time1},read count:{bytesToRead}", "timeDebug");
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
}
|
||||
}).Start();
|
||||
}
|
||||
|
||||
private void ProcessBuffer(byte[] buffer)
|
||||
{
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
var newByte = buffer[i];
|
||||
switch (_state)
|
||||
{
|
||||
case 0:
|
||||
_receiveList.Clear();
|
||||
if (newByte == 0xBB)
|
||||
{
|
||||
_receiveList.Add(newByte);
|
||||
_state = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (newByte == 0xAA)
|
||||
{
|
||||
_receiveList.Add(newByte);
|
||||
_state = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
_state = 0;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
_receiveList.Add(newByte);
|
||||
if (_receiveList.Count >= 4)
|
||||
{
|
||||
_length = BitConverter.ToUInt16(_receiveList.ToArray(), 2);
|
||||
}
|
||||
|
||||
if (_receiveList.Count == _length + 7)
|
||||
{
|
||||
_state = 0;
|
||||
if (_receiveList[_receiveList.Count - 1] == 0xEE)
|
||||
{
|
||||
_receiveBytes = _receiveList.ToArray();
|
||||
Hedingben.ToastText($"receive from mcu:{BitConverter.ToString(_receiveBytes)}","DiverReceive");
|
||||
if (_receiveBytes[5] == 0xA0)
|
||||
{
|
||||
var dataLength1 = BitConverter.ToUInt32(_receiveBytes, 6);
|
||||
var data1 = new byte[dataLength1];
|
||||
Array.Copy(_receiveBytes, 14, data1, 0, dataLength1);
|
||||
MCUInterface<DiverCartDefinition>.NotifyLowerData("default", data1);
|
||||
var logBytes = new byte[BitConverter.ToInt32(_receiveBytes, 10)];
|
||||
var memorySize = BitConverter.ToInt32(_receiveBytes, 6);
|
||||
if (logBytes.Length > 0)
|
||||
{
|
||||
Array.Copy(_receiveBytes, 14 + memorySize, logBytes, 0, logBytes.Length);
|
||||
string log = System.Text.Encoding.ASCII.GetString(logBytes);
|
||||
string[] result = log.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);
|
||||
for (int j = 0; j < result.Length; j++)
|
||||
{
|
||||
Hedingben.ToastText(result[j], $"mcuLog" + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_state = 0;
|
||||
Hedingben.ToastText($"mcu date error,should end with 0xEE , actual {_receiveList[_receiveList.Count - 1]}","DiverError");
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SendMessage(byte[] data)
|
||||
{
|
||||
Hedingben.ToastText($"send to mcu:{BitConverter.ToString(data)}", "DiverSend");
|
||||
_port.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
public byte[] GetMessage()
|
||||
{
|
||||
return _receiveBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using FundamentalLib;
|
||||
using Medulla;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class EmbeddedCommunication
|
||||
{
|
||||
private SerialPort _port;
|
||||
|
||||
private byte[] _receiveBytes;
|
||||
|
||||
private byte[] _receiveData;
|
||||
|
||||
private const int BufferThreshold = 300; // 缓冲区大小阈值
|
||||
|
||||
private List<byte> _buffer = new List<byte>(); // 缓存接收到的数据
|
||||
|
||||
public bool CommunicationError = false;
|
||||
|
||||
private DateTime _lastTime = DateTime.Now;
|
||||
|
||||
private MCUInterface<DiverCartDefinition> _interface;
|
||||
|
||||
public EmbeddedCommunication(string name, int baudRate)
|
||||
{
|
||||
_interface = new MCUInterface<DiverCartDefinition>();
|
||||
_port = new SerialPort();
|
||||
_port.PortName = name; // 根据你的实际串口名称修改
|
||||
_port.BaudRate = baudRate;
|
||||
_port.Parity = Parity.None;
|
||||
_port.DataBits = 8;
|
||||
_port.StopBits = StopBits.One;
|
||||
_port.Handshake = Handshake.None;
|
||||
_port.Open();
|
||||
_port.DataReceived += OnDataReceived;
|
||||
}
|
||||
|
||||
public void SendMessage(byte[] data)
|
||||
{
|
||||
Hedingben.ToastText($"send to mcu:{BitConverter.ToString(data)}","DiverSend");
|
||||
_port.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
public byte[] GetMessage()
|
||||
{
|
||||
return _receiveBytes;
|
||||
}
|
||||
|
||||
private void OnDataReceived(object sender, SerialDataReceivedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int bytesToRead = _port.BytesToRead;
|
||||
byte[] buffer = new byte[bytesToRead];
|
||||
var startRead = DateTime.Now;
|
||||
_port.Read(buffer, 0, bytesToRead);
|
||||
var time = DateTime.Now - startRead;
|
||||
// 将新接收到的数据添加到缓冲区
|
||||
startRead = DateTime.Now;
|
||||
_buffer.AddRange(buffer);
|
||||
var time2 = DateTime.Now - startRead;
|
||||
Hedingben.ToastText($"buffer length:{_buffer.Count}","bufferDebug");
|
||||
DLog.Log($"buffer length:{_buffer.Count}");
|
||||
//if (_buffer.Count > BufferThreshold)
|
||||
//{
|
||||
// _buffer.Clear();
|
||||
// return;
|
||||
//}
|
||||
|
||||
// 尝试解析缓冲区中的报文
|
||||
var parseTime = DateTime.Now;
|
||||
ParseBuffer();
|
||||
var time3 = DateTime.Now - parseTime;
|
||||
Hedingben.ToastText(
|
||||
$"读取报文时间:{time.TotalMilliseconds},增加到缓存区:{time2.TotalMilliseconds},处理时间:{time3.TotalMilliseconds}",
|
||||
"timeDebug1");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"读取串口数据时发生错误: {ex.Message}"+ex.StackTrace);
|
||||
}
|
||||
}
|
||||
private void ParseBuffer()
|
||||
{
|
||||
while (_buffer.Count >= 7) // 报文的最小长度是 7
|
||||
{
|
||||
// 查找报文头部
|
||||
var findTime = DateTime.Now;
|
||||
int startIndex = _buffer.FindIndex(0, b => b == 0xBB);
|
||||
var time1 = DateTime.Now - findTime;
|
||||
if (startIndex == -1)
|
||||
{
|
||||
// 如果没有找到头部或剩余长度不足最小报文长度,结束解析
|
||||
_buffer.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保头部后还有至少 6 个字节
|
||||
if (startIndex + 1 >= _buffer.Count || _buffer[startIndex + 1] != 0xAA)
|
||||
{
|
||||
// 如果第二字节不是 0xAA,丢弃无效字节
|
||||
_buffer.RemoveAt(startIndex);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 检查数据段长度
|
||||
if (startIndex + 4 >= _buffer.Count) break; // 数据不足,等待下次接收
|
||||
int dataLength = _buffer[startIndex + 2] | (_buffer[startIndex + 3] << 8);
|
||||
|
||||
// 计算报文总长度
|
||||
int totalLength = dataLength + 7;
|
||||
|
||||
// 检查总长度是否足够
|
||||
if (startIndex + totalLength > _buffer.Count) break; // 数据不足,等待下次接收
|
||||
|
||||
// 检查尾部是否是 0xCC 0xEE
|
||||
if (_buffer[startIndex + totalLength - 2] == 0xCC && _buffer[startIndex + totalLength - 1] == 0xEE)
|
||||
{
|
||||
var time2 = DateTime.Now - findTime;
|
||||
var copyTime = DateTime.Now;
|
||||
// 提取完整报文
|
||||
_receiveBytes = _buffer.Skip(startIndex).Take(totalLength).ToArray();
|
||||
var time3 = DateTime.Now - copyTime;
|
||||
if (_receiveBytes[5] == 0xA0)
|
||||
{
|
||||
var dataLength1 = BitConverter.ToUInt32(_receiveBytes, 6);
|
||||
var data1 = new byte[dataLength1];
|
||||
Array.Copy(_receiveBytes, 14, data1, 0, dataLength1);
|
||||
var notifyTime = DateTime.Now;
|
||||
MCUInterface<DiverCartDefinition>.NotifyLowerData("default", data1);
|
||||
var time4 = DateTime.Now - notifyTime;
|
||||
var logBytes = new byte[BitConverter.ToInt32(_receiveBytes, 10)];
|
||||
var memorySize = BitConverter.ToInt32(_receiveBytes, 6);
|
||||
if (logBytes.Length > 0)
|
||||
{
|
||||
Array.Copy(_receiveBytes, 14 + memorySize, logBytes, 0, logBytes.Length);
|
||||
string log = System.Text.Encoding.ASCII.GetString(logBytes);
|
||||
string[] result = log.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
Hedingben.ToastText(result[i], $"mcuLog" + i);
|
||||
}
|
||||
}
|
||||
|
||||
Hedingben.ToastText(
|
||||
$"find head time:{time1.TotalMilliseconds},find total time:{time2.TotalMilliseconds},copy time:{time3.TotalMilliseconds},notify time:{time4.TotalMilliseconds}","timeDebug2");
|
||||
}
|
||||
|
||||
Hedingben.ToastText(
|
||||
$"receive from mcu:{BitConverter.ToString(_receiveBytes)},time:{(DateTime.Now - _lastTime).TotalMilliseconds}",
|
||||
"DiverReceive");
|
||||
if ((DateTime.Now - _lastTime).TotalMilliseconds > 200)
|
||||
{
|
||||
Hedingben.ToastText($"{(DateTime.Now - _lastTime).TotalMilliseconds}ms no message from diver","DiverTimeout");
|
||||
}
|
||||
_lastTime = DateTime.Now;
|
||||
// 从缓冲区中移除已解析的报文
|
||||
_buffer.RemoveRange(0, startIndex + totalLength);
|
||||
return; // 成功解析一条报文后退出本轮解析
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果尾部无效,丢弃头部并继续解析
|
||||
DLog.Log("DIVER报文无效");
|
||||
Console.WriteLine("DIVER报文无效");
|
||||
var errorBytes = _buffer.Skip(startIndex).Take(totalLength).ToArray();
|
||||
DLog.Log("错误报文"+string.Join(" ",errorBytes.Select(p=>$"{p:X2}")));
|
||||
_buffer.RemoveAt(startIndex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
using System;
|
||||
using CartActivator;
|
||||
using CycleGUI;
|
||||
using CycleGUI.API;
|
||||
using FundamentalLib;
|
||||
using Medulla.Types;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public partial class DiverCartDefinition
|
||||
{
|
||||
private bool _fleetRemoteActive;
|
||||
private DateTime _fleetDiagLastStick = DateTime.MinValue;
|
||||
|
||||
private void FleetDiag(string msg)
|
||||
{
|
||||
DLog.Log($"car{CarNum} {msg}", "FleetDiagMedulla");
|
||||
}
|
||||
|
||||
private void ZeroFleetManualFields()
|
||||
{
|
||||
MultiVehicleManualEnabled = false;
|
||||
MultiVehicleManualMode = 0;
|
||||
MultiVehicleManualVx = 0;
|
||||
MultiVehicleManualVy = 0;
|
||||
MultiVehicleManualVth = 0;
|
||||
}
|
||||
|
||||
public float ApplyFleetManualCommand(int mode, float px, float py, float speedRatio)
|
||||
{
|
||||
var ratio = Clamp(speedRatio, 0, 1);
|
||||
px = Clamp(px, -1, 1);
|
||||
py = Clamp(py, -1, 1);
|
||||
|
||||
if (mode < 0 || mode > 2) mode = 0;
|
||||
MultiVehicleManualMode = mode;
|
||||
|
||||
if (mode == 2)
|
||||
{
|
||||
MultiVehicleManualVx = 0;
|
||||
MultiVehicleManualVy = 0;
|
||||
MultiVehicleManualVth = px * MaxManualAngularSpeed * ratio;
|
||||
}
|
||||
else if (mode == 1)
|
||||
{
|
||||
MultiVehicleManualVx = py * MaxManualSpeed * ratio;
|
||||
MultiVehicleManualVy = px * MaxManualSpeed * ratio;
|
||||
MultiVehicleManualVth = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
MultiVehicleManualVx = py * MaxManualSpeed * ratio;
|
||||
MultiVehicleManualVy = 0;
|
||||
MultiVehicleManualVth = px * MaxManualAngularSpeed * ratio;
|
||||
}
|
||||
|
||||
return ratio;
|
||||
}
|
||||
|
||||
[IOObjectUtility]
|
||||
public void FleetRemote()
|
||||
{
|
||||
if (_fleetRemoteActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_fleetRemoteActive = true;
|
||||
var fleetOn = false;
|
||||
var crabOn = false;
|
||||
var rotateOn = false;
|
||||
var speedRatio = 1f;
|
||||
UseGesture manip = null;
|
||||
|
||||
int CurrentMode()
|
||||
{
|
||||
if (crabOn) return 1;
|
||||
if (rotateOn) return 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ApplyMode()
|
||||
{
|
||||
MultiVehicleManualMode = fleetOn ? CurrentMode() : 0;
|
||||
}
|
||||
|
||||
void CleanupFleetRemote()
|
||||
{
|
||||
if (manip != null)
|
||||
{
|
||||
manip.End();
|
||||
manip = null;
|
||||
}
|
||||
|
||||
fleetOn = false;
|
||||
crabOn = false;
|
||||
rotateOn = false;
|
||||
ZeroFleetManualFields();
|
||||
_fleetRemoteActive = false;
|
||||
}
|
||||
|
||||
manip = new UseGesture();
|
||||
|
||||
manip.AddWidget(new UseGesture.StickWidget
|
||||
{
|
||||
name = "fleet_stick",
|
||||
text = "速度摇杆",
|
||||
position = "37.5%+10px, 18%+10px",
|
||||
size = "37.5%-10px, 32%-10px",
|
||||
bounceBack = true,
|
||||
keyboard = "Up,Down,Left,Right",
|
||||
joystick = "Axis0,Axis1",
|
||||
OnValue = (pos, manipulating) =>
|
||||
{
|
||||
if (!fleetOn)
|
||||
{
|
||||
MultiVehicleManualVx = 0;
|
||||
MultiVehicleManualVy = 0;
|
||||
MultiVehicleManualVth = 0;
|
||||
if ((DateTime.Now - _fleetDiagLastStick).TotalMilliseconds >= 200)
|
||||
{
|
||||
_fleetDiagLastStick = DateTime.Now;
|
||||
FleetDiag($"STICK(ignored,fleetOff) pos=({pos.X:0.00},{pos.Y:0.00}) manip={manipulating}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var mode = CurrentMode();
|
||||
var ratio = ApplyFleetManualCommand(mode, pos.X, pos.Y, speedRatio);
|
||||
|
||||
if ((DateTime.Now - _fleetDiagLastStick).TotalMilliseconds >= 200)
|
||||
{
|
||||
_fleetDiagLastStick = DateTime.Now;
|
||||
FleetDiag($"STICK mode={mode} pos=({pos.X:0.00},{pos.Y:0.00}) manip={manipulating} ratio={ratio:0.00} " +
|
||||
$"-> Vx={MultiVehicleManualVx:0.000} Vy={MultiVehicleManualVy:0.000} Vth={MultiVehicleManualVth:0.0} en={MultiVehicleManualEnabled}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
manip.AddWidget(new UseGesture.ToggleWidget
|
||||
{
|
||||
name = "fleet_crab",
|
||||
text = "横移模式",
|
||||
position = "12.5%+10px, 52%+10px",
|
||||
size = "37.5%-10px, 10%-10px",
|
||||
OnValue = b =>
|
||||
{
|
||||
crabOn = b;
|
||||
ApplyMode();
|
||||
FleetDiag($"TOGGLE crab={b} -> mode={MultiVehicleManualMode}");
|
||||
}
|
||||
});
|
||||
|
||||
manip.AddWidget(new UseGesture.ToggleWidget
|
||||
{
|
||||
name = "fleet_rotate",
|
||||
text = "原地旋转",
|
||||
position = "50%+10px, 52%+10px",
|
||||
size = "37.5%-10px, 10%-10px",
|
||||
OnValue = b =>
|
||||
{
|
||||
rotateOn = b;
|
||||
ApplyMode();
|
||||
FleetDiag($"TOGGLE rotate={b} -> mode={MultiVehicleManualMode}");
|
||||
}
|
||||
});
|
||||
|
||||
manip.AddWidget(new UseGesture.ToggleWidget
|
||||
{
|
||||
name = "fleet_enable",
|
||||
text = "车队联动",
|
||||
position = "12.5%+10px, 64%+10px",
|
||||
size = "37.5%-10px, 10%-10px",
|
||||
OnValue = b =>
|
||||
{
|
||||
fleetOn = b;
|
||||
MultiVehicleManualEnabled = b;
|
||||
ApplyMode();
|
||||
if (!b) ZeroFleetManualFields();
|
||||
FleetDiag($"TOGGLE fleetOn={b} -> ManualEnabled={MultiVehicleManualEnabled} mode={MultiVehicleManualMode}");
|
||||
}
|
||||
});
|
||||
|
||||
manip.AddWidget(new UseGesture.ThrottleWidget
|
||||
{
|
||||
name = "fleet_speed_ratio",
|
||||
text = "速度比例",
|
||||
position = "50%+10px, 64%+10px",
|
||||
size = "37.5%-10px, 10%-10px",
|
||||
bounceBack = false,
|
||||
OnValue = (val, _) => speedRatio = Clamp(val, 0, 1)
|
||||
});
|
||||
|
||||
manip.AddWidget(new UseGesture.ButtonWidget
|
||||
{
|
||||
name = "fleet_stop",
|
||||
text = "急停/归零",
|
||||
position = "31.25%+10px, 76%+10px",
|
||||
size = "37.5%-10px, 10%-10px",
|
||||
OnPressed = pressed =>
|
||||
{
|
||||
if (!pressed) return;
|
||||
MultiVehicleManualVx = 0;
|
||||
MultiVehicleManualVy = 0;
|
||||
MultiVehicleManualVth = 0;
|
||||
FleetDiag("BUTTON stop/zero");
|
||||
}
|
||||
});
|
||||
|
||||
manip.ChangeState(new SetAppearance { drawGuizmo = false });
|
||||
manip.Start();
|
||||
|
||||
GUI.PromptOrBringToFront(pb =>
|
||||
{
|
||||
if (pb.Closing())
|
||||
{
|
||||
CleanupFleetRemote();
|
||||
pb.Panel.Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
pb.Panel.TopMost(true)
|
||||
.SetDefaultDocking(Panel.Docking.None)
|
||||
.ShowTitle("车队联动遥控")
|
||||
.InitSize(340, 190)
|
||||
.InitPos(false, -32, 32, 1, 0, 1, 0);
|
||||
|
||||
pb.SeparatorText("状态");
|
||||
var modeName = MultiVehicleManualMode == 2 ? "原地旋转" : MultiVehicleManualMode == 1 ? "横移" : "常规";
|
||||
pb.Label($"车队联动: {MultiVehicleManualEnabled} 模式: {modeName}");
|
||||
pb.Label($"速度比例: {speedRatio:0.00}");
|
||||
pb.Label($"Vx={MultiVehicleManualVx:0.000} Vy={MultiVehicleManualVy:0.000} m/s, Vth={MultiVehicleManualVth:0.0}");
|
||||
pb.Label($"优先级: {CartActivator.CartDefinition.currentPriority} ({CartActivator.CartDefinition.currentPriorityDesc})");
|
||||
pb.Label("请勿同时打开手动控制面板");
|
||||
pb.Panel.Repaint();
|
||||
}, instancingObject: this);
|
||||
}
|
||||
|
||||
private static float Clamp(float value, float min, float max)
|
||||
{
|
||||
if (value < min) return min;
|
||||
if (value > max) return max;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<DiverCompiler />
|
||||
</Weavers>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
|
||||
<xs:element name="Weavers">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="DiverCompiler" minOccurs="0" maxOccurs="1" type="xs:anyType" />
|
||||
</xs:all>
|
||||
<xs:attribute name="VerifyAssembly" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="GenerateXsd" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,291 +0,0 @@
|
||||
using CartActivator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using FundamentalLib;
|
||||
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
// todo: currently use this ladderlogic to act interaction with Medulla.
|
||||
// todo: directly integrate into CartActivator.
|
||||
|
||||
// MCU->Medulla is intervally exchanged information.
|
||||
public class MCUInterface<T> : LadderLogic<T> where T : DiverCartDefinition
|
||||
{
|
||||
|
||||
/// ////////////////////////////// IMPLEMENT THESE ////////////////////////////////////////////
|
||||
|
||||
public static void SetMCUProgram(string mcu_device_url, byte[] program)
|
||||
{
|
||||
List<byte[]> SplitArrayIntoChunks(byte[] array, int chunkSize)
|
||||
{
|
||||
List<byte[]> chunks = new List<byte[]>();
|
||||
|
||||
for (int i = 0; i < array.Length; i += chunkSize)
|
||||
{
|
||||
int currentChunkSize = Math.Min(chunkSize, array.Length - i);
|
||||
byte[] chunk = new byte[currentChunkSize];
|
||||
Array.Copy(array, i, chunk, 0, currentChunkSize);
|
||||
chunks.Add(chunk);
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
//todo: modify this.
|
||||
var codeList = SplitArrayIntoChunks(program, 1024);
|
||||
int i = 0;
|
||||
foreach (var codePack in codeList)
|
||||
{
|
||||
var downloadCode =
|
||||
new DownloadCodePack(program.Length, 1024 * i, codePack.Length, codePack).GetPack();
|
||||
Console.WriteLine(string.Join(" ", downloadCode.Select(p => $"{p:X2}")));
|
||||
cart.Embedded.SendMessage(downloadCode);
|
||||
Console.WriteLine($"send bytes length:{downloadCode.Length}");
|
||||
i++;
|
||||
Thread.Sleep(50);
|
||||
//while (true)
|
||||
//{
|
||||
// var receive = cart.Embedded.GetMessage();
|
||||
// if (receive == null) continue;
|
||||
// if (receive[5] == 0x90 && (receive[6] == 0x05 || receive[6]==0x06)) break;
|
||||
//}
|
||||
}
|
||||
var controlPack2 = new ControlPack(0x01).GetPack();
|
||||
cart.Embedded.SendMessage(controlPack2);
|
||||
Console.WriteLine("下发代码");
|
||||
//MCUTestRunner.DebugSetMCUProgram(program, (bs) => NotifyLowerData("default", bs));
|
||||
}
|
||||
|
||||
public static void SendUpperData(string mcu_device_url, byte[] data)
|
||||
{
|
||||
//todo: this is for VM data exchange, contains upperIO/lowerIO modifications.
|
||||
var upperPack = new UpperIOPack(data, data.Length).GetPack();
|
||||
cart.Embedded.SendMessage(upperPack);
|
||||
//MCUTestRunner.DebugSendUpper(data);
|
||||
}
|
||||
|
||||
|
||||
/// ////////////////////////////// INTERFACES ////////////////////////////////////////////
|
||||
|
||||
public static void NotifyPrint(string mcu_device_url, string message)
|
||||
{
|
||||
Console.WriteLine($"{mcu_device_url}:{message}");
|
||||
}
|
||||
|
||||
// whenever a lower io data is uploaded, call this.
|
||||
public static void NotifyLowerData(string mcu_device_url, byte[] lowerIOData)
|
||||
{
|
||||
using var ms = new MemoryStream(lowerIOData);
|
||||
using var br = new BinaryReader(ms);
|
||||
if (mcu_logics.TryGetValue(mcu_device_url, out var tup))
|
||||
{
|
||||
Hedingben.ToastText($"recv iter {br.ReadInt32()} lowerIO data from {mcu_device_url}, operation {tup.name}", $"DIVER-{tup.name}");
|
||||
while (ms.Position < lowerIOData.Length)
|
||||
{
|
||||
var cid = br.ReadInt16();
|
||||
if (cid < 0 || cid > tup.fields.Length) throw new Exception("invalid Cartfield id!");
|
||||
// if it's upperio skip, otherwise write data.
|
||||
var typeid = br.ReadByte();
|
||||
if (tup.fields[cid].typeid != typeid)
|
||||
throw new Exception($"??? typeid not match for {tup.fields[cid].field}({cid}), expected {tup.fields[cid].typeid} got {typeid}");
|
||||
|
||||
object value;
|
||||
switch (tup.fields[cid].typeid)
|
||||
{
|
||||
case 0:
|
||||
value = br.ReadBoolean();
|
||||
break;
|
||||
case 1:
|
||||
value = br.ReadByte();
|
||||
break;
|
||||
case 2:
|
||||
value = br.ReadSByte();
|
||||
break;
|
||||
case 3:
|
||||
value = br.ReadChar();
|
||||
break;
|
||||
case 4:
|
||||
value = br.ReadInt16();
|
||||
break;
|
||||
case 5:
|
||||
value = br.ReadUInt16();
|
||||
break;
|
||||
case 6:
|
||||
value = br.ReadInt32();
|
||||
break;
|
||||
case 7:
|
||||
value = br.ReadUInt32();
|
||||
break;
|
||||
case 8:
|
||||
value = br.ReadSingle();
|
||||
break;
|
||||
default:
|
||||
throw new Exception($"Unsupported type ID: {tup.fields[cid].typeid}");
|
||||
}
|
||||
|
||||
if (tup.fields[cid].isUpper) continue;
|
||||
tup.fields[cid].fi.SetValue(cart, value);
|
||||
}
|
||||
|
||||
// ok to send current data.
|
||||
using var sends = new MemoryStream();
|
||||
using var bw = new BinaryWriter(sends);
|
||||
bw.Write(tup.iterations++);
|
||||
for (var cid = 0; cid < tup.fields.Length; cid++)
|
||||
{
|
||||
bw.Write((short)cid);
|
||||
bw.Write((byte)tup.fields[cid].typeid);
|
||||
var val = tup.fields[cid].fi.GetValue(cart);
|
||||
switch (tup.fields[cid].typeid)
|
||||
{
|
||||
case 0:
|
||||
bw.Write((bool)val);
|
||||
break;
|
||||
case 1:
|
||||
bw.Write((byte)val);
|
||||
break;
|
||||
case 2:
|
||||
bw.Write((sbyte)val);
|
||||
break;
|
||||
case 3:
|
||||
bw.Write((char)val);
|
||||
break;
|
||||
case 4:
|
||||
bw.Write((short)val);
|
||||
break;
|
||||
case 5:
|
||||
bw.Write((ushort)val);
|
||||
break;
|
||||
case 6:
|
||||
bw.Write((int)val);
|
||||
break;
|
||||
case 7:
|
||||
bw.Write((uint)val);
|
||||
break;
|
||||
case 8:
|
||||
bw.Write((float)val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SendUpperData(mcu_device_url, sends.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
Hedingben.ToastText($"warning: {mcu_device_url} received lowerIOData but not registered","DIVERWarning");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Start(T c)
|
||||
{
|
||||
cart = c;
|
||||
|
||||
var logics = typeof(T).Assembly.GetTypes()
|
||||
.Where(p => p.GetCustomAttribute<LogicRunOnMCUAttribute>() != null).ToArray();
|
||||
foreach (var logic in logics)
|
||||
{
|
||||
var attr = logic.GetCustomAttribute<LogicRunOnMCUAttribute>();
|
||||
Console.WriteLine($"Set logic {logic.Name} to run on MCU-VM @ device {attr.mcu_url}");
|
||||
|
||||
byte[] ReadAllBytes(Stream stream)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
stream.CopyTo(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
var bytes = ReadAllBytes(Assembly.GetExecutingAssembly().GetManifestResourceStream($"{logic.Name}.bin"));
|
||||
SetMCUProgram(attr.mcu_url, bytes);
|
||||
var json = UTF8Encoding.UTF8.GetString(ReadAllBytes(Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream($"{logic.Name}.bin.json")));
|
||||
Console.WriteLine(json);
|
||||
var fields = JsonConvert.DeserializeObject<PField[]>(json);
|
||||
if (mcu_logics.ContainsKey(attr.mcu_url))
|
||||
throw new Exception($"Already have logic for {attr.mcu_url}: LadderLogic {logic.Name}");
|
||||
mcu_logics[attr.mcu_url] = new LogicInfo() { fields = fields, name = logic.Name };
|
||||
foreach (var pField in fields)
|
||||
{
|
||||
pField.fi = typeof(T).GetField(pField.field);
|
||||
if (pField.fi == null)
|
||||
throw new Exception($"field {pField.field} doesn't exist in cart object?");
|
||||
pField.isUpper = pField.fi.IsDefined(typeof(AsUpperIO));
|
||||
// todo: check type.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ///////////////////////////////// DONT CARE /////////////////////////////////////
|
||||
private static T cart;
|
||||
|
||||
class PField
|
||||
{
|
||||
public string field;
|
||||
public FieldInfo fi;
|
||||
public bool isUpper;
|
||||
public int typeid, offset;
|
||||
}
|
||||
|
||||
class LogicInfo
|
||||
{
|
||||
public string name;
|
||||
public PField[] fields;
|
||||
public int iterations;
|
||||
}
|
||||
private static Dictionary<string, LogicInfo> mcu_logics = new();
|
||||
public override void Operation(int iteration)
|
||||
{
|
||||
// just send LIO.
|
||||
}
|
||||
}
|
||||
|
||||
//unsafe class MCUTestRunner
|
||||
//{
|
||||
|
||||
// public delegate void NotifyLowerDelegate(byte* changedStates, int length);
|
||||
// [DllImport("MCURuntime.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
// public static extern void set_lowerio_cb(NotifyLowerDelegate callback);
|
||||
|
||||
// private static NotifyLowerDelegate DNotifyStateChanged = StateChanged;
|
||||
|
||||
// [DllImport("MCURuntime.dll")]
|
||||
// static extern void test(byte* bin, int len);
|
||||
// [DllImport("MCURuntime.dll")]
|
||||
// static extern void put_upper(byte* bin, int len);
|
||||
|
||||
// private static Action<byte[]> lo_notifier;
|
||||
// private static void StateChanged(byte* changedstates, int length)
|
||||
// {
|
||||
// byte[] byteArray = new byte[length];
|
||||
// Marshal.Copy((IntPtr)changedstates, byteArray, 0, length);
|
||||
// lo_notifier(byteArray);
|
||||
// }
|
||||
|
||||
// public static void DebugSendUpper(byte[] data)
|
||||
// {
|
||||
// fixed (byte* ptr = data)
|
||||
// {
|
||||
// put_upper(ptr, data.Length);
|
||||
// }
|
||||
// }
|
||||
// public static void DebugSetMCUProgram(byte[] program, Action<byte[]> notifier)
|
||||
// {
|
||||
// lo_notifier = notifier;
|
||||
// set_lowerio_cb(DNotifyStateChanged);
|
||||
// new Thread(() =>
|
||||
// {
|
||||
// var allb = new byte[10240]; //10K runtime
|
||||
// Array.Copy(program, allb, program.Length);
|
||||
// fixed (byte* ptr = allb)
|
||||
// {
|
||||
// test(ptr, 10240);
|
||||
// }
|
||||
// }).Start();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,879 +1 @@
|
||||
using CartActivator;
|
||||
using FundamentalLib;
|
||||
using MCUSerialBridgeCLR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
//[LogicRunOnMCU(scanInterval = 20)]
|
||||
public class MCURoutine:LadderLogic<DiverCartDefinition>
|
||||
{
|
||||
private int _lastIteration = 0;
|
||||
private int _count = 0;
|
||||
private int _operationTime = 0;
|
||||
private bool _driversDisabled;
|
||||
private bool _canCallbackRegistered;
|
||||
private bool _serialCallbackRegistered;
|
||||
private byte _resetCode = 0x86;
|
||||
private byte _enableCode1 = 0x06;
|
||||
private byte _enableCode2 = 0x07;
|
||||
private byte _enableCode3 = 0x0F;
|
||||
private bool io_bit0 = false;//继电器
|
||||
private bool io_bit1 = false;//抱闸
|
||||
private bool io_bit2 = false;//红灯
|
||||
private bool io_bit3 = false;//绿灯
|
||||
private bool io_bit4 = false;//黄灯
|
||||
private const byte BatteryPortIndex = 3;
|
||||
private static readonly byte[] BatteryRequest = BuildBatteryRequest();
|
||||
|
||||
private static float ConvertMps2Rpm(float mps)
|
||||
{
|
||||
return (float)(mps / (Math.PI * 85f) * 10.5f * 60f * 1000f);
|
||||
}
|
||||
private static float ConvertRpm2Mps(float rpm)
|
||||
{
|
||||
return (float)(rpm / 10.5f / 60f * Math.PI * 85f / 1000f);
|
||||
}
|
||||
private float ConvertR2MM(float r)
|
||||
{
|
||||
return (float)(r / 10.5f * Math.PI * 85);
|
||||
}
|
||||
private static float DecodeRpmFromPayload(byte[] payload, int offset = 4)
|
||||
{
|
||||
return BitConverter.ToInt32(payload, offset) * 1875f / 512f / 10000f;
|
||||
}
|
||||
public override void Operation(int iteration)
|
||||
{
|
||||
if (_lastIteration != iteration)
|
||||
{
|
||||
_lastIteration = iteration;
|
||||
_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_count++;
|
||||
}
|
||||
if (_count >= 15)
|
||||
{
|
||||
cart.AlarmLevel = 2;
|
||||
Console.WriteLine("mcu lost connection \n");
|
||||
}
|
||||
|
||||
if (_count >= 30)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cart?.Bridge == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//注册CAN回调
|
||||
EnsureCanCallbacksRegistered();
|
||||
//注册串口回调
|
||||
EnsureSerialCallbacksRegistered();
|
||||
PollBatterySerial(iteration);
|
||||
|
||||
#region io部分
|
||||
var ioReadBuffer = new byte[4];
|
||||
var readInputErr = cart.Bridge.ReadInput(out ioReadBuffer, 20);
|
||||
if (readInputErr == MCUSerialBridgeError.OK)
|
||||
{
|
||||
cart.test = ioReadBuffer[0];
|
||||
cart.Start = (ioReadBuffer[0] & (1 << 0)) != 0;
|
||||
cart.ResetPressed = (ioReadBuffer[0] & (1 << 1)) != 0;
|
||||
cart.ChassisMode = ((ioReadBuffer[0] & (1 << 2)) == 0) ? 0 : 1;
|
||||
cart.BrakeEnable = (ioReadBuffer[0] & (1 << 3)) != 0;
|
||||
if ((ioReadBuffer[0] & (1 << 4)) == 0)
|
||||
{
|
||||
cart.EmergencyPressed = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("IO Read FAILED");
|
||||
}
|
||||
|
||||
var ioWriteBuffer = new byte[4];
|
||||
io_bit0 = cart.ChargePort ? true : false;
|
||||
io_bit1 = cart.EmergencyPressed == 1 ? false : true;
|
||||
if (cart.MultiVehicleLightSync == 0)
|
||||
{
|
||||
io_bit2 = false;
|
||||
io_bit3 = false;
|
||||
io_bit4 = false;
|
||||
}
|
||||
else if (cart.MultiVehicleLightSync == 1)
|
||||
{
|
||||
io_bit2 = false;
|
||||
io_bit3 = true;
|
||||
io_bit4 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cart.LightMode == 2)
|
||||
{
|
||||
io_bit2 = true;//红
|
||||
io_bit3 = false;//绿
|
||||
io_bit4 = false;//黄
|
||||
}
|
||||
else if (cart.LightMode == 3)
|
||||
{
|
||||
io_bit2 = false;
|
||||
io_bit3 = false;
|
||||
io_bit4 = true;
|
||||
}
|
||||
else if (cart.LightMode == 1)
|
||||
{
|
||||
io_bit2 = false;
|
||||
io_bit3 = true;
|
||||
io_bit4 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
io_bit2 = false;
|
||||
io_bit3 = false;
|
||||
io_bit4 = false;
|
||||
}
|
||||
}
|
||||
|
||||
ioWriteBuffer[0] = (byte)((io_bit0 ? 1 << 0 : 0) | //继电器
|
||||
(io_bit1 ? 1 << 1 : 0) | //抱闸
|
||||
(io_bit2 ? 1 << 2 : 0) | //红灯
|
||||
(io_bit3 ? 1 << 3 : 0) | //绿灯
|
||||
(io_bit4 ? 1 << 4 : 0)); //黄灯
|
||||
if (cart.Bridge.WriteOutput(ioWriteBuffer, 20) != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("IO Write FAILED");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 驱动部分
|
||||
cart.ActualSpeedLeftFront = (cart.ActualSpeedLeftFrontLeft + cart.ActualSpeedLeftFrontRight) / 2;
|
||||
cart.ActualSpeedLeftRear = (cart.ActualSpeedLeftRearLeft + cart.ActualSpeedLeftRearRight) / 2;
|
||||
cart.ActualSpeedRightFront = (cart.ActualSpeedRightFrontLeft + cart.ActualSpeedRightFrontRight) / 2;
|
||||
cart.ActualSpeedRightRear = (cart.ActualSpeedRightRearLeft + cart.ActualSpeedRightRearRight) / 2;
|
||||
MCUSerialBridgeError SendCan(byte port, ushort standardId, byte[] payload, bool RTR = false, uint timeout = 2)
|
||||
{
|
||||
var canSend = new CANMessage
|
||||
{
|
||||
ID = standardId,
|
||||
RTR = RTR,
|
||||
DLC = !RTR ? (byte)8 : (byte)0,
|
||||
Payload = payload ?? new byte[] { }
|
||||
};
|
||||
return cart.Bridge.WriteCAN(port, canSend, timeout);
|
||||
}
|
||||
|
||||
var resetPayload = new byte[8] { 0xFD, _resetCode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
var enable1Payload = new byte[8] { 0xFD, _enableCode1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
var enable2Payload = new byte[8] { 0xFD, _enableCode2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
var enable3Payload = new byte[8] { 0xFD, _enableCode3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
Hedingben.ToastText($"_operationTime:{_operationTime}", "OperationTime");
|
||||
if (_operationTime == 0)
|
||||
{
|
||||
SendCan(0, 0x00, new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
else if (_operationTime == 1)
|
||||
{
|
||||
if (cart.LeftFrontLeftErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x201, enable1Payload);
|
||||
SendCan(0, 0x201, resetPayload);
|
||||
}
|
||||
if (cart.LeftFrontRightErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x202, enable1Payload);
|
||||
SendCan(0, 0x202, resetPayload);
|
||||
}
|
||||
if (cart.RightFrontLeftErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x203, enable1Payload);
|
||||
SendCan(0, 0x203, resetPayload);
|
||||
}
|
||||
if (cart.RightFrontRightErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x204, enable1Payload);
|
||||
SendCan(0, 0x204, resetPayload);
|
||||
}
|
||||
if (cart.LeftRearLeftErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x205, enable1Payload);
|
||||
SendCan(0, 0x205, resetPayload);
|
||||
}
|
||||
if (cart.LeftRearRightErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x206, enable1Payload);
|
||||
SendCan(0, 0x206, resetPayload);
|
||||
}
|
||||
if (cart.RightRearLeftErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x207, enable1Payload);
|
||||
SendCan(0, 0x207, resetPayload);
|
||||
}
|
||||
if (cart.RightRearRightErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x208, enable1Payload);
|
||||
SendCan(0, 0x208, resetPayload);
|
||||
}
|
||||
if (cart.LeftArmErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x209, enable1Payload);
|
||||
SendCan(0, 0x209, resetPayload);
|
||||
}
|
||||
if (cart.RightArmErrorCode != 0)
|
||||
{
|
||||
SendCan(0, 0x20A, enable1Payload);
|
||||
SendCan(0, 0x20A, resetPayload);
|
||||
}
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
else if (_operationTime == 2)
|
||||
{
|
||||
//SendNodeGuardRequests(SendCan);
|
||||
//if (AreAllNodesOperational())
|
||||
//{
|
||||
// _operationTime++;
|
||||
//}
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
//检查错误是否被消除 若没被消除就得重新返回上一步发复位 若消除了就继续往下
|
||||
else if (_operationTime == 3)
|
||||
{
|
||||
if (cart.LeftFrontLeftErrorCode != 0 || cart.LeftFrontRightErrorCode != 0 ||
|
||||
cart.LeftRearLeftErrorCode != 0 || cart.LeftRearRightErrorCode != 0
|
||||
|| cart.RightFrontLeftErrorCode != 0 || cart.RightFrontRightErrorCode != 0 ||
|
||||
cart.RightRearLeftErrorCode != 0 || cart.RightRearRightErrorCode != 0 ||
|
||||
cart.LeftArmErrorCode != 0 || cart.RightArmErrorCode != 0)
|
||||
{
|
||||
_operationTime = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 没有错误 没有节点保护 就发06 07 0F使能
|
||||
else if (_operationTime == 4)
|
||||
{
|
||||
SendCan(0, 0x201, enable1Payload);
|
||||
SendCan(0, 0x202, enable1Payload);
|
||||
SendCan(0, 0x203, enable1Payload);
|
||||
SendCan(0, 0x204, enable1Payload);
|
||||
SendCan(0, 0x205, enable1Payload);
|
||||
SendCan(0, 0x206, enable1Payload);
|
||||
SendCan(0, 0x207, enable1Payload);
|
||||
SendCan(0, 0x208, enable1Payload);
|
||||
SendCan(0, 0x209, enable1Payload);
|
||||
SendCan(0, 0x20A, enable1Payload);
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
else if (_operationTime == 5)
|
||||
{
|
||||
SendCan(0, 0x201, enable2Payload);
|
||||
SendCan(0, 0x202, enable2Payload);
|
||||
SendCan(0, 0x203, enable2Payload);
|
||||
SendCan(0, 0x204, enable2Payload);
|
||||
SendCan(0, 0x205, enable2Payload);
|
||||
SendCan(0, 0x206, enable2Payload);
|
||||
SendCan(0, 0x207, enable2Payload);
|
||||
SendCan(0, 0x208, enable2Payload);
|
||||
SendCan(0, 0x209, enable2Payload);
|
||||
SendCan(0, 0x20A, enable2Payload);
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
else if (_operationTime == 6)
|
||||
{
|
||||
SendCan(0, 0x201, enable3Payload);
|
||||
SendCan(0, 0x202, enable3Payload);
|
||||
SendCan(0, 0x203, enable3Payload);
|
||||
SendCan(0, 0x204, enable3Payload);
|
||||
SendCan(0, 0x205, enable3Payload);
|
||||
SendCan(0, 0x206, enable3Payload);
|
||||
SendCan(0, 0x207, enable3Payload);
|
||||
SendCan(0, 0x208, enable3Payload);
|
||||
SendCan(0, 0x209, enable3Payload);
|
||||
SendCan(0, 0x20A, enable3Payload);
|
||||
if (cart.LeftFrontLeftErrorCode != 0 || cart.LeftFrontRightErrorCode != 0 ||
|
||||
cart.LeftRearLeftErrorCode != 0 || cart.LeftRearRightErrorCode != 0
|
||||
|| cart.RightFrontLeftErrorCode != 0 || cart.RightFrontRightErrorCode != 0 ||
|
||||
cart.RightRearLeftErrorCode != 0 || cart.RightRearRightErrorCode != 0 ||
|
||||
cart.LeftArmErrorCode != 0 || cart.RightArmErrorCode != 0)
|
||||
{
|
||||
_operationTime = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
_operationTime++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cart.ResetPressed || cart.ResetFromM || cart.ResetFromC)
|
||||
{
|
||||
cart.AlarmLevel = -1;
|
||||
cart.EmergencyPressed = 0;
|
||||
_count = 0;
|
||||
_operationTime = 0;
|
||||
_driversDisabled = false;
|
||||
cart.WheelAbleState = true;
|
||||
cart.ResetFromM = false;
|
||||
}
|
||||
|
||||
if (cart.DisableFromM || cart.DisableFromC)
|
||||
{
|
||||
_driversDisabled = true;
|
||||
cart.WheelAbleState = false;
|
||||
cart.DisableFromM = false;
|
||||
}
|
||||
|
||||
var lfl = Math.Sign(cart.SpeedLFL) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedLFL));
|
||||
var lfr = Math.Sign(cart.SpeedLFR) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedLFR));
|
||||
var rfl = Math.Sign(cart.SpeedRFL) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedRFL));
|
||||
var rfr = Math.Sign(cart.SpeedRFR) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedRFR));
|
||||
var lrl = Math.Sign(cart.SpeedLRL) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedLRL));
|
||||
var lrr = Math.Sign(cart.SpeedLRR) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedLRR));
|
||||
var rrl = Math.Sign(cart.SpeedRRL) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedRRL));
|
||||
var rrr = Math.Sign(cart.SpeedRRR) * Math.Min(Math.Max(0, cart.SendThresSpeed), Math.Abs(cart.SpeedRRR));
|
||||
|
||||
var v1 = ConvertMps2Rpm(lfl);
|
||||
var v2 = ConvertMps2Rpm(-lfr);
|
||||
var v3 = ConvertMps2Rpm(rfl);
|
||||
var v4 = ConvertMps2Rpm(-rfr);
|
||||
var v5 = ConvertMps2Rpm(lrl);
|
||||
var v6 = ConvertMps2Rpm(-lrr);
|
||||
var v7 = ConvertMps2Rpm(rrl);
|
||||
var v8 = ConvertMps2Rpm(-rrr);
|
||||
var v9 = ConvertMps2Rpm(cart.SpeedLeftArm);
|
||||
var v10 = ConvertMps2Rpm(cart.SpeedRightArm);
|
||||
if (cart.AlarmLevel == 2 || cart.WaitStart || cart.PreparaStart)
|
||||
{
|
||||
v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 = 0;
|
||||
}
|
||||
if ((cart.ActualPosLeftArm <= cart.LeftArmLowerPos && cart.SpeedLeftArm < 0) || (cart.ActualPosLeftArm >= cart.LeftArmUpperPos && cart.SpeedLeftArm > 0))
|
||||
{
|
||||
v9 = 0;
|
||||
}
|
||||
if ((cart.ActualPosRightArm <= cart.RightArmLowerPos && cart.SpeedRightArm < 0) || (cart.ActualPosRightArm >= cart.RightArmUpperPos && cart.SpeedRightArm > 0))
|
||||
{
|
||||
v10 = 0;
|
||||
}
|
||||
|
||||
var sendLFL = BitConverter.GetBytes((int)Math.Round(v1 * 512f * 10000f / 1875f));
|
||||
var sendLFR = BitConverter.GetBytes((int)Math.Round(v2 * 512f * 10000f / 1875f));
|
||||
var sendRFL = BitConverter.GetBytes((int)Math.Round(v3 * 512f * 10000f / 1875f));
|
||||
var sendRFR = BitConverter.GetBytes((int)Math.Round(v4 * 512f * 10000f / 1875f));
|
||||
var sendLRL = BitConverter.GetBytes((int)Math.Round(v5 * 512f * 10000f / 1875f));
|
||||
var sendLRR = BitConverter.GetBytes((int)Math.Round(v6 * 512f * 10000f / 1875f));
|
||||
var sendRRL = BitConverter.GetBytes((int)Math.Round(v7 * 512f * 10000f / 1875f));
|
||||
var sendRRR = BitConverter.GetBytes((int)Math.Round(v8 * 512f * 10000f / 1875f));
|
||||
var sendLArm = BitConverter.GetBytes((int)Math.Round(v9 * 512f * 10000f / 1875f));
|
||||
var sendRArm = BitConverter.GetBytes((int)Math.Round(v10 * 512f * 10000f / 1875f));
|
||||
|
||||
if (iteration % 2 == 0)
|
||||
{
|
||||
//SendNodeGuardRequests(SendCan);
|
||||
}
|
||||
|
||||
if (_driversDisabled)
|
||||
{
|
||||
SendCan(0, 0x201, enable1Payload);
|
||||
SendCan(0, 0x202, enable1Payload);
|
||||
SendCan(0, 0x203, enable1Payload);
|
||||
SendCan(0, 0x204, enable1Payload);
|
||||
SendCan(0, 0x205, enable1Payload);
|
||||
SendCan(0, 0x206, enable1Payload);
|
||||
SendCan(0, 0x207, enable1Payload);
|
||||
SendCan(0, 0x208, enable1Payload);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendCan(0, 0x201, new byte[] { 0xFD, _enableCode3, 0x00, sendLFL[0], sendLFL[1], sendLFL[2], sendLFL[3], 0x00 });
|
||||
SendCan(0, 0x202, new byte[] { 0xFD, _enableCode3, 0x00, sendLFR[0], sendLFR[1], sendLFR[2], sendLFR[3], 0x00 });
|
||||
SendCan(0, 0x203, new byte[] { 0xFD, _enableCode3, 0x00, sendRFL[0], sendRFL[1], sendRFL[2], sendRFL[3], 0x00 });
|
||||
SendCan(0, 0x204, new byte[] { 0xFD, _enableCode3, 0x00, sendRFR[0], sendRFR[1], sendRFR[2], sendRFR[3], 0x00 });
|
||||
SendCan(0, 0x205, new byte[] { 0xFD, _enableCode3, 0x00, sendLRL[0], sendLRL[1], sendLRL[2], sendLRL[3], 0x00 });
|
||||
SendCan(0, 0x206, new byte[] { 0xFD, _enableCode3, 0x00, sendLRR[0], sendLRR[1], sendLRR[2], sendLRR[3], 0x00 });
|
||||
SendCan(0, 0x207, new byte[] { 0xFD, _enableCode3, 0x00, sendRRL[0], sendRRL[1], sendRRL[2], sendRRL[3], 0x00 });
|
||||
SendCan(0, 0x208, new byte[] { 0xFD, _enableCode3, 0x00, sendRRR[0], sendRRR[1], sendRRR[2], sendRRR[3], 0x00 });
|
||||
}
|
||||
SendCan(0, 0x209, new byte[] { 0xFD, _enableCode3, 0x00, sendLArm[0], sendLArm[1], sendLArm[2], sendLArm[3], 0x00 });
|
||||
SendCan(0, 0x20A, new byte[] { 0xFD, _enableCode3, 0x00, sendRArm[0], sendRArm[1], sendRArm[2], sendRArm[3], 0x00 });
|
||||
|
||||
if (cart.LeftFrontLeftErrorCode != 0 || cart.LeftFrontRightErrorCode != 0 ||
|
||||
cart.LeftRearLeftErrorCode != 0 || cart.LeftRearRightErrorCode != 0
|
||||
|| cart.RightFrontLeftErrorCode != 0 || cart.RightFrontRightErrorCode != 0 ||
|
||||
cart.RightRearLeftErrorCode != 0 || cart.RightRearRightErrorCode != 0)
|
||||
{
|
||||
//_errorCount++;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
private static bool IsNodeOperational(byte remoteCode)
|
||||
{
|
||||
return remoteCode == 5 || remoteCode == 133;
|
||||
}
|
||||
|
||||
private bool AreAllNodesOperational()
|
||||
{
|
||||
return IsNodeOperational(cart.LFLRemoteCode)
|
||||
&& IsNodeOperational(cart.LFRRemoteCode)
|
||||
&& IsNodeOperational(cart.RFLRemoteCode)
|
||||
&& IsNodeOperational(cart.RFRRemoteCode)
|
||||
&& IsNodeOperational(cart.LRLRemoteCode)
|
||||
&& IsNodeOperational(cart.LRRRemoteCode)
|
||||
&& IsNodeOperational(cart.RRLRemoteCode)
|
||||
&& IsNodeOperational(cart.RRRRemoteCode)
|
||||
&& IsNodeOperational(cart.LArmRemoteCode)
|
||||
&& IsNodeOperational(cart.RArmRemoteCode);
|
||||
}
|
||||
|
||||
private static void SendNodeGuardRequests(Func<byte, ushort, byte[], bool, uint, MCUSerialBridgeError> sendCan)
|
||||
{
|
||||
sendCan(0, 0x709, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x70A, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x701, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x702, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x703, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x704, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x705, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x706, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x707, Array.Empty<byte>(), true, 2);
|
||||
sendCan(0, 0x708, Array.Empty<byte>(), true, 2);
|
||||
}
|
||||
|
||||
private void EnsureCanCallbacksRegistered()
|
||||
{
|
||||
if (_canCallbackRegistered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cart?.Bridge == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var dispatch = BuildCanDispatchTable();
|
||||
|
||||
var err0 = cart.Bridge.RegisterCANPortCallback(0, msg =>
|
||||
{
|
||||
if (msg == null) return;
|
||||
if (dispatch.TryGetValue(msg.ID, out var handler))
|
||||
{
|
||||
handler(msg);
|
||||
}
|
||||
});
|
||||
_canCallbackRegistered = true;
|
||||
}
|
||||
|
||||
private void EnsureSerialCallbacksRegistered()
|
||||
{
|
||||
if (_serialCallbackRegistered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cart?.Bridge == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var err1 = cart.Bridge.RegisterSerialPortCallback(1, msg =>
|
||||
{
|
||||
if (msg == null) return;
|
||||
Hedingben.ToastText($"Callback Serial 1 Callback Received: {BitConverter.ToString(msg)}", "Serial 1");
|
||||
});
|
||||
Hedingben.ToastText($"Register Serial 1: {err1}", "Register Serial");
|
||||
_serialCallbackRegistered = err1 == MCUSerialBridgeError.OK;
|
||||
}
|
||||
|
||||
private void PollBatterySerial(int iteration)
|
||||
{
|
||||
if (cart?.Bridge == null) return;
|
||||
if (iteration % 20 != 0) return;
|
||||
|
||||
var writeErr = cart.Bridge.WriteSerial(BatteryPortIndex, BatteryRequest, 60);
|
||||
if (writeErr != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Hedingben.ToastText($"Battery write err: {writeErr}", "Serial 2");
|
||||
return;
|
||||
}
|
||||
|
||||
var readErr = cart.Bridge.ReadSerial(BatteryPortIndex, out var msg, 40);
|
||||
if (readErr == MCUSerialBridgeError.NoData) return;
|
||||
if (readErr != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Hedingben.ToastText($"Battery read err: {readErr}", "Serial 2");
|
||||
return;
|
||||
}
|
||||
if (msg == null || msg.Length == 0) return;
|
||||
|
||||
Hedingben.ToastText($"Serial 2 RX: {BitConverter.ToString(msg)}", "Serial 2");
|
||||
TryUpdateBatteryData(msg);
|
||||
}
|
||||
|
||||
private void TryUpdateBatteryData(byte[] msg)
|
||||
{
|
||||
// Modbus RTU response: [id,03,08,data(8),crc(2)]
|
||||
if (msg.Length < 13 || msg[0] != 0x01 || msg[1] != 0x03 || msg[2] < 8) return;
|
||||
ushort calc = ComputeModbusCrc(msg, msg.Length - 2);
|
||||
ushort recv = (ushort)(msg[msg.Length - 2] | (msg[msg.Length - 1] << 8));
|
||||
if (calc != recv) return;
|
||||
|
||||
cart.Voltage = ReadInt16BE(msg, 3) * 0.1f;
|
||||
cart.Soc = ReadUInt16BE(msg, 5);
|
||||
cart.SOH = ReadUInt16BE(msg, 7);
|
||||
cart.ElectricCurrent = -ReadInt16BE(msg, 9) * 0.1f;
|
||||
}
|
||||
|
||||
private static byte[] BuildBatteryRequest()
|
||||
{
|
||||
// 01 03 00 03 00 04 CRC (读取寄存器 03~06)
|
||||
byte[] req = new byte[] { 0x01, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00 };
|
||||
ushort crc = ComputeModbusCrc(req, 6);
|
||||
req[6] = (byte)(crc & 0xFF);
|
||||
req[7] = (byte)((crc >> 8) & 0xFF);
|
||||
return req;
|
||||
}
|
||||
|
||||
private static ushort ComputeModbusCrc(byte[] data, int length)
|
||||
{
|
||||
ushort crc = 0xFFFF;
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
crc ^= data[i];
|
||||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
bool lsb = (crc & 0x0001) != 0;
|
||||
crc >>= 1;
|
||||
if (lsb) crc ^= 0xA001;
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
private static short ReadInt16BE(byte[] data, int offset)
|
||||
{
|
||||
return (short)((data[offset] << 8) | data[offset + 1]);
|
||||
}
|
||||
|
||||
private static ushort ReadUInt16BE(byte[] data, int offset)
|
||||
{
|
||||
return (ushort)((data[offset] << 8) | data[offset + 1]);
|
||||
}
|
||||
|
||||
private Dictionary<ushort, Action<CANMessage>> BuildCanDispatchTable()
|
||||
{
|
||||
return new Dictionary<ushort, Action<CANMessage>>
|
||||
{
|
||||
// 速度/位置反馈 0x281~0x28A
|
||||
[0x281] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x281 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedLeftFrontLeft = ConvertRpm2Mps(rpm);
|
||||
cart.LFLActualPos = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x282] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x282 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedLeftFrontRight = -ConvertRpm2Mps(rpm);
|
||||
cart.LFRActualPos = ConvertR2MM(-BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x283] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x283 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedRightFrontLeft = ConvertRpm2Mps(rpm);
|
||||
cart.RFLActualPos = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x284] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x284 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedRightFrontRight = -ConvertRpm2Mps(rpm);
|
||||
cart.RFRActualPos = ConvertR2MM(-BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x285] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x285 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedLeftRearLeft = ConvertRpm2Mps(rpm);
|
||||
cart.LRLActualPos = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x286] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x286 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedLeftRearRight = -ConvertRpm2Mps(rpm);
|
||||
cart.LRRActualPos = ConvertR2MM(-BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x287] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x287 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedRightRearLeft = ConvertRpm2Mps(rpm);
|
||||
cart.RRLActualPos = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x288] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x288 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedRightRearRight = -ConvertRpm2Mps(rpm);
|
||||
cart.RRRActualPos = ConvertR2MM(-BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x289] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x289 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedLeftArm = ConvertRpm2Mps(rpm);
|
||||
cart.ActualPosLeftArm = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
[0x28A] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x28A CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 8) return;
|
||||
var rpm = DecodeRpmFromPayload(payload);
|
||||
cart.ActualSpeedRightArm = ConvertRpm2Mps(rpm);
|
||||
cart.ActualPosRightArm = ConvertR2MM(BitConverter.ToInt32(payload, 0) / 10000f);
|
||||
},
|
||||
// 状态/错误码 0x181~0x18A
|
||||
[0x181] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x181 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.LeftFrontLeftStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.LeftFrontLeftErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.LeftFrontLeftElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x182] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x182 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.LeftFrontRightStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.LeftFrontRightErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.LeftFrontRightElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x183] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x183 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.RightFrontLeftStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.RightFrontLeftErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.RightFrontLeftElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x184] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x184 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.RightFrontRightStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.RightFrontRightErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.RightFrontRightElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x185] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x185 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.LeftRearLeftStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.LeftRearLeftErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.LeftRearLeftElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x186] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x186 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.LeftRearRightStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.LeftRearRightErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.LeftRearRightElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x187] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x187 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.RightRearLeftStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.RightRearLeftErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.RightRearLeftElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x188] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x188 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.RightRearRightStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.RightRearRightErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.RightRearRightElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x189] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x189 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.LeftArmStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.LeftArmErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.LeftArmElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
[0x18A] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x18A CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.RightArmStateCode = BitConverter.ToInt16(payload, 0);
|
||||
cart.RightArmErrorCode = BitConverter.ToInt16(payload, 2);
|
||||
cart.RightArmElectric = BitConverter.ToInt16(payload, 5) * 0.001f;
|
||||
},
|
||||
|
||||
// 舵角 0x18B~0x18E
|
||||
[0x18B] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x18B CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.ActualThLeftFront = BitConverter.ToInt32(payload, 0);
|
||||
cart.ActualThLeftFront = cart.ActualThLeftFront >= 16384
|
||||
? (cart.ActualThLeftFront - 98303) / 4096f / 5f * 360 - cart.ThBiasLeftFront
|
||||
: cart.ActualThLeftFront / 4096f / 5f * 360 - cart.ThBiasLeftFront;
|
||||
},
|
||||
[0x18C] = (msg) =>
|
||||
{
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
var raw = BitConverter.ToInt32(payload, 0);
|
||||
cart.ActualThRightFront = raw >= 16384
|
||||
? (raw - 98303) / 4096f / 5f * 360 - cart.ThBiasRightFront
|
||||
: raw / 4096f / 5f * 360 - cart.ThBiasRightFront;
|
||||
//DLog.Log($"RF raw=0x{raw:X8}({raw}) angle={cart.ActualThRightFront:F2}", "0x18C");
|
||||
},
|
||||
[0x18D] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine($"Received 0x18D CAN Message {DateTime.Now:yyyy-MM-dd HH:mm:ss.ffffff}");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.ActualThLeftRear = BitConverter.ToInt32(payload, 0);
|
||||
cart.ActualThLeftRear = cart.ActualThLeftRear >= 16384
|
||||
? (cart.ActualThLeftRear - 98303) / 4096f / 5f * 360 - cart.ThBiasLeftRear
|
||||
: cart.ActualThLeftRear / 4096f / 5f * 360 - cart.ThBiasLeftRear;
|
||||
},
|
||||
[0x18E] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x18E CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 4) return;
|
||||
cart.ActualThRightRear = BitConverter.ToInt32(payload, 0);
|
||||
cart.ActualThRightRear = cart.ActualThRightRear >= 16384
|
||||
? (cart.ActualThRightRear - 98303) / 4096f / 5f * 360 - cart.ThBiasRightRear
|
||||
: cart.ActualThRightRear / 4096f / 5f * 360 - cart.ThBiasRightRear;
|
||||
},
|
||||
|
||||
// 远程帧
|
||||
[0x701] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x701 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.LFLRemoteCode = payload[0];
|
||||
},
|
||||
[0x702] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x702 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.LFRRemoteCode = payload[0];
|
||||
},
|
||||
[0x703] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x703 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.RFLRemoteCode = payload[0];
|
||||
},
|
||||
[0x704] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x704 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.RFRRemoteCode = payload[0];
|
||||
},
|
||||
[0x705] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x705 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.LRLRemoteCode = payload[0];
|
||||
},
|
||||
[0x706] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x706 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.LRRRemoteCode = payload[0];
|
||||
},
|
||||
[0x707] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x707 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.RRLRemoteCode = payload[0];
|
||||
},
|
||||
[0x708] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x708 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.RRRRemoteCode = payload[0];
|
||||
},
|
||||
[0x709] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x709 CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.LArmRemoteCode = payload[0];
|
||||
},
|
||||
[0x70A] = (msg) =>
|
||||
{
|
||||
//Console.WriteLine("Received 0x70A CAN Message");
|
||||
var payload = msg.Payload;
|
||||
if (payload == null || payload.Length < 1) return;
|
||||
cart.RArmRemoteCode = payload[0];
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 实际CAN协议、反馈解析、IO、电池、急停
|
||||
@@ -1,3 +1,5 @@
|
||||
// C#调用MCU通信桥
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -102,6 +104,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 转换为可读字符串
|
||||
/// </summary>
|
||||
/// <returns>返回包含产品、Tag、Commit、BuildTime 的字符串</returns>
|
||||
// M层MCU适配:格式化固件版本信息便于日志显示。
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Product: {ProductionName}, Tag: {GitTag}, Commit: {GitCommit}, Built: {BuildTime}";
|
||||
@@ -144,6 +147,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 返回可读的状态字符串
|
||||
/// </summary>
|
||||
/// <returns>例如 "Bridge: Running" 或 "DIVER: Error"</returns>
|
||||
// M层MCU适配:格式化MCU运行状态便于日志显示。
|
||||
public override string ToString()
|
||||
{
|
||||
string modeStr = IsBridge ? "Bridge" : "DIVER";
|
||||
@@ -174,6 +178,7 @@ namespace MCUSerialBridgeCLR
|
||||
|
||||
/// <summary>序列化端口配置为字节数组(供 P/Invoke 使用)</summary>
|
||||
/// <returns>返回固定长度字节数组(16 bytes)</returns>
|
||||
// M层MCU适配:将端口配置序列化为原生接口字节。
|
||||
public abstract byte[] ToBytes();
|
||||
}
|
||||
|
||||
@@ -185,6 +190,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// </remarks>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <param name="receiveFrameMs">接收帧间隔</param>
|
||||
// M层MCU适配:创建串口通信参数配置。
|
||||
public class SerialPortConfig(uint baud, uint receiveFrameMs) : PortConfig
|
||||
{
|
||||
/// <summary>Serial 类型</summary>
|
||||
@@ -200,6 +206,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 转换为字节数组
|
||||
/// </summary>
|
||||
/// <returns>16 字节数组</returns>
|
||||
// M层MCU适配:序列化串口波特率和组帧时间。
|
||||
public override byte[] ToBytes()
|
||||
{
|
||||
var c = new PortStructHelper.SerialPortConfigC
|
||||
@@ -221,6 +228,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// </remarks>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <param name="retryTimeMs">重发间隔</param>
|
||||
// M层MCU适配:创建CAN通信参数配置。
|
||||
public class CANPortConfig(uint baud, uint retryTimeMs) : PortConfig
|
||||
{
|
||||
/// <summary>CAN 类型</summary>
|
||||
@@ -236,6 +244,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 转换为字节数组
|
||||
/// </summary>
|
||||
/// <returns>16 字节数组</returns>
|
||||
// M层MCU适配:序列化CAN波特率和重试时间。
|
||||
public override byte[] ToBytes()
|
||||
{
|
||||
var c = new PortStructHelper.CANPortConfigC
|
||||
@@ -272,6 +281,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <returns>返回字节数组:2 bytes header + Payload</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException">如果 DLC > 8</exception>
|
||||
/// <exception cref="ArgumentException">如果 Payload 长度 != DLC</exception>
|
||||
// M层CAN适配:将标准或扩展CAN帧序列化为原生布局。
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
if (DLC > 8)
|
||||
@@ -303,6 +313,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="length">实际有效长度</param>
|
||||
/// <returns>CANMessage 实例</returns>
|
||||
/// <exception cref="ArgumentException">数据长度错误</exception>
|
||||
// M层CAN适配:从原生缓冲区还原CAN消息。
|
||||
public static CANMessage FromBytes(byte[] data, uint length)
|
||||
{
|
||||
if (data == null || length > data.Length || length < 2)
|
||||
@@ -332,6 +343,7 @@ namespace MCUSerialBridgeCLR
|
||||
return msg;
|
||||
}
|
||||
|
||||
// M层CAN诊断:格式化CAN标识符和数据内容。
|
||||
public override string ToString()
|
||||
{
|
||||
string payloadStr =
|
||||
@@ -351,6 +363,7 @@ namespace MCUSerialBridgeCLR
|
||||
private const string DLL = @"mcu_serial_bridge.dll";
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:打开MCU串口桥设备。
|
||||
internal static extern MCUSerialBridgeError msb_open(
|
||||
out IntPtr handle,
|
||||
[MarshalAs(UnmanagedType.LPStr)] string port,
|
||||
@@ -358,12 +371,15 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:关闭MCU串口桥设备。
|
||||
internal static extern MCUSerialBridgeError msb_close(IntPtr handle);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:复位MCU串口桥。
|
||||
internal static extern MCUSerialBridgeError msb_reset(IntPtr handle, uint timeout_ms);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:读取MCU固件版本。
|
||||
public static extern MCUSerialBridgeError msb_version(
|
||||
IntPtr handle,
|
||||
out VersionInfo version,
|
||||
@@ -371,6 +387,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:读取MCU当前运行状态。
|
||||
public static extern MCUSerialBridgeError mcu_state(
|
||||
IntPtr handle,
|
||||
out MCUState state,
|
||||
@@ -378,6 +395,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:下发串口桥端口配置。
|
||||
internal static extern MCUSerialBridgeError msb_configure(
|
||||
IntPtr handle,
|
||||
uint num_ports,
|
||||
@@ -386,6 +404,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:读取MCU数字输入。
|
||||
internal static extern MCUSerialBridgeError msb_read_input(
|
||||
IntPtr handle,
|
||||
[Out] byte[] inputs,
|
||||
@@ -393,6 +412,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:写入MCU数字输出。
|
||||
internal static extern MCUSerialBridgeError msb_write_output(
|
||||
IntPtr handle,
|
||||
[In] byte[] outputs,
|
||||
@@ -400,6 +420,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:从指定串口或CAN端口读取数据。
|
||||
internal static extern MCUSerialBridgeError msb_read_port(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
@@ -410,6 +431,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
// M层硬件桥接:定义串口或CAN端口收到原生数据时的回调签名。
|
||||
internal delegate void msb_on_port_data_callback_function_t(
|
||||
IntPtr dst_data,
|
||||
uint dst_data_size,
|
||||
@@ -417,6 +439,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:注册端口数据到达回调。
|
||||
internal static extern MCUSerialBridgeError msb_register_port_data_callback(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
@@ -425,6 +448,7 @@ namespace MCUSerialBridgeCLR
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
// M层原生接口:向指定串口或CAN端口写入数据。
|
||||
internal static extern MCUSerialBridgeError msb_write_port(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
@@ -448,18 +472,21 @@ namespace MCUSerialBridgeCLR
|
||||
public bool IsOpen => nativeHandle != IntPtr.Zero;
|
||||
|
||||
/// <summary>构造函数,初始化对象</summary>
|
||||
// M层MCU适配:创建串口桥包装器并固定原生回调委托。
|
||||
public MCUSerialBridge()
|
||||
{
|
||||
nativeHandle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
/// <summary>析构函数</summary>
|
||||
// M层MCU适配:对象回收时兜底释放原生串口桥句柄。
|
||||
~MCUSerialBridge()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>显式释放资源</summary>
|
||||
// M层MCU适配:释放串口桥句柄和非托管资源。
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
@@ -468,6 +495,7 @@ namespace MCUSerialBridgeCLR
|
||||
|
||||
/// <summary>内部释放资源方法</summary>
|
||||
/// <param name="disposing">true 表示手动释放,false 表示析构释放</param>
|
||||
// M层MCU适配:按托管或终结路径关闭原生句柄。
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (nativeHandle != IntPtr.Zero)
|
||||
@@ -481,6 +509,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="portName">串口名,如 "COM3"</param>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层单车通信:按端口名和波特率连接MCU串口桥。
|
||||
public MCUSerialBridgeError Open(string portName, uint baud)
|
||||
{
|
||||
return MCUSerialBridgeCoreAPI.msb_open(out nativeHandle, portName, baud);
|
||||
@@ -488,6 +517,7 @@ namespace MCUSerialBridgeCLR
|
||||
|
||||
/// <summary>关闭串口</summary>
|
||||
/// <returns>错误码</returns>
|
||||
// M层单车通信:关闭当前MCU串口桥连接。
|
||||
public MCUSerialBridgeError Close()
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -500,6 +530,7 @@ namespace MCUSerialBridgeCLR
|
||||
|
||||
/// <summary>MCU 复位</summary>
|
||||
/// <returns>错误码</returns>
|
||||
// M层单车通信:请求MCU复位并等待结果。
|
||||
public MCUSerialBridgeError Reset(uint timeout = 200)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -512,6 +543,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="version">输出版本信息</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层MCU诊断:读取串口桥固件版本。
|
||||
public MCUSerialBridgeError GetVersion(out VersionInfo version, uint timeout = 200)
|
||||
{
|
||||
version = new VersionInfo();
|
||||
@@ -525,6 +557,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="state">输出状态</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层MCU诊断:读取串口桥运行状态。
|
||||
public MCUSerialBridgeError GetState(out MCUState state, uint timeout = 200)
|
||||
{
|
||||
state = new MCUState();
|
||||
@@ -538,6 +571,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="ports">端口集合</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层MCU适配:批量配置CAN和串口通道参数。
|
||||
public MCUSerialBridgeError Configure(IEnumerable<PortConfig> ports, uint timeout = 200)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -587,6 +621,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="inputs">输出数组</param>
|
||||
/// <param name="timeout">超时(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层单车IO:读取MCU数字输入状态。
|
||||
public MCUSerialBridgeError ReadInput(out byte[] inputs, uint timeout = 100)
|
||||
{
|
||||
inputs = new byte[4];
|
||||
@@ -600,6 +635,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// <param name="outputs">数据数组</param>
|
||||
/// <param name="timeout">超时(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
// M层单车IO:写入继电器、灯光等数字输出状态。
|
||||
public MCUSerialBridgeError WriteOutput(byte[] outputs, uint timeout = 100)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -629,6 +665,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// - NoData 当前无可读数据(仅在 timeout == 0 或等待超时)
|
||||
/// - Win_InvalidParam 参数错误
|
||||
/// </returns>
|
||||
// M层串口通信:同步读取指定MCU串口的数据。
|
||||
public MCUSerialBridgeError ReadSerial(byte portIndex, out byte[] buffer, uint timeout)
|
||||
{
|
||||
buffer = Array.Empty<byte>();
|
||||
@@ -670,6 +707,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// - OK 成功发送
|
||||
/// - 其他错误请查看 MCUSerialBridgeError
|
||||
/// </returns>
|
||||
// M层串口通信:向指定MCU串口发送数据。
|
||||
public MCUSerialBridgeError WriteSerial(byte portIndex, byte[] data, uint timeout)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -706,6 +744,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// - CAN_DataError CAN数据错误
|
||||
/// - Win_HandleNotFound 句柄无效
|
||||
/// </returns>
|
||||
// M层CAN通信:同步读取指定CAN通道的一帧消息。
|
||||
public MCUSerialBridgeError ReadCAN(byte portIndex, out CANMessage message, uint timeout)
|
||||
{
|
||||
message = null;
|
||||
@@ -753,6 +792,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// - CAN_DataError CAN 数据错误
|
||||
/// - Win_HandleNotFound 句柄无效
|
||||
/// </returns>
|
||||
// M层CAN通信:向指定CAN通道发送一帧消息。
|
||||
public MCUSerialBridgeError WriteCAN(byte portIndex, CANMessage message, uint timeout)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
@@ -796,6 +836,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 5. 数据可能随时到来,请保证回调尽快返回,避免影响后续帧接收。
|
||||
/// 6. 不要把其他类型的端口注册到这个接口,接口不对 portIndex 做类型检查。
|
||||
/// </remarks>
|
||||
// M层串口通信:注册指定串口的异步接收回调。
|
||||
public MCUSerialBridgeError RegisterSerialPortCallback(
|
||||
byte portIndex,
|
||||
Action<byte[]> callback
|
||||
@@ -808,6 +849,7 @@ namespace MCUSerialBridgeCLR
|
||||
return MCUSerialBridgeError.Config_PortNumOver;
|
||||
|
||||
// 包装 C# 回调为 P/Invoke 委托
|
||||
// M层串口回调:复制原生缓存并转交托管回调处理。
|
||||
void del(IntPtr dst_data, uint dst_data_size, IntPtr user_ctx)
|
||||
{
|
||||
byte[] data = new byte[dst_data_size];
|
||||
@@ -842,6 +884,7 @@ namespace MCUSerialBridgeCLR
|
||||
/// 5. 数据可能随时到来,请保证回调尽快返回,避免影响后续帧接收。
|
||||
/// 6. 不要把其他类型的端口注册到这个接口,接口不对 portIndex 做类型检查。
|
||||
/// </remarks>
|
||||
// M层CAN通信:注册指定CAN通道的异步接收回调。
|
||||
public MCUSerialBridgeError RegisterCANPortCallback(
|
||||
byte portIndex,
|
||||
Action<CANMessage> callback
|
||||
@@ -854,6 +897,7 @@ namespace MCUSerialBridgeCLR
|
||||
return MCUSerialBridgeError.Config_PortNumOver;
|
||||
|
||||
// 包装 C# 回调为 P/Invoke 委托
|
||||
// M层CAN回调:还原原生CAN帧并转交托管回调处理。
|
||||
void del(IntPtr dst_data, uint dst_data_size, IntPtr user_ctx)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
// MCU通信错误码
|
||||
|
||||
namespace MCUSerialBridgeCLR
|
||||
{
|
||||
@@ -47,6 +47,7 @@ namespace MCUSerialBridgeCLR
|
||||
|
||||
public static class MCUSerialBridgeErrorExtensions
|
||||
{
|
||||
// M层MCU适配:把串口桥错误码转换为便于诊断的说明。
|
||||
public static string ToDescription(this MCUSerialBridgeError err)
|
||||
{
|
||||
return err switch
|
||||
|
||||
@@ -1,44 +1,47 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
|
||||
<AssemblyName>MedullaAdapter</AssemblyName>
|
||||
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<OutputPath>build\Medulla\plugins\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="EmbeddedCommunication.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fody" Version="6.9.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonUsage">
|
||||
<HintPath>ref\CommonUsage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CycleGUI">
|
||||
<HintPath>ref\CycleGUI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MDCSToolBox">
|
||||
<HintPath>ref\MDCSToolBox.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CartActivator">
|
||||
<HintPath>ref\RefCartActivator.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="FundamentalLib">
|
||||
<HintPath>ref\RefFundamentalLib.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="MedullaCore">
|
||||
<HintPath>ref\RefMedullaCore.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="FundamentalLib">
|
||||
<HintPath>ref\RefFundamentalLib.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="CommonUsage">
|
||||
<HintPath>ref\CommonUsage.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="MDCSToolBox">
|
||||
<HintPath>ref\MDCSToolBox.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="CycleGUI">
|
||||
<HintPath>ref\CycleGUI.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WeaverFiles Include="deps\DiverCompiler.exe" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,233 +1 @@
|
||||
using CartActivator;
|
||||
using CommonUsage.Mathematics;
|
||||
using FundamentalLib;
|
||||
using MDCSToolBox.Commons;
|
||||
using MDCSToolBox.Commons.Controllers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static MDCSToolBox.Medulla.Chassis.BasicCartDefinition;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class MotorRoutine:LadderLogic<DiverCartDefinition>
|
||||
{
|
||||
private DateTime _lastMoveTime = DateTime.Now;
|
||||
private DateTime _transmitterFleetDbgLastLog = DateTime.MinValue;
|
||||
private DateTime _transmitterFleetResetLastLog = DateTime.MinValue;
|
||||
|
||||
private void LogTransmitterFleet(string branch, bool force = false)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
if (!force && (now - _transmitterFleetDbgLastLog).TotalMilliseconds < 200) return;
|
||||
_transmitterFleetDbgLastLog = now;
|
||||
DLog.Log(
|
||||
$"branch={branch} connected={cart.TransmitterConnected} ctrl={cart.TransmitterControlEnable} " +
|
||||
$"SA={cart.Transmitter_SA} SC={cart.Transmitter_SC} SB={cart.Transmitter_SB} SD={cart.Transmitter_SD} car={cart.CarNum} " +
|
||||
$"joyLx={cart.TransmitterLeftJoystickValX:0.000} joyRy={cart.TransmitterRightJoystickValY:0.000} joyRx={cart.TransmitterRightJoystickValX:0.000} " +
|
||||
$"rawLx={cart.TransmitterLeftJoystickValXRaw} rawRy={cart.TransmitterRightJoystickValYRaw} " +
|
||||
$"remotePanel={cart.MultiVehicleRemoteManualEnabled} outEn={cart.MultiVehicleManualEnabled} outMode={cart.MultiVehicleManualMode} " +
|
||||
$"outVx={cart.MultiVehicleManualVx:0.000} outVy={cart.MultiVehicleManualVy:0.000} outVth={cart.MultiVehicleManualVth:0.000} hold={cart.MultiVehicleHold}",
|
||||
"TransmitterFleetDbg");
|
||||
}
|
||||
|
||||
private void LogTransmitterFleetReset(string reason)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
if ((now - _transmitterFleetResetLastLog).TotalMilliseconds < 500) return;
|
||||
_transmitterFleetResetLastLog = now;
|
||||
DLog.Log(
|
||||
$"reset reason={reason} remotePanel={cart.MultiVehicleRemoteManualEnabled} beforeEn={cart.MultiVehicleManualEnabled} " +
|
||||
$"beforeMode={cart.MultiVehicleManualMode} beforeVx={cart.MultiVehicleManualVx:0.000} beforeVy={cart.MultiVehicleManualVy:0.000} " +
|
||||
$"beforeVth={cart.MultiVehicleManualVth:0.000} hold={cart.MultiVehicleHold}",
|
||||
"TransmitterFleetDbg");
|
||||
}
|
||||
|
||||
public override void Operation(int iteration)
|
||||
{
|
||||
void ResetMultiVehicle(string reason)
|
||||
{
|
||||
if (cart.MultiVehicleRemoteManualEnabled)
|
||||
{
|
||||
LogTransmitterFleet("reset-skipped-remote-panel");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cart.MultiVehicleManualEnabled || cart.MultiVehicleManualVx != 0 || cart.MultiVehicleManualVy != 0 ||
|
||||
cart.MultiVehicleManualVth != 0 || cart.MultiVehicleHold)
|
||||
LogTransmitterFleetReset(reason);
|
||||
|
||||
cart.MultiVehicleManualEnabled = false;
|
||||
cart.MultiVehicleManualVx = 0;
|
||||
cart.MultiVehicleManualVy = 0;
|
||||
cart.MultiVehicleManualVth = 0;
|
||||
cart.MultiVehicleHold = false;
|
||||
}
|
||||
|
||||
TriggerOnce(cart.TransmitterConnected && cart.Transmitter_SA, 700,
|
||||
() =>
|
||||
{
|
||||
Console.WriteLine("遥控器使能!");
|
||||
cart.TransmitterControlEnable = true;
|
||||
cart.TransmitterLastTime = DateTime.Now;
|
||||
LogTransmitterFleet("enable", true);
|
||||
});
|
||||
TriggerOnce(cart.TransmitterConnected && !cart.Transmitter_SA, 700,
|
||||
() =>
|
||||
{
|
||||
Console.WriteLine("遥控器断使能!");
|
||||
cart.TransmitterControlEnable = false;
|
||||
LogTransmitterFleet("disable", true);
|
||||
});
|
||||
|
||||
if (cart.TransmitterControlEnable && cart.Transmitter_SC == cart.CarNum)
|
||||
{
|
||||
CartDefinition.testPriority(5, "TransmitterMode");
|
||||
ResetMultiVehicle("single-car-control");
|
||||
LogTransmitterFleet("single-car-control");
|
||||
TransmitterChassisControl();
|
||||
cart.TransmitterLastTime = DateTime.Now;
|
||||
cart.CarStatu = "Transmitter控制模式使能";
|
||||
}
|
||||
else if (cart.TransmitterControlEnable && cart.Transmitter_SC == 3)
|
||||
{
|
||||
cart.CarStatu = "Transmitter双车联动模式使能";
|
||||
cart.MultiVehicleManualEnabled = true;
|
||||
var fleetMode = 0;
|
||||
if (cart.Transmitter_SB == TransmitterState.Mode0) fleetMode = 0;
|
||||
else if (cart.Transmitter_SB == TransmitterState.Mode1) fleetMode = 1;
|
||||
else if (cart.Transmitter_SB == TransmitterState.Mode2) fleetMode = 2;
|
||||
cart.ApplyFleetManualCommand(fleetMode, -cart.TransmitterLeftJoystickValX,
|
||||
cart.TransmitterRightJoystickValY, 1f);
|
||||
|
||||
// hold multi-vehicle sync, make speed 0
|
||||
cart.MultiVehicleHold = cart.Transmitter_SD == TransmitterState.Mode1;
|
||||
LogTransmitterFleet("fleet-control");
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetMultiVehicle("idle-or-sc-mismatch");
|
||||
LogTransmitterFleet("idle-or-sc-mismatch");
|
||||
cart.CarStatu = "正常运行";
|
||||
}
|
||||
|
||||
cart.ClumsyControl = true;
|
||||
cart.LeftFrontPid.ChangeParameters(cart.DiffSteerKp, cart.DiffSteerKi, cart.DiffSteerKd, cart.DiffSteerMaxI,
|
||||
cart.DiffSteerDeadZone, cart.DiffSteerThresh, cart.DiffSteerSpeedAcc);
|
||||
cart.LeftRearPid.ChangeParameters(cart.DiffSteerKp, cart.DiffSteerKi, cart.DiffSteerKd, cart.DiffSteerMaxI,
|
||||
cart.DiffSteerDeadZone, cart.DiffSteerThresh, cart.DiffSteerSpeedAcc);
|
||||
cart.RightFrontPid.ChangeParameters(cart.DiffSteerKp, cart.DiffSteerKi, cart.DiffSteerKd, cart.DiffSteerMaxI,
|
||||
cart.DiffSteerDeadZone, cart.DiffSteerThresh, cart.DiffSteerSpeedAcc);
|
||||
cart.RightRearPid.ChangeParameters(cart.DiffSteerKp, cart.DiffSteerKi, cart.DiffSteerKd, cart.DiffSteerMaxI,
|
||||
cart.DiffSteerDeadZone, cart.DiffSteerThresh, cart.DiffSteerSpeedAcc);
|
||||
var diffLf = cart.LeftFrontPid.GetResponse(cart.ThLeftFront, false, false, "LF");
|
||||
var diffRf = cart.RightFrontPid.GetResponse(cart.ThRightFront, false, false, "RF");
|
||||
var diffLr = cart.LeftRearPid.GetResponse(cart.ThLeftRear, false, false, "LR");
|
||||
var diffRr = cart.RightRearPid.GetResponse(cart.ThRightRear, false, false, "RR");
|
||||
// Hedingben.ToastText($"LF:{diffLf:0.00},LR:{diffLr:0.00},RF:{diffRf:0.00},RR:{diffRr:0.00}", "wheel-pid");
|
||||
DLog.Log($"[wheel pid] {cart.ActualThLeftFront:0.00}->{cart.ThLeftFront:0.00} diff:{CommonMath.ThDiff(cart.ThLeftFront, cart.ActualThLeftFront):0.00} pid:{diffLf:0.00}");
|
||||
cart.SpeedLFL = cart.SpeedLeftFrontLeft - diffLf;
|
||||
cart.SpeedLFR = cart.SpeedLeftFrontRight + diffLf;
|
||||
cart.SpeedRFL = cart.SpeedRightFrontLeft - diffRf;
|
||||
cart.SpeedRFR = cart.SpeedRightFrontRight + diffRf;
|
||||
cart.SpeedLRL = cart.SpeedLeftRearLeft - diffLr;
|
||||
cart.SpeedLRR = cart.SpeedLeftRearRight + diffLr;
|
||||
cart.SpeedRRL = cart.SpeedRightRearLeft - diffRr;
|
||||
cart.SpeedRRR = cart.SpeedRightRearRight + diffRr;
|
||||
List<float> wheelSpeed = new float[]
|
||||
{
|
||||
Math.Abs(cart.SpeedLFL), Math.Abs(cart.SpeedLFR), Math.Abs(cart.SpeedRFL),
|
||||
Math.Abs(cart.SpeedRFR), Math.Abs(cart.SpeedLRL),Math.Abs(cart.SpeedLRR), Math.Abs(cart.SpeedRRL),
|
||||
Math.Abs(cart.SpeedRRR)
|
||||
}.ToList();
|
||||
var wheelMaxSpeed = wheelSpeed.Max();
|
||||
var speedSign = Math.Sign(cart.ThresSpeed - cart.SendThresSpeed);
|
||||
var acc = Math.Abs(cart.ThresSpeed) > Math.Abs(cart.SendThresSpeed) ? cart.Chassis.AccPerSecond : cart.Chassis.DeAccPerSecond;
|
||||
cart.SendThresSpeed += speedSign * Math.Min(Math.Abs(cart.ThresSpeed - cart.SendThresSpeed),
|
||||
acc * (float)(DateTime.Now - _lastMoveTime).TotalSeconds);
|
||||
if (cart.ThresSpeed < wheelMaxSpeed && cart.SendThresSpeed > wheelMaxSpeed)
|
||||
cart.SendThresSpeed = Math.Min(cart.SendThresSpeed, wheelMaxSpeed);
|
||||
_lastMoveTime = DateTime.Now;
|
||||
|
||||
//灯光控制
|
||||
if (cart.AlarmLevel == 2)
|
||||
{
|
||||
//故障红灯常亮
|
||||
cart.LightMode = 2;
|
||||
}
|
||||
else if (cart.ThresSpeed != 1)
|
||||
{
|
||||
//避障黄灯常亮
|
||||
cart.LightMode = 3;
|
||||
}
|
||||
else if (!cart.WheelAbleState)
|
||||
{
|
||||
FlipFlop(ref cart.LightMode, 500, 0, 3);
|
||||
}
|
||||
else if (cart.Soc < cart.LowBatteryAlarmThreshold && cart.ElectricCurrent >= -10)
|
||||
{
|
||||
cart.LightMode = 3;
|
||||
}
|
||||
else if (cart.ElectricCurrent < -10)
|
||||
{
|
||||
FlipFlop(ref cart.LightMode, 500, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
FlipFlop(ref cart.LightMode, 500, 0, 1);
|
||||
}
|
||||
}
|
||||
public void TransmitterChassisControl()
|
||||
{
|
||||
TriggerOnce(cart.Transmitter_SB == TransmitterState.Mode0, 100,
|
||||
() => cart.TransmitterControlMode = DiverCartDefinition.ManualControlMode.Normal);
|
||||
TriggerOnce(cart.Transmitter_SB == TransmitterState.Mode1, 100,
|
||||
() => cart.TransmitterControlMode = DiverCartDefinition.ManualControlMode.Crab);
|
||||
TriggerOnce(cart.Transmitter_SB == TransmitterState.Mode2, 100,
|
||||
() => cart.TransmitterControlMode = DiverCartDefinition.ManualControlMode.Spin);
|
||||
|
||||
Hedingben.ToastText($"X方向速度: {cart.TransmitterLeftJoystickValX} Y方向速度: {cart.TransmitterRightJoystickValY}");
|
||||
|
||||
if (cart.Transmitter_SD == TransmitterState.Mode1)
|
||||
{
|
||||
if(cart.Transmitter_T3 == 1694)
|
||||
cart.WheelReset();
|
||||
else if(cart.Transmitter_T3 == 151)
|
||||
cart.WheelDisable();
|
||||
}
|
||||
if (cart.Transmitter_SD == TransmitterState.Mode1 && cart.TransmitterLeftJoystickValXRaw == 353)
|
||||
{
|
||||
TriggerOnce(cart.TransmitterRightJoystickValYRaw == 353, 100, () => cart.TransmitterSpeed += 0.1f);
|
||||
TriggerOnce(cart.TransmitterRightJoystickValYRaw == 1694, 100, () => cart.TransmitterSpeed -= 0.1f);
|
||||
}
|
||||
cart.TransmitterSpeed = Math.Max(Math.Min(cart.TransmitterSpeed, cart.TransmitterSpeedUpperLimit), cart.TransmitterSpeedLowerLimit);
|
||||
//cart.TransmitterSpeed = Math.Max(cart.TransmitterSpeed, cart.TransmitterSpeedLowerLimit);
|
||||
if (!cart.Transmitter_SA)
|
||||
{
|
||||
cart.ManualControl(cart.TransmitterControlMode, 0,
|
||||
0, 0, cart.TransmitterSpeed,
|
||||
DateTime.Now - cart.TransmitterLastTime);
|
||||
cart.SpeedLeftArm = 0;
|
||||
cart.SpeedRightArm = 0;
|
||||
}
|
||||
//摇杆控制底盘
|
||||
else if (cart.Transmitter_SD == TransmitterState.Mode0)
|
||||
{
|
||||
cart.ManualControl(cart.TransmitterControlMode, cart.TransmitterLeftJoystickValX,
|
||||
cart.TransmitterRightJoystickValY, 0, cart.TransmitterSpeed,
|
||||
DateTime.Now - cart.TransmitterLastTime);
|
||||
cart.SpeedLeftArm = 0;
|
||||
cart.SpeedRightArm = 0;
|
||||
}
|
||||
//右摇杆同时控制左右夹臂
|
||||
else if (cart.Transmitter_SD == TransmitterState.Mode1 && cart.TransmitterLeftJoystickValX == 0)
|
||||
{
|
||||
cart.ManualControl(cart.TransmitterControlMode, 0,
|
||||
0, 0, cart.TransmitterSpeed,
|
||||
DateTime.Now - cart.TransmitterLastTime);
|
||||
cart.SpeedLeftArm = cart.TransmitterRightJoystickValX * cart.ManualArmSpeedFac;
|
||||
cart.SpeedRightArm = cart.TransmitterRightJoystickValX * cart.ManualArmSpeedFac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 计算8个驱动电机的目标速度和舵角PID
|
||||
@@ -1,168 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class BasePack
|
||||
{
|
||||
private static ushort CalculateCRC16(byte[] data)
|
||||
{
|
||||
const ushort polynomial = 0xA001; // CRC-16-IBM多项式
|
||||
ushort crc = 0xFFFF; // 初始值
|
||||
|
||||
foreach (byte b in data)
|
||||
{
|
||||
crc ^= b; // 将数据字节与CRC寄存器按位异或
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
if ((crc & 0x0001) != 0)
|
||||
{
|
||||
crc >>= 1;
|
||||
crc ^= polynomial;
|
||||
}
|
||||
else
|
||||
{
|
||||
crc >>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
private byte[] _data;
|
||||
|
||||
public void SetData(byte[] data)
|
||||
{
|
||||
_data = data;
|
||||
}
|
||||
|
||||
public byte[] GetPack()
|
||||
{
|
||||
var pack = new byte[_data.Length+7];
|
||||
pack[0] = 0xBB;
|
||||
pack[1] = 0xAA;
|
||||
var length = BitConverter.GetBytes(_data.Length);
|
||||
pack[2] = length[0];
|
||||
pack[3] = length[1];
|
||||
for (int i = 0; i < _data.Length; i++)
|
||||
{
|
||||
pack[4+i] = _data[i];
|
||||
}
|
||||
|
||||
var crcByes = new byte[pack.Length - 5];
|
||||
Array.Copy(pack,2,crcByes,0,crcByes.Length);
|
||||
var crc = BitConverter.GetBytes(CalculateCRC16(crcByes));
|
||||
pack[pack.Length-1] = 0xEE;
|
||||
pack[pack.Length-2] = crc[1];
|
||||
pack[pack.Length-3] = crc[0];
|
||||
return pack;
|
||||
}
|
||||
}
|
||||
|
||||
public class ControlPack : BasePack
|
||||
{
|
||||
public ControlPack(byte controlCode)
|
||||
{
|
||||
byte[] controlData = new byte[3]{0x01,0x00,controlCode};
|
||||
SetData(controlData);
|
||||
}
|
||||
}
|
||||
|
||||
public class SetConfigPack : BasePack
|
||||
{
|
||||
public SetConfigPack(int can1BaudRate, int can2BaudRate,int modbus0BaudRate, int modbus1BaudRate, int modbus2BaudRate,
|
||||
int serialBaudRate,int upperSize = 1024,int lowerSize =1024 )
|
||||
{
|
||||
var upper = BitConverter.GetBytes(upperSize);
|
||||
var lower = BitConverter.GetBytes(lowerSize);
|
||||
var can = BitConverter.GetBytes(can1BaudRate);
|
||||
var can2 = BitConverter.GetBytes(can2BaudRate);
|
||||
var modbus0 = BitConverter.GetBytes(modbus0BaudRate);
|
||||
var modbus1 = BitConverter.GetBytes(modbus1BaudRate);
|
||||
var modbus2 = BitConverter.GetBytes(modbus2BaudRate);
|
||||
var serial = BitConverter.GetBytes(serialBaudRate);
|
||||
var canBuffer = BitConverter.GetBytes(128);
|
||||
var mbBuffer = BitConverter.GetBytes(512);
|
||||
var serialBuffer = BitConverter.GetBytes(1024);
|
||||
byte[] configData = new byte[]
|
||||
{
|
||||
0x01, 0x10, 0x02, upper[0], upper[1], upper[2], upper[3], lower[0], lower[1],
|
||||
lower[2], lower[3], 0x06, 0x00, 0x00, can[0], can[1], can[2], can[3], canBuffer[0], canBuffer[1], 0x00,
|
||||
can2[0], can2[1], can2[2], can2[3], canBuffer[0], canBuffer[1], 0x10, modbus0[0],
|
||||
modbus0[1], modbus0[2], modbus0[3], mbBuffer[0], mbBuffer[1], 0x10, modbus1[0],
|
||||
modbus1[1], modbus1[2], modbus1[3], mbBuffer[0], mbBuffer[1], 0x10, modbus2[0],
|
||||
modbus2[1], modbus2[2], modbus2[3], mbBuffer[0], mbBuffer[1], 0x20, serial[0], serial[1], serial[2],
|
||||
serial[3], serialBuffer[0], serialBuffer[1]
|
||||
};
|
||||
SetData(configData);
|
||||
}
|
||||
}
|
||||
|
||||
public class ReadConfigPack : BasePack
|
||||
{
|
||||
public ReadConfigPack()
|
||||
{
|
||||
var readConfigData = new byte[] { 0x01, 0x10, 0x00 };
|
||||
SetData(readConfigData);
|
||||
}
|
||||
}
|
||||
|
||||
public class DownloadCodePack : BasePack
|
||||
{
|
||||
public DownloadCodePack(int totalLength, int offset, int currentLength, byte[] codeBytes)
|
||||
{
|
||||
var codeData = new byte[12 + codeBytes.Length];
|
||||
codeData[0] = 0x01;
|
||||
codeData[1] = 0x11;
|
||||
var totalLengthBytes = BitConverter.GetBytes(totalLength);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
codeData[2 + i] = totalLengthBytes[i];
|
||||
}
|
||||
var offsetBytes = BitConverter.GetBytes(offset);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
codeData[6 + i] = offsetBytes[i];
|
||||
}
|
||||
var curLengthBytes = BitConverter.GetBytes(currentLength);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
codeData[10 + i] = curLengthBytes[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < codeBytes.Length; i++)
|
||||
{
|
||||
codeData[12+i] = codeBytes[i];
|
||||
}
|
||||
SetData(codeData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class HeartBeatPack : BasePack
|
||||
{
|
||||
public HeartBeatPack(int state, int error)
|
||||
{
|
||||
var errorBytes = BitConverter.GetBytes(error);
|
||||
var heartBearData = new byte[] { 0x01, 0xF0, (byte)state, errorBytes[0], errorBytes[1] };
|
||||
SetData(heartBearData);
|
||||
}
|
||||
}
|
||||
|
||||
public class UpperIOPack : BasePack
|
||||
{
|
||||
public UpperIOPack(byte[] data,int size)
|
||||
{
|
||||
byte[] UpperData = new byte[6 + size];
|
||||
UpperData[0] = 0x01;
|
||||
UpperData[1] = 0x20;
|
||||
var length = BitConverter.GetBytes(size);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
UpperData[2+i] = length[i];
|
||||
}
|
||||
Array.Copy(data,0,UpperData,6,size);
|
||||
SetData(UpperData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CartActivator;
|
||||
using MDCSToolBox.Medulla.Chassis.MultiWheel;
|
||||
|
||||
namespace MedullaAdapter
|
||||
{
|
||||
public class Remote:MultiWheelRemote<DiverCartDefinition>
|
||||
{
|
||||
[AsControlItem(name = "夹抱速度", LayoutRow = 0, LayoutCol = 4)]
|
||||
public Throttle ArmSpeed;
|
||||
|
||||
[AsControlItem(name = "夹抱打开", LayoutRow = 1, LayoutCol = 0)]
|
||||
public Button Open;
|
||||
|
||||
[AsControlItem(name = "夹抱关闭", LayoutRow = 1, LayoutCol = 2)]
|
||||
public Button Close;
|
||||
|
||||
public override void MultiVehicleModeChassisLogic()
|
||||
{
|
||||
// cart.MultiVehicleRemoteManualEnabled = true;
|
||||
// cart.MultiVehicleManualEnabled = true;
|
||||
// cart.MultiVehicleManualVx = SpeedPad.y * SpeedThreshold.val;
|
||||
// cart.MultiVehicleManualVth = -(float)Math.Pow(Math.Abs(SpeedPad.x), cart.ManualThetaPow) * Math.Sign(SpeedPad.x);
|
||||
}
|
||||
|
||||
public override void CustomOperation()
|
||||
{
|
||||
if (Open.pressed)
|
||||
{
|
||||
cart.SpeedLeftArm = -ArmSpeed.val * cart.ManualArmSpeedFac;
|
||||
cart.SpeedRightArm = -ArmSpeed.val * cart.ManualArmSpeedFac;
|
||||
}
|
||||
else if (Close.pressed)
|
||||
{
|
||||
cart.SpeedLeftArm = ArmSpeed.val * cart.ManualArmSpeedFac;
|
||||
cart.SpeedRightArm = ArmSpeed.val * cart.ManualArmSpeedFac;
|
||||
}
|
||||
else
|
||||
{
|
||||
cart.SpeedLeftArm = 0;
|
||||
cart.SpeedRightArm = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Medulla虚拟遥控器和夹臂控制
|
||||
@@ -1,47 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CartActivator
|
||||
{
|
||||
public class LogicRunOnMCUAttribute:Attribute
|
||||
{
|
||||
public string mcu_url = "default";
|
||||
public int scanInterval = 50;
|
||||
}
|
||||
|
||||
public class RunOnMCU
|
||||
{
|
||||
// if return null: not data, or return payload data excluding CRC
|
||||
public static byte[] ReadEvent(int port, int event_id) => default;
|
||||
|
||||
public static void WriteEvent(byte[] payload, int port, int event_id) { }
|
||||
|
||||
// if return null: not data.
|
||||
public static byte[] ReadStream(int port) => default;
|
||||
|
||||
public static void WriteStream(byte[] payload, int port){}
|
||||
|
||||
// always have the same sized data.
|
||||
public static byte[] ReadSnapshot() => default;
|
||||
|
||||
public static void WriteSnapshot(byte[] payload)
|
||||
{
|
||||
}
|
||||
|
||||
public static T BytesToStruct<T>() where T: struct => default;
|
||||
|
||||
public static byte[] StructToBytes<T>(T what) where T : struct => default;
|
||||
|
||||
public static int GetMillisFromStart() => default;
|
||||
|
||||
public static T Iterate<T>(IEnumerable<T> ie) => default;
|
||||
}
|
||||
|
||||
public class MCUManager
|
||||
{
|
||||
public static void Use<T>()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,352 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETStandard,Version=v2.0/",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.0": {},
|
||||
".NETStandard,Version=v2.0/": {
|
||||
"MedullaAdapter/1.0.0": {
|
||||
"dependencies": {
|
||||
"Fody": "6.9.3",
|
||||
"NETStandard.Library": "2.0.3",
|
||||
"Newtonsoft.Json": "13.0.4",
|
||||
"System.IO.Ports": "6.0.0",
|
||||
"CommonUsage": "1.0.0.0",
|
||||
"CycleGUI": "1.0.0.0",
|
||||
"MDCSToolBox": "1.0.0.0",
|
||||
"RefCartActivator": "1.0.0.0",
|
||||
"RefFundamentalLib": "0.0.0.0",
|
||||
"RefMedullaCore": "1.0.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"MedullaAdapter.dll": {}
|
||||
}
|
||||
},
|
||||
"Fody/6.9.3": {},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
||||
"Microsoft.Win32.Registry/5.0.0": {
|
||||
"dependencies": {
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Memory": "4.5.4",
|
||||
"System.Security.AccessControl": "5.0.0",
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
|
||||
"assemblyVersion": "5.0.0.0",
|
||||
"fileVersion": "5.0.20.51904"
|
||||
}
|
||||
}
|
||||
},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.4": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.4.30916"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports/6.0.0": {},
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports/6.0.0": {},
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports/6.0.0": {},
|
||||
"runtime.native.System.IO.Ports/6.0.0": {
|
||||
"dependencies": {
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports": "6.0.0"
|
||||
}
|
||||
},
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports/6.0.0": {},
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports/6.0.0": {},
|
||||
"System.Buffers/4.5.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Buffers.dll": {
|
||||
"assemblyVersion": "4.0.3.0",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Ports/6.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Win32.Registry": "5.0.0",
|
||||
"System.Memory": "4.5.4",
|
||||
"runtime.native.System.IO.Ports": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.IO.Ports.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Memory/4.5.4": {
|
||||
"dependencies": {
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Numerics.Vectors": "4.4.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Memory.dll": {
|
||||
"assemblyVersion": "4.0.1.1",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Numerics.Vectors.dll": {
|
||||
"assemblyVersion": "4.1.3.0",
|
||||
"fileVersion": "4.6.25519.3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.5.3": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
|
||||
"assemblyVersion": "4.0.4.1",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.AccessControl/5.0.0": {
|
||||
"dependencies": {
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Security.AccessControl.dll": {
|
||||
"assemblyVersion": "5.0.0.0",
|
||||
"fileVersion": "5.0.20.51904"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.Principal.Windows/5.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Security.Principal.Windows.dll": {
|
||||
"assemblyVersion": "5.0.0.0",
|
||||
"fileVersion": "5.0.20.51904"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CommonUsage/1.0.0.0": {
|
||||
"runtime": {
|
||||
"CommonUsage.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CycleGUI/1.0.0.0": {
|
||||
"runtime": {
|
||||
"CycleGUI.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MDCSToolBox/1.0.0.0": {
|
||||
"runtime": {
|
||||
"MDCSToolBox.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RefCartActivator/1.0.0.0": {
|
||||
"runtime": {
|
||||
"RefCartActivator.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RefFundamentalLib/0.0.0.0": {
|
||||
"runtime": {
|
||||
"RefFundamentalLib.dll": {
|
||||
"assemblyVersion": "0.0.0.0",
|
||||
"fileVersion": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RefMedullaCore/1.0.0.0": {
|
||||
"runtime": {
|
||||
"RefMedullaCore.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"MedullaAdapter/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Fody/6.9.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1CUGgFdyECDKgi5HaUBhdv6k+VG9Iy4OCforGfHyar3xQXAJypZkzymgKtWj/4SPd6nSG0Qi7NH71qHrDSZLaA==",
|
||||
"path": "fody/6.9.3",
|
||||
"hashPath": "fody.6.9.3.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
||||
"path": "microsoft.netcore.platforms/1.1.0",
|
||||
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Win32.Registry/5.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
|
||||
"path": "microsoft.win32.registry/5.0.0",
|
||||
"hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
|
||||
},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
||||
"path": "netstandard.library/2.0.3",
|
||||
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.4": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==",
|
||||
"path": "newtonsoft.json/13.0.4",
|
||||
"hashPath": "newtonsoft.json.13.0.4.nupkg.sha512"
|
||||
},
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-75q52H7CSpgIoIDwXb9o833EvBZIXJ0mdPhz1E6jSisEXUBlSCPalC29cj3EXsjpuDwr0dj1LRXZepIQH/oL4Q==",
|
||||
"path": "runtime.linux-arm.runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.linux-arm.runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-xn2bMThmXr3CsvOYmS8ex2Yz1xo+kcnhVg2iVhS9PlmqjZPAkrEo/I40wjrBZH/tU4kvH0s1AE8opAvQ3KIS8g==",
|
||||
"path": "runtime.linux-arm64.runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.linux-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-16nbNXwv0sC+gLGIuecri0skjuh6R1maIJggsaNP7MQBcbVcEfWFUOkEnsnvoLEjy0XerfibuRptfQ8AmdIcWA==",
|
||||
"path": "runtime.linux-x64.runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.linux-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KaaXlpOcuZjMdmyF5wzzx3b+PRKIzt6A5Ax9dKenPDQbVJAFpev+casD0BIig1pBcbs3zx7CqWemzUJKAeHdSQ==",
|
||||
"path": "runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-fXG12NodG1QrCdoaeSQ1gVnk/koi4WYY4jZtarMkZeQMyReBm1nZlSRoPnUjLr2ZR36TiMjpcGnQfxymieUe7w==",
|
||||
"path": "runtime.osx-arm64.runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.osx-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-/As+zPY49+dSUXkh+fTUbyPhqrdGN//evLxo4Vue88pfh1BHZgF7q4kMblTkxYvwR6Vi03zSYxysSFktO8/SDQ==",
|
||||
"path": "runtime.osx-x64.runtime.native.system.io.ports/6.0.0",
|
||||
"hashPath": "runtime.osx-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Buffers/4.5.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
|
||||
"path": "system.buffers/4.5.1",
|
||||
"hashPath": "system.buffers.4.5.1.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dRyGI7fUESar5ZLIpiBOaaNLW7YyOBGftjj5Of+xcduC/Rjl7RjhEnWDvvNBmHuF3d0tdXoqdVI/yrVA8f00XA==",
|
||||
"path": "system.io.ports/6.0.0",
|
||||
"hashPath": "system.io.ports.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Memory/4.5.4": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
|
||||
"path": "system.memory/4.5.4",
|
||||
"hashPath": "system.memory.4.5.4.nupkg.sha512"
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==",
|
||||
"path": "system.numerics.vectors/4.4.0",
|
||||
"hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.5.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==",
|
||||
"path": "system.runtime.compilerservices.unsafe/4.5.3",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.4.5.3.nupkg.sha512"
|
||||
},
|
||||
"System.Security.AccessControl/5.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
|
||||
"path": "system.security.accesscontrol/5.0.0",
|
||||
"hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Security.Principal.Windows/5.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
|
||||
"path": "system.security.principal.windows/5.0.0",
|
||||
"hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
|
||||
},
|
||||
"CommonUsage/1.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"CycleGUI/1.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"MDCSToolBox/1.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"RefCartActivator/1.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"RefFundamentalLib/0.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"RefMedullaCore/1.0.0.0": {
|
||||
"type": "reference",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"MedullaAdapter/1.0.0": {
|
||||
"runtime": {
|
||||
"MedullaAdapter.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"MedullaAdapter/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,79 +0,0 @@
|
||||
#define i1 char
|
||||
#define u1 unsigned char
|
||||
#define i2 short
|
||||
#define u2 unsigned short
|
||||
#define i4 int
|
||||
#define u4 unsigned int
|
||||
#define r4 float
|
||||
|
||||
// function begins
|
||||
|
||||
r4 cfun0(r4 arg0 ){
|
||||
//stack_vars:
|
||||
r4 stack_0_r4;;
|
||||
r4 stack_1_r4;;
|
||||
//local_vars:
|
||||
r4 var0;
|
||||
L_0001: stack_0_r4=(arg0); //IL_0001: ldarg.0: s_0, pop0, push1
|
||||
L_0002: stack_1_r4=(10.5f); //IL_0002: ldc.r4 10.5: s_1, pop0, push1
|
||||
L_0007: stack_0_r4=((stack_0_r4)/(stack_1_r4)); //IL_0007: div: s_2, pop2, push1
|
||||
L_0008: stack_1_r4=(60.0f); //IL_0008: ldc.r4 60: s_1, pop0, push1
|
||||
L_000d: stack_0_r4=((stack_0_r4)/(stack_1_r4)); //IL_000d: div: s_2, pop2, push1
|
||||
L_000e: stack_0_r4=(stack_0_r4); //IL_000e: conv.r8: s_1, pop1, push1
|
||||
L_000f: stack_1_r4=(3.1f); //IL_000f: ldc.r8 3.14159265358979: s_1, pop0, push1
|
||||
L_0018: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_0018: mul: s_2, pop2, push1
|
||||
L_0019: stack_1_r4=(85.0f); //IL_0019: ldc.r8 85: s_1, pop0, push1
|
||||
L_0022: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_0022: mul: s_2, pop2, push1
|
||||
L_0023: stack_1_r4=(1000.0f); //IL_0023: ldc.r8 1000: s_1, pop0, push1
|
||||
L_002c: stack_0_r4=((stack_0_r4)/(stack_1_r4)); //IL_002c: div: s_2, pop2, push1
|
||||
L_002d: stack_0_r4=(stack_0_r4); //IL_002d: conv.r4: s_1, pop1, push1
|
||||
L_002e: var0=stack_0_r4; //IL_002e: stloc.0: s_1, pop1, push0
|
||||
L_002f: goto L_0031; //IL_002f: br.s IL_0031: s_0, pop0, push0
|
||||
L_0031: stack_0_r4=(var0); //IL_0031: ldloc.0: s_0, pop0, push1
|
||||
L_0032: return stack_0_r4; //IL_0032: ret: s_1, pop1, push0
|
||||
}
|
||||
|
||||
r4 cfun1(void* arg0, r4 arg1 ){
|
||||
//stack_vars:
|
||||
r4 stack_0_r4;;
|
||||
r4 stack_1_r4;;
|
||||
//local_vars:
|
||||
r4 var0;
|
||||
L_0001: stack_0_r4=(arg1); //IL_0001: ldarg.1: s_0, pop0, push1
|
||||
L_0002: stack_1_r4=(10.5f); //IL_0002: ldc.r4 10.5: s_1, pop0, push1
|
||||
L_0007: stack_0_r4=((stack_0_r4)/(stack_1_r4)); //IL_0007: div: s_2, pop2, push1
|
||||
L_0008: stack_0_r4=(stack_0_r4); //IL_0008: conv.r8: s_1, pop1, push1
|
||||
L_0009: stack_1_r4=(3.1f); //IL_0009: ldc.r8 3.14159265358979: s_1, pop0, push1
|
||||
L_0012: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_0012: mul: s_2, pop2, push1
|
||||
L_0013: stack_1_r4=(85.0f); //IL_0013: ldc.r8 85: s_1, pop0, push1
|
||||
L_001c: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_001c: mul: s_2, pop2, push1
|
||||
L_001d: stack_0_r4=(stack_0_r4); //IL_001d: conv.r4: s_1, pop1, push1
|
||||
L_001e: var0=stack_0_r4; //IL_001e: stloc.0: s_1, pop1, push0
|
||||
L_001f: goto L_0021; //IL_001f: br.s IL_0021: s_0, pop0, push0
|
||||
L_0021: stack_0_r4=(var0); //IL_0021: ldloc.0: s_0, pop0, push1
|
||||
L_0022: return stack_0_r4; //IL_0022: ret: s_1, pop1, push0
|
||||
}
|
||||
|
||||
r4 cfun2(r4 arg0 ){
|
||||
//stack_vars:
|
||||
r4 stack_0_r4;;
|
||||
r4 stack_1_r4;;
|
||||
//local_vars:
|
||||
r4 var0;
|
||||
L_0001: stack_0_r4=(arg0); //IL_0001: ldarg.0: s_0, pop0, push1
|
||||
L_0002: stack_0_r4=(stack_0_r4); //IL_0002: conv.r8: s_1, pop1, push1
|
||||
L_0003: stack_1_r4=(267.0f); //IL_0003: ldc.r8 267.035375555132: s_1, pop0, push1
|
||||
L_000c: stack_0_r4=((stack_0_r4)/(stack_1_r4)); //IL_000c: div: s_2, pop2, push1
|
||||
L_000d: stack_1_r4=(10.5f); //IL_000d: ldc.r8 10.5: s_1, pop0, push1
|
||||
L_0016: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_0016: mul: s_2, pop2, push1
|
||||
L_0017: stack_1_r4=(60.0f); //IL_0017: ldc.r8 60: s_1, pop0, push1
|
||||
L_0020: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_0020: mul: s_2, pop2, push1
|
||||
L_0021: stack_1_r4=(1000.0f); //IL_0021: ldc.r8 1000: s_1, pop0, push1
|
||||
L_002a: stack_0_r4=((stack_0_r4)*(stack_1_r4)); //IL_002a: mul: s_2, pop2, push1
|
||||
L_002b: stack_0_r4=(stack_0_r4); //IL_002b: conv.r4: s_1, pop1, push1
|
||||
L_002c: var0=stack_0_r4; //IL_002c: stloc.0: s_1, pop1, push0
|
||||
L_002d: goto L_002f; //IL_002d: br.s IL_002f: s_0, pop0, push0
|
||||
L_002f: stack_0_r4=(var0); //IL_002f: ldloc.0: s_0, pop0, push1
|
||||
L_0030: return stack_0_r4; //IL_0030: ret: s_1, pop1, push0
|
||||
}
|
||||
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
|
||||
@@ -1,23 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("MedullaAdapter")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("MedullaAdapter")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("MedullaAdapter")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
2eac81d674c264ce890b4225c419fa343e662bbba0825694002aaadff6e734b7
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = MedullaAdapter
|
||||
build_property.ProjectDir = D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.CsWinRTUseWindowsUIXamlProjections = false
|
||||
build_property.EffectiveAnalysisLevelStyle =
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
7311d51d953d1fc22835d320a3489ce25305e242222f67ae1dd4ce8b482c0a5a
|
||||
@@ -1,19 +0,0 @@
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.csproj.AssemblyReference.cache
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.GeneratedMSBuildEditorConfig.editorconfig
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.AssemblyInfoInputs.cache
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.AssemblyInfo.cs
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.csproj.CoreCompileInputs.cache
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.pdb
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\MedullaAdapter.deps.json
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\MedullaAdapter.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\MedullaAdapter.pdb
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\CommonUsage.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\CycleGUI.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\MDCSToolBox.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\RefCartActivator.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\RefFundamentalLib.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\bin\Debug\netstandard2.0\RefMedullaCore.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.csproj.Fody.CopyLocal.cache
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaAdapter.csproj.Fody.RuntimeCopyLocal.cache
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\obj\Debug\netstandard2.0\MedullaA.645DEFF4.Up2Date
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\parkingRobotRef\CommonUsage.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\ref\CycleGUI.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\parkingRobotRef\MDCSToolBox.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\ref\RefCartActivator.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\ref\RefFundamentalLib.dll
|
||||
D:\@FariyLandTask\@FRLD-GitProject\ParkingRobot\MedullaAdapter\ref\RefMedullaCore.dll
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
C:\Users\Fairyland\.nuget\packages\microsoft.win32.registry\5.0.0\lib\netstandard2.0\Microsoft.Win32.Registry.dll
|
||||
C:\Users\Fairyland\.nuget\packages\newtonsoft.json\13.0.4\lib\netstandard2.0\Newtonsoft.Json.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.buffers\4.5.1\lib\netstandard2.0\System.Buffers.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.io.ports\6.0.0\lib\netstandard2.0\System.IO.Ports.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.memory\4.5.4\lib\netstandard2.0\System.Memory.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.numerics.vectors\4.4.0\lib\netstandard2.0\System.Numerics.Vectors.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.3\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.security.accesscontrol\5.0.0\lib\netstandard2.0\System.Security.AccessControl.dll
|
||||
C:\Users\Fairyland\.nuget\packages\system.security.principal.windows\5.0.0\lib\netstandard2.0\System.Security.Principal.Windows.dll
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,36 +1,36 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj": {}
|
||||
"D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj": {
|
||||
"D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"projectUniqueName": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"projectName": "MedullaAdapter",
|
||||
"projectPath": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"packagesPath": "C:\\Users\\Fairyland\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\obj\\",
|
||||
"projectPath": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"packagesPath": "C:\\Users\\CodexSandboxOffline\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\VS2022\\Shared\\NuGetPackages"
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Fairyland\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.0"
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
@@ -47,30 +47,8 @@
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"Fody": {
|
||||
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[6.9.3, )"
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[2.0.3, )",
|
||||
"autoReferenced": true
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
"target": "Package",
|
||||
"version": "[13.0.4, )"
|
||||
},
|
||||
"System.IO.Ports": {
|
||||
"target": "Package",
|
||||
"version": "[6.0.0, )"
|
||||
}
|
||||
},
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
@@ -82,7 +60,12 @@
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.308\\RuntimeIdentifierGraph.json"
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.316/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Fairyland\.nuget\packages\;D:\VS2022\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">C:\Users\CodexSandboxOffline\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\CodexSandboxOffline\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.2</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.3</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Fairyland\.nuget\packages\" />
|
||||
<SourceRoot Include="D:\VS2022\Shared\NuGetPackages\" />
|
||||
<SourceRoot Include="C:\Users\CodexSandboxOffline\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,7 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)fody\6.9.3\build\Fody.targets" Condition="Exists('$(NuGetPackageRoot)fody\6.9.3\build\Fody.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
@@ -1,909 +1,43 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.0": {
|
||||
"Fody/6.9.3": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"build/Fody.targets": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/netstandard1.0/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard1.0/_._": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.Win32.Registry/5.0.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Memory": "4.5.4",
|
||||
"System.Security.AccessControl": "5.0.0",
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/netstandard2.0/Microsoft.Win32.Registry.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win"
|
||||
}
|
||||
}
|
||||
},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
},
|
||||
"compile": {
|
||||
"lib/netstandard1.0/_._": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard1.0/_._": {}
|
||||
},
|
||||
"build": {
|
||||
"build/netstandard2.0/NETStandard.Library.targets": {}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.4": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/netstandard2.0/Newtonsoft.Json.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Newtonsoft.Json.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"runtimeTargets": {
|
||||
"runtimes/linux-arm/native/libSystem.IO.Ports.Native.so": {
|
||||
"assetType": "native",
|
||||
"rid": "linux-arm"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"runtimeTargets": {
|
||||
"runtimes/linux-arm64/native/libSystem.IO.Ports.Native.so": {
|
||||
"assetType": "native",
|
||||
"rid": "linux-arm64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"runtimeTargets": {
|
||||
"runtimes/linux-x64/native/libSystem.IO.Ports.Native.so": {
|
||||
"assetType": "native",
|
||||
"rid": "linux-x64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports": "6.0.0",
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports": "6.0.0"
|
||||
}
|
||||
},
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"runtimeTargets": {
|
||||
"runtimes/osx-arm64/native/libSystem.IO.Ports.Native.dylib": {
|
||||
"assetType": "native",
|
||||
"rid": "osx-arm64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"runtimeTargets": {
|
||||
"runtimes/osx-x64/native/libSystem.IO.Ports.Native.dylib": {
|
||||
"assetType": "native",
|
||||
"rid": "osx-x64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Buffers/4.5.1": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.0/System.Buffers.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Buffers.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Ports/6.0.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Microsoft.Win32.Registry": "5.0.0",
|
||||
"System.Memory": "4.5.4",
|
||||
"runtime.native.System.IO.Ports": "6.0.0"
|
||||
},
|
||||
"compile": {
|
||||
"lib/netstandard2.0/System.IO.Ports.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.IO.Ports.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/unix/lib/netstandard2.0/System.IO.Ports.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "unix"
|
||||
},
|
||||
"runtimes/win/lib/netstandard2.0/System.IO.Ports.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Memory/4.5.4": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Numerics.Vectors": "4.4.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
|
||||
},
|
||||
"compile": {
|
||||
"lib/netstandard2.0/System.Memory.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Memory.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.0/System.Numerics.Vectors.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Numerics.Vectors.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.5.3": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.AccessControl/5.0.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Security.Principal.Windows": "5.0.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/netstandard2.0/System.Security.AccessControl.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Security.AccessControl.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.Principal.Windows/5.0.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"ref/netstandard2.0/System.Security.Principal.Windows.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Security.Principal.Windows.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Fody/6.9.3": {
|
||||
"sha512": "1CUGgFdyECDKgi5HaUBhdv6k+VG9Iy4OCforGfHyar3xQXAJypZkzymgKtWj/4SPd6nSG0Qi7NH71qHrDSZLaA==",
|
||||
"type": "package",
|
||||
"path": "fody/6.9.3",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"build/Fody.targets",
|
||||
"fody.6.9.3.nupkg.sha512",
|
||||
"fody.nuspec",
|
||||
"package_icon.png",
|
||||
"package_readme.md",
|
||||
"tasks/net472/FodyCommon.dll",
|
||||
"tasks/net472/FodyHelpers.dll",
|
||||
"tasks/net472/FodyHelpers.xml",
|
||||
"tasks/net472/FodyIsolated.dll",
|
||||
"tasks/net472/FodyTasks.dll",
|
||||
"tasks/net472/Mono.Cecil.Pdb.dll",
|
||||
"tasks/net472/Mono.Cecil.Pdb.pdb",
|
||||
"tasks/net472/Mono.Cecil.Rocks.dll",
|
||||
"tasks/net472/Mono.Cecil.Rocks.pdb",
|
||||
"tasks/net472/Mono.Cecil.dll",
|
||||
"tasks/net472/Mono.Cecil.pdb",
|
||||
"tasks/netstandard2.0/FodyCommon.dll",
|
||||
"tasks/netstandard2.0/FodyHelpers.dll",
|
||||
"tasks/netstandard2.0/FodyHelpers.xml",
|
||||
"tasks/netstandard2.0/FodyIsolated.dll",
|
||||
"tasks/netstandard2.0/FodyTasks.dll",
|
||||
"tasks/netstandard2.0/Mono.Cecil.Pdb.dll",
|
||||
"tasks/netstandard2.0/Mono.Cecil.Pdb.pdb",
|
||||
"tasks/netstandard2.0/Mono.Cecil.Rocks.dll",
|
||||
"tasks/netstandard2.0/Mono.Cecil.Rocks.pdb",
|
||||
"tasks/netstandard2.0/Mono.Cecil.dll",
|
||||
"tasks/netstandard2.0/Mono.Cecil.pdb"
|
||||
]
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
||||
"sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
||||
"type": "package",
|
||||
"path": "microsoft.netcore.platforms/1.1.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"ThirdPartyNotices.txt",
|
||||
"dotnet_library_license.txt",
|
||||
"lib/netstandard1.0/_._",
|
||||
"microsoft.netcore.platforms.1.1.0.nupkg.sha512",
|
||||
"microsoft.netcore.platforms.nuspec",
|
||||
"runtime.json"
|
||||
]
|
||||
},
|
||||
"Microsoft.Win32.Registry/5.0.0": {
|
||||
"sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
|
||||
"type": "package",
|
||||
"path": "microsoft.win32.registry/5.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net46/Microsoft.Win32.Registry.dll",
|
||||
"lib/net461/Microsoft.Win32.Registry.dll",
|
||||
"lib/net461/Microsoft.Win32.Registry.xml",
|
||||
"lib/netstandard1.3/Microsoft.Win32.Registry.dll",
|
||||
"lib/netstandard2.0/Microsoft.Win32.Registry.dll",
|
||||
"lib/netstandard2.0/Microsoft.Win32.Registry.xml",
|
||||
"microsoft.win32.registry.5.0.0.nupkg.sha512",
|
||||
"microsoft.win32.registry.nuspec",
|
||||
"ref/net46/Microsoft.Win32.Registry.dll",
|
||||
"ref/net461/Microsoft.Win32.Registry.dll",
|
||||
"ref/net461/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/Microsoft.Win32.Registry.dll",
|
||||
"ref/netstandard1.3/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/de/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/es/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/it/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml",
|
||||
"ref/netstandard2.0/Microsoft.Win32.Registry.dll",
|
||||
"ref/netstandard2.0/Microsoft.Win32.Registry.xml",
|
||||
"runtimes/win/lib/net46/Microsoft.Win32.Registry.dll",
|
||||
"runtimes/win/lib/net461/Microsoft.Win32.Registry.dll",
|
||||
"runtimes/win/lib/net461/Microsoft.Win32.Registry.xml",
|
||||
"runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll",
|
||||
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll",
|
||||
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"NETStandard.Library/2.0.3": {
|
||||
"sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
||||
"type": "package",
|
||||
"path": "netstandard.library/2.0.3",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"build/netstandard2.0/NETStandard.Library.targets",
|
||||
"build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.AppContext.dll",
|
||||
"build/netstandard2.0/ref/System.Collections.Concurrent.dll",
|
||||
"build/netstandard2.0/ref/System.Collections.NonGeneric.dll",
|
||||
"build/netstandard2.0/ref/System.Collections.Specialized.dll",
|
||||
"build/netstandard2.0/ref/System.Collections.dll",
|
||||
"build/netstandard2.0/ref/System.ComponentModel.Composition.dll",
|
||||
"build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll",
|
||||
"build/netstandard2.0/ref/System.ComponentModel.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll",
|
||||
"build/netstandard2.0/ref/System.ComponentModel.dll",
|
||||
"build/netstandard2.0/ref/System.Console.dll",
|
||||
"build/netstandard2.0/ref/System.Core.dll",
|
||||
"build/netstandard2.0/ref/System.Data.Common.dll",
|
||||
"build/netstandard2.0/ref/System.Data.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.Contracts.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.Debug.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.Process.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.Tools.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll",
|
||||
"build/netstandard2.0/ref/System.Diagnostics.Tracing.dll",
|
||||
"build/netstandard2.0/ref/System.Drawing.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.Drawing.dll",
|
||||
"build/netstandard2.0/ref/System.Dynamic.Runtime.dll",
|
||||
"build/netstandard2.0/ref/System.Globalization.Calendars.dll",
|
||||
"build/netstandard2.0/ref/System.Globalization.Extensions.dll",
|
||||
"build/netstandard2.0/ref/System.Globalization.dll",
|
||||
"build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll",
|
||||
"build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll",
|
||||
"build/netstandard2.0/ref/System.IO.Compression.dll",
|
||||
"build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll",
|
||||
"build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll",
|
||||
"build/netstandard2.0/ref/System.IO.FileSystem.dll",
|
||||
"build/netstandard2.0/ref/System.IO.IsolatedStorage.dll",
|
||||
"build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll",
|
||||
"build/netstandard2.0/ref/System.IO.Pipes.dll",
|
||||
"build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll",
|
||||
"build/netstandard2.0/ref/System.IO.dll",
|
||||
"build/netstandard2.0/ref/System.Linq.Expressions.dll",
|
||||
"build/netstandard2.0/ref/System.Linq.Parallel.dll",
|
||||
"build/netstandard2.0/ref/System.Linq.Queryable.dll",
|
||||
"build/netstandard2.0/ref/System.Linq.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Http.dll",
|
||||
"build/netstandard2.0/ref/System.Net.NameResolution.dll",
|
||||
"build/netstandard2.0/ref/System.Net.NetworkInformation.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Ping.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Requests.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Security.dll",
|
||||
"build/netstandard2.0/ref/System.Net.Sockets.dll",
|
||||
"build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll",
|
||||
"build/netstandard2.0/ref/System.Net.WebSockets.Client.dll",
|
||||
"build/netstandard2.0/ref/System.Net.WebSockets.dll",
|
||||
"build/netstandard2.0/ref/System.Net.dll",
|
||||
"build/netstandard2.0/ref/System.Numerics.dll",
|
||||
"build/netstandard2.0/ref/System.ObjectModel.dll",
|
||||
"build/netstandard2.0/ref/System.Reflection.Extensions.dll",
|
||||
"build/netstandard2.0/ref/System.Reflection.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.Reflection.dll",
|
||||
"build/netstandard2.0/ref/System.Resources.Reader.dll",
|
||||
"build/netstandard2.0/ref/System.Resources.ResourceManager.dll",
|
||||
"build/netstandard2.0/ref/System.Resources.Writer.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Extensions.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Handles.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.InteropServices.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Numerics.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.Serialization.dll",
|
||||
"build/netstandard2.0/ref/System.Runtime.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Claims.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll",
|
||||
"build/netstandard2.0/ref/System.Security.Principal.dll",
|
||||
"build/netstandard2.0/ref/System.Security.SecureString.dll",
|
||||
"build/netstandard2.0/ref/System.ServiceModel.Web.dll",
|
||||
"build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll",
|
||||
"build/netstandard2.0/ref/System.Text.Encoding.dll",
|
||||
"build/netstandard2.0/ref/System.Text.RegularExpressions.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.Overlapped.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.Tasks.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.Thread.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.ThreadPool.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.Timer.dll",
|
||||
"build/netstandard2.0/ref/System.Threading.dll",
|
||||
"build/netstandard2.0/ref/System.Transactions.dll",
|
||||
"build/netstandard2.0/ref/System.ValueTuple.dll",
|
||||
"build/netstandard2.0/ref/System.Web.dll",
|
||||
"build/netstandard2.0/ref/System.Windows.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.Linq.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.ReaderWriter.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.Serialization.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.XDocument.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.XPath.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.XmlDocument.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.XmlSerializer.dll",
|
||||
"build/netstandard2.0/ref/System.Xml.dll",
|
||||
"build/netstandard2.0/ref/System.dll",
|
||||
"build/netstandard2.0/ref/mscorlib.dll",
|
||||
"build/netstandard2.0/ref/netstandard.dll",
|
||||
"build/netstandard2.0/ref/netstandard.xml",
|
||||
"lib/netstandard1.0/_._",
|
||||
"netstandard.library.2.0.3.nupkg.sha512",
|
||||
"netstandard.library.nuspec"
|
||||
]
|
||||
},
|
||||
"Newtonsoft.Json/13.0.4": {
|
||||
"sha512": "pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A==",
|
||||
"type": "package",
|
||||
"path": "newtonsoft.json/13.0.4",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"lib/net20/Newtonsoft.Json.dll",
|
||||
"lib/net20/Newtonsoft.Json.xml",
|
||||
"lib/net35/Newtonsoft.Json.dll",
|
||||
"lib/net35/Newtonsoft.Json.xml",
|
||||
"lib/net40/Newtonsoft.Json.dll",
|
||||
"lib/net40/Newtonsoft.Json.xml",
|
||||
"lib/net45/Newtonsoft.Json.dll",
|
||||
"lib/net45/Newtonsoft.Json.xml",
|
||||
"lib/net6.0/Newtonsoft.Json.dll",
|
||||
"lib/net6.0/Newtonsoft.Json.xml",
|
||||
"lib/netstandard1.0/Newtonsoft.Json.dll",
|
||||
"lib/netstandard1.0/Newtonsoft.Json.xml",
|
||||
"lib/netstandard1.3/Newtonsoft.Json.dll",
|
||||
"lib/netstandard1.3/Newtonsoft.Json.xml",
|
||||
"lib/netstandard2.0/Newtonsoft.Json.dll",
|
||||
"lib/netstandard2.0/Newtonsoft.Json.xml",
|
||||
"newtonsoft.json.13.0.4.nupkg.sha512",
|
||||
"newtonsoft.json.nuspec",
|
||||
"packageIcon.png"
|
||||
]
|
||||
},
|
||||
"runtime.linux-arm.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "75q52H7CSpgIoIDwXb9o833EvBZIXJ0mdPhz1E6jSisEXUBlSCPalC29cj3EXsjpuDwr0dj1LRXZepIQH/oL4Q==",
|
||||
"type": "package",
|
||||
"path": "runtime.linux-arm.runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.linux-arm.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.linux-arm.runtime.native.system.io.ports.nuspec",
|
||||
"runtimes/linux-arm/native/libSystem.IO.Ports.Native.so",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"runtime.linux-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "xn2bMThmXr3CsvOYmS8ex2Yz1xo+kcnhVg2iVhS9PlmqjZPAkrEo/I40wjrBZH/tU4kvH0s1AE8opAvQ3KIS8g==",
|
||||
"type": "package",
|
||||
"path": "runtime.linux-arm64.runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.linux-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.linux-arm64.runtime.native.system.io.ports.nuspec",
|
||||
"runtimes/linux-arm64/native/libSystem.IO.Ports.Native.so",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"runtime.linux-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "16nbNXwv0sC+gLGIuecri0skjuh6R1maIJggsaNP7MQBcbVcEfWFUOkEnsnvoLEjy0XerfibuRptfQ8AmdIcWA==",
|
||||
"type": "package",
|
||||
"path": "runtime.linux-x64.runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.linux-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.linux-x64.runtime.native.system.io.ports.nuspec",
|
||||
"runtimes/linux-x64/native/libSystem.IO.Ports.Native.so",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "KaaXlpOcuZjMdmyF5wzzx3b+PRKIzt6A5Ax9dKenPDQbVJAFpev+casD0BIig1pBcbs3zx7CqWemzUJKAeHdSQ==",
|
||||
"type": "package",
|
||||
"path": "runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.native.system.io.ports.nuspec",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"runtime.osx-arm64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "fXG12NodG1QrCdoaeSQ1gVnk/koi4WYY4jZtarMkZeQMyReBm1nZlSRoPnUjLr2ZR36TiMjpcGnQfxymieUe7w==",
|
||||
"type": "package",
|
||||
"path": "runtime.osx-arm64.runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.osx-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.osx-arm64.runtime.native.system.io.ports.nuspec",
|
||||
"runtimes/osx-arm64/native/libSystem.IO.Ports.Native.dylib",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"runtime.osx-x64.runtime.native.System.IO.Ports/6.0.0": {
|
||||
"sha512": "/As+zPY49+dSUXkh+fTUbyPhqrdGN//evLxo4Vue88pfh1BHZgF7q4kMblTkxYvwR6Vi03zSYxysSFktO8/SDQ==",
|
||||
"type": "package",
|
||||
"path": "runtime.osx-x64.runtime.native.system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"runtime.osx-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"runtime.osx-x64.runtime.native.system.io.ports.nuspec",
|
||||
"runtimes/osx-x64/native/libSystem.IO.Ports.Native.dylib",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"System.Buffers/4.5.1": {
|
||||
"sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
|
||||
"type": "package",
|
||||
"path": "system.buffers/4.5.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net461/System.Buffers.dll",
|
||||
"lib/net461/System.Buffers.xml",
|
||||
"lib/netcoreapp2.0/_._",
|
||||
"lib/netstandard1.1/System.Buffers.dll",
|
||||
"lib/netstandard1.1/System.Buffers.xml",
|
||||
"lib/netstandard2.0/System.Buffers.dll",
|
||||
"lib/netstandard2.0/System.Buffers.xml",
|
||||
"lib/uap10.0.16299/_._",
|
||||
"ref/net45/System.Buffers.dll",
|
||||
"ref/net45/System.Buffers.xml",
|
||||
"ref/netcoreapp2.0/_._",
|
||||
"ref/netstandard1.1/System.Buffers.dll",
|
||||
"ref/netstandard1.1/System.Buffers.xml",
|
||||
"ref/netstandard2.0/System.Buffers.dll",
|
||||
"ref/netstandard2.0/System.Buffers.xml",
|
||||
"ref/uap10.0.16299/_._",
|
||||
"system.buffers.4.5.1.nupkg.sha512",
|
||||
"system.buffers.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"System.IO.Ports/6.0.0": {
|
||||
"sha512": "dRyGI7fUESar5ZLIpiBOaaNLW7YyOBGftjj5Of+xcduC/Rjl7RjhEnWDvvNBmHuF3d0tdXoqdVI/yrVA8f00XA==",
|
||||
"type": "package",
|
||||
"path": "system.io.ports/6.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"buildTransitive/netcoreapp2.0/System.IO.Ports.targets",
|
||||
"buildTransitive/netcoreapp3.1/_._",
|
||||
"lib/net461/System.IO.Ports.dll",
|
||||
"lib/net461/System.IO.Ports.xml",
|
||||
"lib/net6.0/System.IO.Ports.dll",
|
||||
"lib/net6.0/System.IO.Ports.xml",
|
||||
"lib/netstandard2.0/System.IO.Ports.dll",
|
||||
"lib/netstandard2.0/System.IO.Ports.xml",
|
||||
"runtimes/unix/lib/net6.0/System.IO.Ports.dll",
|
||||
"runtimes/unix/lib/net6.0/System.IO.Ports.xml",
|
||||
"runtimes/unix/lib/netstandard2.0/System.IO.Ports.dll",
|
||||
"runtimes/unix/lib/netstandard2.0/System.IO.Ports.xml",
|
||||
"runtimes/win/lib/net461/System.IO.Ports.dll",
|
||||
"runtimes/win/lib/net461/System.IO.Ports.xml",
|
||||
"runtimes/win/lib/net6.0/System.IO.Ports.dll",
|
||||
"runtimes/win/lib/net6.0/System.IO.Ports.xml",
|
||||
"runtimes/win/lib/netstandard2.0/System.IO.Ports.dll",
|
||||
"runtimes/win/lib/netstandard2.0/System.IO.Ports.xml",
|
||||
"system.io.ports.6.0.0.nupkg.sha512",
|
||||
"system.io.ports.nuspec",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"System.Memory/4.5.4": {
|
||||
"sha512": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
|
||||
"type": "package",
|
||||
"path": "system.memory/4.5.4",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net461/System.Memory.dll",
|
||||
"lib/net461/System.Memory.xml",
|
||||
"lib/netcoreapp2.1/_._",
|
||||
"lib/netstandard1.1/System.Memory.dll",
|
||||
"lib/netstandard1.1/System.Memory.xml",
|
||||
"lib/netstandard2.0/System.Memory.dll",
|
||||
"lib/netstandard2.0/System.Memory.xml",
|
||||
"ref/netcoreapp2.1/_._",
|
||||
"system.memory.4.5.4.nupkg.sha512",
|
||||
"system.memory.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {
|
||||
"sha512": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==",
|
||||
"type": "package",
|
||||
"path": "system.numerics.vectors/4.4.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/MonoAndroid10/_._",
|
||||
"lib/MonoTouch10/_._",
|
||||
"lib/net46/System.Numerics.Vectors.dll",
|
||||
"lib/net46/System.Numerics.Vectors.xml",
|
||||
"lib/netcoreapp2.0/_._",
|
||||
"lib/netstandard1.0/System.Numerics.Vectors.dll",
|
||||
"lib/netstandard1.0/System.Numerics.Vectors.xml",
|
||||
"lib/netstandard2.0/System.Numerics.Vectors.dll",
|
||||
"lib/netstandard2.0/System.Numerics.Vectors.xml",
|
||||
"lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll",
|
||||
"lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml",
|
||||
"lib/xamarinios10/_._",
|
||||
"lib/xamarinmac20/_._",
|
||||
"lib/xamarintvos10/_._",
|
||||
"lib/xamarinwatchos10/_._",
|
||||
"ref/MonoAndroid10/_._",
|
||||
"ref/MonoTouch10/_._",
|
||||
"ref/net46/System.Numerics.Vectors.dll",
|
||||
"ref/net46/System.Numerics.Vectors.xml",
|
||||
"ref/netcoreapp2.0/_._",
|
||||
"ref/netstandard1.0/System.Numerics.Vectors.dll",
|
||||
"ref/netstandard1.0/System.Numerics.Vectors.xml",
|
||||
"ref/netstandard2.0/System.Numerics.Vectors.dll",
|
||||
"ref/netstandard2.0/System.Numerics.Vectors.xml",
|
||||
"ref/xamarinios10/_._",
|
||||
"ref/xamarinmac20/_._",
|
||||
"ref/xamarintvos10/_._",
|
||||
"ref/xamarinwatchos10/_._",
|
||||
"system.numerics.vectors.4.4.0.nupkg.sha512",
|
||||
"system.numerics.vectors.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.5.3": {
|
||||
"sha512": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==",
|
||||
"type": "package",
|
||||
"path": "system.runtime.compilerservices.unsafe/4.5.3",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net461/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"lib/net461/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"ref/net461/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"ref/net461/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml",
|
||||
"system.runtime.compilerservices.unsafe.4.5.3.nupkg.sha512",
|
||||
"system.runtime.compilerservices.unsafe.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"System.Security.AccessControl/5.0.0": {
|
||||
"sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
|
||||
"type": "package",
|
||||
"path": "system.security.accesscontrol/5.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net46/System.Security.AccessControl.dll",
|
||||
"lib/net461/System.Security.AccessControl.dll",
|
||||
"lib/net461/System.Security.AccessControl.xml",
|
||||
"lib/netstandard1.3/System.Security.AccessControl.dll",
|
||||
"lib/netstandard2.0/System.Security.AccessControl.dll",
|
||||
"lib/netstandard2.0/System.Security.AccessControl.xml",
|
||||
"lib/uap10.0.16299/_._",
|
||||
"ref/net46/System.Security.AccessControl.dll",
|
||||
"ref/net461/System.Security.AccessControl.dll",
|
||||
"ref/net461/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/System.Security.AccessControl.dll",
|
||||
"ref/netstandard1.3/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/de/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/es/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/fr/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/it/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/ja/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/ko/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/ru/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml",
|
||||
"ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml",
|
||||
"ref/netstandard2.0/System.Security.AccessControl.dll",
|
||||
"ref/netstandard2.0/System.Security.AccessControl.xml",
|
||||
"ref/uap10.0.16299/_._",
|
||||
"runtimes/win/lib/net46/System.Security.AccessControl.dll",
|
||||
"runtimes/win/lib/net461/System.Security.AccessControl.dll",
|
||||
"runtimes/win/lib/net461/System.Security.AccessControl.xml",
|
||||
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll",
|
||||
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml",
|
||||
"runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll",
|
||||
"runtimes/win/lib/uap10.0.16299/_._",
|
||||
"system.security.accesscontrol.5.0.0.nupkg.sha512",
|
||||
"system.security.accesscontrol.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
},
|
||||
"System.Security.Principal.Windows/5.0.0": {
|
||||
"sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
|
||||
"type": "package",
|
||||
"path": "system.security.principal.windows/5.0.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"lib/net46/System.Security.Principal.Windows.dll",
|
||||
"lib/net461/System.Security.Principal.Windows.dll",
|
||||
"lib/net461/System.Security.Principal.Windows.xml",
|
||||
"lib/netstandard1.3/System.Security.Principal.Windows.dll",
|
||||
"lib/netstandard2.0/System.Security.Principal.Windows.dll",
|
||||
"lib/netstandard2.0/System.Security.Principal.Windows.xml",
|
||||
"lib/uap10.0.16299/_._",
|
||||
"ref/net46/System.Security.Principal.Windows.dll",
|
||||
"ref/net461/System.Security.Principal.Windows.dll",
|
||||
"ref/net461/System.Security.Principal.Windows.xml",
|
||||
"ref/netcoreapp3.0/System.Security.Principal.Windows.dll",
|
||||
"ref/netcoreapp3.0/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/System.Security.Principal.Windows.dll",
|
||||
"ref/netstandard1.3/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/de/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/es/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/fr/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/it/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/ja/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/ko/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/ru/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml",
|
||||
"ref/netstandard2.0/System.Security.Principal.Windows.dll",
|
||||
"ref/netstandard2.0/System.Security.Principal.Windows.xml",
|
||||
"ref/uap10.0.16299/_._",
|
||||
"runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll",
|
||||
"runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml",
|
||||
"runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll",
|
||||
"runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
|
||||
"runtimes/win/lib/net46/System.Security.Principal.Windows.dll",
|
||||
"runtimes/win/lib/net461/System.Security.Principal.Windows.dll",
|
||||
"runtimes/win/lib/net461/System.Security.Principal.Windows.xml",
|
||||
"runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll",
|
||||
"runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml",
|
||||
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll",
|
||||
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
|
||||
"runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll",
|
||||
"runtimes/win/lib/uap10.0.16299/_._",
|
||||
"system.security.principal.windows.5.0.0.nupkg.sha512",
|
||||
"system.security.principal.windows.nuspec",
|
||||
"useSharedDesignerContext.txt",
|
||||
"version.txt"
|
||||
]
|
||||
}
|
||||
"net8.0": {}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
".NETStandard,Version=v2.0": [
|
||||
"Fody >= 6.9.3",
|
||||
"NETStandard.Library >= 2.0.3",
|
||||
"Newtonsoft.Json >= 13.0.4",
|
||||
"System.IO.Ports >= 6.0.0"
|
||||
]
|
||||
"net8.0": []
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\": {},
|
||||
"D:\\VS2022\\Shared\\NuGetPackages": {}
|
||||
"C:\\Users\\CodexSandboxOffline\\.nuget\\packages\\": {},
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"projectUniqueName": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"projectName": "MedullaAdapter",
|
||||
"projectPath": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"packagesPath": "C:\\Users\\Fairyland\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\obj\\",
|
||||
"projectPath": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"packagesPath": "C:\\Users\\CodexSandboxOffline\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\VS2022\\Shared\\NuGetPackages"
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Fairyland\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"netstandard2.0"
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
@@ -920,30 +54,8 @@
|
||||
"SdkAnalysisLevel": "9.0.300"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"Fody": {
|
||||
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[6.9.3, )"
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[2.0.3, )",
|
||||
"autoReferenced": true
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
"target": "Package",
|
||||
"version": "[13.0.4, )"
|
||||
},
|
||||
"System.IO.Ports": {
|
||||
"target": "Package",
|
||||
"version": "[6.0.0, )"
|
||||
}
|
||||
},
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
@@ -955,7 +67,12 @@
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.308\\RuntimeIdentifierGraph.json"
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.316/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "M6NonK0uNRA=",
|
||||
"dgSpecHash": "b9v8vkN2ac8=",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\fody\\6.9.3\\fody.6.9.3.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\newtonsoft.json\\13.0.4\\newtonsoft.json.13.0.4.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.linux-arm.runtime.native.system.io.ports\\6.0.0\\runtime.linux-arm.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.linux-arm64.runtime.native.system.io.ports\\6.0.0\\runtime.linux-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.linux-x64.runtime.native.system.io.ports\\6.0.0\\runtime.linux-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.native.system.io.ports\\6.0.0\\runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.osx-arm64.runtime.native.system.io.ports\\6.0.0\\runtime.osx-arm64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\runtime.osx-x64.runtime.native.system.io.ports\\6.0.0\\runtime.osx-x64.runtime.native.system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.io.ports\\6.0.0\\system.io.ports.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.memory\\4.5.4\\system.memory.4.5.4.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.numerics.vectors\\4.4.0\\system.numerics.vectors.4.4.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\4.5.3\\system.runtime.compilerservices.unsafe.4.5.3.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512"
|
||||
],
|
||||
"projectFilePath": "D:\\Users\\Desktop\\入职培训\\停车机器人\\MyParking\\MedullaAdapter\\MedullaAdapter.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user