internal Motor(MotorController motorController, MotorState state, int address) { Controller = motorController; State = state; Mbus = Controller.modbus; Address = address; }
//not completely happy with this constructor //public MotorController(Controller controller) public MotorController() { //creation of communication protocals modbus = new Modbus(); //UDPCom = new UDPCom(); //Controller = controller; //Motor States VerticleMotorState = new MotorState(5, 0.00001, 0.00001); TransverseMotorState = new MotorState(15, 1, 0.1); LateralMotorState = new MotorState(5, 1, 0.1); SpindleMotorState = new MotorState(2000, 0, 10); //creating the verticle motor, it communicates over USB RS424 verticalMotor = new VerticalMotor(this); //creating the transverse motor, it communicatates over UDP or Modbus transverseMotor = new TransverseMotor(this); //creating the Lateral motor, it communicatates over UDP or Modbus lateralMotor = new LateralMotor(this); //creating the spindle motor, it communicatates over Modbus spindleMotor = new SpindleMotor(this); }