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;

namespace GcDevicePc
{
    //public delegate void GetHMIVersion( ref ushort[] version);

   

    public partial class InstrConfig : Form
    {
        public string Hmiversion = "";
        public string Tempversion = "";
        public string Powerversion = "";
        public string FID1version = "";
        public string FID2version = "";
        public string TCD1version = "";
       

        public InstrConfig(ushort[] buf)
        {
            InitializeComponent();
            this.Hmiversion = buf[1].ToString() + "." + buf[0].ToString();
            this.Tempversion = buf[3].ToString() + "." + buf[2].ToString();
            this.Powerversion = buf[5].ToString() + "." + buf[4].ToString();
            this.FID1version = buf[7].ToString() + "." + buf[6].ToString();
            this.FID2version = buf[9].ToString() + "." + buf[8].ToString();
            this.TCD1version = buf[11].ToString() + "." + buf[10].ToString();            
        }

       // public event GetHMIVersion getallversion;
        private void InstrConfig_Load(object sender, EventArgs e)
        {
            this.instrshow.Image = this.Instrcfgimage.Images[0];
            this.instrcreate.Image = this.Instrcfgimage.Images[1];            
            this.instrsend.Image = this.Instrcfgimage.Images[2];
            this.instrcheck.Image = this.Instrcfgimage.Images[3];

          //  ushort[] buf = new ushort[9];
           // getallversion(ref buf);

            this.tempver.Text = this.Tempversion;
            this.powerver.Text = this.Powerversion;
            this.fid1ver.Text = this.FID1version;
            this.fid2ver.Text = this.FID2version;
            this.tcdver.Text = this.TCD1version;
            this.PCver.Text = this.Hmiversion + "/1.4.8";
                   
        }

        private void instrcreate_Click(object sender, EventArgs e)
        {
            CreateConfig f = new CreateConfig();
            f.fatherForm = this;
            f.Show();
            this.Hide();
        }

        private void instrsend_Click(object sender, EventArgs e)
        {
            SendConfig f = new SendConfig();
            f.fatherForm = this;
            f.Show();
            this.Hide();
        }

        private void instrshow_Click(object sender, EventArgs e)
        {
            ShowConfig f = new ShowConfig();
            f.fatherForm = this;
            f.Show();
            this.Hide();
        }

        private void instrcheck_Click(object sender, EventArgs e)
        {
            ConfigInfo f = new ConfigInfo();
            f.fatherForm = this;
            f.Show();
            this.Hide();
        }
    }
}
