private void SerialMessages_MessageReceived(object sender, Messages.MESSAGE_IDS msgId, object value) { switch (msgId) { case Messages.MESSAGE_IDS.PARAM_KP: UpdateParameters("Kp", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_KI: UpdateParameters("Ki", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_KD: UpdateParameters("Kd", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_CURRENT: UpdateParameters("Current", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_STEPSIZE: UpdateParameters("Step Size", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_ENDIR: UpdateParameters("EN Pin", value.ToString()); break; case Messages.MESSAGE_IDS.PARAM_MOTORDIR: UpdateParameters("Motor Direction", value.ToString()); break; case Messages.MESSAGE_IDS.VALUE_ANGLE: { UpdateValues("angle", (float)value); break; } case Messages.MESSAGE_IDS.VALUE_ANGLE_ERR: { UpdateValues("angleErr", (float)value); break; } } }
private void SerialMessages_MessageReceived1(object sender, Messages.MESSAGE_IDS msgId, object value) { switch (msgId) { case Messages.MESSAGE_IDS.VALUE_ANGLE_ERR: { float angError = (float)value; var span = pidAutotuneClass.AddAngleError(angError); } break; case Messages.MESSAGE_IDS.VALUE_ANGLE: { float ang = (float)value; var span = pidAutotuneClass.AddAngle(ang); } break; } }
public void NotifyNewMessageReceived(Messages.MESSAGE_IDS id, object data) { MessageReceived?.Invoke(this, id, data); }