void OnDataReady() { UT60EPacket package = new UT60EPacket(current_package_time_stamp, buffer); buffer.Clear(); EventArgs e = new UT60EPackageReceivedEventArgs(package); foreach (EventHandler event_handler in DataReady.GetInvocationList()) { event_handler.BeginInvoke(this, e, null, null); } }
void OnDataReady(object sender, EventArgs e) { UT60EPacket package = (e as UT60EPackageReceivedEventArgs).package; IUT60EData data = package.Parse(); if (data == null) { parse_error_count += 1; } else if (data.Unit == unit) { data_packages.Add(data); } else { data = null; } DataReady.Invoke(this, new UT60EDataReadyEventArgs(data)); }
public UT60EPackageReceivedEventArgs(UT60EPacket package) : base() { this.package = package; }
public UT60EDataParser(UT60EPacket package) { this.package = package; }