Esempio n. 1
0
        public SubEquipment()
        {
            MaterialManagerInstance = new MaterialManager();
            PackingLogManager = new Manager.PackingLogManager();
            BackgroundSequenceManager = new FASequenceManager();
            BandingMachineSequenceManager = new FASequenceManager();

            VT8792MaterialManager.OnUpdate +=
                delegate(object sender, FAGenericEventArgs<string[]> e)
                {
                    PackingLogManager.WriteMaterialLog(e.Value);
                };

            OnChangedUser +=
                delegate(object sender, FAGenericEventArgs<Equipment.UserInfo> e)
                {
                    if (e.Value.Permission == Equipment.UserPermissionTypes.OPERATOR)
                        LastLoginOperator = e.Value;
                };

            _backgroundThread = new System.Threading.Thread(
                delegate(object obj)
                {
                    while (_backgroundThreadStopRequest == false)
                    {
                        try
                        {
                            if (VT8792MaterialManager != null)
                            {
                                var trayCount = System.IO.File.ReadAllText(System.IO.Path.Combine(ConfigClasses.GlobalConst.MATERIAL_PATH, "trayCount.txt"));
                                var trayCountArray = trayCount.Split(',');

                                if (trayCountArray.Length == 5)
                                {
                                    SetTrayCount(VT8792MaterialManager.Materials.TrayInTheTrayStacker1, trayCountArray[0]);
                                    SetTrayCount(VT8792MaterialManager.Materials.TrayInTheTrayStacker2, trayCountArray[1]);
                                    SetTrayCount(VT8792MaterialManager.Materials.TrayInTheTrayStacker3, trayCountArray[2]);
                                    SetTrayCount(VT8792MaterialManager.Materials.TrayInTheTrayStacker4, trayCountArray[3]);
                                    SetTrayCount(VT8792MaterialManager.Materials.TrayInTheTrayStacker5, trayCountArray[4]);
                                }
                            }
                        }
                        catch
                        {
                        }

                        System.Threading.Thread.Sleep(5000);
                    }
                });

            _backgroundThread.Start();

            GEM.GEMDefine.AccessClass();
            Utility.GEM.GEMManager.Instance.Initialize(Utility.GEM.CEID.ObjectList,
                Utility.GEM.SVID.ObjectList);
            Utility.GEM.GEMManager.Instance.GEM.OnRemoteCommand += GemOnRemoteCommand;
            Utility.GEM.GEMManager.Instance.Start();
        }
Esempio n. 2
0
        public SubEquipment()
        {
            MaterialManagerInstance = new MaterialManager();
            PackingLogManager = new Manager.PackingLogManager();
            BackgroundSequenceManager = new FASequenceManager();
            ProductOutput.UseSetUPHOnTrackOut = true;

            VT5081MaterialManager.OnUpdate +=
                delegate(object sender, FAGenericEventArgs<string[]> e)
                {
                    PackingLogManager.WriteMaterialLog(e.Value);
                };

            OnChangedUser +=
                delegate(object sender, FAGenericEventArgs<Equipment.UserInfo> e)
                {
                    if (e.Value.Permission == Equipment.UserPermissionTypes.OPERATOR)
                        LastLoginOperator = e.Value;
                };

            _backgroundThread = new System.Threading.Thread(
                delegate(object obj)
                {
                    while (_backgroundThreadStopRequest == false)
                    {
                        try
                        {
                            if (VT5081MaterialManager != null)
                            {
                                if (BoxFormingUnit != null &&
                                    BoxFormingUnit.BoxEmpty != null &&
                                    BoxFormingUnit.BoxEmpty.IsOn)
                                {
                                    VT5081MaterialManager.Materials.LargeBox.RemainQuantity = 0;
                                    VT5081MaterialManager.Materials.LargeBox.UseQuantity = 50;
                                }
                                else
                                {
                                    VT5081MaterialManager.Materials.LargeBox.RemainQuantity = 50;
                                    VT5081MaterialManager.Materials.LargeBox.UseQuantity = 0;
                                }

                                if (DummyBoxLoadingUnit != null &&
                                    DummyBoxLoadingUnit.StackerBoxSensor != null &&
                                    DummyBoxLoadingUnit.StackerBoxSensor.IsOff)
                                {
                                    VT5081MaterialManager.Materials.EmptyBox.RemainQuantity = 0;
                                    VT5081MaterialManager.Materials.EmptyBox.UseQuantity = 20;
                                }
                                else
                                {
                                    VT5081MaterialManager.Materials.EmptyBox.RemainQuantity = 20;
                                    VT5081MaterialManager.Materials.EmptyBox.UseQuantity = 0;
                                }
                            }
                        }
                        catch
                        {
                        }

                        System.Threading.Thread.Sleep(5000);
                    }
                });

            _backgroundThread.Start();

            GEM.GEMDefine.AccessClass();
            Utility.GEM.GEMManager.Instance.Initialize(Utility.GEM.CEID.ObjectList,
                Utility.GEM.SVID.ObjectList);
            Utility.GEM.GEMManager.Instance.GEM.OnRemoteCommand += GemOnRemoteCommand;
            Utility.GEM.GEMManager.Instance.Start();
        }
Esempio n. 3
0
        public SubEquipment()
        {
            MaterialManagerInstance = new MaterialManager();
            PackingLogManager = new Manager.PackingLogManager();
            BackgroundSequenceManager = new FASequenceManager();
            PrinterAndBandingSequenceManager = new FASequenceManager();
            ProductOutput.UseSetUPHOnTrackOut = true;

            VT5070MaterialManager.OnUpdate +=
                delegate(object sender, FAGenericEventArgs<string[]> e)
                {
                    PackingLogManager.WriteMaterialLog(e.Value);
                };

            OnChangedUser +=
                delegate(object sender, FAGenericEventArgs<Equipment.UserInfo> e)
                {
                    if (e.Value.Permission == Equipment.UserPermissionTypes.OPERATOR)
                        LastLoginOperator = e.Value;
                };

            _backgroundThread = new System.Threading.Thread(
                delegate(object obj)
                {
                    while (_backgroundThreadStopRequest == false)
                    {
                        try
                        {
                            if (VT5070MaterialManager != null)
                            {
                                var boxCountString = System.IO.File.ReadAllText(@"z:\\RemainBoxCount.txt");
                                var foamPadCountString = System.IO.File.ReadAllText(@"z:\\RemainFoamPadCount.txt");

                                double boxCount = 0.0;
                                double foamPadCount = 0.0;

                                if (double.TryParse(boxCountString, out boxCount) == true)
                                {
                                    VT5070MaterialManager.Materials.SmallBox.RemainQuantity = boxCount;
                                    VT5070MaterialManager.Materials.SmallBox.UseQuantity = VT5070MaterialManager.Materials.SmallBox.Max - VT5070MaterialManager.Materials.SmallBox.RemainQuantity;
                                }

                                if (double.TryParse(foamPadCountString, out foamPadCount) == true)
                                {
                                    VT5070MaterialManager.Materials.FoamPad.RemainQuantity = foamPadCount;
                                    VT5070MaterialManager.Materials.FoamPad.UseQuantity = VT5070MaterialManager.Materials.FoamPad.Max - VT5070MaterialManager.Materials.FoamPad.RemainQuantity;
                                }
                            }
                        }
                        catch
                        {
                        }

                        System.Threading.Thread.Sleep(5000);
                    }
                });

            _backgroundThread.Start();

            GEM.GEMDefine.AccessClass();
            Utility.GEM.GEMManager.Instance.Initialize(Utility.GEM.CEID.ObjectList,
                Utility.GEM.SVID.ObjectList);
            Utility.GEM.GEMManager.Instance.GEM.OnRemoteCommand += GemOnRemoteCommand;
            Utility.GEM.GEMManager.Instance.Start();
        }