예제 #1
0
        private bool MESBatteryFill(int fillSeq, string palletID, List <string> batteryList, ref string reStr)
        {
            try
            {
                ANCStepResult stepRe = MesAcc.GetStep(palletID);
                if (stepRe.ResultCode != 0)
                {
                    reStr = stepRe.ResultMsg;
                    return(false);
                }

                int     channelMax = 36;
                JObject jsonObj    = new JObject(new JProperty("Type", "One"), new JProperty("TrayNO", palletID));
                if (fillSeq > 1)
                {
                    jsonObj["Type"] = "Two";
                }
                for (int i = 0; i < Math.Min(channelMax, batteryList.Count()); i++)
                {
                    jsonObj.Add("Cell" + (i + 1).ToString(), batteryList[i]);
                }
                VMResult re = MesAcc.UploadTrayCellInfo(jsonObj.ToString());
                if (re.ResultCode != 0)
                {
                    reStr = re.ResultMsg;
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }