private bool AddLoadingCount(FAECInfo.PACKING_MASTER_INFO_RPY masterInfo, out bool changedLot)
        {
            changedLot = false;

            if (string.IsNullOrEmpty(CurrentLotInfo.LOT_ID) && LoadingCount == 0)
            {
                if (GlobalConfigModule.RobotWorkType == ERobotWorkType.StartAtScanedFirstSmallBox)
                    changedLot = true;
                LoadingCount++;
                masterInfo.CopyTo(CurrentLotInfo);
                return true;
            }
            else
            {
                if (CurrentLotInfo.LOT_ID == masterInfo.LOT_ID)
                {
                    LoadingCount++;

                    if (GlobalConfigModule.RobotWorkType == ERobotWorkType.StartAtScanedLastSmallBox)
                    {
                        if (LoadingCount == MAX_SMALLBOX_COUNT)
                            changedLot = true;
                    }

                    return true;
                }
                else
                    return false;
            }
        }
        private bool AddLoadingCount(FAECInfo.PACKING_MASTER_INFO_RPY masterInfo, string serial, out bool changedLot, out bool differentLot, out bool duplicateSerial)
        {
            changedLot = false;
            duplicateSerial = false;
            differentLot = false;

            if (string.IsNullOrEmpty(CurrentLotInfo.LOT_ID) && LoadingCount == 0)
            {
                changedLot = true;
                LoadingCount++;
                CurrentLotProductList.Add(serial);
                masterInfo.CopyTo(CurrentLotInfo);
                return true;
            }
            else
            {
                if (CurrentLotInfo.LOT_ID == masterInfo.LOT_ID)
                {
                    if (CurrentLotProductList.Contains(serial) == true)
                    {
                        duplicateSerial = true;
                        return false;
                    }
                    else
                    {
                        LoadingCount++;
                        CurrentLotProductList.Add(serial);
                        return true;
                    }
                }
                else
                {
                    differentLot = true;
                    return false;
                }
            }
        }
        public void AddWork(FAECInfo.PACKING_MASTER_INFO_RPY packingMasterInfo, FAProductInfo allProductInfo)
        {
            RobotWork robotWork = new RobotWork();
            allProductInfo.CopyTo(robotWork.AllProductInfo);

            packingMasterInfo.CopyTo(robotWork.ProductInfo);
            robotWork.SmallBoxCount = packingMasterInfo.LOT_QTY / packingMasterInfo.S_BOX_MOQ;
            if (packingMasterInfo.LOT_QTY % packingMasterInfo.S_BOX_MOQ > 0)
                robotWork.SmallBoxCount += 1;

            int largeBoxCount = robotWork.SmallBoxCount / robotWork.ProductInfo.L_BOX_MOQ;
            if (robotWork.SmallBoxCount % robotWork.ProductInfo.L_BOX_MOQ > 0)
                largeBoxCount += 1;

            int smallBoxCountIncludeEmptyBox = robotWork.ProductInfo.L_BOX_MOQ * largeBoxCount;
            robotWork.TotalSmallBoxCount = smallBoxCountIncludeEmptyBox;

            WorkQueue.Enqueue(robotWork);
        }