示例#1
0
		public static void AddUSBHidLog(FS2LogItem value)
		{
			if (LogsViewModel.Current != null)
			{
				LogsViewModel.Current.AddLog(value);
			}
		}
示例#2
0
		public void AddLog(FS2LogItem value)
		{
			Dispatcher.Invoke(new Action(() =>
			{
				HidLogs.Insert(0, value);
				if (HidLogs.Count > 1000)
					HidLogs.Remove(HidLogs.Last());
			}));
		}
示例#3
0
		public bool Send(List<byte> bytes, string name, string deviceName, int attemptNo)
		{
			//Trace.WriteLine(DateTime.Now.TimeOfDay.ToString() + " - Send Name = " + name + " - " + attemptNo);
			var fs2LogItem = new FS2LogItem()
			{
				DateTime = DateTime.Now,
				Name = name,
				DeviceName = deviceName,
				AttemptNo = attemptNo
			};
			LogService.AddUSBHidLog(fs2LogItem);
			if (IsDisposed)
				return false;
			UsbHidPort.SpecifiedDevice.SendData(bytes.ToArray());
			return true;
		}