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.Diagnostics;

namespace GcDevicePc
{
    public delegate void Fireport(int flag,ushort futime,ushort hvtime);  //点火委托
    public partial class FormUser : Form
    {
        public FormUser()
        {
          
            InitializeComponent();
           
        }

        private void FormUser_Load(object sender, EventArgs e)
        {
          //  userCtl1.Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
         
        }

        private void FormUser_Activated(object sender, EventArgs e)  //激活
        {
         //   Console.WriteLine("激活");

        }

        private void FormUser_Deactivate(object sender, EventArgs e) //停用
        {
           // MessageBox.Show("停用");
           // Console.WriteLine("停用");
        }
        public event Fireport autofire;
        //点火操作
        private void buttonFID_Click(object sender, EventArgs e)
        {
            if (globaldata.m_dpbuffer.ShowList.showDet.fDetStatue != 2)
                autofire(0, 10, 5);
            else
                MessageBox.Show("点火操作禁止，FID已经点火成功");

        }
        //自动校准
        private void buttonauto_Click(object sender, EventArgs e)  
        {
           

            DialogResult dr = new CK_UI.LandIn("calibration").ShowDialog();

            if (dr == DialogResult.OK)
            {
                if (CK_UI.LandIn.Island)
                {
                    CKVocAnalyzer.AutoAdjust auto = new CKVocAnalyzer.AutoAdjust();
                    auto.Show();
                    Trace.WriteLine(string.Format("用户{0}，进入自动校准模式", "calibration"), "sys");
                }else
                {
                    MessageBox.Show("无权限操作！！！！");
                }
            }

            if (dr == DialogResult.No)
            {
               // MessageBox.Show("无权限操作！！！！");
            }


        }
      
    }
}
