Exemplo n.º 1
0
        public ManualDrive(Connection conn)
        {
            InitializeComponent();

            groupKeys.Enabled = false;
            groupMotor1.Enabled = false;
            groupMotor2.Enabled = false;

            try
            {

                _motorControl = new Phidgets.MotorControl();
                _motorControl.Attach += new Phidgets.Events.AttachEventHandler(motorControl_Attach);
                _motorControl.BackEMFUpdate += new Phidgets.Events.BackEMFUpdateEventHandler(motorControl_BackEMFUpdate);
                _motorControl.CurrentChange += new Phidgets.Events.CurrentChangeEventHandler(motorControl_CurrentChange);
                _motorControl.CurrentUpdate += new Phidgets.Events.CurrentUpdateEventHandler(motorControl_CurrentUpdate);
                _motorControl.Detach += new Phidgets.Events.DetachEventHandler(motorControl_Detach);
                _motorControl.EncoderPositionChange += new Phidgets.Events.EncoderPositionChangeEventHandler(motorControl_EncoderPositionChange);
                _motorControl.EncoderPositionUpdate += new Phidgets.Events.EncoderPositionUpdateEventHandler(motorControl_EncoderPositionUpdate);
                _motorControl.Error += new Phidgets.Events.ErrorEventHandler(motorControl_Error);
                _motorControl.InputChange += new Phidgets.Events.InputChangeEventHandler(motorControl_InputChange);
                _motorControl.SensorUpdate += new Phidgets.Events.SensorUpdateEventHandler(motorControl_SensorUpdate);
                _motorControl.ServerConnect += new Phidgets.Events.ServerConnectEventHandler(motorControl_ServerConnect);
                _motorControl.ServerDisconnect += new Phidgets.Events.ServerDisconnectEventHandler(motorControl_ServerDisconnect);
                _motorControl.VelocityChange += new Phidgets.Events.VelocityChangeEventHandler(motorControl_VelocityChange);

                _motorControl.open(conn.Ip, conn.Port, conn.Pass);

            }
            catch
            {
                Fatal_Error();
            }
        }
        public ObstacleAvoidance(Connection conn)
        {
            InitializeComponent();

            try
            {
                interfaceKit = new Phidgets.InterfaceKit();
                interfaceKit.SensorChange += new Phidgets.Events.SensorChangeEventHandler(interfaceKit_SensorChange);
                interfaceKit.open(conn.Ip, conn.Port, conn.Pass);
            }
            catch
            {
            }
        }
Exemplo n.º 3
0
        public Form ExcecutePlugin(string pluginName, ref DataAccess woabotStats, Connection conn)
        {
            foreach (var op in operations)
            {

                if (op.Name == pluginName)
                {
                    try
                    {
                        return op.Excecute(ref woabotStats, conn);
                    }
                    catch (Exception ex)
                    {
                        woabotStats.EventLog.Insert("Plugin Importer", "Error", ex.ToString(), true);
                    }
                }
            }

            return null;
        }
Exemplo n.º 4
0
 public Form Excecute(ref DataAccess woabotStats, Connection conn)
 {
     ObstacleAvoidance t = new ObstacleAvoidance(conn);
     t.OnAllStop += ObstacleAvoidance_OnAllStop;
     return t;
 }
Exemplo n.º 5
0
 public Form Excecute(ref DataAccess woabotStats, Connection conn)
 {
     ManualDrive f = new ManualDrive(conn);
     return f;
 }
Exemplo n.º 6
0
 private Connection GetConnection()
 {
     Connection conn = new Connection();
     conn.Ip = Properties.Settings.Default.Phidget_IP;
     conn.Pass = Properties.Settings.Default.Phidget_Pass;
     conn.Port = Convert.ToInt32(Properties.Settings.Default.Phidget_Port);
     conn.Remote = Properties.Settings.Default.Phidget_Remote;
     return conn;
 }