コード例 #1
0
        override public void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscillo, graphControl.GetConsumer());
            SetToolbar(new DigitalArduinoDueToolStrip(oscillo, graphControl));

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscillo);

            float[] divs = { 1.0f, 0.5f, 0.2f, 0.1f, 0.05f, 0.02f, 0.01f, 0.005f, 0.002f, 0.001f, 0.0002f, 0.0005f, 0.0001f, 0.00005f, 0.00002f, 0.00001f };
            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.time.SelectedIndex = 10;

            SetToolbar(commonToolStrip);

            gd.SetVerticalRange(0, 255, (float)(255.0 / 6.5), "Volts");

            graphControl.SetRenderer(gd);
        }
コード例 #2
0
ファイル: DigitalVizArduino.cs プロジェクト: karawin/xoscillo
        public override void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscillo, graphControl.GetConsumer());
            SetToolbar(new DigitalArduinoToolStrip(oscillo, graphControl));

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscillo);

            float[] divs = { 1.0f, 0.5f, 0.2f, 0.1f, 0.05f, 0.02f, 0.01f, 0.005f, 0.002f, 0.001f, 0.0002f, 0.0005f };
            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.time.SelectedIndex = 10;

            SetToolbar(commonToolStrip);

            gd.SetVerticalRange(0, 255, (float)(255.0 / 6.5), "Volts");

            graphControl.SetRenderer(gd);
        }
コード例 #3
0
ファイル: VizParallax.cs プロジェクト: karawin/xoscillo
        public override void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscillo, GetFirstConsumerInChain());
            gf.drawSlidingFFT = true;

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscillo);

            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.selectedIndexChanged += this.time_SelectedIndexChanged;
            commonToolStrip.time.SelectedIndex = 10;

            SetToolbar(GetFilteringToolStrip());
            SetToolbar(GetFftToolStrip());
            SetToolbar(new ParallaxToolStrip(oscillo, graphControl));
            SetToolbar(commonToolStrip);

            ga.SetVerticalRange(0, 255, 32, "Volts");
        }
コード例 #4
0
        public override void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscilloDue, GetFirstConsumerInChain());
            gf.drawSlidingFFT = true;

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscilloDue);
            float[] divs = { 1.0f, 0.5f, 0.2f, 0.1f, 0.05f, 0.02f, 0.01f, 0.005f, 0.002f, 0.001f, 0.0002f, 0.0005f, 0.0001f, 0.00005f, 0.00002f, 0.00001f };
            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.time.SelectedIndex = 10;

            AnalogArduinoDueToolbar aat = new AnalogArduinoDueToolbar(oscilloDue, graphControl);
            SetToolbar(GetFilteringToolStrip());
            SetToolbar(GetFftToolStrip());
            SetToolbar(aat);
            SetToolbar(commonToolStrip);

            ga.SetVerticalRange(255, 0, 32, "Volts");
        }
コード例 #5
0
ファイル: VizParallax.cs プロジェクト: zoomx/xoscillo
        override public void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscillo, GetFirstConsumerInChain());
            gf.drawSlidingFFT = true;

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscillo);

            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.selectedIndexChanged += this.time_SelectedIndexChanged;
            commonToolStrip.time.SelectedIndex    = 10;

            SetToolbar(GetFilteringToolStrip());
            SetToolbar(GetFftToolStrip());
            SetToolbar(new ParallaxToolStrip(oscillo, graphControl));
            SetToolbar(commonToolStrip);

            ga.SetVerticalRange(0, 255, 32, "Volts");
        }
コード例 #6
0
        override public void Form_Load(object sender, EventArgs e)
        {
            m_Acq = new Acquirer();
            m_Acq.Open(oscilloDue, GetFirstConsumerInChain());
            gf.drawSlidingFFT = true;

            commonToolStrip = new CommonToolStrip(this, m_Acq, graphControl, oscilloDue);
            float[] divs = { 1.0f, 0.5f, 0.2f, 0.1f, 0.05f, 0.02f, 0.01f, 0.005f, 0.002f, 0.001f, 0.0002f, 0.0005f, 0.0001f, 0.00005f, 0.00002f, 0.00001f };
            foreach (float t in divs)
            {
                commonToolStrip.time.Items.Add(t);
            }
            commonToolStrip.time.SelectedIndex = 10;

            AnalogArduinoDueToolbar aat = new AnalogArduinoDueToolbar(oscilloDue, graphControl);

            SetToolbar(GetFilteringToolStrip());
            SetToolbar(GetFftToolStrip());
            SetToolbar(aat);
            SetToolbar(commonToolStrip);

            ga.SetVerticalRange(255, 0, 32, "Volts");
        }
コード例 #7
0
ファイル: CommonToolStrip.cs プロジェクト: zoomx/xoscillo
        public CommonToolStrip(VizForm vf, Acquirer acq, GraphControl gc, Oscillo os)
        {
            vizForm      = vf;
            m_acquirer   = acq;
            graphControl = gc;
            m_Oscillo    = os;

            this.timeLabel = new System.Windows.Forms.ToolStripLabel();
            this.clone     = new System.Windows.Forms.ToolStripButton();
            this.play      = new System.Windows.Forms.ToolStripButton();
            this.time      = new System.Windows.Forms.ToolStripComboBox();


            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.timeLabel,
                this.time,
                this.clone,
                this.play
            });
            this.toolStrip.Location = new System.Drawing.Point(0, 0);
            this.toolStrip.Name     = "toolStrip2";
            this.toolStrip.Size     = new System.Drawing.Size(497, 25);
            this.toolStrip.TabIndex = 1;
            this.toolStrip.Text     = "toolStrip2";

            //
            // time
            //
            this.time.Name = "time";
            this.time.Size = new System.Drawing.Size(50, 25);
            this.time.SelectedIndexChanged += new System.EventHandler(this.time_SelectedIndexChanged);

            //
            // clone
            //
            this.clone.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.clone.Image                 = null;// ((System.Drawing.Image)(resources.GetObject("clone.Image")));
            this.clone.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.clone.Name   = "clone";
            this.clone.Size   = new System.Drawing.Size(42, 22);
            this.clone.Text   = "Clone";
            this.clone.Click += new System.EventHandler(this.clone_Click);

            //
            // play
            //
            if (m_acquirer != null)
            {
                this.play.CheckOnClick          = true;
                this.play.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.play.Image                 = global::XOscillo.Properties.Resources.play;
                this.play.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.play.Margin                = new System.Windows.Forms.Padding(1);
                this.play.Name            = "play";
                this.play.Size            = new System.Drawing.Size(23, 23);
                this.play.Text            = "toolStripButton2";
                this.play.CheckedChanged += new System.EventHandler(this.play_CheckedChanged);
                this.play.Checked         = true;
            }

            this.toolStrip.Items.Add(new System.Windows.Forms.ToolStripSeparator());

            //
            // Channels
            //
            if (m_Oscillo != null)
            {
                for (int i = 0; i < m_Oscillo.GetNumberOfSupportedChannels(); i++)
                {
                    CheckBox cb = new CheckBox();
                    cb.Text               = "Ch" + i;
                    cb.Tag                = i;
                    cb.Appearance         = Appearance.Button;
                    cb.CheckStateChanged += ((s, ex) =>
                    {
                        m_Oscillo.SetChannel((int)cb.Tag, cb.CheckState == CheckState.Checked);
                        SetAcquirerStatus(); // since the above doesnt fire a CheckStateChanged
                    });
                    ToolStripControlHost host = new ToolStripControlHost(cb);

                    if (i == 0)
                    {
                        cb.Checked = true;
                    }

                    this.toolStrip.Items.Add(host);
                }
            }
        }
コード例 #8
0
ファイル: CommonToolStrip.cs プロジェクト: Reeyaw/xoscillo
        public CommonToolStrip(VizForm vf, Acquirer acq, GraphControl gc, Oscillo os)
        {
            vizForm = vf;
            m_acquirer = acq;
            graphControl = gc;
            m_Oscillo = os;

            this.timeLabel = new System.Windows.Forms.ToolStripLabel();
            this.clone = new System.Windows.Forms.ToolStripButton();
            this.play = new System.Windows.Forms.ToolStripButton();
            this.time = new System.Windows.Forms.ToolStripComboBox();


            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.timeLabel,
            this.time,
            this.clone,
            this.play});
            this.toolStrip.Location = new System.Drawing.Point(0, 0);
            this.toolStrip.Name = "toolStrip2";
            this.toolStrip.Size = new System.Drawing.Size(497, 25);
            this.toolStrip.TabIndex = 1;
            this.toolStrip.Text = "toolStrip2";

            // 
            // time
            // 
            this.time.Name = "time";
            this.time.Size = new System.Drawing.Size(50, 25);
            this.time.SelectedIndexChanged += new System.EventHandler(this.time_SelectedIndexChanged);

            // 
            // clone
            // 
            this.clone.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.clone.Image = null;// ((System.Drawing.Image)(resources.GetObject("clone.Image")));
            this.clone.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.clone.Name = "clone";
            this.clone.Size = new System.Drawing.Size(42, 22);
            this.clone.Text = "Clone";
            this.clone.Click += new System.EventHandler(this.clone_Click);

            // 
            // play
            // 
            if (m_acquirer != null)
            {
                this.play.CheckOnClick = true;
                this.play.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.play.Image = global::XOscillo.Properties.Resources.play;
                this.play.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.play.Margin = new System.Windows.Forms.Padding(1);
                this.play.Name = "play";
                this.play.Size = new System.Drawing.Size(23, 23);
                this.play.Text = "toolStripButton2";
                this.play.CheckedChanged += new System.EventHandler(this.play_CheckedChanged);
                this.play.Checked = true;
            }

            this.toolStrip.Items.Add(new System.Windows.Forms.ToolStripSeparator());

            //
            // Channels
            //
            if (m_Oscillo != null)
            {
                for (int i = 0; i < m_Oscillo.GetNumberOfSupportedChannels(); i++)
                {
                    CheckBox cb = new CheckBox();
                    cb.Text = "Ch" + i;
                    cb.Tag = i;
                    cb.Appearance = Appearance.Button;
                    cb.CheckStateChanged += ((s, ex) =>
                    {
                        m_Oscillo.SetChannel((int)cb.Tag, cb.CheckState == CheckState.Checked);
                        SetAcquirerStatus(); // since the above doesnt fire a CheckStateChanged
                    });
                    ToolStripControlHost host = new ToolStripControlHost(cb);

                    if (i == 0)
                    {
                        cb.Checked = true;
                    }

                    this.toolStrip.Items.Add(host);
                }
            }

        }