public Form1(string[] args) { InitializeComponent(); m_DelegateUpdateStatus = new DelegateUpdateStatus(updateStatusInBox); try { MM_BeginPeriod(1); } catch (Exception E) { Console.WriteLine("Failed to set thread high prio"); } useCombiAdapter = set.UseCombiAdapter; if (args.Length > 0) { if (Convert.ToInt32(args.GetValue(0)) == 1) useCombiAdapter = true; else useCombiAdapter = false; if (args.Length > 1) { if (Convert.ToInt32(args.GetValue(1)) == 1) autoRead = true; else autoRead = false; if (Convert.ToInt32(args.GetValue(1)) == 2) autoWrite = true; else autoWrite = false; } if (args.Length > 2) { fileToProcess = (string)args.GetValue(2); } } //TODO: Expand for ELM327 support // and EasySync support if (useCombiAdapter) { // init combi adapter library canUsbDevice = new LPCCANDevice_T7(); button3.Enabled = false; } else { canUsbDevice = new CANUSBDevice(); kwpCanDevice = new KWPCANDevice(); } }
public Form1(string[] args) { InitializeComponent(); m_DelegateUpdateStatus = new DelegateUpdateStatus(updateStatusInBox); try { MM_BeginPeriod(1); } catch (Exception E) { Console.WriteLine("Failed to set thread high prio"); } useCombiAdapter = set.UseCombiAdapter; if (args.Length > 0) { if (Convert.ToInt32(args.GetValue(0)) == 1) { useCombiAdapter = true; } else { useCombiAdapter = false; } if (args.Length > 1) { if (Convert.ToInt32(args.GetValue(1)) == 1) { autoRead = true; } else { autoRead = false; } if (Convert.ToInt32(args.GetValue(1)) == 2) { autoWrite = true; } else { autoWrite = false; } } if (args.Length > 2) { fileToProcess = (string)args.GetValue(2); } } //TODO: Expand for ELM327 support // and EasySync support if (useCombiAdapter) { // init combi adapter library canUsbDevice = new LPCCANDevice_T7(); button3.Enabled = false; } else { canUsbDevice = new CANUSBDevice(); kwpCanDevice = new KWPCANDevice(); } }