コード例 #1
0
        public RunWnd()
        {
            InitializeComponent();
            task = new TaskMachine();
            task.StatusChanged += new StrEventHandler(UpdateStatusBar);
            lastcalls           = new Queue <string>();
            uiTimer             = new System.Windows.Forms.Timer();
            uiTimer.Tick       += new EventHandler(uiTimer_Tick);
            uiTimer.Interval    = 300; //250ms for UI update
            uiTimer.Enabled     = true;;

            rxDisplay1.Click += new EventHandler(rx_display_Click);
            rxDisplay2.Click += new EventHandler(rx_display_Click);
            rxDisplay3.Click += new EventHandler(rx_display_Click);
            rxDisplay4.Click += new EventHandler(rx_display_Click);



            statusBar1.Top               = win_height - bar_height;
            statusBar1.Left              = 0;
            statusBar1.Size              = new Size(win_width, bar_height);
            statusBar1.Width             = win_width;
            statusBar1.Height            = bar_height;
            statusBar1.MenuClick        += new EventHandler(statusBar1_MenuClick);
            statusBar1.StartStopClick   += new EventHandler(statusBar1_StartStopClick);
            statusBar1.PauseResumeClick += new EventHandler(statusBar1_PauseResumeClick);
            ArrangeWnd();
            rxDisplay1.ReDraw(true);
            this.Load += new EventHandler(RunWnd_Load);
        }
コード例 #2
0
        public RunWnd()
        {
            InitializeComponent();
            task = new TaskMachine();
            task.StatusChanged += new StrEventHandler(UpdateStatusBar);
            lastcalls           = new Queue <string>();
            uiTimer             = new System.Windows.Forms.Timer();
            uiTimer.Tick       += new EventHandler(uiTimer_Tick);
            uiTimer.Interval    = 250; //250ms for UI update
            uiTimer.Enabled     = true;;

            rxDisplay1.Click += new EventHandler(rx_display_Click);
            rxDisplay2.Click += new EventHandler(rx_display_Click);
            rxDisplay3.Click += new EventHandler(rx_display_Click);
            rxDisplay4.Click += new EventHandler(rx_display_Click);

            SetGridStyle();

            //dataGrid2.DataSource = Program.data.dt;
            dataGrid2.Click += new EventHandler(dataGrid2_Click);

            graphPane2.XAxisTicCount = 10;
            graphPane2.YAxisTicCount = 4;
            graphPane2.YAxisMax      = 5;
            graphPane2.YAxisMin      = -5;
            graphPane2.YAxisTitle    = "PPM";
            graphPane2.XAxisTicCount = 10;

            /*
             * for (int j = 0; j < 25;j++ )
             *  AddValue(j+1, 100152.34-j);
             * ThrowData();
             */
            graphPane2.Invalidate();


            statusBar1.Top               = win_height - bar_height;
            statusBar1.Left              = 0;
            statusBar1.Size              = new Size(win_width, bar_height);
            statusBar1.Width             = win_width;
            statusBar1.Height            = bar_height;
            statusBar1.MenuClick        += new EventHandler(statusBar1_MenuClick);
            statusBar1.StartStopClick   += new EventHandler(statusBar1_StartStopClick);
            statusBar1.PauseResumeClick += new EventHandler(statusBar1_PauseResumeClick);
            ArrangeWnd();
            this.Load += new EventHandler(RunWnd_Load);
        }
コード例 #3
0
        public RunWnd()
        {
            InitializeComponent();

            runstate            = new RunState();
            task                = new TaskMachine();
            task.StatusChanged += new StrEventHandler(UpdateStatusBar);
            uiTimer             = new System.Windows.Forms.Timer();
            uiTimer.Tick       += new EventHandler(uiTimer_Tick);
            uiTimer.Interval    = 250; //250ms for UI update
            uiTimer.Enabled     = true;;

            #region set status bar style
            SetButtonType(btn_aux1, StringResource.str("val_" + aux1_mode.ToString().ToLower()));
            SetButtonType(btn_aux2, StringResource.str("val_" + aux2_mode.ToString().ToLower()));
            SetButtonType(btn_bigdisp, StringResource.str("val_" + bigdisp_mode.ToString().ToLower()));
            btn_menu.Enabled = true;
            SetButtonType(btn_menu, "menu");
            btn_menu.ValidClick += new EventHandler((o, e) => {
                if (task.bRunning || task.bPaused)
                {
                    statusBar1_PauseResumeClick(o, e);
                }
                else
                {
                    Program.SwitchWindow("mainconfig");
                }
            });

            btn_dispchan.Enabled = true;
            SetButtonType(btn_dispchan, "CH1");
            graphPane2.channels      = new string[] { "1" };
            btn_dispchan.ValidClick += new EventHandler((o, e) => {
                if (StringResource.str("lst_rxchan").Trim(new char[] { '|' }).IndexOf('|') > 0)
                {
                    ChoiceWnd.Init(StringResource.str("choose") + StringResource.str("channel"),
                                   "dispchan",
                                   StringResource.str("lst_rxchan").Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries),
                                   -1,
                                   null,
                                   KbdData);
                }
            });

            btn_dispmode.Enabled = true;
            SetButtonType(btn_dispmode, StringResource.str("disp_graph"));
            btn_dispmode.ValidClick += new EventHandler((o, e) =>
            {
                if (Program.sysinfo.iDispMode == RXDISP_MODE.GRID)
                {
                    Program.sysinfo.iDispMode = RXDISP_MODE.GRAPH;
                }
                else
                {
                    Program.sysinfo.iDispMode = RXDISP_MODE.GRID;
                }
                btn_dispmode.Invalidate();
                ReDraw(true);
            });
            #endregion
            bt_run.Text   = StringResource.str("start");
            bt_run.Click += new EventHandler((o, e) =>
            {
                statusBar1_StartStopClick(o, e);
            });


            SetGridStyle();

            AddValue("1", 1, 1.000000, 0, 0);
            AddValue("1", 2, 1.000002, 0, 0);
            AddValue("1", 3, 1.000001, 0, 0);
            PointPair.datamode = RXDATA_MODE.RX;
            graphPane2.Invalidate();

            this.Load += new EventHandler(RunWnd_Load);
        }
コード例 #4
0
ファイル: RunWnd.cs プロジェクト: imdmmp/kpgweigher
        public RunWnd()
        {
            InitializeComponent();
            task = new TaskMachine();
            task.StatusChanged += new StrEventHandler(UpdateStatusBar);
            lastcalls = new Queue<string>();
            uiTimer = new System.Windows.Forms.Timer();
            uiTimer.Tick += new EventHandler(uiTimer_Tick);
            uiTimer.Interval = 300; //250ms for UI update
            uiTimer.Enabled = true; ;

            rxDisplay1.Click += new EventHandler(rx_display_Click);
            rxDisplay2.Click += new EventHandler(rx_display_Click);
            rxDisplay3.Click += new EventHandler(rx_display_Click);
            rxDisplay4.Click += new EventHandler(rx_display_Click);

            
            
            statusBar1.Top = win_height - bar_height;
            statusBar1.Left = 0;
            statusBar1.Size = new Size(win_width,bar_height);
            statusBar1.Width = win_width;
            statusBar1.Height = bar_height;
            statusBar1.MenuClick += new EventHandler(statusBar1_MenuClick);
            statusBar1.StartStopClick += new EventHandler(statusBar1_StartStopClick);
            statusBar1.PauseResumeClick += new EventHandler(statusBar1_PauseResumeClick);
            ArrangeWnd();
            rxDisplay1.ReDraw(true);
            this.Load += new EventHandler(RunWnd_Load);
        }
コード例 #5
0
ファイル: RunWnd.cs プロジェクト: imdmmp/kpgweigher
        public RunWnd()
        {
            InitializeComponent();

            runstate = new RunState();
            task = new TaskMachine();
            task.StatusChanged += new StrEventHandler(UpdateStatusBar);
            uiTimer = new System.Windows.Forms.Timer();
            uiTimer.Tick += new EventHandler(uiTimer_Tick);
            uiTimer.Interval = 250; //250ms for UI update
            uiTimer.Enabled = true; ;

            #region set status bar style
            SetButtonType(btn_aux1,    StringResource.str("val_" + aux1_mode.ToString().ToLower()));
            SetButtonType(btn_aux2,    StringResource.str("val_" + aux2_mode.ToString().ToLower()));
            SetButtonType(btn_bigdisp, StringResource.str("val_" + bigdisp_mode.ToString().ToLower()));
            btn_menu.Enabled = true;
            SetButtonType(btn_menu, "menu");
            btn_menu.ValidClick += new EventHandler((o,e) =>{
                if (task.bRunning || task.bPaused)
                {
                    statusBar1_PauseResumeClick(o, e);
                }
                else
                {
                    Program.SwitchWindow("mainconfig");
                }
            });

            btn_dispchan.Enabled = true;
            SetButtonType(btn_dispchan, "CH1");
            graphPane2.channels = new string[] { "1" };
            btn_dispchan.ValidClick +=new EventHandler((o,e)=>{
                if (StringResource.str("lst_rxchan").Trim(new char[] { '|' }).IndexOf('|') >0)
                {
                    ChoiceWnd.Init(StringResource.str("choose") + StringResource.str("channel"),
                        "dispchan",
                        StringResource.str("lst_rxchan").Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries),
                        -1,
                        null,
                        KbdData);
                }
            });

            btn_dispmode.Enabled = true;
            SetButtonType(btn_dispmode, StringResource.str("disp_graph"));
            btn_dispmode.ValidClick += new EventHandler((o, e) =>
            {
                if (Program.sysinfo.iDispMode == RXDISP_MODE.GRID)
                    Program.sysinfo.iDispMode = RXDISP_MODE.GRAPH;
                else
                    Program.sysinfo.iDispMode = RXDISP_MODE.GRID;
                btn_dispmode.Invalidate();
                ReDraw(true);
            });
            #endregion
            bt_run.Text = StringResource.str("start");
            bt_run.Click += new EventHandler((o, e) =>
            {
                statusBar1_StartStopClick(o, e);
            });


            SetGridStyle();

            AddValue("1", 1, 1.000000, 0, 0);
            AddValue("1", 2, 1.000002, 0, 0);
            AddValue("1", 3, 1.000001, 0, 0);
            PointPair.datamode = RXDATA_MODE.RX;
            graphPane2.Invalidate();
            
            this.Load += new EventHandler(RunWnd_Load);
        }