Ejemplo n.º 1
0
        private void Init()
        {
            dockManager1.BeginUpdate();
            CETCManagerApp.Instance.m_pETETCStage.ReadConditions();

            if (m_Instance == null)
            {
                m_Instance          = this;
                main_DataManagement = new Main_DataManagement();
                main_TempChart      = new Main_TempChart();
                main_DataAnasis     = new Main_DataAnasis();
            }


            main_TempChart.TopLevel = false;
            main_TempChart.Parent   = this;
            main_TempChart.Show();
            main_TempChart.Dock = DockStyle.Fill;

            main_DataAnasis.TopLevel   = false;
            main_DataAnasis.ControlBox = false;
            main_DataAnasis.Dock       = DockStyle.Fill;
            dockPanelDataAnasis.Controls.Add(main_DataAnasis);


            main_DataManagement.TopLevel   = false;
            main_DataManagement.ControlBox = false;
            dockPanelManagement.Controls.Add(main_DataManagement);
            //main_DataManagement.Dock = DockStyle.Left;


            main_TempChart.Visible      = true;
            main_DataAnasis.Visible     = true;
            main_DataManagement.Visible = true;

            InitChannelBarButton();
            AutoSearchETCDevice();
            //SelectETCDevice();
            // 注册设备事件
            RegisterDeviceCommport();
            InitStatusBar();
            timer1.Enabled = true;

            barTool1.Offset = 0;
            barTool2.Offset = 0;
            barTool3.Offset = 0;


            dockManager1.EndUpdate();
        }
Ejemplo n.º 2
0
        //为了保证在关闭某一浮动窗体之后,再打开时能够在原位置显示,要对浮动窗体处理,处理窗体的DockstateChanged事件,标签窗体dock位置改变,记录到公共类

        /*public  void Main_DataManagement_DockStateChanged(object sender, EventArgs e)
         * {
         *  //关闭时(dockstate为unknown) 不把dockstate保存
         *  if (m_Instance != null)
         *  {
         *      if (this.DockState == DockState.Unknown || this.DockState == DockState.Hidden)
         *      {
         *          return;
         *      }
         *
         *      AppConfig.dockState1 = this.DockState;
         *  }
         * }  */


        private void Main_DataManagement_FormClosed(object sender, FormClosedEventArgs e)
        {
            m_Instance = null;  // 否则下次打开时报错,提示“无法访问已释放对象”
        }