public Form1() { testthreads = new Thread[100]; volt = new int[5]; curr = new int[5]; recvcmdbuf = new byte[100][]; analyzer = new HWCommandAnalyzer(); analyzer.SingleQuiryResponse_Received += Analyzer_SingleQuiryResponse_Received; analyzer.RxModeResponse_Received += Analyzer_RxInitResponse_Received; analyzer.ConfigLoadResponse_Received += Analyzer_ConfigLoadResponse_Received; analyzer.ControlError_Received += Analyzer_ControlError_Received; analyzer.ReceivedPower8b_Received += Analyzer_ReceivedPower8b_Received; analyzer.SingleQuiryPowersupplyResponse_Received += Analyzer_SingleQuiryPowersupplyResponse_Received; analyzer.PowersupplyConfigResponse_Received += Analyzer_PowersupplyConfigResponse_Received; cmdwait = new EventWaitHandle[100]; for (int i = 0; i < 100; i++) { cmdwait[i] = new EventWaitHandle(false, EventResetMode.AutoReset); cmdwait[i].Reset(); } SerialPort sp = new SerialPort("COM12", 115200, Parity.None, 8, StopBits.One); sbp = new SerialBusProcessor.SerialBusProcessor(this, 256, sp); sbp.SerialCommandArrival += Sbp_SerialCommandArrial; sbp.SerialDataArrival += Sbp_SerialDataArrival; InitializeComponent(); sbp.OpenSerialBusProcessor(); }
public HW_Rx_Operation(SerialBusProcessor sbp, int channel, byte target) { _sbp = sbp; _channel = channel; _target = target; _sbp.SerialDataArrival += _sbp_SerialDataArrival; _readbuf = new byte[128]; _wr_event = new AutoResetEvent(false); _rd_event = new AutoResetEvent(false); }
public TestProcessor(Control ctrl, SerialBusProcessor sbp) { uictrl = ctrl; serialBusProcessor = sbp; }