update
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
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 DiverCommunication Embedded;
|
||||
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;
|
||||
|
||||
#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;
|
||||
|
||||
[AsLowerIO(desc = "左前左轮实际位置")] public float LFLActualPos;
|
||||
[AsLowerIO(desc = "左前右轮实际位置")] public float LFRActualPos;
|
||||
[AsLowerIO(desc = "右前左轮实际位置")] public float RFLActualPos;
|
||||
[AsLowerIO(desc = "右前右轮实际位置")] public float RFRActualPos;
|
||||
[AsLowerIO(desc = "左后左轮实际位置")] public float LRLActualPos;
|
||||
[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;
|
||||
|
||||
[AsInitParam(desc = "遥控器速度上限")] public float TransmitterSpeedUpperLimit = 1.0f;
|
||||
[AsInitParam(desc = "遥控器速度下限")] public float TransmitterSpeedLowerLimit = 0.0f;
|
||||
internal DateTime TransmitterLastTime;
|
||||
|
||||
[IOObjectUtility]
|
||||
public void WheelReset()
|
||||
{
|
||||
ResetFromM = true;
|
||||
}
|
||||
|
||||
[IOObjectUtility]
|
||||
public void WheelDisable()
|
||||
{
|
||||
DisableFromM = true;
|
||||
}
|
||||
|
||||
public override void CommunicationInit()
|
||||
{
|
||||
if (GhostMode) return;
|
||||
|
||||
Bridge = new MCUSerialBridge();
|
||||
//Step1:打开指定串口连接
|
||||
var err = Bridge.Open(MCUPort, 1000000u);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU Open FAILED: {0}", 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());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
Console.WriteLine("MCU Reset OK");
|
||||
}
|
||||
|
||||
//Step3:GetVersion
|
||||
err = Bridge.GetVersion(out var version, 100);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU GetVersion FAILED: {0}", err.ToDescription());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU GetVersion OK: {0}", version.ToString());
|
||||
}
|
||||
|
||||
//Step4:GetState
|
||||
err = Bridge.GetState(out var state, 100);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU GetState FAILED: {0}", err.ToDescription());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU GetState OK: {0}", state.ToString());
|
||||
}
|
||||
|
||||
//Step5:串口/CAN配置
|
||||
try
|
||||
{
|
||||
var ports = new List<PortConfig>();
|
||||
for (int i = 0; i < 1; i++)
|
||||
ports.Add(new CANPortConfig(500000, 10));
|
||||
for (int i = 0; i < 3; i++)
|
||||
ports.Add(new SerialPortConfig(9600, 10));
|
||||
Console.WriteLine("=== Port Configuration ===");
|
||||
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);
|
||||
else if (ports[i] is CANPortConfig c)
|
||||
Console.WriteLine("Port {0}: CAN, Baud={1}, RetryTimeMs={2}", i, c.Baud, c.RetryTimeMs);
|
||||
}
|
||||
|
||||
var ret = Bridge.Configure(ports, 200);
|
||||
if (ret != MCUSerialBridgeError.OK)
|
||||
{
|
||||
Console.WriteLine("MCU Configure FAILED: {0}", ret.ToDescription());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("MCU Configure OK");
|
||||
}
|
||||
Console.WriteLine("MCU Configure {0}", ret == MCUSerialBridgeError.OK ? "OK" : $"FAILED: 0x{(uint)ret:X8}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Configure Exception: {0}", ex.Message);
|
||||
}
|
||||
//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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<DiverCompiler />
|
||||
</Weavers>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,291 @@
|
||||
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();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -0,0 +1,879 @@
|
||||
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];
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,884 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MCUSerialBridgeCLR
|
||||
{
|
||||
/// <summary>
|
||||
/// 辅助方法与内部 C 结构体封装,用于 P/Invoke 交互
|
||||
/// </summary>
|
||||
internal static class PortStructHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 将任意结构体序列化为字节数组
|
||||
/// </summary>
|
||||
/// <typeparam name="T">结构体类型</typeparam>
|
||||
/// <param name="str">要序列化的结构体</param>
|
||||
/// <returns>返回结构体对应的字节数组</returns>
|
||||
/// <remarks>使用 Marshal 分配内存并复制内容</remarks>
|
||||
public static byte[] StructToBytes<T>(T str)
|
||||
where T : struct
|
||||
{
|
||||
int size = Marshal.SizeOf<T>();
|
||||
byte[] arr = new byte[size];
|
||||
IntPtr ptr = Marshal.AllocHGlobal(size);
|
||||
try
|
||||
{
|
||||
Marshal.StructureToPtr(str, ptr, false);
|
||||
Marshal.Copy(ptr, arr, 0, size);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 串口端口配置的原生结构体(与 MCU C 层对应)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct SerialPortConfigC
|
||||
{
|
||||
/// <summary>端口类型(0x01 = Serial)</summary>
|
||||
public byte port_type;
|
||||
|
||||
/// <summary>波特率</summary>
|
||||
public uint baud;
|
||||
|
||||
/// <summary>接收帧时间间隔</summary>
|
||||
public uint receive_frame_ms;
|
||||
|
||||
/// <summary>保留字节,填 0</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
|
||||
public byte[] reserved;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CAN 端口配置的原生结构体(与 MCU C 层对应)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct CANPortConfigC
|
||||
{
|
||||
/// <summary>端口类型(0x02 = CAN)</summary>
|
||||
public byte port_type;
|
||||
|
||||
/// <summary>波特率</summary>
|
||||
public uint baud;
|
||||
|
||||
/// <summary>最大重发时间</summary>
|
||||
public uint retry_time_ms;
|
||||
|
||||
/// <summary>保留字节,填 0</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
|
||||
public byte[] reserved;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MCU 固件版本信息结构体
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct VersionInfo
|
||||
{
|
||||
/// <summary>产品型号</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
|
||||
public string ProductionName;
|
||||
|
||||
/// <summary>Git 标签</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string GitTag;
|
||||
|
||||
/// <summary>Git commit 哈希值</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string GitCommit;
|
||||
|
||||
/// <summary>编译时间(字符串)</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)]
|
||||
public string BuildTime;
|
||||
|
||||
/// <summary>
|
||||
/// 转换为可读字符串
|
||||
/// </summary>
|
||||
/// <returns>返回包含产品、Tag、Commit、BuildTime 的字符串</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Product: {ProductionName}, Tag: {GitTag}, Commit: {GitCommit}, Built: {BuildTime}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MCU 当前运行状态
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct MCUState
|
||||
{
|
||||
/// <summary>原始 32 位状态值</summary>
|
||||
[FieldOffset(0)]
|
||||
public uint RawValue;
|
||||
|
||||
/// <summary>状态子字段 0</summary>
|
||||
[FieldOffset(0)]
|
||||
public byte Substate0;
|
||||
|
||||
/// <summary>状态子字段 1</summary>
|
||||
[FieldOffset(1)]
|
||||
public byte Substate1;
|
||||
|
||||
/// <summary>状态子字段 2</summary>
|
||||
[FieldOffset(2)]
|
||||
public byte Substate2;
|
||||
|
||||
/// <summary>高字节模式标志</summary>
|
||||
[FieldOffset(3)]
|
||||
public byte Mode;
|
||||
|
||||
/// <summary>是否处于 Bridge 模式</summary>
|
||||
public bool IsBridge => (Mode & 0x80) == 0;
|
||||
|
||||
/// <summary>是否处于 DIVER 模式</summary>
|
||||
public bool IsDIVER => (Mode & 0x80) != 0;
|
||||
|
||||
/// <summary>
|
||||
/// 返回可读的状态字符串
|
||||
/// </summary>
|
||||
/// <returns>例如 "Bridge: Running" 或 "DIVER: Error"</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
string modeStr = IsBridge ? "Bridge" : "DIVER";
|
||||
uint substate = (uint)(Substate0 | (Substate1 << 8) | (Substate2 << 16));
|
||||
|
||||
string subStr = substate switch
|
||||
{
|
||||
0x00000000 => "Idle",
|
||||
0x0000000F => "Running",
|
||||
0x000000FF => "Error",
|
||||
0x00000001 => "Configured", // DIVER specific
|
||||
0x8000000F => "Running",
|
||||
0x800000FF => "Error",
|
||||
_ => $"Unknown (0x{substate:X6})",
|
||||
};
|
||||
|
||||
return $"{modeStr}: {subStr}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 抽象端口配置基类
|
||||
/// </summary>
|
||||
public abstract class PortConfig
|
||||
{
|
||||
/// <summary>端口类型(由子类实现)</summary>
|
||||
public abstract byte PortType { get; }
|
||||
|
||||
/// <summary>序列化端口配置为字节数组(供 P/Invoke 使用)</summary>
|
||||
/// <returns>返回固定长度字节数组(16 bytes)</returns>
|
||||
public abstract byte[] ToBytes();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 串口配置
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 构造函数
|
||||
/// </remarks>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <param name="receiveFrameMs">接收帧间隔</param>
|
||||
public class SerialPortConfig(uint baud, uint receiveFrameMs) : PortConfig
|
||||
{
|
||||
/// <summary>Serial 类型</summary>
|
||||
public override byte PortType => 0x01;
|
||||
|
||||
/// <summary>波特率</summary>
|
||||
public uint Baud { get; set; } = baud;
|
||||
|
||||
/// <summary>接收帧间隔</summary>
|
||||
public uint ReceiveFrameMs { get; set; } = receiveFrameMs;
|
||||
|
||||
/// <summary>
|
||||
/// 转换为字节数组
|
||||
/// </summary>
|
||||
/// <returns>16 字节数组</returns>
|
||||
public override byte[] ToBytes()
|
||||
{
|
||||
var c = new PortStructHelper.SerialPortConfigC
|
||||
{
|
||||
port_type = PortType,
|
||||
baud = Baud,
|
||||
receive_frame_ms = ReceiveFrameMs,
|
||||
reserved = new byte[7],
|
||||
};
|
||||
return PortStructHelper.StructToBytes(c);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CAN 端口配置
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 构造函数
|
||||
/// </remarks>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <param name="retryTimeMs">重发间隔</param>
|
||||
public class CANPortConfig(uint baud, uint retryTimeMs) : PortConfig
|
||||
{
|
||||
/// <summary>CAN 类型</summary>
|
||||
public override byte PortType => 0x02;
|
||||
|
||||
/// <summary>波特率</summary>
|
||||
public uint Baud { get; set; } = baud;
|
||||
|
||||
/// <summary>重发间隔</summary>
|
||||
public uint RetryTimeMs { get; set; } = retryTimeMs;
|
||||
|
||||
/// <summary>
|
||||
/// 转换为字节数组
|
||||
/// </summary>
|
||||
/// <returns>16 字节数组</returns>
|
||||
public override byte[] ToBytes()
|
||||
{
|
||||
var c = new PortStructHelper.CANPortConfigC
|
||||
{
|
||||
port_type = PortType,
|
||||
baud = Baud,
|
||||
retry_time_ms = RetryTimeMs,
|
||||
reserved = new byte[7],
|
||||
};
|
||||
return PortStructHelper.StructToBytes(c);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CAN 帧结构(标准帧 11-bit ID + 1-bit RTR + 4-bit DLC + Payload)
|
||||
/// </summary>
|
||||
public class CANMessage
|
||||
{
|
||||
/// <summary>标准帧 ID(0~0x7FF,11 位)</summary>
|
||||
public ushort ID { get; set; }
|
||||
|
||||
/// <summary>远程帧标志:false = 数据帧,true = 远程帧</summary>
|
||||
public bool RTR { get; set; }
|
||||
|
||||
/// <summary>数据长度码:0~8</summary>
|
||||
public byte DLC { get; set; }
|
||||
|
||||
/// <summary>数据负载,长度必须严格等于 DLC(DLC=0 时可为 null)</summary>
|
||||
public byte[] Payload { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序列化为 MCU 协议字节流
|
||||
/// </summary>
|
||||
/// <returns>返回字节数组:2 bytes header + Payload</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException">如果 DLC > 8</exception>
|
||||
/// <exception cref="ArgumentException">如果 Payload 长度 != DLC</exception>
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
if (DLC > 8)
|
||||
throw new ArgumentOutOfRangeException(nameof(DLC), "DLC must be 0-8");
|
||||
if (DLC > 0 && (Payload == null || Payload.Length != DLC))
|
||||
throw new ArgumentException("Payload length must equal DLC");
|
||||
|
||||
// 构造 2 字节 header
|
||||
ushort header = 0;
|
||||
header |= (ushort)(ID & 0x7FF); // bits 0-10
|
||||
if (RTR)
|
||||
header |= (1 << 11); // bit 11
|
||||
header |= (ushort)((DLC & 0xF) << 12); // bits 12-15
|
||||
|
||||
byte[] result = new byte[2 + DLC];
|
||||
byte[] headerBytes = BitConverter.GetBytes(header); // 小端序
|
||||
result[0] = headerBytes[0];
|
||||
result[1] = headerBytes[1];
|
||||
|
||||
if (DLC > 0)
|
||||
Buffer.BlockCopy(Payload, 0, result, 2, DLC);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化 MCU 协议字节流为 CANMessage
|
||||
/// </summary>
|
||||
/// <param name="data">原始字节数组</param>
|
||||
/// <param name="length">实际有效长度</param>
|
||||
/// <returns>CANMessage 实例</returns>
|
||||
/// <exception cref="ArgumentException">数据长度错误</exception>
|
||||
public static CANMessage FromBytes(byte[] data, uint length)
|
||||
{
|
||||
if (data == null || length > data.Length || length < 2)
|
||||
throw new ArgumentException("Data must be at least 2 bytes");
|
||||
|
||||
ushort header = BitConverter.ToUInt16(data, 0);
|
||||
|
||||
var msg = new CANMessage
|
||||
{
|
||||
ID = (ushort)(header & 0x7FF),
|
||||
RTR = (header & (1 << 11)) != 0,
|
||||
DLC = (byte)((header >> 12) & 0xF),
|
||||
};
|
||||
|
||||
if (msg.DLC > 0)
|
||||
{
|
||||
if (length < 2 + msg.DLC)
|
||||
throw new ArgumentException("Data length less than DLC");
|
||||
msg.Payload = new byte[msg.DLC];
|
||||
Buffer.BlockCopy(data, 2, msg.Payload, 0, msg.DLC);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Payload = Array.Empty<byte>();
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string payloadStr =
|
||||
(Payload == null || Payload.Length == 0)
|
||||
? "[]"
|
||||
: "0x[" + string.Join(" ", Payload.Select(b => $"{b:X2}")) + "]";
|
||||
|
||||
return $"CANMessage(ID=0x{ID:X3}, RTR={RTR}, DLC={DLC}, Payload={payloadStr})";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内部 P/Invoke 层,直接映射 C DLL 函数
|
||||
/// </summary>
|
||||
internal static class MCUSerialBridgeCoreAPI
|
||||
{
|
||||
private const string DLL = @"mcu_serial_bridge.dll";
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_open(
|
||||
out IntPtr handle,
|
||||
[MarshalAs(UnmanagedType.LPStr)] string port,
|
||||
uint baud
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_close(IntPtr handle);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_reset(IntPtr handle, uint timeout_ms);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern MCUSerialBridgeError msb_version(
|
||||
IntPtr handle,
|
||||
out VersionInfo version,
|
||||
uint timeout_ms
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern MCUSerialBridgeError mcu_state(
|
||||
IntPtr handle,
|
||||
out MCUState state,
|
||||
uint timeout
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_configure(
|
||||
IntPtr handle,
|
||||
uint num_ports,
|
||||
IntPtr ports,
|
||||
uint timeout
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_read_input(
|
||||
IntPtr handle,
|
||||
[Out] byte[] inputs,
|
||||
uint timeout_ms
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_write_output(
|
||||
IntPtr handle,
|
||||
[In] byte[] outputs,
|
||||
uint timeout_ms
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_read_port(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
[Out] byte[] dst_data,
|
||||
uint dst_capacity,
|
||||
out uint out_length,
|
||||
uint timeout_ms
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
internal delegate void msb_on_port_data_callback_function_t(
|
||||
IntPtr dst_data,
|
||||
uint dst_data_size,
|
||||
IntPtr user_ctx
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_register_port_data_callback(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
msb_on_port_data_callback_function_t callback,
|
||||
IntPtr user_ctx
|
||||
);
|
||||
|
||||
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern MCUSerialBridgeError msb_write_port(
|
||||
IntPtr handle,
|
||||
byte port_index,
|
||||
[In] byte[] src_data,
|
||||
uint src_data_len,
|
||||
uint timeout_ms
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MCU 串口/端口操作托管封装类
|
||||
/// 实现 IDisposable 管理底层句柄生命周期
|
||||
/// </summary>
|
||||
public class MCUSerialBridge : IDisposable
|
||||
{
|
||||
public static uint MaxPortNumber = 16;
|
||||
|
||||
private IntPtr nativeHandle = IntPtr.Zero;
|
||||
|
||||
/// <summary>判断是否已打开</summary>
|
||||
public bool IsOpen => nativeHandle != IntPtr.Zero;
|
||||
|
||||
/// <summary>构造函数,初始化对象</summary>
|
||||
public MCUSerialBridge()
|
||||
{
|
||||
nativeHandle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
/// <summary>析构函数</summary>
|
||||
~MCUSerialBridge()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>显式释放资源</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>内部释放资源方法</summary>
|
||||
/// <param name="disposing">true 表示手动释放,false 表示析构释放</param>
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (nativeHandle != IntPtr.Zero)
|
||||
{
|
||||
MCUSerialBridgeCoreAPI.msb_close(nativeHandle);
|
||||
nativeHandle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>打开串口</summary>
|
||||
/// <param name="portName">串口名,如 "COM3"</param>
|
||||
/// <param name="baud">波特率</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError Open(string portName, uint baud)
|
||||
{
|
||||
return MCUSerialBridgeCoreAPI.msb_open(out nativeHandle, portName, baud);
|
||||
}
|
||||
|
||||
/// <summary>关闭串口</summary>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError Close()
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
MCUSerialBridgeError error = MCUSerialBridgeCoreAPI.msb_close(nativeHandle);
|
||||
nativeHandle = IntPtr.Zero;
|
||||
return error;
|
||||
}
|
||||
|
||||
/// <summary>MCU 复位</summary>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError Reset(uint timeout = 200)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.msb_reset(nativeHandle, timeout);
|
||||
}
|
||||
|
||||
/// <summary>获取固件版本</summary>
|
||||
/// <param name="version">输出版本信息</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError GetVersion(out VersionInfo version, uint timeout = 200)
|
||||
{
|
||||
version = new VersionInfo();
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.msb_version(nativeHandle, out version, timeout);
|
||||
}
|
||||
|
||||
/// <summary>获取 MCU 当前状态</summary>
|
||||
/// <param name="state">输出状态</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError GetState(out MCUState state, uint timeout = 200)
|
||||
{
|
||||
state = new MCUState();
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.mcu_state(nativeHandle, out state, timeout);
|
||||
}
|
||||
|
||||
/// <summary>配置端口</summary>
|
||||
/// <param name="ports">端口集合</param>
|
||||
/// <param name="timeout">超时时间(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError Configure(IEnumerable<PortConfig> ports, uint timeout = 200)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
if (ports == null)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
|
||||
// 转换成数组
|
||||
PortConfig[] portArray = ports as PortConfig[] ?? ports.ToArray();
|
||||
int count = portArray.Length;
|
||||
|
||||
// 分配连续原生内存
|
||||
int structSize = 16; // 每个 PortConfig 固定 16 字节
|
||||
IntPtr nativePorts = Marshal.AllocHGlobal(structSize * count);
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
byte[] bytes = portArray[i].ToBytes();
|
||||
if (bytes.Length != structSize)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
|
||||
Marshal.Copy(bytes, 0, nativePorts + i * structSize, structSize);
|
||||
}
|
||||
|
||||
// 调用底层 API
|
||||
return MCUSerialBridgeCoreAPI.msb_configure(
|
||||
nativeHandle,
|
||||
(uint)count,
|
||||
nativePorts,
|
||||
timeout
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(nativePorts);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>读取输入(4 字节)</summary>
|
||||
/// <param name="inputs">输出数组</param>
|
||||
/// <param name="timeout">超时(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError ReadInput(out byte[] inputs, uint timeout = 100)
|
||||
{
|
||||
inputs = new byte[4];
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.msb_read_input(nativeHandle, inputs, timeout);
|
||||
}
|
||||
|
||||
/// <summary>写输出(4 字节)</summary>
|
||||
/// <param name="outputs">数据数组</param>
|
||||
/// <param name="timeout">超时(ms)</param>
|
||||
/// <returns>错误码</returns>
|
||||
public MCUSerialBridgeError WriteOutput(byte[] outputs, uint timeout = 100)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.msb_write_output(nativeHandle, outputs, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取 Serial 端口的一帧数据。
|
||||
/// Serial 上报的数据按帧入队;本接口每次调用最多读取一帧。
|
||||
/// 注意,如果不及时调用该接口,数据可能会丢失。
|
||||
/// </summary>
|
||||
/// <param name="portIndex">Serial 端口索引</param>
|
||||
/// <param name="buffer">接收到的数据</param>
|
||||
/// <param name="timeout">
|
||||
/// 超时时间(毫秒)
|
||||
/// - 0:不等待,有数据立即返回,没有数据立即返回 MSB_Error_NoData
|
||||
/// - >0:若当前无数据,最多等待 timeout,期间有新帧到达则立即返回
|
||||
/// </param>
|
||||
/// <remarks>
|
||||
/// 如果已经注册回调,本函数将始终返回 MSB_Error_NoData
|
||||
/// </remarks>
|
||||
/// <returns>
|
||||
/// 错误码 MCUSerialBridgeError
|
||||
/// - OK 成功读取一帧
|
||||
/// - NoData 当前无可读数据(仅在 timeout == 0 或等待超时)
|
||||
/// - Win_InvalidParam 参数错误
|
||||
/// </returns>
|
||||
public MCUSerialBridgeError ReadSerial(byte portIndex, out byte[] buffer, uint timeout)
|
||||
{
|
||||
buffer = Array.Empty<byte>();
|
||||
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
const int MAX_PORT_FRAME = 2048;
|
||||
byte[] tmp = new byte[MAX_PORT_FRAME];
|
||||
|
||||
var err = MCUSerialBridgeCoreAPI.msb_read_port(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
tmp,
|
||||
(uint)tmp.Length,
|
||||
out uint outLen,
|
||||
timeout
|
||||
);
|
||||
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
return err;
|
||||
|
||||
buffer = new byte[outLen];
|
||||
Buffer.BlockCopy(tmp, 0, buffer, 0, (int)outLen);
|
||||
|
||||
return MCUSerialBridgeError.OK;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 写 Serial 端口数据。
|
||||
/// 注意:对于单个Serial端口,不支持多线程并行发送,不要在上一条数据没有发送完成之前调用该函数,否则有可能导致数据错误。
|
||||
/// 注意:超时时间一定要大于波特率和数据长度综合得出的帧时间
|
||||
/// </summary>
|
||||
/// <param name="portIndex">Serial 端口索引</param>
|
||||
/// <param name="data">待发送数据</param>
|
||||
/// <param name="timeout">超时时间(毫秒)</param>
|
||||
/// <returns>
|
||||
/// 错误码 MCUSerialBridgeError
|
||||
/// - OK 成功发送
|
||||
/// - 其他错误请查看 MCUSerialBridgeError
|
||||
/// </returns>
|
||||
public MCUSerialBridgeError WriteSerial(byte portIndex, byte[] data, uint timeout)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
if (data == null || data.Length == 0)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
|
||||
return MCUSerialBridgeCoreAPI.msb_write_port(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
data,
|
||||
(uint)data.Length,
|
||||
timeout
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取 CAN 端口的一帧数据。
|
||||
/// CAN 上报的数据按帧入队;本接口每次调用最多读取一帧。
|
||||
/// 注意,如果不及时调用该接口,数据可能会丢失。
|
||||
/// </summary>
|
||||
/// <param name="portIndex">CAN 端口索引</param>
|
||||
/// <param name="message">输出 CAN 消息对象</param>
|
||||
/// <param name="timeout">超时时间(毫秒)</param>
|
||||
/// <remarks>
|
||||
/// 如果已经注册回调,本函数将始终返回 MSB_Error_NoData
|
||||
/// </remarks>
|
||||
/// <returns>
|
||||
/// 错误码 MCUSerialBridgeError
|
||||
/// - OK 成功读取一帧
|
||||
/// - NoData 当前无可读数据(仅在 timeout == 0 或等待超时)
|
||||
/// - Win_InvalidParam 参数错误
|
||||
/// - CAN_DataError CAN数据错误
|
||||
/// - Win_HandleNotFound 句柄无效
|
||||
/// </returns>
|
||||
public MCUSerialBridgeError ReadCAN(byte portIndex, out CANMessage message, uint timeout)
|
||||
{
|
||||
message = null;
|
||||
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
|
||||
const int MAX_FRAME = 16;
|
||||
byte[] tmp = new byte[MAX_FRAME];
|
||||
|
||||
var err = MCUSerialBridgeCoreAPI.msb_read_port(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
tmp,
|
||||
(uint)tmp.Length,
|
||||
out uint outLen,
|
||||
timeout
|
||||
);
|
||||
if (err != MCUSerialBridgeError.OK)
|
||||
return err;
|
||||
|
||||
try
|
||||
{
|
||||
message = CANMessage.FromBytes(tmp, outLen);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return MCUSerialBridgeError.CAN_DataError;
|
||||
}
|
||||
return MCUSerialBridgeError.OK;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 写 CAN 端口数据。
|
||||
/// 注意:CAN 支持多线程发送,最多可同时发送 16 个消息。
|
||||
/// 但是,多个CAN消息会进入排队队列等待发送,如果消息太多,可能引起超时。
|
||||
/// </summary>
|
||||
/// <param name="portIndex">CAN 端口索引</param>
|
||||
/// <param name="message">待发送 CAN 消息对象</param>
|
||||
/// <param name="timeout">超时时间(毫秒),默认 500ms</param>
|
||||
/// <returns>
|
||||
/// 错误码 MCUSerialBridgeError
|
||||
/// - OK 成功发送
|
||||
/// - Win_InvalidParam 参数错误
|
||||
/// - CAN_DataError CAN 数据错误
|
||||
/// - Win_HandleNotFound 句柄无效
|
||||
/// </returns>
|
||||
public MCUSerialBridgeError WriteCAN(byte portIndex, CANMessage message, uint timeout)
|
||||
{
|
||||
if (nativeHandle == IntPtr.Zero)
|
||||
return MCUSerialBridgeError.Win_HandleNotFound;
|
||||
if (message == null)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
try
|
||||
{
|
||||
byte[] buffer = message.ToBytes();
|
||||
return MCUSerialBridgeCoreAPI.msb_write_port(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
buffer,
|
||||
(uint)buffer.Length,
|
||||
timeout
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return MCUSerialBridgeError.CAN_DataError;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Dictionary<
|
||||
byte,
|
||||
MCUSerialBridgeCoreAPI.msb_on_port_data_callback_function_t
|
||||
> _portCallbacks = [];
|
||||
|
||||
/// <summary>
|
||||
/// 注册指定端口(Serial)的回调函数
|
||||
/// </summary>
|
||||
/// <param name="portIndex">端口索引</param>
|
||||
/// <param name="callback">接收数据回调,byte[] 为接收到的原始数据</param>
|
||||
/// <returns>错误码</returns>
|
||||
/// <remarks>
|
||||
/// 注意事项:
|
||||
/// 1. 回调会在底层 C 层线程中直接调用,请**不要在回调内阻塞**,例如等待 I/O 或 Sleep。
|
||||
/// 2. 回调内**不能调用 WriteSerial/WriteCAN 等发送函数**,否则可能导致死锁或丢帧。
|
||||
/// 3. 回调内只能做轻量级操作,例如简单解析、统计或打标记。
|
||||
/// 4. 若需要复杂处理(例如长时间解析、解码、存储数据库等),请**将数据入队到另一个线程**,再在后台处理。
|
||||
/// 5. 数据可能随时到来,请保证回调尽快返回,避免影响后续帧接收。
|
||||
/// 6. 不要把其他类型的端口注册到这个接口,接口不对 portIndex 做类型检查。
|
||||
/// </remarks>
|
||||
public MCUSerialBridgeError RegisterSerialPortCallback(
|
||||
byte portIndex,
|
||||
Action<byte[]> callback
|
||||
)
|
||||
{
|
||||
if (callback == null)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
|
||||
if (portIndex > MaxPortNumber)
|
||||
return MCUSerialBridgeError.Config_PortNumOver;
|
||||
|
||||
// 包装 C# 回调为 P/Invoke 委托
|
||||
void del(IntPtr dst_data, uint dst_data_size, IntPtr user_ctx)
|
||||
{
|
||||
byte[] data = new byte[dst_data_size];
|
||||
Marshal.Copy(dst_data, data, 0, (int)dst_data_size);
|
||||
callback(data);
|
||||
}
|
||||
|
||||
// 保存引用,防止 GC 回收
|
||||
_portCallbacks[portIndex] = del;
|
||||
|
||||
// 调用 C 层注册
|
||||
return MCUSerialBridgeCoreAPI.msb_register_port_data_callback(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
_portCallbacks[portIndex],
|
||||
IntPtr.Zero
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册指定端口(CAN)的回调函数
|
||||
/// </summary>
|
||||
/// <param name="portIndex">端口索引</param>
|
||||
/// <param name="callback">接收数据回调,CANMessage 为接收到的原始数据</param>
|
||||
/// <returns>错误码</returns>
|
||||
/// <remarks>
|
||||
/// 注意事项:
|
||||
/// 1. 回调会在底层 C 层线程中直接调用,请**不要在回调内阻塞**,例如等待 I/O 或 Sleep。
|
||||
/// 2. 回调内**不能调用 WriteSerial/WriteCAN 等发送函数**,否则可能导致死锁或丢帧。
|
||||
/// 3. 回调内只能做轻量级操作,例如简单解析、统计或打标记。
|
||||
/// 4. 若需要复杂处理(例如长时间解析、解码、存储数据库等),请**将数据入队到另一个线程**,再在后台处理。
|
||||
/// 5. 数据可能随时到来,请保证回调尽快返回,避免影响后续帧接收。
|
||||
/// 6. 不要把其他类型的端口注册到这个接口,接口不对 portIndex 做类型检查。
|
||||
/// </remarks>
|
||||
public MCUSerialBridgeError RegisterCANPortCallback(
|
||||
byte portIndex,
|
||||
Action<CANMessage> callback
|
||||
)
|
||||
{
|
||||
if (callback == null)
|
||||
return MCUSerialBridgeError.Win_InvalidParam;
|
||||
|
||||
if (portIndex > MaxPortNumber)
|
||||
return MCUSerialBridgeError.Config_PortNumOver;
|
||||
|
||||
// 包装 C# 回调为 P/Invoke 委托
|
||||
void del(IntPtr dst_data, uint dst_data_size, IntPtr user_ctx)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] data = new byte[dst_data_size];
|
||||
Marshal.Copy(dst_data, data, 0, (int)dst_data_size);
|
||||
CANMessage msg = CANMessage.FromBytes(data, dst_data_size);
|
||||
callback(msg);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 解析失败直接忽略,保证回调不会抛异常阻塞 C 层线程
|
||||
}
|
||||
}
|
||||
|
||||
// 保存引用,防止 GC 回收
|
||||
_portCallbacks[portIndex] = del;
|
||||
|
||||
// 调用 C 层注册
|
||||
return MCUSerialBridgeCoreAPI.msb_register_port_data_callback(
|
||||
nativeHandle,
|
||||
portIndex,
|
||||
_portCallbacks[portIndex],
|
||||
IntPtr.Zero
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
|
||||
namespace MCUSerialBridgeCLR
|
||||
{
|
||||
public enum MCUSerialBridgeError : uint
|
||||
{
|
||||
OK = 0x00000000, // Success
|
||||
NoData = 0x00000001, // Port no new data
|
||||
Win_Unknown = 0x80000001, // Unknown Windows error
|
||||
Win_InvalidParam = 0x80000002, // Invalid parameter
|
||||
Win_AllocFail = 0x80000003, // Memory allocation failed
|
||||
Win_HandleNotFound = 0x80000004, // Handle not found
|
||||
Win_ResourceBusy = 0x80000005, // Resource busy
|
||||
Win_BufferFull = 0x80000006, // Buffer is full
|
||||
Win_UserBufferTooSmall = 0x80000007, // Buffer is too small
|
||||
Win_CannotOpenPort = 0x80000010, // Cannot open port
|
||||
Win_CannotGetCommState = 0x80000011, // Cannot get comm state
|
||||
Win_CannotSetCommState = 0x80000012, // Cannot set comm state
|
||||
Win_CannotCreateThread = 0x80000013, // Cannot create thread
|
||||
Proto_Invalid = 0xE0000001, // Protocol invalid
|
||||
Proto_Checksum = 0xE0000002, // CRC check failed
|
||||
Proto_Timeout = 0xE0000003, // Protocol timeout
|
||||
Proto_FrameTooLong = 0xE0000004, // Frame too long
|
||||
Proto_UnknownCommand = 0xE0000005, // Unknown command
|
||||
Proto_InvalidPayload = 0xE0000006, // Invalid payload
|
||||
State_NotRunning = 0xF0000000, // Not running, configure
|
||||
State_Running = 0xF0000001, // Can not configure, already running
|
||||
Config_PortNumOver = 0xC0000000, // Port number over
|
||||
Config_SerialNumOver = 0xC0000001, // Serial port number over
|
||||
Config_CANNumOver = 0xC0000002, // CAN number over
|
||||
Config_UnknownPortType = 0xC0000010, // Unknown Port Type
|
||||
Serial_OpenFail = 0x01000001, // Serial open failed
|
||||
Serial_NotOpen = 0x01000002, // Serial not open
|
||||
Serial_ReadFail = 0x01000003, // Serial read failed
|
||||
Serial_WriteFail = 0x01000004, // Serial write failed
|
||||
Serial_Busy = 0x01000005, // Serial is busy
|
||||
CAN_DataError = 0x02000000, // CAN data error
|
||||
CAN_SendFail = 0x02000001, // CAN send failed
|
||||
CAN_RecvFail = 0x02000002, // CAN receive failed
|
||||
CAN_BufferFull = 0x02000003, // CAN buffer full
|
||||
CAN_NotInit = 0x02000004, // CAN not initialized
|
||||
Port_WriteBusy = 0x10000001, // Port is busy now
|
||||
MCU_Unknown = 0x00010001, // MCU unknown error
|
||||
MCU_IOSizeError = 0x00010002, // IO Should be 4 bytes
|
||||
MCU_OverTemperature = 0x00010010, // MCU over temperature
|
||||
}
|
||||
|
||||
public static class MCUSerialBridgeErrorExtensions
|
||||
{
|
||||
public static string ToDescription(this MCUSerialBridgeError err)
|
||||
{
|
||||
return err switch
|
||||
{
|
||||
MCUSerialBridgeError.OK => "OK|Success",
|
||||
MCUSerialBridgeError.NoData => "NoData|Port no new data",
|
||||
MCUSerialBridgeError.Win_Unknown => "Win_Unknown|Unknown Windows error",
|
||||
MCUSerialBridgeError.Win_InvalidParam => "Win_InvalidParam|Invalid parameter",
|
||||
MCUSerialBridgeError.Win_AllocFail => "Win_AllocFail|Memory allocation failed",
|
||||
MCUSerialBridgeError.Win_HandleNotFound => "Win_HandleNotFound|Handle not found",
|
||||
MCUSerialBridgeError.Win_ResourceBusy => "Win_ResourceBusy|Resource busy",
|
||||
MCUSerialBridgeError.Win_BufferFull => "Win_BufferFull|Buffer is full",
|
||||
MCUSerialBridgeError.Win_UserBufferTooSmall => "Win_UserBufferTooSmall|Buffer is too small",
|
||||
MCUSerialBridgeError.Win_CannotOpenPort => "Win_CannotOpenPort|Cannot open port",
|
||||
MCUSerialBridgeError.Win_CannotGetCommState => "Win_CannotGetCommState|Cannot get comm state",
|
||||
MCUSerialBridgeError.Win_CannotSetCommState => "Win_CannotSetCommState|Cannot set comm state",
|
||||
MCUSerialBridgeError.Win_CannotCreateThread => "Win_CannotCreateThread|Cannot create thread",
|
||||
MCUSerialBridgeError.Proto_Invalid => "Proto_Invalid|Protocol invalid",
|
||||
MCUSerialBridgeError.Proto_Checksum => "Proto_Checksum|CRC check failed",
|
||||
MCUSerialBridgeError.Proto_Timeout => "Proto_Timeout|Protocol timeout",
|
||||
MCUSerialBridgeError.Proto_FrameTooLong => "Proto_FrameTooLong|Frame too long",
|
||||
MCUSerialBridgeError.Proto_UnknownCommand => "Proto_UnknownCommand|Unknown command",
|
||||
MCUSerialBridgeError.Proto_InvalidPayload => "Proto_InvalidPayload|Invalid payload",
|
||||
MCUSerialBridgeError.State_NotRunning => "State_NotRunning|Not running, configure",
|
||||
MCUSerialBridgeError.State_Running => "State_Running|Can not configure, already running",
|
||||
MCUSerialBridgeError.Config_PortNumOver => "Config_PortNumOver|Port number over",
|
||||
MCUSerialBridgeError.Config_SerialNumOver => "Config_SerialNumOver|Serial port number over",
|
||||
MCUSerialBridgeError.Config_CANNumOver => "Config_CANNumOver|CAN number over",
|
||||
MCUSerialBridgeError.Config_UnknownPortType => "Config_UnknownPortType|Unknown Port Type",
|
||||
MCUSerialBridgeError.Serial_OpenFail => "Serial_OpenFail|Serial open failed",
|
||||
MCUSerialBridgeError.Serial_NotOpen => "Serial_NotOpen|Serial not open",
|
||||
MCUSerialBridgeError.Serial_ReadFail => "Serial_ReadFail|Serial read failed",
|
||||
MCUSerialBridgeError.Serial_WriteFail => "Serial_WriteFail|Serial write failed",
|
||||
MCUSerialBridgeError.Serial_Busy => "Serial_Busy|Serial is busy",
|
||||
MCUSerialBridgeError.CAN_DataError => "CAN_DataError|CAN data error",
|
||||
MCUSerialBridgeError.CAN_SendFail => "CAN_SendFail|CAN send failed",
|
||||
MCUSerialBridgeError.CAN_RecvFail => "CAN_RecvFail|CAN receive failed",
|
||||
MCUSerialBridgeError.CAN_BufferFull => "CAN_BufferFull|CAN buffer full",
|
||||
MCUSerialBridgeError.CAN_NotInit => "CAN_NotInit|CAN not initialized",
|
||||
MCUSerialBridgeError.Port_WriteBusy => "Port_WriteBusy|Port is busy now",
|
||||
MCUSerialBridgeError.MCU_Unknown => "MCU_Unknown|MCU unknown error",
|
||||
MCUSerialBridgeError.MCU_IOSizeError => "MCU_IOSizeError|IO Should be 4 bytes",
|
||||
MCUSerialBridgeError.MCU_OverTemperature => "MCU_OverTemperature|MCU over temperature",
|
||||
_ => "Unknown Error",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</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>
|
||||
</Reference>
|
||||
<Reference Include="FundamentalLib">
|
||||
<HintPath>ref\RefFundamentalLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MedullaCore">
|
||||
<HintPath>ref\RefMedullaCore.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WeaverFiles Include="deps\DiverCompiler.exe" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,233 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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.
@@ -0,0 +1,352 @@
|
||||
{
|
||||
"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.
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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.
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,79 @@
|
||||
#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
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2eac81d674c264ce890b4225c419fa343e662bbba0825694002aaadff6e734b7
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
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.
@@ -0,0 +1 @@
|
||||
7311d51d953d1fc22835d320a3489ce25305e242222f67ae1dd4ce8b482c0a5a
|
||||
@@ -0,0 +1,19 @@
|
||||
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
|
||||
@@ -0,0 +1,6 @@
|
||||
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
@@ -0,0 +1,9 @@
|
||||
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.
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\MedullaAdapter\\MedullaAdapter.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\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\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\VS2022\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Fairyland\\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"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"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, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.308\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<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>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.2</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Fairyland\.nuget\packages\" />
|
||||
<SourceRoot Include="D:\VS2022\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,962 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Fairyland\\.nuget\\packages\\": {},
|
||||
"D:\\VS2022\\Shared\\NuGetPackages": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\@FariyLandTask\\@FRLD-GitProject\\ParkingRobot\\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\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"D:\\VS2022\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Fairyland\\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"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"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, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.308\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "M6NonK0uNRA=",
|
||||
"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"
|
||||
],
|
||||
"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.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user