Exemplo n.º 1
0
        private void PrimaryEZB_OnConnectionChange2(EZB sender, bool isConnected)
        {
            var portType = (Config.ConfigTitles.PortTypeEnum)_cf.STORAGE[Config.ConfigTitles.CONNECTION_TYPE];

            if (portType == ConfigTitles.PortTypeEnum.PC_COM)
            {
                return;
            }

            try {
                if (isConnected)
                {
                    init();
                }
                else
                {
                    if (_robotController != null)
                    {
                        _robotController.Dispose();

                        _robotController = null;
                    }

                    Invokers.SetAppendText(tbLog, true, "Disconnected");
                }
            } catch (Exception ex) {
                Invokers.SetAppendText(tbLog, true, "Connection change: {0}", ex);
            }
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.ezb                = new EZB();
            this.camera             = new Camera(this.ezb);
            this.camera.OnStart    += this.CameraOnOnStart;
            this.camera.OnNewFrame += this.CameraOnOnNewFrame;
            this.camera.OnStop     += this.CameraOnStop;

            this.ezb.OnConnectionChange += this.EzbOnConnectionChange;

            //create event object to avoid sleep/poll check
            this.ezbConnectionStatusChangedWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

            //create event for ezb connection status changes
            this.ezbConnectionStatusChangedWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

            //activate forms timer
            this.OneSecondTimer.Enabled = true;
            this.OneSecondTimer.Start();
        }
Exemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.ezb                = new EZB();
            this.camera             = new Camera(this.ezb);
            this.camera.OnStart    += this.CameraOnOnStart;
            this.camera.OnNewFrame += this.CameraOnOnNewFrame;
            this.camera.OnStop     += this.CameraOnStop;

            this.ezb.OnConnectionChange += this.EzbOnConnectionChange;

            //We leave out this and use Cognitive Services for speech recognition
            //ezb.SpeechSynth.OnPhraseRecognized += SpeechSynth_OnPhraseRecognized;
            //ezb.SpeechSynth.SetDictionaryOfPhrases((new string[] { "Track face", "Are you thirsty", "where is screwdriver", "what do you see" }));

            //create event object to avoid sleep/poll check
            this.ezbConnectionStatusChangedWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

            //create event for ezb connection status changes
            this.ezbConnectionStatusChangedWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

            //activate forms timer
            this.OneSecondTimer.Enabled = true;
            this.OneSecondTimer.Start();

            //Load Settings
            IpAddressTB.Text                       = Settings.Instance.IPAdress;
            EmotionApiKey.Text                     = Settings.Instance.EmotionApiKey;
            FaceApiKey.Text                        = Settings.Instance.FaceApiKey;
            SpeakerRecognitionApiKey.Text          = Settings.Instance.SpeakerRecognitionApiKeyValue;
            LuisEndpointTextBox.Text               = Settings.Instance.LuisEndpoint;
            SpeechApiKeyTextBox.Text               = Settings.Instance.SpeechRecognitionApiKey;
            CustomVisionApiKey_Textbox.Text        = Settings.Instance.VisionApiKey;
            CustomVisionPredictionKey_TextBox.Text = Settings.Instance.PredictionKey;
            CustomVisionProjectID_Textbox.Text     = Settings.Instance.VisionApiProjectId;
            CustomVisionIterationId_Textbox.Text   = Settings.Instance.VisionApiIterationId;

            //Face recognition
            ToggleFaceRecognitionEvent += new EventHandler(ToggleFaceRecognition);
        }
Exemplo n.º 4
0
 protected internal Movement(EZB ezb)
 {
     _ezb = ezb;
 }
Exemplo n.º 5
0
 private EzbController()
 {
     this.ezb = new EZB("MyEzb");
     this.ezb.OnConnectionChange += this.EzbOnConnectionChange;
 }
Exemplo n.º 6
0
 protected internal PWM(EZB ezb)
 {
     _ezb = ezb;
 }
Exemplo n.º 7
0
 protected internal SabertoothSerial(EZB ezb)
 {
     _ezb = ezb;
 }
Exemplo n.º 8
0
 protected internal MP3Trigger(EZB ezb)
 {
     _ezb = ezb;
 }