void ldd_evtDataReceive(object sender, MvAssistant.DeviceDrive.WacohForce.WacohForceMessageEventArgs e) { var ea = new IHalForce6AxisEventArgs(); ea.centerForceVector = new HalForce6AxisVector(e.centerForceVector); ea.rawForceVector = new HalForce6AxisVector(e.rawForceVector); this.OnDataReceive(ea); }
void OnDataReceive(WacohForceMessageEventArgs ea) { if (this.evtDataReceive == null) { return; } this.evtDataReceive(this, ea); }
public WacohForceLdd() { this.netNonStopTcpClient.EhDataReceive += (sender, e) => { var ee = e as CtkNonStopTcpStateEventArgs; var msg = ee.TrxMessageBuffer; this.messageReceiver.Receive(msg.Buffer, msg.Offset, msg.Length); this.messageReceiver.AnalysisMessage(); if (this.messageReceiver.Count == 0) { return; } var vec = this.messageReceiver.Dequeue(); if (this.correctionFlag) { this.centerForceVector = vec; lock (this) correctionFlag = false; } var ea = new WacohForceMessageEventArgs(); ea.centerForceVector = this.centerForceVector; ea.rawForceVector = vec; this.OnDataReceive(ea); }; this.netNonStopTcpClient.EhDisconnect += (sender, e) => { this.connectionStatus = WacohForceEnumConnectionStatus.Disconnection; }; this.netNonStopTcpClient.EhFirstConnect += (sender, e) => { this.connectionStatus = WacohForceEnumConnectionStatus.Connected; }; }