关于plotlab的图形控件。实现一些基础功能

zl710260185 2014-05-08 12:44:54

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace WindowsFormsApplication1
{


public partial class Form1 : Form
{
delegate void UpdateUICallback8();
UpdateUICallback8 updateUI8;

Thread ScanThread = null;



const int xArrayPoint = 1260;//X轴//
const int yArrayPoint = 150; //Y轴//
Mitov.PlotLab.Scope mySpectrumScope1 = new Mitov.PlotLab.Scope();//第一条线// 在c#中每次使用新的功能都要进行创建新实例
Mitov.PlotLab.Scope mySpectrumScope2 = new Mitov.PlotLab.Scope();
Mitov.PlotLab.ScopeChannel scopeChannel21 = new Mitov.PlotLab.ScopeChannel();
Mitov.PlotLab.ScopePoints scopePoints21 = new Mitov.PlotLab.ScopePoints();
Vcl.VclPen vclPen21 = new Vcl.VclPen();
Mitov.PlotLab.ScopeChannel scopeChannel22 = new Mitov.PlotLab.ScopeChannel();//第二条线//
Mitov.PlotLab.ScopePoints scopePoints22 = new Mitov.PlotLab.ScopePoints();
Vcl.VclPen vclPen22 = new Vcl.VclPen();
Mitov.PlotLab.ScopeChannel scopeChannel23 = new Mitov.PlotLab.ScopeChannel();//第三条线//
Mitov.PlotLab.ScopePoints scopePoints23 = new Mitov.PlotLab.ScopePoints();
Vcl.VclPen vclPen23 = new Vcl.VclPen();
Mitov.PlotLab.Scope mySpectrumScope3 = new Mitov.PlotLab.Scope();
Mitov.PlotLab.Scope mySpectrumScope4 = new Mitov.PlotLab.Scope();
Mitov.PlotLab.Scope myStarScope1 = new Mitov.PlotLab.Scope();


double[] spect_array01 = new double[1024];
double[] spect_array02 = new double[1024];
double[] spect_array03 = new double[1024];
double[] wave_array = new double[1024];



private static Form2 formS1Scan;//定义formS1Scan可以调用Form2中的所有方法
private static Form2 formS2Scan;
private static Form4 formListSignal;
private static Form2 formfixed;
private static Form5 formtype5;
private static Form6 formstatus;
private static System.Windows.Forms.TabControl SignalList;
private TabPage tabPage01;
private TabPage tabPage02;
private TabPage tabPage03;
private TabPage tabPage04;
private TabPage tabPage05;

private Random a_RandomGen = new Random(123);
private int Counter2 = 0;

public Form1()
{
InitializeComponent();



updateUI8 = new UpdateUICallback8(chart_refresh);//模拟信号button//

/* for (int i = 0; i < 600; i++) spect_array01[i] = -70;
for (int i = 34; i < 39; i++) spect_array01[i] = -10;*/
for (int i = 0; i < 100; i++)
{
spect_array01[i] = a_RandomGen.NextDouble() * 200 - 100; //频谱
spect_array02[i] = ( Counter2 % 15 - 7) * 10; //一个周期15振幅为7//波形
Counter2 ++;
}

SignalList = new TabControl();
SignalList.Location = new Point(0,0);
SignalList.Size = new System.Drawing.Size(800, 150);//显示频谱窗口的大小button//
tabPage01 = new System.Windows.Forms.TabPage();
SignalList.Controls.Add(tabPage01);
tabPage01.UseVisualStyleBackColor = true;
tabPage01.Text = "当前信号";
tabPage02 = new System.Windows.Forms.TabPage();
SignalList.Controls.Add(tabPage02);
tabPage02.UseVisualStyleBackColor = true;
tabPage02.Text = "历史信号";
tabPage03 = new System.Windows.Forms.TabPage();
SignalList.Controls.Add(tabPage03);
tabPage03.UseVisualStyleBackColor = true;
tabPage03.Text = "新发现信号";
tabPage04 = new System.Windows.Forms.TabPage();
SignalList.Controls.Add(tabPage04);
tabPage04.UseVisualStyleBackColor = true;
tabPage04.Text = "重要信号";
tabPage05 = new System.Windows.Forms.TabPage();
SignalList.Controls.Add(tabPage05);
tabPage05.UseVisualStyleBackColor = true;
tabPage05.Text = "一般信号";




//mySpectrumScope1.Location = new Point(5, 60);
mySpectrumScope1.Location = new Point(0, 0);//xy初始坐标
mySpectrumScope1.Size = new System.Drawing.Size(xArrayPoint, yArrayPoint);
mySpectrumScope1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
mySpectrumScope1.Title.Visible = true;
mySpectrumScope1.Title.Font.Size = 9;
mySpectrumScope1.Title.ViewSize.AutoSize = true;
mySpectrumScope1.Dock = System.Windows.Forms.DockStyle.Fill;//第一张频谱图停靠的位置 铺满
mySpectrumScope1.XAxis.AxisLabel.Visible = false;
mySpectrumScope1.Title.Text = "频谱(MHz)";
mySpectrumScope1.XAxis.Max.DataValue = 600;//频谱图的600个点
mySpectrumScope1.XAxis.Max.Value = 600;

mySpectrumScope1.YAxis.Max.DataValue = 0;
mySpectrumScope1.YAxis.Max.Value = 0;

mySpectrumScope1.YAxis.Min.DataValue = -100;
mySpectrumScope1.YAxis.Min.Value = -100;
mySpectrumScope1.YAxis.AutoScaling.Enabled = false;
mySpectrumScope1.YAxis.AxisLabel.Text = "功率(dBm)";
mySpectrumScope1.YAxis.AxisLabel.Font.Size = 9;



// scope2 for wideband spectrum
mySpectrumScope2.Location = new Point(0, 0);//频谱图窗体的定义//
mySpectrumScope2.Size = new System.Drawing.Size(xArrayPoint/2, yArrayPoint);
mySpectrumScope2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
mySpectrumScope2.Title.Visible = true;
mySpectrumScope2.Title.Font.Size = 9;
mySpectrumScope2.Title.ViewSize.AutoSize = true;
mySpectrumScope2.Dock = System.Windows.Forms.DockStyle.Fill;//设置控件的边框停靠父控件的位置 平铺
mySpectrumScope2.XAxis.AxisLabel.Visible = true;//????
mySpectrumScope2.Title.Text = "频谱";

mySpectrumScope2.XAxis.Max.DataValue = 600;
mySpectrumScope2.XAxis.Max.Value = 600;

mySpectrumScope2.XAxis.Min.DataValue = 0;
mySpectrumScope2.XAxis.Min.Value = 0;

mySpectrumScope2.XAxis.AxisLabel.Text = "频率(dBm)";
mySpectrumScope2.XAxis.AxisLabel.Font.Size = 9;

mySpectrumScope2.YAxis.Max.DataValue = 0;
mySpectrumScope2.YAxis.Max.Value = 0;

mySpectrumScope2.YAxis.Min.DataValue = -100;
mySpectrumScope2.YAxis.Min.Value = -100;

mySpectrumScope2.YAxis.AutoScaling.Enabled = false;
mySpectrumScope2.YAxis.AxisLabel.Text = "功率(dBm)";
mySpectrumScope2.YAxis.AxisLabel.Font.Size = 9;

scopeChannel21.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))));
//scopeChannel21.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("scopeChannel4.InternalData")));
scopeChannel21.MouseCursor = System.Windows.Forms.Cursors.Default;
scopeChannel21.Name = "频谱";
scopePoints21.Brush = new Vcl.VclBrush(System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))), 0);
vclPen21.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//vclPen20.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("vclPen20.InternalData")));
scopePoints21.Pen = vclPen21;
scopePoints21.Size = ((uint)(3u));
scopeChannel21.Points = scopePoints21;
scopeChannel21.XAxisIndex = 0;
scopeChannel21.YAxisIndex = 0;

scopeChannel22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
//scopeChannel22.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("scopeChannel5.InternalData")));
scopeChannel22.MouseCursor = System.Windows.Forms.Cursors.Default;
scopeChannel22.Name = "迹线";
scopePoints22.Brush = new Vcl.VclBrush(System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))), 0);
vclPen22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//vclPen22.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("vclPen21.InternalData")));
scopePoints22.Pen = vclPen22;
scopePoints22.Size = ((uint)(3u));
scopeChannel22.Points = scopePoints22;
scopeChannel22.XAxisIndex = 0;
scopeChannel22.YAxisIndex = 0;

scopeChannel23.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
//scopeChannel23.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("scopeChannel6.InternalData")));
scopeChannel23.MouseCursor = System.Windows.Forms.Cursors.Default;
scopeChannel23.Name = "波形";
scopePoints23.Brush = new Vcl.VclBrush(System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))), 0);
vclPen23.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//vclPen23.InternalData = ((Vcl.VclBinaryData)(resources.GetObject("vclPen22.InternalData")));
scopePoints23.Pen = vclPen22;
scopePoints23.Size = ((uint)(3u));
scopeChannel23.Points = scopePoints23;
scopeChannel23.XAxisIndex = 0;
scopeChannel23.YAxisIndex = 0;






...全文
667 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wowowo2388 2015-04-28
  • 打赏
  • 举报
回复
能给我发个源代码?这个具体是什么啊?是poltlab控件吗
zl710260185 2014-05-08
  • 打赏
  • 举报
回复
private void toolStripButton10_Click(object sender, EventArgs e) { if (formtype5 == null || formtype5.IsDisposed) { formtype5 = new Form5(); formtype5.Text = "星座图"; formtype5.MdiParent = this; formtype5.Show(); } else { formtype5.Activate(); } } private void toolStripButton9_Click(object sender, EventArgs e) { if (formfixed == null || formfixed.IsDisposed) { formfixed = new Form2(); formfixed.Text = "定频侦测频谱"; formfixed.MdiParent = this; //formS2Scan.Size = new System.Drawing.Size(xArrayPoint/2+5, yArrayPoint * 2); formfixed.mySpectrumScope = mySpectrumScope3; formfixed.Form_add(); formfixed.Show(); } else { formfixed.Activate(); } } private void toolStripButton12_Click(object sender, EventArgs e) { if (formListSignal == null || formListSignal.IsDisposed) { formListSignal = new Form4(); formListSignal.Text = "信号检测列表"; formListSignal.MdiParent = this; //formS1Scan.Size = new System.Drawing.Size(xArrayPoint/2+5, yArrayPoint * 2); formListSignal.SignalList = SignalList; formListSignal.Form_add(); formListSignal.Show(); } else { formListSignal.Activate(); } } private void toolStripButton13_Click(object sender, EventArgs e) { if (formstatus == null || formstatus.IsDisposed) { formstatus = new Form6(); formstatus.Text = "设备状态"; formstatus.MdiParent = this; formstatus.Show(); } else { formstatus.Activate(); } } private void 参数设置ToolStripMenuItem_Click(object sender, EventArgs e) { Form parameterSetting = new Form(); parameterSetting.Text = "参数设置"; parameterSetting.MdiParent = this; parameterSetting.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; parameterSetting.MinimizeBox = true; parameterSetting.Show(); } } public class mySpectrumPlot : FlowLayoutPanel { public Mitov.PlotLab.Scope mySpectrumScope = null; public Mitov.PlotLab.Waterfall myWaterfall = null; public mySpectrumPlot() { } } }
zl710260185 2014-05-08
  • 打赏
  • 举报
回复
private void toolStripButton6_Click(object sender, EventArgs e)//平铺// { //this.LayoutMdi(MdiLayout.TileVertical); /* formMainScan.WindowState = FormWindowState.Normal; formS1Scan.WindowState = FormWindowState.Normal; formS2Scan.WindowState = FormWindowState.Normal; formMainScan.Location = new Point(0, 0); formS2Scan.Location = new Point(0, 320); formS1Scan.Location = new Point(635, 320);*/ //if (formMainScan != null) formMainScan.WindowState = FormWindowState.Normal; if (formS1Scan != null) formS1Scan.WindowState = FormWindowState.Normal; if (formS2Scan != null) formS2Scan.WindowState = FormWindowState.Normal; if (formListSignal != null) formListSignal.WindowState = FormWindowState.Normal; if (formstatus != null) formstatus.WindowState = FormWindowState.Normal; if (formListSignal != null) formListSignal.Location = new Point(0, 0); //if (formMainScan != null) formMainScan.Location = new Point(0, 140); if (formS1Scan != null) formS2Scan.Location = new Point(0, 430); if (formS2Scan != null) formS1Scan.Location = new Point(635, 430); if (formstatus != null) formstatus.Location = new Point(800,0); //if (formMainScan != null) formMainScan.Focus(); if (formListSignal != null) formListSignal.Focus(); if (formstatus != null) formstatus.Focus(); } private void toolStripButton7_Click(object sender, EventArgs e) { //this.LayoutMdi(MdiLayout.ArrangeIcons); //if (formMainScan != null) formMainScan.WindowState = FormWindowState.Normal; if (formS1Scan != null) formS1Scan.WindowState = FormWindowState.Normal; if (formS2Scan != null) formS2Scan.WindowState = FormWindowState.Normal; if (formListSignal != null) formListSignal.WindowState = FormWindowState.Normal; if (formstatus != null) formstatus.WindowState = FormWindowState.Normal; //if (formMainScan != null) formMainScan.Location = new Point(0, 0); if (formS1Scan != null) formS1Scan.Location = new Point(25, 25); if (formS2Scan != null) formS2Scan.Location = new Point(50, 50); if (formListSignal != null) formListSignal.Location = new Point(75, 75); if (formstatus != null) formstatus.Location = new Point(100, 100); if (formS1Scan != null) formS1Scan.Focus(); if (formS2Scan != null) formS2Scan.Focus(); if (formListSignal != null) formListSignal.Focus(); if (formstatus != null) formstatus.Focus(); } private void Form1_Load(object sender, EventArgs e) { } protected override void OnFormClosing(FormClosingEventArgs e) { /* if (MessageBox.Show( "你确认要退出该程序吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) base.OnFormClosing(e); else e.Cancel = true; */ } private void toolStripButton8_Click(object sender, EventArgs e) { //this.LayoutMdi(MdiLayout.TileHorizontal); //if (formMainScan != null) formMainScan.WindowState = FormWindowState.Minimized; if (formS1Scan != null) formS1Scan.WindowState = FormWindowState.Minimized; if (formS2Scan != null) formS2Scan.WindowState = FormWindowState.Minimized; if (formListSignal != null) formListSignal.WindowState = FormWindowState.Minimized; if (formstatus != null) formstatus.WindowState = FormWindowState.Minimized; } private void modeScan_Click(object sender, EventArgs e)//扫描侦查// { modeScan.Checked = true;//对按键进行设置// modeFixed.Checked = false; toolStripButton2.Enabled = true; toolStripButton3.Enabled = true; toolStripButton4.Enabled = true; toolStripButton5.Enabled = true; toolStripButton6.Enabled = true; toolStripButton7.Enabled = true; toolStripButton8.Enabled = true; toolStripButton1.Enabled = false; toolStripButton9.Enabled = false; toolStripButton10.Enabled = false; toolStripButton11.Enabled = false; toolStripButton12.Enabled = false; toolStripButton13.Enabled = false; toolStripButton14.Enabled = false; if (formfixed != null) formfixed.Close(); if (formtype5 != null) formtype5.Close(); if (formListSignal != null) formListSignal.Close(); if (formstatus != null) formstatus.Close(); if (ScanThread == null) { ScanThread = new Thread(new ThreadStart(ScanWork)); ScanThread.Name = "ScanThread"; ScanThread.IsBackground = true; ScanThread.Start(); } } private void modeFixed_Click(object sender, EventArgs e)//实时监测// { ScanThread.Abort(); ScanThread.Join(); ScanThread = null; modeScan.Checked = false; modeFixed.Checked = true;//对按键进行设置// toolStripButton2.Enabled = false; toolStripButton3.Enabled = false; toolStripButton4.Enabled = false; toolStripButton5.Enabled = false; toolStripButton6.Enabled = false; toolStripButton7.Enabled = false; toolStripButton8.Enabled = false; toolStripButton1.Enabled = true; toolStripButton9.Enabled = true; toolStripButton10.Enabled = true; toolStripButton11.Enabled = true; toolStripButton12.Enabled = true; toolStripButton13.Enabled = true; toolStripButton14.Enabled = true; //if (formMainScan != null) formMainScan.Close(); if (formS1Scan != null) formS1Scan.Close(); if (formS2Scan != null) formS2Scan.Close(); if (formListSignal != null) formListSignal.Close(); if (formstatus != null) formstatus.Close(); }
zl710260185 2014-05-08
  • 打赏
  • 举报
回复
mySpectrumScope2.Channels.AddRange(new Mitov.PlotLab.ScopeChannel[] {//把值传到mySpectrumScope2中// scopeChannel21, scopeChannel22, scopeChannel23}); mySpectrumScope2.Channels[0].Data.AddYData(spect_array01, 0, 600); mySpectrumScope2.XAxis.AdditionalAxes[0].Axis.Visible = true; mySpectrumScope2.XAxis.AdditionalAxes[1].Axis.Visible = false; mySpectrumScope2.XAxis.AdditionalAxes[0].Axis.Min.Value = 942 - 20.0; mySpectrumScope2.XAxis.AdditionalAxes[0].Axis.Max.Value = 942 + 20.0; mySpectrumScope3.Location = new Point(0, 0);//设置第二张频谱图的相关位置 mySpectrumScope3.Size = new System.Drawing.Size(xArrayPoint/2, yArrayPoint); mySpectrumScope3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); mySpectrumScope3.Title.Visible = true; mySpectrumScope3.Title.Font.Size = 9; mySpectrumScope3.Title.ViewSize.AutoSize = true; mySpectrumScope3.Dock = System.Windows.Forms.DockStyle.Fill; mySpectrumScope3.XAxis.AxisLabel.Visible = false; mySpectrumScope3.Title.Text = "频谱(MHz)"; mySpectrumScope3.XAxis.Max.DataValue = 600; mySpectrumScope3.XAxis.Max.Value = 600; mySpectrumScope3.YAxis.Max.DataValue = 0; mySpectrumScope3.YAxis.Max.Value = 0; mySpectrumScope3.YAxis.Min.DataValue = -100; mySpectrumScope3.YAxis.Min.Value = -100; mySpectrumScope3.YAxis.AutoScaling.Enabled = false; mySpectrumScope3.YAxis.AxisLabel.Text = "功率(dBm)"; mySpectrumScope3.YAxis.AxisLabel.Font.Size = 9; //第二张图的传值程序 mySpectrumScope3.Channels.AddRange(new Mitov.PlotLab.ScopeChannel[] {//把值传到mySpectrumScope3中// scopeChannel21, scopeChannel22, scopeChannel23}); mySpectrumScope3.Channels[0].Data.AddYData(spect_array01, 0, 600); mySpectrumScope3.XAxis.AdditionalAxes[0].Axis.Visible = true; mySpectrumScope3.XAxis.AdditionalAxes[1].Axis.Visible = false; mySpectrumScope3.XAxis.AdditionalAxes[0].Axis.Min.Value = 942 - 20.0; mySpectrumScope3.XAxis.AdditionalAxes[0].Axis.Max.Value = 942 + 20.0; mySpectrumScope4.Location = new Point(50, 60);//设置Scope4 子控件的位置 mySpectrumScope4.Size = new System.Drawing.Size(420, 200);//设置子控件的高度和宽度 mySpectrumScope4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));//子控件的颜色 myStarScope1.Location = new Point(500, 60);//设置Scope1 子控件的位置 myStarScope1.Size = new System.Drawing.Size(420, 400);//设置子控件的高度和宽度 myStarScope1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));//子控件的颜色 this.Focus(); toolStripButton2.Enabled = false; toolStripButton3.Enabled = false; toolStripButton4.Enabled = false; toolStripButton5.Enabled = false; toolStripButton6.Enabled = false; toolStripButton7.Enabled = false; toolStripButton8.Enabled = false; toolStripButton1.Enabled = false; toolStripButton9.Enabled = false; toolStripButton10.Enabled = false; toolStripButton11.Enabled = false; toolStripButton12.Enabled = false; toolStripButton13.Enabled = false; toolStripButton14.Enabled = false; } public void chart_refresh()//刷新 { mySpectrumScope2.Channels[0].Data.Clear(); mySpectrumScope2.Channels[0].Data.AddYData(spect_array01, 0, 600); } private void ScanWork()//扫描 { double dtemp; while (true) { dtemp = spect_array01[0]; for (int i = 0; i < 599; i++) spect_array01[i] = spect_array01[i + 1]; spect_array01[599] = dtemp; Thread.Sleep(25); this.Invoke(updateUI8); //mySpectrumScope2.Channels[0].Data.Clear(); //mySpectrumScope2.Channels[0].Data.AddYData(spect_array01, 0, 600); } } private void timer1_Tick(object sender, EventArgs e)//时钟// { double[] Buffer1 = new double[1000]; double[] Buffer2 = new double[1000]; for (int i = 0; i < 1000; i++) { Buffer1[i] = m_RandomGen.NextDouble() * 40000 - 20000; Buffer2[i] = (m_Counter % 120) * 300 - 18000; m_Counter++; } } private Random m_RandomGen = new Random(123); private int m_Counter = 0; /* private void toolStripButton1_Click(object sender, EventArgs e) { if (formMainScan == null || formMainScan.IsDisposed) { formMainScan = new Form3(); formMainScan.Text = "射频全景频谱"; formMainScan.MdiParent = this; //formMainScan.Size = new System.Drawing.Size(xArrayPoint+10, yArrayPoint * 2 + 30); formMainScan.mySpectrumScope = mySpectrumScope1; formMainScan.myWaterfall = myWaterfall1; formMainScan.Form_add(); formMainScan.Show(); } else { formMainScan.Activate(); } }*/ private void toolStripButton2_Click(object sender, EventArgs e)//射频一button// { if (formS1Scan == null || formS1Scan.IsDisposed) { formS1Scan = new Form2();//实例化一个form2的对象// formS1Scan.Text = "射频观测频段一"; formS1Scan.MdiParent = this; //formS1Scan.Size = new System.Drawing.Size(xArrayPoint/2+5, yArrayPoint * 2); formS1Scan.mySpectrumScope = mySpectrumScope2; //formS1Scan.myWaterfall = myWaterfall2; formS1Scan.Form_add(); formS1Scan.Show(); } else { formS1Scan.Activate(); } } private void toolStripButton3_Click(object sender, EventArgs e)//射频二button// { if (formS2Scan == null || formS2Scan.IsDisposed) { formS2Scan = new Form2(); formS2Scan.Text = "射频观测频段二"; formS2Scan.MdiParent = this; //formS2Scan.Size = new System.Drawing.Size(xArrayPoint/2+5, yArrayPoint * 2); formS2Scan.mySpectrumScope = mySpectrumScope3; //formS2Scan.myWaterfall = myWaterfall3; formS2Scan.Form_add(); formS2Scan.Show();//频谱显示 } else { formS2Scan.Activate(); } } private void toolStripButton4_Click(object sender, EventArgs e)//信号检测列表button// { //this.LayoutMdi(MdiLayout.Cascade); if (formListSignal == null || formListSignal.IsDisposed) { formListSignal = new Form4(); formListSignal.Text = "信号检测列表"; formListSignal.MdiParent = this; //formS1Scan.Size = new System.Drawing.Size(xArrayPoint/2+5, yArrayPoint * 2); formListSignal.SignalList = SignalList; formListSignal.Form_add(); formListSignal.Show(); } else { formListSignal.Activate(); } } private void toolStripButton5_Click(object sender, EventArgs e)//设备状态button// { if (formstatus == null || formstatus.IsDisposed) { formstatus = new Form6(); formstatus.Text = "设备状态"; formstatus.MdiParent = this; formstatus.Show(); } else { formstatus.Activate(); } }

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧