public EosBoard(EosDirectSerial eosInterface, byte address, string name) { _interface = new WeakReference(eosInterface); _address = address; _name = name; // Send out packet to get info on this board if (eosInterface.Bus != null) { eosInterface.Bus.GetInfo(address); } _outputs.Add(new EosBacklight(this)); }
private void UpdateServo(EosPacket packet) { EosDirectSerial bus = Interface as EosDirectSerial; foreach (EosBoard board in bus.Boards) { foreach (EosServo servo in board.ServoOutputs) { servo.ParseConfigPacket(packet); } foreach (EosStepper stepper in board.StepperOutputs) { stepper.ParseConfigPacket(packet); } } }
protected override void OnInterfaceChanged(Helios.HeliosInterface oldInterface, Helios.HeliosInterface newInterface) { EosDirectSerial oldSerialInterface = oldInterface as EosDirectSerial; if (oldSerialInterface != null) { oldSerialInterface.Bus.ResponseReceived -= Bus_ResponseReceived; } EosDirectSerial serialInterface = newInterface as EosDirectSerial; if (serialInterface != null) { serialInterface.Dispatcher = Dispatcher; serialInterface.ResponseReceived += Bus_ResponseReceived; } }
public EosBoard(EosDirectSerial eosInterface, EosDevice device) : this(eosInterface, device.Address, device.Name) { Device = device; }