MycronicControl.cs 3.0 KB
using DeviceLibrary;
using OnlineStore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TheMachine.device.Other
{
    public partial class MycronicControl : UserControl
    {
        public MycronicControl()
        {
            InitializeComponent();
        }

        private void MycronicControl_Load(object sender, EventArgs e)
        {
            uc_boxdebug1.Init(RobotManage.MI1Postion);
            uc_boxdebug2.Init(RobotManage.MI2Postion);
            uc_boxdebug3.Init(RobotManage.CIPostion);

            ucurRobot1.Init(RobotManage.Robot_MI1);
            ucurRobot2.Init(RobotManage.Robot_MI2);
            ucurRobot3.Init(RobotManage.Robot_CI);

            #region 状态信息listview初始化
            stateView.View = View.Details;
            ColumnHeader c1 = new ColumnHeader();
            c1.Text = "";
            c1.Width = 0;
            ColumnHeader c2 = new ColumnHeader();
            c2.Text = "Tower ID";
            c2.Width = 120;
            ColumnHeader c3 = new ColumnHeader();
            c3.Text = "Status";
            c3.Width = 120;
            ColumnHeader c4 = new ColumnHeader();
            c4.Text = crc.GetString("Form1_tabc_tabP1_Text", "信息");
            c4.Width = 470;

            stateView.Columns.Add(c1);
            stateView.Columns.Add(c2);
            stateView.Columns.Add(c3);
            stateView.Columns.Add(c4);
            #endregion
            crc.LanguageChangeEvent += Crc_LanguageChangeEvent; ;

        }

        private void Crc_LanguageChangeEvent(object sender, EventArgs e)
        {
            stateView.Columns[1].Text = "Tower ID";
            stateView.Columns[2].Text = "Status";
            stateView.Columns[3].Text = crc.GetString("Form1_tabc_tabP1_Text", "信息");
        }

        private void tabPage4_Click(object sender, EventArgs e)
        {

        }

        private void btn_manualout_Click(object sender, EventArgs e)
        {
            VStoreCollection.VStoreList.Values.First().VLog.Info("手动出库:"+ txt_reelid.Text);
            VStoreCollection.VStoreList.Values.First().ServerCM.BeginOutStore(new JobInfo(txt_reelid.Text, "", 0, 0), RobotManage.VStoreCollection.VLog);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            stateView.Items.Clear();
            foreach (var store in VStoreCollection.VStoreList.Values.ToList()) {

                ListViewItem lvi = new ListViewItem(new string[] { "", store.CID, store.RTStoreStatus.ToString(), store.GetStateStr() });
                stateView.Items.Add(lvi);
            }
        }

        private void btn_ResetRobot_Click(object sender, EventArgs e)
        {
            if (RobotManage.isRunning)
            {
                MessageBox.Show("请先停止系统运行");
                return;
            }

            MI.DeviceList["AMH-MI1"].
        }
    }
}