Ejemplo n.º 1
0
        private void tp_function_TPStatusEvent(object sender, TPEventArgs e)
        {
            //Trackpad Power On
            if (e.Status == 0)
            {
            }

            //Sleep1
            if (e.Status == 1)
            {
                System.Threading.Thread.Sleep(500);

                List <STATE.states> MM_STATES = new List <STATE.states>();

                for (int i = 0; i < Config.MEAS_TIMES; i++)
                {
                    MM_STATES.Add(STATE.states.MM_ReadCurr);
                }
                MM_STATES.Add(STATE.states.MM_CalcSleep1Curr);

                mm_thread.en_queue(MM_STATES);
            }

            //Deep Sleep
            if (e.Status == 2)
            {
                System.Threading.Thread.Sleep(500);

                List <STATE.states> MM_STATES = new List <STATE.states>();

                for (int i = 0; i < Config.MEAS_TIMES; i++)
                {
                    MM_STATES.Add(STATE.states.MM_ReadCurr);
                }
                MM_STATES.Add(STATE.states.MM_CalcDeepSleepCurr);

                mm_thread.en_queue(MM_STATES);
            }

            //Trackpad Power Off
            if (e.Status == 4)
            {
                //mm_thread.en_queue(STATE.states.idle);
            }
        }
Ejemplo n.º 2
0
        private void tp_function_TPStatusEvent(object sender, TPEventArgs e)
        {
            //Trackpad Power On
            if (e.Status == 0)
            {

            }

            //Sleep1
            if (e.Status == 1)
            {
                System.Threading.Thread.Sleep(500);

                List<STATE.states> MM_STATES = new List<STATE.states>();

                for (int i = 0; i < Config.MEAS_TIMES; i++)
                {
                    MM_STATES.Add(STATE.states.MM_ReadCurr);
                }
                MM_STATES.Add(STATE.states.MM_CalcSleep1Curr);

                mm_thread.en_queue(MM_STATES);
            }

            //Deep Sleep
            if (e.Status == 2)
            {
                System.Threading.Thread.Sleep(500);

                List<STATE.states> MM_STATES = new List<STATE.states>();

                for (int i = 0; i < Config.MEAS_TIMES; i++)
                {
                    MM_STATES.Add(STATE.states.MM_ReadCurr);
                }
                MM_STATES.Add(STATE.states.MM_CalcDeepSleepCurr);

                mm_thread.en_queue(MM_STATES);
            }

            //Trackpad Power Off
            if (e.Status == 4)
            {
                //mm_thread.en_queue(STATE.states.idle);
            }
        }