예제 #1
0
파일: Scope.cs 프로젝트: jirik09/Instrulab
        private void Zed_update(object sender, ElapsedEventArgs e)
        {
            bool update = false;

            if (last_XYplot != XYplot)
            {
                update = true;
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                horizontal_cursor_update();
                update_X_axe();
                last_XYplot = XYplot;
            }

            if (maxX != last_maxX || minX != last_minX)
            {
                scopePane.XAxis.Scale.MaxAuto = false;
                scopePane.XAxis.Scale.MinAuto = false;

                scopePane.XAxis.Scale.Max = maxX;
                scopePane.XAxis.Scale.Min = minX;

                if (XYplot)
                {
                    scopePane.XAxis.Scale.Max = maxY;
                    scopePane.XAxis.Scale.Min = minY;
                }

                last_maxX = maxX;
                last_minX = minX;

                update = true;

                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                horizontal_cursor_update();
                paint_cursors();
                try
                {
                    scopePane.AxisChange();
                }
                catch (Exception ex) { }
            }
            if (maxY != last_maxY || minY != last_minY)
            {

                scopePane.YAxis.Scale.MaxAuto = false;
                scopePane.YAxis.Scale.MinAuto = false;

                scopePane.YAxis.Scale.Max = maxY;
                scopePane.YAxis.Scale.Min = minY;

                last_maxY = maxY;
                last_minY = minY;
                update = true;
                process_signals();
                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                horizontal_cursor_update();
                paint_cursors();
                try
                {
                    scopePane.AxisChange();
                }
                catch (Exception ex) { }
            }

            if (gain[0] != last_gain[0] || gain[1] != last_gain[1] || gain[2] != last_gain[2] || gain[3] != last_gain[3] || gain[4] != last_gain[4] || offset[0] != last_offset[0] || offset[1] != last_offset[1] || offset[2] != last_offset[2] || offset[3] != last_offset[3] || offset[4] != last_offset[4])
            {
                update = true;
                process_signals();
                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                horizontal_cursor_update();
                paint_cursors();
                Array.Copy(gain, last_gain, 5);
                Array.Copy(offset, last_offset, 5);
            }

            if (interpolation != last_interpolation || showPoints != last_showPoints || last_antialiasing != antialiasing)
            {
                update = true;
                process_signals();
                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                paint_cursors();
                last_interpolation = interpolation;
                last_showPoints = showPoints;
                last_antialiasing = antialiasing;
            }

            if (last_tA != tA || last_tB != tB || last_ver_cur_src != VerticalCursorSrc)
            {
                update = true;
                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                paint_cursors();
                last_tA = tA;
                last_tB = tB;
                last_ver_cur_src = VerticalCursorSrc;
            }

            if (last_uA != uA || last_uB != uB || last_hor_cur_src != HorizontalCursorSrc)
            {
                update = true;
                scopePane.CurveList.Clear();
                paint_signals();
                paint_markers();
                horizontal_cursor_update();
                paint_cursors();
                last_uA = uA;
                last_uB = uB;
                last_hor_cur_src = HorizontalCursorSrc;
            }

            if (last_measValid != measValid)
            {
                update = true;
                meas.calculateMeasurements(device.scopeCfg.samples, device.scopeCfg.ranges[1, selectedRange], device.scopeCfg.ranges[0, selectedRange], device.scopeCfg.actualChannels, device.scopeCfg.sampligFreq, device.scopeCfg.timeBase.Length, device.scopeCfg.actualRes);
                last_measValid = measValid;
            }

            if (last_math != math) {
                update = true;
                scopePane.CurveList.Clear();
                process_signals();
                paint_signals();
                paint_markers();
                vertical_cursor_update();
                horizontal_cursor_update();
                paint_cursors();
                last_math = math;
            }

            if (last_pretrigger != pretrigger)
            {
                set_prettriger(pretrigger);
                last_pretrigger = pretrigger;
            }

            if (last_trigger_level != triggerLevel) {
                set_trigger_level(triggerLevel);
                last_trigger_level = triggerLevel;
            }

            if (update)
            {
                this.Invalidate();
            }
        }
예제 #2
0
파일: Scope.cs 프로젝트: jirik09/Instrulab
 private void ch1XCh2ToolStripMenuItem_mult_Click(object sender, EventArgs e)
 {
     if (ch1XCh2ToolStripMenuItem_mult.Checked)
     {
         math = math_def.MULT;
     }
     else {
         math = math_def.NONE;
     }
     validate_math();
 }
예제 #3
0
파일: Scope.cs 프로젝트: jirik09/Instrulab
 private void ch2Ch1ToolStripMenuItem_minus_Click(object sender, EventArgs e)
 {
     if (ch2Ch1ToolStripMenuItem_minus.Checked)
     {
         math = math_def.DIFF_B;
     }
     else
     {
         math = math_def.NONE;
     }
     validate_math();
 }
예제 #4
0
파일: Scope.cs 프로젝트: jirik09/Instrulab
 private void ch1Ch2ToolStripMenuItem_plus_Click(object sender, EventArgs e)
 {
     if (ch1Ch2ToolStripMenuItem_plus.Checked) {
         math = math_def.SUM;
     }
     else
     {
         math = math_def.NONE;
     }
     validate_math();
 }