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 GcDevicePc.GCBuffer;

namespace GcDevicePc.DeviceConfigUI
{
    public partial class ColumnBox : Form
    {
        #region 私有变量
        private HWConfig hWConfig;
        #endregion

        #region 构造函数
        public ColumnBox()
        {
            InitializeComponent();
        }

        public ColumnBox(ref HWConfig hwconfig)
        {
            InitializeComponent();
            this.hWConfig = hwconfig;
        }
        #endregion

        #region 窗口事件
        private void ColumnBox_Load(object sender, EventArgs e)
        {
            if (hWConfig != null)
            {
                this.Col.Checked = this.hWConfig.hwconfiginfo.u16Col == 1 ? true : false;
                this.ColType.SelectedIndex = this.hWConfig.hwconfiginfo.u16ColType;
                this.ColPTemp.Text = this.hWConfig.hwconfiginfo.u16ColPTemp.ToString();


            }

        }
        #endregion


        #region 控件事件
        private void okbtn_Click(object sender, EventArgs e)
        {
            if (hWConfig != null)
            {

                this.hWConfig.hwconfiginfo.u16Col = this.Col.Checked ? 1:0;
                this.hWConfig.hwconfiginfo.u16ColType = this.ColType.SelectedIndex;
                this.hWConfig.hwconfiginfo.u16ColPTemp = int.Parse(this.ColPTemp.Text);

            }
            this.Close();
        }

        private void cancelbtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion
    }
}
