From f02e336f3417f55ca83f51d281fc202610d80ebc Mon Sep 17 00:00:00 2001 From: Tyrone CT Date: Wed, 26 Feb 2025 16:16:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88Cmd=E7=9A=84console=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=B6=88=E6=81=AF=E5=92=8C=E8=BF=90=E8=A1=8C?= =?UTF-8?q?cmd=E7=AA=97=E5=8F=A3=E5=BC=B9=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CapMachine.Wpf/CanDrive/ToomossCan.cs | 28 +++++++++++++-------------- CapMachine.Wpf/CapMachine.Wpf.csproj | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CapMachine.Wpf/CanDrive/ToomossCan.cs b/CapMachine.Wpf/CanDrive/ToomossCan.cs index 29f9e07..6ea2ef9 100644 --- a/CapMachine.Wpf/CanDrive/ToomossCan.cs +++ b/CapMachine.Wpf/CanDrive/ToomossCan.cs @@ -350,19 +350,19 @@ namespace CapMachine.Wpf.CanDrive { StringBuilder MsgName = new StringBuilder(32); CAN_DBCParser.DBC_GetMsgName(DBCHandle, i, MsgName); - Console.WriteLine("Msg.Name = {0}", MsgName); + //Console.WriteLine("Msg.Name = {0}", MsgName); int DBCSigNum = CAN_DBCParser.DBC_GetMsgSignalQuantity(DBCHandle, MsgName); StringBuilder Publisher = new StringBuilder(32); CAN_DBCParser.DBC_GetMsgPublisher(DBCHandle, MsgName, Publisher); long MsgId; MsgId = CAN_DBCParser.DBC_GetMsgIDByName(DBCHandle, MsgName); - Console.Write("Signals:"); + //Console.Write("Signals:"); for (int j = 0; j < DBCSigNum; j++) { StringBuilder SigName = new StringBuilder(32); CAN_DBCParser.DBC_GetMsgSignalName(DBCHandle, MsgName, j, SigName); - Console.Write("{0} ", SigName); + //Console.Write("{0} ", SigName); //增加信息数据 ListCanDbcModel.Add(new CanDbcModel() @@ -376,7 +376,7 @@ namespace CapMachine.Wpf.CanDrive Publisher = Publisher.ToString() }); } - Console.WriteLine(""); + //Console.WriteLine(""); } //Dbc解析成功 @@ -426,11 +426,11 @@ namespace CapMachine.Wpf.CanDrive int SendedNum = USB2CAN.CAN_SendMsg(DevHandle, WriteCANIndex, CanMsg, (uint)CanMsg.Length); if (SendedNum >= 0) { - Console.WriteLine("Success send frames:{0}", SendedNum); + //Console.WriteLine("Success send frames:{0}", SendedNum); } else { - Console.WriteLine("Send CAN data failed! {0}", SendedNum); + //Console.WriteLine("Send CAN data failed! {0}", SendedNum); } } @@ -527,11 +527,11 @@ namespace CapMachine.Wpf.CanDrive int SendedNum = USB2CAN.CAN_SendMsg(DevHandle, WriteCANIndex, CanMsg, (uint)CanMsg.Length); if (SendedNum >= 0) { - Console.WriteLine("Success send frames:{0}", SendedNum); + //Console.WriteLine("Success send frames:{0}", SendedNum); } else { - Console.WriteLine("Send CAN data failed! {0}", SendedNum); + //Console.WriteLine("Send CAN data failed! {0}", SendedNum); } } catch (Exception ex) @@ -568,14 +568,14 @@ namespace CapMachine.Wpf.CanDrive //CanMsgBuffer[i] = (USB2CAN.CAN_MSG)Marshal.PtrToStructure((IntPtr)((UInt32)msgPtRead + i * Marshal.SizeOf(typeof(USB2CAN.CAN_MSG))), typeof(USB2CAN.CAN_MSG)); //有溢出报错 CanMsgBuffer[i] = (USB2CAN.CAN_MSG)Marshal.PtrToStructure((IntPtr)(msgPtRead + i * Marshal.SizeOf(typeof(USB2CAN.CAN_MSG))), typeof(USB2CAN.CAN_MSG)); - Console.WriteLine("CanMsg[{0}].ID = 0x{1}", i, CanMsgBuffer[i].ID.ToString("X8")); - Console.WriteLine("CanMsg[{0}].TimeStamp = {1}", i, CanMsgBuffer[i].TimeStamp); - Console.Write("CanMsg[{0}].Data = ", i); + //Console.WriteLine("CanMsg[{0}].ID = 0x{1}", i, CanMsgBuffer[i].ID.ToString("X8")); + //Console.WriteLine("CanMsg[{0}].TimeStamp = {1}", i, CanMsgBuffer[i].TimeStamp); + //Console.Write("CanMsg[{0}].Data = ", i); for (int j = 0; j < CanMsgBuffer[i].DataLen; j++) { Console.Write("{0} ", CanMsgBuffer[i].Data[j].ToString("X2")); } - Console.WriteLine(""); + //Console.WriteLine(""); //报文给高速记录的服务 HighSpeedDataService.AppendOrUpdateMsg(new Models.HighSpeed.CommMsg() @@ -589,11 +589,11 @@ namespace CapMachine.Wpf.CanDrive } else if (CanNum == 0) { - Console.WriteLine("No CAN data!"); + //Console.WriteLine("No CAN data!"); } else { - Console.WriteLine("Get CAN data error!"); + //Console.WriteLine("Get CAN data error!"); } Console.WriteLine(""); diff --git a/CapMachine.Wpf/CapMachine.Wpf.csproj b/CapMachine.Wpf/CapMachine.Wpf.csproj index 9aeae28..61f16c6 100644 --- a/CapMachine.Wpf/CapMachine.Wpf.csproj +++ b/CapMachine.Wpf/CapMachine.Wpf.csproj @@ -1,7 +1,7 @@  - Exe + WinExe net6.0-windows enable enable