Exemplo n.º 1
0
        public Case_Load CreateTray(BaseCaseData caseData)
        {
            ATCCaseData ATCcData = caseData as ATCCaseData;

            if (ATCcData == null)
            {
                Log.Write("ERROR: Bad cast to ATCCaseData in CreateCaseLoad", Color.Red);
                return(null);
            }

            return(CreateTray(
                       ATCcData.mts,
                       ATCcData.TUIdent,
                       ATCcData.TUType,
                       ATCcData.source,
                       ATCcData.destination,
                       ATCcData.presetStateCode,
                       ATCcData.Height,
                       ATCcData.Width,
                       ATCcData.Length,
                       ATCcData.Weight,
                       ATCcData.colour.ToString(),
                       TrayStatus.Loaded,
                       ATCcData.TrayStacks
                       ));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the ATC Case Data that the load will hold from the telegram
        /// </summary>
        public ATCCaseData CreateATCCaseData(string[] telegramFields, string index = "")
        {
            ATCCaseData caseData = new ATCCaseData();
            float       length, width, height, weight;

            float.TryParse(telegramFields.GetFieldValue(TelegramFields.length, index), out length);
            float.TryParse(telegramFields.GetFieldValue(TelegramFields.width, index), out width);
            float.TryParse(telegramFields.GetFieldValue(TelegramFields.height, index), out height);
            float.TryParse(telegramFields.GetFieldValue(TelegramFields.weight, index), out weight);

            caseData.Length = length / 1000;
            caseData.Width  = width / 1000;
            caseData.Height = height / 1000;
            caseData.Weight = weight;
            caseData.colour = LoadColor(telegramFields.GetFieldValue(TelegramFields.color, index));

            caseData.TUIdent         = telegramFields.GetFieldValue(TelegramFields.tuIdent, index);
            caseData.TUType          = telegramFields.GetFieldValue(TelegramFields.tuType, index);
            caseData.mts             = telegramFields.GetFieldValue(TelegramFields.mts);
            caseData.presetStateCode = telegramFields.GetFieldValue(TelegramFields.presetStateCode, index);
            caseData.source          = telegramFields.GetFieldValue(TelegramFields.source, index);
            caseData.destination     = telegramFields.GetFieldValue(TelegramFields.destination, index);

            return(caseData);
        }
Exemplo n.º 3
0
        public Case_Load CreateCaseLoad(BaseCaseData caseData)
        {
            //Need to either create a case or a tray here
            if (LoadType == LoadTypes.Case)
            {
                MeshInfo boxInfo = new MeshInfo()
                {
                    color    = caseData.colour,
                    length   = caseData.Length,
                    width    = caseData.Width,
                    height   = caseData.Height,
                    filename = Case_Load.GraphicsMesh
                };

                ATCCaseLoad load     = new ATCCaseLoad(boxInfo);
                ATCCaseData ATCcData = caseData as ATCCaseData;

                if (ATCcData == null)
                {
                    Log.Write("ERROR: Bad cast to ATCCaseData in CreateCaseLoad", Color.Red);
                    return(null);
                }

                load.Weight          = caseData.Weight / 1000f;
                load.TUIdent         = ATCcData.TUIdent;
                load.TUType          = ATCcData.TUType;
                load.Source          = ATCcData.source;
                load.Destination     = ATCcData.destination;
                load.PresetStateCode = ATCcData.presetStateCode;
                //load.MTS = ATCcData.mts;

                return(load);
            }
            else if (LoadType == LoadTypes.Tray)
            {
                return(CreateTray(caseData));
            }
            else
            {
                return(null);
            }
        }