StoreSettingControl.cs 1.8 KB
using CodeLibrary;
using ConfigHelper;
using DeviceLibrary;
using OnlineStore;
using OnlineStore.ACSingleStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TheMachine
{
    public partial class StoreSettingControl : UserControl
    {
        StoreMachine Machine;
        public StoreSettingControl(StoreMachine machine)
        {
            Machine = machine;
            InitializeComponent();
            RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
        }

        private void RobotManage_LoadFinishEvent(bool state, string msg)
        {
            if (!state)
                return;

            if (!RobotManage.haveFixpos)
                cb_usefixpos.Visible = false;

        }


        private void SettingControl_Load(object sender, EventArgs e)
        {
            Config.PropertyBind($"Device_{Machine.MachineSide}_Use_Fixpos", cb_usefixpos, "Checked", "CheckedChanged");
        }


        private void button_positiontool_Click(object sender, EventArgs e)
        {
            if (RobotManage.isRunning)
            {
                MessageBox.Show(crc.GetString("Res0191","运行库位校准程序前,需要先停止料仓的运行"));
            }
            else
            {
                FrmPositionTool frmPositionTool = new FrmPositionTool(Machine.UpDown_Axis, SIO_Type.Laser_Location, Machine);
                frmPositionTool.ShowDialog();
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!Visible)
                return;
        }

    }
}