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