コード例 #1
0
        /// <summary>
        /// 根据机台配置获取IO配置,新增IO配置,需要修改此方法
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public static IIOSetupable GetIOSetupable(MachineSetting setting)
        {
            IIOSetupable ioSetupable = null;

            if (setting.MachineSelect == MachineSelection.AD16 || setting.MachineSelect == MachineSelection.iJet7 || setting.MachineSelect == MachineSelection.AFN)
            {
                switch (setting.CardSelect)
                {
                case CardSelection.Gts8x1:
                    ioSetupable = new IOSetupAD16_Gts8x1();
                    break;

                case CardSelection.Gts4x2:
                    ioSetupable = new IOSetupAD16_Gts4x2();
                    break;

                case CardSelection.ADMC4:
                    ioSetupable = new IOSetupAD16_ADMC4();
                    break;

                case CardSelection.Gts4x1:
                    if (setting.AxesStyle == Motion.ActiveItems.RobotAxesStyle.XYZU || setting.AxesStyle == Motion.ActiveItems.RobotAxesStyle.XYZ)
                    {
                        if (setting.ConveyorSelect == ConveyorSelection.双轨)
                        {
                            ioSetupable = new IOSetupAD16_Gts4_单阀双轨();
                        }
                        else
                        {
                            ioSetupable = new IOSetupAD16_Gts8x1();
                        }
                    }
                    break;
                }
            }
            else if (setting.MachineSelect == MachineSelection.iJet6)
            {
                ioSetupable = new IOSetupIjet6();
            }
            else if (setting.MachineSelect == MachineSelection.AD19)
            {
                ioSetupable = new IOSetupAD19();
            }
            else if (setting.MachineSelect == MachineSelection.YBSX)
            {
                ioSetupable = new IOSetupYBSX_Gts4();
            }
            else if (setting.MachineSelect == MachineSelection.RTV)
            {
                ioSetupable = new IOSetupRTV();
            }
            else if (setting.MachineSelect == MachineSelection.TSV300)
            {
                ioSetupable = new IOSetupTSV300();
            }
            return(ioSetupable);
        }
コード例 #2
0
 public PageSetupMachine()
 {
     InitializeComponent();
     this.ShowBorder = false;
     this.propertyGrid1.SelectedObject = Machine.Instance.Setting;
     if (Machine.Instance.Setting != null)
     {
         this.SettingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
     }
 }
コード例 #3
0
 public SettingMachineForm()
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.FixedDialog;
     this.StartPosition   = FormStartPosition.CenterScreen;
     this.propertyGrid1.SelectedObject = Machine.Instance.Setting;
     if (Machine.Instance.Setting != null)
     {
         this.SettingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
     }
     this.ReadLanguageResources();
 }
コード例 #4
0
        public ValveSetupForm Setup()
        {
            this.listBox1.Items.Add("喷射阀[DJ-Series]");
            this.listBox1.Items.Add("螺杆阀[SV-Series]");
            this.listBox1.Items.Add("齿轮泵阀[Gear-Series]");

            this.listBox2.Items.Add("喷射阀[DJ-Series]");
            this.listBox2.Items.Add("螺杆阀[SV-Series]");
            this.listBox2.Items.Add("齿轮泵阀[Gear-Series]");

            if (Machine.Instance.Valve1.ValveSeries == ValveSeries.喷射阀)
            {
                this.listBox1.SelectedIndex = 0;
                this.valve1 = new JtValve(Machine.Instance.Valve1);
            }
            else if (Machine.Instance.Valve1.ValveSeries == ValveSeries.螺杆阀)
            {
                this.listBox1.SelectedIndex = 1;
                this.valve1 = new SvValve(Machine.Instance.Valve1);
            }
            else if (Machine.Instance.Valve1.ValveSeries == ValveSeries.齿轮泵阀)
            {
                this.listBox1.SelectedIndex = 2;
                this.valve1 = new GearValve(Machine.Instance.Valve1);
            }

            if (Machine.Instance.Valve2.ValveSeries == ValveSeries.喷射阀)
            {
                this.listBox2.SelectedIndex = 0;
                this.valve2 = new JtValve(Machine.Instance.Valve2);
            }
            else if (Machine.Instance.Valve2.ValveSeries == ValveSeries.螺杆阀)
            {
                this.listBox2.SelectedIndex = 1;
                this.valve2 = new SvValve(Machine.Instance.Valve2);
            }
            else if (Machine.Instance.Valve2.ValveSeries == ValveSeries.齿轮泵阀)
            {
                this.listBox2.SelectedIndex = 2;
                this.valve2 = new GearValve(Machine.Instance.Valve2);
            }


            this.cmbValveSelect.Items.Add(strValveSetup1);
            this.cmbValveSelect.Items.Add(strValveSetup2);
            this.cmbValveSelect.SelectedIndex = (int)Machine.Instance.Setting.ValveSelect;
            if (Machine.Instance.Setting != null)
            {
                this.settingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
            }
            return(this);
        }
コード例 #5
0
ファイル: PageSetupValves.cs プロジェクト: SetCode/Fluid
        public void setup()
        {
            this.metroSetListBox1.Items.Add("Valve1[DJ-Series]");
            this.metroSetListBox1.Items.Add("Valve1[SV-Series]");
            this.metroSetListBox1.Items.Add("Valve1[Gear-Series]");

            this.metroSetListBox2.Items.Add("Valve2[DJ-Series]");
            this.metroSetListBox2.Items.Add("Valve2[SV-Series]");
            this.metroSetListBox2.Items.Add("Valve2[Gear-Series]");

            if (Machine.Instance.Valve1.ValveSeries == ValveSeries.喷射阀)
            {
                this.metroSetListBox1.SelectedIndex = 0;
                this.valve1 = new JtValve(Machine.Instance.Valve1);
            }
            else if (Machine.Instance.Valve1.ValveSeries == ValveSeries.螺杆阀)
            {
                this.metroSetListBox1.SelectedIndex = 1;
                this.valve1 = new SvValve(Machine.Instance.Valve1);
            }
            else if (Machine.Instance.Valve1.ValveSeries == ValveSeries.齿轮泵阀)
            {
                this.metroSetListBox1.SelectedIndex = 2;
                this.valve1 = new GearValve(Machine.Instance.Valve1);
            }

            if (Machine.Instance.Valve2.ValveSeries == ValveSeries.喷射阀)
            {
                this.metroSetListBox2.SelectedIndex = 0;
                this.valve2 = new JtValve(Machine.Instance.Valve2);
            }
            else if (Machine.Instance.Valve2.ValveSeries == ValveSeries.螺杆阀)
            {
                this.metroSetListBox2.SelectedIndex = 1;
                this.valve2 = new SvValve(Machine.Instance.Valve2);
            }
            else if (Machine.Instance.Valve2.ValveSeries == ValveSeries.齿轮泵阀)
            {
                this.metroSetListBox2.SelectedIndex = 2;
                this.valve2 = new GearValve(Machine.Instance.Valve2);
            }

            this.cmbValveSelect.Items.Add(strValveSetup1);
            this.cmbValveSelect.Items.Add(strValveSetup2);
            this.cmbValveSelect.SelectedIndex = (int)Machine.Instance.Setting.ValveSelect;
            if (Machine.Instance.Setting != null)
            {
                this.settingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
            }
        }
コード例 #6
0
ファイル: PageSetupMachine.cs プロジェクト: SetCode/Fluid
 public PageSetupMachine()
 {
     InitializeComponent();
     this.ShowBorder = false;
     this.propertyGrid1.SelectedObject = Machine.Instance.Setting;
     if (Machine.Instance.Setting != null)
     {
         this.SettingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
     }
     //权限加载
     this.accessExecutor = new AccessExecutor(this);
     this.LoadAccess();
     AccessControlMgr.Instance.Register(this);
 }
コード例 #7
0
        public IOSetupForm()
        {
            InitializeComponent();
            this.ReadLanguageResources();
            this.StartPosition   = FormStartPosition.CenterParent;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox     = false;

            this.comboBox1.Items.Add(MachineSelection.AD16);
            this.comboBox1.Items.Add(MachineSelection.iJet7);
            this.comboBox1.Items.Add(MachineSelection.iJet6);
            this.comboBox1.Items.Add(MachineSelection.AD19);
            this.comboBox1.SelectedItem = Machine.Instance.Setting.MachineSelect;

            this.SettingBackUp = (MachineSetting)Machine.Instance.Setting.Clone();
        }
        public CreateClient(MachineInfoDTO machine)
        {
            this.ipAddress   = machine.IpAddress;
            this.portNo      = (ushort)machine.PortNo;
            this.machineId   = machine.MachineId;
            this.MName       = this.machineId;
            this.interfaceId = machine.InterfaceId;
            this.setting     = machine.Settings;
            this.machineDTO  = machine;

            _timeDelayMainThread = (int)TimeSpan.FromSeconds(10).TotalMilliseconds;
            if (_timeDelayMainThread <= 4000)
            {
                _timeDelayMainThread = 4000;
            }

            int alaramsHistoryTimerDelay = (int)TimeSpan.FromMinutes(1).TotalMilliseconds;

            if (alaramsHistoryTimerDelay > 0 && alaramsHistoryTimerDelay < (int)TimeSpan.FromMinutes(1).TotalMilliseconds)
            {
                alaramsHistoryTimerDelay = (int)TimeSpan.FromMinutes(1).TotalMilliseconds;
            }

            int alarmsDataHundaiWiaTimerDelay = 0;

            int.TryParse(ConfigurationManager.AppSettings["TimeDelayAlarmsDataHundaiWiaThread"], out alarmsDataHundaiWiaTimerDelay);
            if (alarmsDataHundaiWiaTimerDelay > 0)
            {
                alarmsDataHundaiWiaTimerDelay = (int)TimeSpan.FromSeconds(alarmsDataHundaiWiaTimerDelay).TotalMilliseconds;
            }

            if (alaramsHistoryTimerDelay > 0)
            {
                _timerAlarmHistory = new Timer(GetAlarmsData, null, 1000, alaramsHistoryTimerDelay);
            }

            if (alarmsDataHundaiWiaTimerDelay > 0)
            {
                _timerAlarmsDataHundaiWia = new Timer(GetAlarmsDataHundaiWia, null, 2000, alarmsDataHundaiWiaTimerDelay);
            }
        }
コード例 #9
0
        /// <summary>
        /// 更加机台配置获取卡配置,新增卡需要更改此方法
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public static ICardSetupable GetCardSetup(MachineSetting setting)
        {
            ICardSetupable rtn = null;

            switch (setting.CardSelect)
            {
            case CardSelection.Gts8x1:
                rtn = new CardSetupGts8x1();
                break;

            case CardSelection.Gts4x2:
                rtn = new CardSetupGts4x2();
                break;

            case CardSelection.Gts4x1:
                if (setting.AxesStyle == Motion.ActiveItems.RobotAxesStyle.XYZR)
                {
                    rtn = new CardSetupGts4_XYZR();
                }
                else if (setting.AxesStyle == Motion.ActiveItems.RobotAxesStyle.XYZU)
                {
                    rtn = new CardSetupGts4_XYZU();
                }
                else if (setting.AxesStyle == Motion.ActiveItems.RobotAxesStyle.XYZ)
                {
                    rtn = new CardSetupGts4_XYZ();
                }
                break;

            case CardSelection.ADMC4:
                rtn = new CardSetupADMC();
                break;

            case CardSelection.Gts8_RTV:
                rtn = new CardSetupGts8_RTV();
                break;
            }
            return(rtn);
        }
コード例 #10
0
ファイル: GlobalConfig.cs プロジェクト: icprog/HmiPro
        /// <summary>
        /// 加载 Globa.xls 配置文件
        /// </summary>
        /// <param name="path"></param>
        public static void Load(string path)
        {
            path = YUtil.GetAbsolutePath(path);
            MachineSettingDict = new Dictionary <string, MachineSetting>();
            IpToHmiDict        = new Dictionary <string, string>();
            using (var xlsOp = new XlsService(path)) {
                var speedDt = xlsOp.ExcelToDataTable("逻辑配置", true);
                foreach (DataRow row in speedDt.Rows)
                {
                    MachineSetting setting = new MachineSetting();
                    setting.Code = row["Code"].ToString();
                    if (string.IsNullOrEmpty(setting.Code))
                    {
                        continue;
                    }
                    setting.OeeSpeed = row["OeeSpeed"].ToString();
                    var oeeSpeedMax = row["OeeSpeedMax"].ToString();
                    if (!string.IsNullOrEmpty(oeeSpeedMax) && !string.IsNullOrEmpty(setting.OeeSpeed))
                    {
                        //从Mq接受最大速度
                        if (oeeSpeedMax.ToUpper().StartsWith("MQ_"))
                        {
                            setting.OeeSpeedMax  = oeeSpeedMax.Split('_')[1];
                            setting.OeeSpeedType = OeeActions.CalcOeeSpeedType.MaxSpeedMq;
                            //从Plc中读取最大速度
                        }
                        else if (oeeSpeedMax.ToUpper().StartsWith("PLC_"))
                        {
                            setting.OeeSpeedMax  = oeeSpeedMax.Split('_')[1];
                            setting.OeeSpeedType = OeeActions.CalcOeeSpeedType.MaxSpeedPlc;
                            //最大速度为设定值
                        }
                        else if (float.TryParse(row["OeeSpeedMax"].ToString(), out var maxSettingVal))
                        {
                            if (maxSettingVal == 0)
                            {
                                throw new Exception($"机台{setting.Code} 的 OeeSpeedMax1Setting 为0,请检查");
                            }
                            setting.OeeSpeedMax  = maxSettingVal;
                            setting.OeeSpeedType = OeeActions.CalcOeeSpeedType.MaxSpeedSetting;
                        }
                    }
                    setting.MqNeedSpeed  = row["MqNeedSpeed"].ToString();
                    setting.StateSpeed   = row["StateSpeed"].ToString();
                    setting.NoteMeter    = row["NoteMeter"].ToString();
                    setting.Spark        = row["Spark"].ToString();
                    setting.Od           = row["Od"].ToString();
                    setting.CpmModuleIps = row["CpmModuleIps"].ToString().Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    setting.DPms         = row["Dpms"].ToString().Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    setting.ProcessName  = row["Process"]?.ToString();
                    //setting.StartTrayNum = int.Parse(row["StartTrayNum"].ToString());
                    MachineSettingDict[setting.Code] = setting;
                }

                var ipDt = xlsOp.ExcelToDataTable("Ip配置", true);
                foreach (DataRow row in ipDt.Rows)
                {
                    IpToHmiDict[row["Ip"].ToString()] = row["Hmi"].ToString();
                    var hmi = row["hmi"].ToString().Split('_');
                    //保证后续逻辑不会出现空指针
                    foreach (var s in hmi)
                    {
                        if (!MachineSettingDict.ContainsKey(s))
                        {
                            MachineSettingDict[s] = new MachineSetting();
                        }
                    }
                }

                var otherDt = xlsOp.ExcelToDataTable("其它配置", true);
                foreach (DataRow row in otherDt.Rows)
                {
                    var name  = row["Name"].ToString().ToUpper();
                    var value = row["Value"].ToString().ToUpper();
                    //RC、RF这种收线盘不贴卡,放栈板上面的
                    //即它们的收线盘的 Rfid 就是栈板的 Rfid,多个收线盘共用一个 Rfid
                    if (name == "栈板机台")
                    {
                        PalletMachineCodes = value.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    }
                    else if (name == "重启机台")
                    {
                        UpdateMustReartHmiNames = value.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    }
                }
            }
        }
コード例 #11
0
 public void SetMachineSetting(MachineSetting name, string MachineName, string value)
 {
     _provider.SetSetting(EntityType.Machine.ToString(), MachineName, name.ToString(), value);
 }
コード例 #12
0
 public string GetMachineSetting(MachineSetting name, string MachineName)
 {
     return(_provider.GetSetting(EntityType.Machine.ToString(), MachineName, name.ToString()));
 }