public MainForm(PXCMSession session) { InitializeComponent(); m_faceTextOrganizer = new FaceTextOrganizer(); m_deviceMenuItem = new ToolStripMenuItem("Device"); m_moduleMenuItem = new ToolStripMenuItem("Module"); Session = session; CreateResolutionMap(); PopulateDeviceMenu(); PopulateModuleMenu(); PopulateProfileMenu(); PopulateUnitMenu(); FormClosing += MainForm_FormClosing; Panel2.Paint += Panel_Paint; yawningTimer = new System.Timers.Timer(); yawningTimer.Elapsed += new ElapsedEventHandler(OnYawnTimedEvent); yawningTimer.Interval = 3000; yawningTimer.Enabled = true; speakTimer = new System.Timers.Timer(); speakTimer.Elapsed += new ElapsedEventHandler(OnSpeakEvent); speakTimer.Interval = 2500; speakTimer.Enabled = true; var thread = new Thread(DoTracking); thread.Start(); eyeCloseTimer = new System.Timers.Timer(); eyeCloseTimer.Elapsed += new ElapsedEventHandler(OnEyeCloseTimedEvent); eyeCloseTimer.Interval = 1000; eyeCloseTimer.Enabled = true; currentPort = new SerialPort(); currentPort.PortName = "COM16"; //Serial port Edison is connected to currentPort.BaudRate = 9600; currentPort.ReadTimeout = 500; currentPort.WriteTimeout = 500; try { currentPort.Open(); } catch(System.IO.IOException ex) { MessageBox.Show("Edison Unit not detected, please set it to COM16."); } }
public MainForm(PXCMSession session) { InitializeComponent(); //皮肤代码 m_faceTextOrganizer = new FaceTextOrganizer(); m_deviceMenuItem = new ToolStripMenuItem("Device"); m_moduleMenuItem = new ToolStripMenuItem("Module"); Session = session; Expression = new FacialExpression(); CreateResolutionMap(); PopulateDeviceMenu(); //PopulateModuleMenu(); PopulateProfileMenu(); InitializeUserSettings(); FormClosing += MainForm_FormClosing; Panel2.Paint += Panel_Paint; this.MaximizeBox = false; }
/* */ 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); }
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; }