예제 #1
0
        public Main()
        {
            Control.CheckForIllegalCrossThreadCalls = true;
            InitializeComponent();
            DoubleBuffered = true;
            SuspendLayout();
            bufferedChart = new BufferedChart();
            bufferedChart.mainForm = this;
            bufferedChart.Dock = DockStyle.Fill;
            kontainerPreGraf.Controls.Add(bufferedChart);

            ResumeLayout();
            //fillRandomDataPoints();
            timer1_Tick(this, EventArgs.Empty);
            timer1.Interval = (60 - DateTime.Now.Second) * 1000;
            timer1.Enabled = true;
            setTimer = true;

            MeasurementControl = new MeasurementControl();
            MeasurementControl.Graf = bufferedChart;

            MeasurementControl.setMainForm(this);
        }
예제 #2
0
        private void menuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NoveMeranieWindow noveMeranieWindow = new NoveMeranieWindow();
            DialogResult res = noveMeranieWindow.ShowDialog();
            if (res == DialogResult.OK)
            {
                sidebar.Enabled = true;
                stopButton.Enabled = true;
                stopAfterCycle.Enabled = true;
                menuToolStripMenuItem.Enabled = false;
                //hodnota setMerania.parametreMerania obsahuje instanciu triedy measurementsparameters
                //ktora obsahuje vsetky informacie na zacatie merania.
                MeasurementControl = new MeasurementControl(noveMeranieWindow.parametreMerania, this);
                MeasurementControl.Graf = bufferedChart;
                estTimeLabel.Text = DateTime.Now.AddSeconds(noveMeranieWindow.parametreMerania.StepTime * noveMeranieWindow.parametreMerania.NumberOfCycles * noveMeranieWindow.parametreMerania.NumberOfSteps).ToString("hh:mm tt");
                //energyScanStepTimeLabel.Text = noveMeranieWindow.parametreMerania.EnergyScan.StepTime.ToString();
                resolutionLabel.Text = noveMeranieWindow.parametreMerania.Resolution.ToString();
                MeasurementControl.start();

                //bufferedChart.setParameters(setmerania.parametreMerania.StartPoint,
                //    setmerania.parametreMerania.EndPoint,
                //    setmerania.parametreMerania.PocetBodov,
                //    setmerania.parametreMerania.PocetCyklov);
                //bufferedChart.init();

            }
        }