示例#1
0
文件: FrameWork.cs 项目: OgcvFnlm/sss
 public override void OnNodeClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Button == MouseButtons.Left && e.Node != null)
     {
         Tree.SelectedNode = e.Node;
         Table.DataSource  = TreeLogic.GetTableSource(e.Node);
         Table.AutoResizeColumns();
     }
     else if (e.Button == MouseButtons.Right && e.Node != null)
     {
         Tree.SelectedNode = e.Node;
         RightMenu.Show(MousePosition);
     }
 }
        void ITestModule.Run()
        {
            // Report
            Report.Log(ReportLevel.Info, "Starting TestCase: " + this.ToString());

            // Open right side menu
            RightMenu.OpenAndCloseRightMenu(true, false);

            // Open New Account Page
            RightMenu.OpenNewAccountPage();

            // Add account details
            RightMenu.AddNewAccountDetails("Test", "500");

            // Report
            Report.Log(ReportLevel.Info, "Ending TestCase: " + this.ToString());
        }
        void ITestModule.Run()
        {
            // Report
            Report.Log(ReportLevel.Info, "Starting TestCase: " + this.ToString());

            // Open right side menu
            RightMenu.OpenAndCloseRightMenu(true, false);

            // Validate right hand side menu options
            RightMenu.ValidateRightHandSideMenuItems();

            // Close right side menu
            RightMenu.OpenAndCloseRightMenu(false, true);

            // Report
            Report.Log(ReportLevel.Info, "Ending TestCase: " + this.ToString());
        }
示例#4
0
    //Poll starts here...
    IEnumerator RunPoll()
    {
        ContentManager content  = ContentManager.Instance;
        CubeSpawner    spawner  = CubeSpawner.Instance;
        SideMenu       sideMenu = SideMenu.Instance;

        CenterScreen centerScreen = CenterScreen.Instance;
        CenterMenu   centerMenu   = CenterMenu.Instance;
        LeftMenu     leftMenu     = LeftMenu.Instance;
        RightMenu    rightMenu    = RightMenu.Instance;

        yield return(new WaitForSeconds(m_pollWindowWaitTime));

        Player.ShowMoveCubeText = true;
        rightMenu.ShowBackground(true);
        centerMenu.ShowBackground(true);
        leftMenu.ShowBackground(true);

        yield return(new WaitForSeconds(1.2f));

        //Set poll question and responses...
        m_pollQuestionCounter = (m_pollQuestionCounter + 1) %
                                content.PollAList.Count;
        m_poll = content.PollAList[m_pollQuestionCounter];
        content.OpenConnection();
        m_answerInfo = (AOrBAnswerInfo)content.GetPollAnswersA(m_poll.Question_Id);
        content.CloseConnection();

        centerScreen.HeaderText.text        = m_poll.Question;
        centerMenu.ActivePollAAnswer.text   = m_poll.Answer_a;
        centerMenu.InactivePollAAnswer.text = m_poll.Answer_a;
        rightMenu.ActivePollAAnswer.text    = m_poll.Answer_b;
        rightMenu.InactivePollAAnswer.text  = m_poll.Answer_b;

        yield return(new WaitForSeconds(m_showPollWaitTime));

        centerScreen.ShowHeader(true);
        centerMenu.ShowPollA(true);
        rightMenu.ShowPollA(true);
        PanelManager.Instance.ClearPanel(1);
        PanelManager.Instance.ClearPanel(2);
        m_yesNoActive = true;

        StartCoroutine(RunPollCountdown());
    }
示例#5
0
 protected override void ctCopy_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     RightMenu.Hide();
     if (e.ClickedItem.Text == "导入数据")
     {
         OpenFileDialog ofd = new OpenFileDialog();
         ofd.Filter = "*.xls|*.xls";
         if (ofd.ShowDialog() == DialogResult.OK)
         {
             string FileName = ofd.FileName;
             MessageBoxHelper.Show(FileName);
         }
     }
     else
     {
         base.ctCopy_ItemClicked(sender, e);
     }
 }
示例#6
0
        private void Get()
        {
            chkNeedShiftKey.Checked     = RightMenu.NeedShiftKey();
            chkFastNeedShiftKey.Checked = RightMenu.NeedShiftKey(RightMenu.FastSetting.True);

            Properties.Settings.Default.Reload();

            txtAutoExtRule.Text      = Properties.Settings.Default.autoExtRule;
            chkAutoExtSwitch.Checked = Properties.Settings.Default.autoExtSwitch;
            txtAutoExtRule.Enabled   = chkAutoExtSwitch.Checked;

            txtQuickPasteExHotkey.Text = Properties.Settings.Default.pasteHotkey;

            txtFileNamePattern.Text = Properties.Settings.Default.fileNamePattern;

            chkAutoSave.Checked        = Properties.Settings.Default.monitorAutoSaveEnabled;
            txtAutoSaveFolderPath.Text = Properties.Settings.Default.monitorAutoSavePath;
        }
示例#7
0
        private void Get()
        {
            chkNeedShiftKey.Checked     = RightMenu.NeedShiftKey();
            chkFastNeedShiftKey.Checked = RightMenu.NeedShiftKey(RightMenu.FastSetting.True);

            Properties.Settings.Default.Reload();

            txtAutoExtRule.Text      = Properties.Settings.Default.autoExtRule;
            chkAutoExtSwitch.Checked = Properties.Settings.Default.autoExtSwitch;
            txtAutoExtRule.Enabled   = chkAutoExtSwitch.Checked;

            txtQuickPasteExHotkey.Text          = Properties.Settings.Default.pasteHotkey;
            chkQuickPasteExHotkeyWinKey.Checked = Properties.Settings.Default.pasteHotkey.Contains("Win");

            // File Name Pattern
            txtFileNamePattern.Text = Properties.Settings.Default.fileNamePattern;

            // Auto Save Path
            chkAutoSave.Checked        = Properties.Settings.Default.monitorAutoSaveEnabled;
            txtAutoSaveFolderPath.Text = Properties.Settings.Default.monitorAutoSavePath;

            // Default Startup Monitor Mode
            chkDefaultStartupMonitorMode.Checked = Properties.Settings.Default.DefaultStartupMonitorModeEnabled;

            // Application Filter
            txtAppFilterInclude.Text = Properties.Settings.Default.ApplicationFilterInclude;
            txtAppFilterExclude.Text = Properties.Settings.Default.ApplicationFilterExclude;
            if (Properties.Settings.Default.ApplicationFilterState == AppFilterStateEnum.Include.ToString())
            {
                radInclude.Checked = true;
                radExclude.Checked = false;
            }
            else
            {
                radInclude.Checked = false;
                radExclude.Checked = true;
            }
        }
示例#8
0
    IEnumerator RunPollCountdown()
    {
        ContentManager   content          = ContentManager.Instance;
        PanelManager     panelManager     = PanelManager.Instance;
        CenterScreen     centerScreen     = CenterScreen.Instance;
        SideMenu         sideMenu         = SideMenu.Instance;
        CenterMenu       centerMenu       = CenterMenu.Instance;
        RightMenu        rightMenu        = RightMenu.Instance;
        LeftMenu         leftMenu         = LeftMenu.Instance;
        LargeCubeCluster largeCubeCluster = LargeCubeCluster.Instance;
        SmallCubeCluster smallCubeCluster = SmallCubeCluster.Instance;
        EqualCubeCluster equalCubeCluster = EqualCubeCluster.Instance;

        float pollCountdown = StartupSettings.Instance.PollCountdown;

        PlayerManager playerManager = PlayerManager.Instance;
        var           activePlayers = playerManager.ActivePlayers;

        yield return(new WaitForSeconds(m_beforeCountdownTime));

        //Wait for show icon above to go away...
        yield return(new WaitForSeconds(1f));

        Player.ShowMoveCubeText   = false;
        Player.CountdownValue     = (int)pollCountdown;
        Player.ShowCountdownValue = true;

        StartCoroutine(Player.RunCountdown(null));
        yield return(new WaitForSeconds(pollCountdown + 1f));

        Player.ShowCountdownValue = false;
        yield return(new WaitForSeconds(1f));

        m_yesNoActive = false;
        rightMenu.ShowActiveNo(false);
        centerMenu.ShowActiveYes(false);
        rightMenu.HideInactiveNo(false);
        centerMenu.HideInactiveYes(false);

        {   //Poll results start here...
            bool leftHasNotChanged  = true;
            bool rightHasNotChanged = true;

            foreach (Player player in playerManager.ActivePlayers)
            {
                if (panelManager.ContainsPlayer(player, 1))      //center panel...
                {
                    leftHasNotChanged     = false;
                    m_answerInfo.answerA += 1;
                }
                else if (panelManager.ContainsPlayer(player, 2))     //right panel...
                {
                    rightHasNotChanged    = false;
                    m_answerInfo.answerB += 1;
                }
            }

            bool largeIsRight = m_answerInfo.answerA < m_answerInfo.answerB;
            bool smallIsRight = m_answerInfo.answerA > m_answerInfo.answerB;

            //Filters players from cube clusters they didn't vote for...
            FilterActivePlayers(largeIsRight, smallIsRight);

            centerScreen.MoveUpHeader(true);
            centerMenu.MoveDownYes(true);
            rightMenu.MoveDownNo(true);

            yield return(new WaitForSeconds(1f));

            CubeCluster.HidePlayerCubes = false;
            Player.ShowColor            = false;

            float total        = m_answerInfo.answerA + m_answerInfo.answerB;
            int   leftPercent  = (int)((m_answerInfo.answerA / total) * 100);
            int   rightPercent = (int)((m_answerInfo.answerB / total) * 100);

            centerMenu.StartPollAPercentCountdown(m_percentCountdownTime, leftPercent);
            rightMenu.StartPollAPercentCountdown(m_percentCountdownTime, rightPercent);

            largeCubeCluster.InstantShowCluster();
            smallCubeCluster.InstantShowCluster();
            equalCubeCluster.InstantShowCluster();

            if (largeIsRight)
            {
                centerMenu.ShowSmallResults(true);
                rightMenu.ShowLargeResults(true);
            }
            else if (smallIsRight)
            {
                centerMenu.ShowLargeResults(true);
                rightMenu.ShowSmallResults(true);
            }
            else    //They are equal...
            {
                rightMenu.ShowLargeResults(true);
                centerMenu.ShowEqualResults(true);
            }

            yield return(new WaitForSeconds(m_percentCountdownTime));

            yield return(new WaitForSeconds(2f));

            if (leftHasNotChanged)
            {
                centerMenu.HideLargePercent(true);
                centerMenu.HideSmallPercent(true);

                if (largeIsRight)
                {
                    smallCubeCluster.Explode();
                }
                else if (smallIsRight)
                {
                    largeCubeCluster.Explode();
                }
                else
                {
                    equalCubeCluster.Explode();
                }
            }
            if (rightHasNotChanged)
            {
                rightMenu.HideLargePercent(true);
                rightMenu.HideSmallPercent(true);

                if (largeIsRight)
                {
                    largeCubeCluster.Explode();
                }
                else if (smallIsRight)
                {
                    smallCubeCluster.Explode();
                }
                else
                {
                    largeCubeCluster.Explode();
                }
            }

            yield return(new WaitForSeconds(StartupSettings.Instance.AfterPollATimeout));

            centerMenu.ShowLargeResults(false);
            centerMenu.ShowSmallResults(false);
            centerMenu.ShowEqualResults(false);
            rightMenu.ShowLargeResults(false);
            rightMenu.ShowSmallResults(false);
            rightMenu.ShowEqualResults(false);

            //Updating poll answers and starting takeaway...
            content.OpenConnection();
            content.PutPollAnswers(m_answerInfo);
            PollManager.Instance.StartTakeaway(m_poll.Question_Id);
            content.CloseConnection();

            yield return(new WaitForSeconds(2f));

            centerMenu.HideLargePercent(false);
            rightMenu.HideLargePercent(false);
            centerMenu.HideSmallPercent(false);
            rightMenu.HideSmallPercent(false);

            largeCubeCluster.DestroyCluster();
            largeCubeCluster.CreateCluster();
            smallCubeCluster.DestroyCluster();
            smallCubeCluster.CreateCluster();
            equalCubeCluster.DestroyCluster();
            equalCubeCluster.CreateCluster();

            //Cleanup...
            largeCubeCluster.FilteredPlayers.Clear();
            smallCubeCluster.FilteredPlayers.Clear();
            equalCubeCluster.FilteredPlayers.Clear();
        }

        //Cleanup...
        Player.ShowColor          = false;
        Player.ShowInactiveColor  = true;
        Player.ShowCountdownValue = false;
        Player.ShowMoveIcon       = true;
        StartCoroutine(Player.ShowHashtagOverTime(m_hashtagShowTime));

        sideMenu.ShowBackground(false);
        rightMenu.ShowBackground(false);
        centerMenu.ShowBackground(false);
        leftMenu.ShowBackground(false);
        centerScreen.ShowHeader(false);
        centerMenu.ShowPollA(false);
        rightMenu.ShowPollA(false);

        //Wait some time for animations above to take effect...
        yield return(new WaitForSeconds(1.5f));

        centerScreen.ResetHeader();
        centerMenu.ResetYesAnimator();
        rightMenu.ResetNoAnimator();

        yield return(new WaitForSeconds(1.5f));

        //Allow streaming cubes to start streaming in again...
        //TODO: Should be AppState.TAKE_AWAY...
        AppManager.State = AppManager.AppState.ATTRACT_CUBES;
        PanelManager.Instance.ClearAllPanels();
    }
示例#9
0
 private void btnFastUnRegister_Click(object sender, EventArgs e)
 {
     RightMenu.Delete(RightMenu.FastSetting.True);
 }
示例#10
0
 private void btnFastRegister_Click(object sender, EventArgs e)
 {
     RightMenu.ShiftSetting shift = chkFastNeedShiftKey.Checked ? RightMenu.ShiftSetting.True : RightMenu.ShiftSetting.False;
     RightMenu.Add(shift, RightMenu.FastSetting.True);
 }
示例#11
0
 private void btnUnRegister_Click(object sender, EventArgs e)
 {
     RightMenu.Delete();
 }
示例#12
0
    IEnumerator RunPollCountdown()
    {
        ContentManager content       = ContentManager.Instance;
        CenterScreen   centerScreen  = CenterScreen.Instance;
        SideMenu       sideMenu      = SideMenu.Instance;
        CenterMenu     centerMenu    = CenterMenu.Instance;
        RightMenu      rightMenu     = RightMenu.Instance;
        LeftMenu       leftMenu      = LeftMenu.Instance;
        BarGraph       barGraph      = BarGraph.Instance;
        PlayerManager  playerManager = PlayerManager.Instance;

        float pollCountdown = StartupSettings.Instance.PollCountdown;

        GraphAnswerInfo answerInfo    = null;
        var             poll          = content.PollBList[m_pollQuestionCounter];
        var             activePlayers = playerManager.ActivePlayers;

        yield return(new WaitForSeconds(m_beforeCountdownTime));

        Player.CheckRange = true;

        //Wait for show icon above to go away...
        yield return(new WaitForSeconds(1f));

        Player.ShowMoveCubeText   = false;
        Player.CountdownValue     = (int)pollCountdown;
        Player.ShowCountdownValue = true;

        StartCoroutine(Player.RunCountdown(null));

        yield return(new WaitForSeconds(pollCountdown + 1f));

        Player.ShowCountdownValue = false;
        Player.CheckRange         = false;

        yield return(new WaitForSeconds(1f));

        centerScreen.MoveUpHeader(true);
        centerScreen.HideRangeBar(true);
        centerScreen.ShowBarGraph(true);

        //Wait some time before showing bar graph...
        yield return(new WaitForSeconds(1f));

        //Bar graph stuff...
        {
            content.OpenConnection();

            answerInfo = (GraphAnswerInfo)content.GetPollAnswersB(poll.Question_Id);
            content.CloseConnection();

            //Setting data and showing bar graph...
            int highestNum = 0;
            foreach (int num in answerInfo.numbers)
            {
                if (num > highestNum)
                {
                    highestNum = num;
                }
            }

            float multipler       = highestNum > 0f ? 10f / highestNum : 0f;
            int   numVotesPerCube = (int)Mathf.Ceil(highestNum / 10f);

            for (int i = 0, count = answerInfo.numbers.Count; i < count; ++i)
            {
                int num = highestNum > 10 ? (int)Mathf.Ceil(answerInfo.numbers[i] /
                                                            ((float)(numVotesPerCube))) :
                          (int)Mathf.Round(answerInfo.numbers[i] * multipler);
                barGraph.SetNumberRows(i, num);
            }

            barGraph.ShowTable(true);

            //Adding player cubes to bar graph...
            yield return(new WaitForSeconds(3f));

            foreach (Player player in activePlayers)
            {
                float range = 0f;
                if (centerScreen.InRangeOfRangeBar(
                        player.transform.position, ref range))
                {
                    int        index = (int)(answerInfo.numbers.Count * range);
                    GameObject cube  = barGraph.AddCubeToRow(index);
                    barGraph.ShowCube(cube, player.ActiveColor);
                    ++answerInfo.numbers[index];

                    Player.ShowColor = false;
                }
            }
        }

        //Wait some time before cleaning up bar graph...
        yield return(new WaitForSeconds(
                         StartupSettings.Instance.AfterPollBTimeout));

        barGraph.HideTable();

        //Wait some time for animation above to take effect...
        yield return(new WaitForSeconds(2f));

        content.OpenConnection();
        content.PutPollAnswers(answerInfo);
        PollManager.Instance.StartTakeaway(poll.Question_Id);
        content.CloseConnection();

        yield return(new WaitForSeconds(1f));

        //Cleanup...
        Player.ShowColor          = false;
        Player.ShowInactiveColor  = true;
        Player.ShowCountdownValue = false;
        Player.ShowMoveIcon       = true;
        StartCoroutine(Player.ShowHashtagOverTime(m_hashtagShowTime));

        sideMenu.ShowBackground(false);
        rightMenu.ShowBackground(false);
        centerMenu.ShowBackground(false);
        leftMenu.ShowBackground(false);
        centerScreen.ShowHeader(false);
        centerScreen.ShowPollB(false);

        //Wait some time for animations above to take effect...
        yield return(new WaitForSeconds(2f));

        centerScreen.ResetHeader();
        centerScreen.HideRangeBar(false);
        centerScreen.ShowBarGraph(false);

        //Puts app back in ambient mode...
        AppManager.State = AppManager.AppState.ATTRACT_CUBES;
        PanelManager.Instance.ClearAllPanels();
    }
示例#13
0
        private void OnGUI()
        {
            if (showValues)
            {
                Rect rect = new Rect(0, 0, 400, 30);
                GUILayout.BeginHorizontal();
                GUILayout.BeginVertical();
                ////
                GUILayout.TextArea(LeftMenuDown.ToString());
                GUILayout.TextArea(LeftMenu.ToString());
                GUILayout.TextArea(LeftMenuUp.ToString());

                GUILayout.TextArea(LeftPadPressDown.ToString());
                GUILayout.TextArea(LeftPadPress.ToString());
                GUILayout.TextArea(LeftPadPressUp.ToString());

                GUILayout.TextArea(LeftPadTouchDown.ToString());
                GUILayout.TextArea(LeftPadTouch.ToString());
                GUILayout.TextArea(LeftPadTouchUp.ToString());

                GUILayout.TextArea(LeftTouchPad.x.ToString("F2") + " " + LeftTouchPad.y.ToString("F2"));

                GUILayout.TextArea(LeftTriggerMagnitude.ToString("F2"));

                GUILayout.TextArea(LeftTriggerDown.ToString());
                GUILayout.TextArea(LeftTrigger.ToString());
                GUILayout.TextArea(LeftTriggerUp.ToString());

                GUILayout.TextArea(LeftGripDown.ToString());
                GUILayout.TextArea(LeftGrip.ToString());
                GUILayout.TextArea(LeftGripUp.ToString());

                GUILayout.EndVertical();
                GUILayout.BeginVertical();
                ////
                GUILayout.TextArea(RightMenuDown.ToString());
                GUILayout.TextArea(RightMenu.ToString());
                GUILayout.TextArea(RightMenuUp.ToString());

                GUILayout.TextArea(RightPadPressDown.ToString());
                GUILayout.TextArea(RightPadPress.ToString());
                GUILayout.TextArea(RightPadPressUp.ToString());

                GUILayout.TextArea(RightPadTouchDown.ToString());
                GUILayout.TextArea(RightPadTouch.ToString());
                GUILayout.TextArea(RightPadTouchUp.ToString());

                GUILayout.TextArea(RightTouchPad.x.ToString("F2") + " " + RightTouchPad.y.ToString("F2"));

                GUILayout.TextArea(RightTriggerMagnitude.ToString("F2"));

                GUILayout.TextArea(RightTriggerDown.ToString());
                GUILayout.TextArea(RightTrigger.ToString());
                GUILayout.TextArea(RightTriggerUp.ToString());

                GUILayout.TextArea(RightGripDown.ToString());
                GUILayout.TextArea(RightGrip.ToString());
                GUILayout.TextArea(RightGripUp.ToString());

                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
            }
        }