Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                myConectorHub = new ConnectorHub.ConnectorHub();

                myConectorHub.Init();
                setValuesNames();
                myConectorHub.SendReady();

                myConectorHub.StartRecordingEvent += MyConectorHub_startRecordingEvent;
                myConectorHub.StopRecordingEvent  += MyConectorHub_stopRecordingEvent;
                myFeedbackHub = new ConnectorHub.FeedbackHub();
                myFeedbackHub.Init();
                myFeedbackHub.FeedbackReceivedEvent += MyFeedbackHub_FeedbackReceivedEvent;
            }
            catch (Exception e)
            {
                int x = 1;
            }

            storingAndSending = new Thread(new ThreadStart(storingAndSendingStart));
            storingAndSending.Start();
        }
        public MainWindow()
        {
            InitializeComponent();
            i = 0;
            var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);

            videoSource.NewFrame += VideoSource_NewFrame;
            videoSource.Start();

            initalizeAudioStuff();
            try
            {
                myConnector = new ConnectorHub.ConnectorHub();
                myConnector.Init();
                myConnector.amIvideo = true;
                myConnector.SendReady();


                myConnector.StartRecordingEvent += MyConnector_startRecordingEvent;
                myConnector.StopRecordingEvent  += MyConnector_stopRecordingEvent;
            }
            catch
            {
            }


            this.Closing += MainWindow_Closing;
        }
Ejemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Method to start the connection to the Learning Hub. </summary>
        ///
        /// <remarks>   Jordi Hutjens, 26-10-2018. </remarks>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static void StartConnection()
        {
            myConnector = new ConnectorHub.ConnectorHub();

            MyConnector.init();
            MyConnector.sendReady();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            try
            {
                int i = 0;
                myConnector = new ConnectorHub.ConnectorHub();

                myConnector.Init();
                setValueNames();

                myConnector.StartRecordingEvent += MyConnector_startRecordingEvent;
                myConnector.StopRecordingEvent  += MyConnector_stopRecordingEvent;
            }
            catch
            {
            }

            // setValueNames();
            controller             = new Controller();
            listener               = new SampleListener();
            controller.Connect    += listener.OnServiceConnect;
            controller.Device     += listener.OnConnect;
            controller.FrameReady += listener.OnFrame;



            // Keep this process running until Enter is pressed
            Console.WriteLine("Press Enter to quit...");
            Console.ReadLine();

            // controller.RemoveListener(listener);
            controller.Dispose();
        }
Ejemplo n.º 5
0
 public MyoManager()
 {
     myConnector = new ConnectorHub.ConnectorHub();
     myConnector.init();
     myFeedback = new ConnectorHub.FeedbackHub();
     myFeedback.init();
     myConnector.sendReady();
 }
Ejemplo n.º 6
0
        public MyoViewModel()
        {
            this.TimerStart = DateTime.Now;
            myConnector     = new ConnectorHub.ConnectorHub();
            myFeedback      = new ConnectorHub.FeedbackHub();
            myConnector.init();
            myFeedback.init();
            myConnector.sendReady();
            myConnector.startRecordingEvent  += MyConnector_startRecordingEvent;
            myConnector.stopRecordingEvent   += MyConnector_stopRecordingEvent;
            myFeedback.feedbackReceivedEvent += MyFeedback_feedbackReceivedEvent;

            myoManager.AccelerometerChanged += UpdateAccelerometer;
            myoManager.GyroscopeChanged     += UpdateGyroscope;
            myoManager.OrientationChanged   += UpdateOrientation;
            myoManager.EMGChanged           += UpdateEMG;

            setValueNames();
        }
Ejemplo n.º 7
0
        public MainWindowViewModel()
        {
            mySpeechManager = SpeechManager.Instance;
            myConnectorHub  = new ConnectorHub.ConnectorHub();
            myConnectorHub.Init();
            myConnectorHub.SendReady();

            //VMCollection = new ViewModelBase[]
            //{
            //    expertViewModel, studentViewModel
            //};


            ExpertButtonCommand  = new RelayCommand(() => OnNav("Expert"), false);
            StudentButtonCommand = new RelayCommand(() => OnNav("Student"), false);
            CloseButtonCommand   = new RelayCommand(() => CloseApplication(), false);
            MessengerInstance.Register <string>(this, "DebugMessage", (debug => SetDebugText(debug)));
            CurrentViewModel = this;
        }
Ejemplo n.º 8
0
        public MainWindow()
        {
            InitializeComponent();
            myoManager.InitMyoManagerHub(this);
            try
            {
                myConnector = new ConnectorHub.ConnectorHub();
                myConnector.init();
                myConnector.startRecordingEvent += MyConnector_startRecordingEvent;
                myConnector.stopRecordingEvent  += MyConnector_stopRecordingEvent;
                myConnector.sendReady();
                setValueNames();

                myFeedback = new ConnectorHub.FeedbackHub();
                myFeedback.init();
                myFeedback.feedbackReceivedEvent += MyFeedback_feedbackReceivedEvent;
            }
            catch (Exception e)
            {
            }
        }