Exemplo n.º 1
0
 public MorseInterpeter(Arduino i_Arduino)
 {
     initOperationsDictionary();
     m_PreviousEyeState = EyeState.Open;
     m_Stopwatch = new Stopwatch();
     m_Arduino = i_Arduino;
 }
Exemplo n.º 2
0
        /* */

        public MainForm(PXCMSession session)
        {
            InitializeComponent();
            InitializeTextBoxes();

            m_faceTextOrganizer = new FaceTextOrganizer();
            m_deviceMenuItem = new ToolStripMenuItem("Device");
            m_moduleMenuItem = new ToolStripMenuItem("Module");
            Session = session;

            CreateResolutionMap();
            PopulateDeviceMenu();
            PopulateModuleMenu();
            PopulateProfileMenu();

            InitializeUserSettings();
            InitializeCheckboxes();
            DisableUnsupportedAlgos();
            RestoreUserSettings();

            FormClosing += MainForm_FormClosing;
            Panel2.Paint += Panel_Paint;

            m_Util = Util.Instance;
            fetchOperations();

            m_Arduino = new Arduino(new ArduinoManager());
            m_CurrentFaceExpression = new Dictionary<PXCMFaceData.ExpressionsData.FaceExpression, int>();
            m_FaceExpressions = new List<ExpressionOperation>();

            morseInterpeter = new MorseInterpeter(m_Arduino);
            
            eyeState = new EyeState(m_Arduino);
         //   eyeState.EyesClosed += EyeState.eyeState_Closed;

//            eyeState.EyesClosed += EyeState.eyeState_Closed;
         //   eyeState.Closed += new EyeState.MyDelegate(EyeState.eyeState_Closed);

//            eyeState.Open += new EyeState.MyDelegate(EyeState.eyeState_Open);

        }
Exemplo n.º 3
0
 /// <summary>
 /// Parse eye state.
 /// </summary>
 /// <param name="i_IsOpen">is eye open</param>
 private void parseEyeState(bool i_IsOpen)
 {
     m_CurrentEyeState = (i_IsOpen) ? EyeState.Open : EyeState.Closed;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Reset all setting to default.
 /// </summary>
 private void reset()
 {
     m_Operation = "";
     m_CurrentEyeState = EyeState.Open;
     m_PreviousEyeState = EyeState.Open;
     m_OperationBuilder = "";
     m_Stopwatch.Reset();
     m_BlinkPrefomed = false;
     m_FlagOne = false;
     m_FlagZero = false;
     m_Arduino.FeedbackSensor.ResetAll();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Check if blink preformed
 /// </summary>
 /// <returns></returns>
 private bool checkBlink()
 {
     //bool toReturn = (!m_CurrentEyeState.Equals(m_PreviousEyeState));
     bool toReturn = (m_CurrentEyeState.Equals(EyeState.Open) && m_PreviousEyeState.Equals(EyeState.Closed));
     m_PreviousEyeState = m_CurrentEyeState;
     return toReturn;
 }