📄 frmmain.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace motorseries
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
private System.Windows.Forms.TreeView treeView;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ListView listView;
private System.Windows.Forms.ImageList imageList1;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem18;
private System.Windows.Forms.ColumnHeader columnHeader5;
//***********自定义变量和结构*********************
private int PortNum;
private int[] RegionRM = new int[12] {0, 21,22,23,24,29,30,35,36,47,48,61};//遥测功能区间(上下界)
private frmSetRM frmSetDataRM ;
//public int iMax,iMin,iDef;//最大值,最小值和缺省值
public int iSelFocus;//选中对象数组下标
public struct RM//遥测值
{
public int ID, iMax,iMin,iExp,iCoef,Val;//标识,最大值,最小值,公式,系数,测量值
public string strName,strDes,strUnit;//名称,说明,单位
}
public RM [] objRM = new RM[64];
public struct RS//遥信值
{
public int ID,iReverse,iValid,Val;//标识,,取反标志,有效标志,测量值
public string strName,strDes;//名称,说明
}
RS [] objRS = new RS[10];
//************************************************
public frmMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuItem15 = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem17 = new System.Windows.Forms.MenuItem();
this.menuItem18 = new System.Windows.Forms.MenuItem();
this.menuItem12 = new System.Windows.Forms.MenuItem();
this.menuItem13 = new System.Windows.Forms.MenuItem();
this.menuItem14 = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.statusBar = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.treeView = new System.Windows.Forms.TreeView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.listView = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.SuspendLayout();
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem10,
this.menuItem8});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem7,
this.menuItem6,
this.menuItem5,
this.menuItem4,
this.menuItem3,
this.menuItem2});
this.menuItem1.Text = "文件";
//
// menuItem7
//
this.menuItem7.Index = 0;
this.menuItem7.Text = "打开工程";
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "-";
//
// menuItem5
//
this.menuItem5.Index = 2;
this.menuItem5.Text = "保存工程";
//
// menuItem4
//
this.menuItem4.Index = 3;
this.menuItem4.Text = "工程另存为";
//
// menuItem3
//
this.menuItem3.Index = 4;
this.menuItem3.Text = "-";
//
// menuItem2
//
this.menuItem2.Index = 5;
this.menuItem2.Text = "退出";
//
// menuItem10
//
this.menuItem10.Index = 1;
this.menuItem10.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem11,
this.menuItem12,
this.menuItem13,
this.menuItem14});
this.menuItem10.Text = "设置";
//
// menuItem11
//
this.menuItem11.Index = 0;
this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem15,
this.menuItem16,
this.menuItem17,
this.menuItem18});
this.menuItem11.Text = "串口";
//
// menuItem15
//
this.menuItem15.Index = 0;
this.menuItem15.Text = "1";
//
// menuItem16
//
this.menuItem16.Index = 1;
this.menuItem16.Text = "2";
this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click);
//
// menuItem17
//
this.menuItem17.Index = 2;
this.menuItem17.Text = "3";
//
// menuItem18
//
this.menuItem18.Index = 3;
this.menuItem18.Text = "4";
//
// menuItem12
//
this.menuItem12.Index = 1;
this.menuItem12.Text = "-";
//
// menuItem13
//
this.menuItem13.Index = 2;
this.menuItem13.Text = "在线";
//
// menuItem14
//
this.menuItem14.Index = 3;
this.menuItem14.Text = "离线";
//
// menuItem8
//
this.menuItem8.Index = 2;
this.menuItem8.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem9});
this.menuItem8.Text = "帮助";
//
// menuItem9
//
this.menuItem9.Index = 0;
this.menuItem9.Text = "关于";
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 699);
this.statusBar.Name = "statusBar";
this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3});
this.statusBar.ShowPanels = true;
this.statusBar.Size = new System.Drawing.Size(1016, 22);
this.statusBar.TabIndex = 0;
this.statusBar.Text = "statusBar1";
//
// statusBarPanel1
//
this.statusBarPanel1.Text = "statusBarPanel1";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -