Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override IDeviceResponse ClearBuffer()
        {
            ResetLog();

            if (IgnoreSendMessage)
            {
                return(_deviceResponse);
            }
            Telegram.Length = 0;
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend1);

            return(TelegramResponse(1, ItemNeeded.STATUS));
        }
Exemple #2
0
        /// <summary>
        /// Get stautus
        /// </summary>
        /// <returns></returns>
        public override IDeviceResponse GetStatus()
        {
            ResetLog();
            int TelegramLen = 0;

            Telegram.Length = 0;
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
            Telegram.Append(CarAddress);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend9);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppendSS);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend11);
            TelegramLen = 18;
            return(TelegramResponse(TelegramLen, ItemNeeded.STATUS));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="shelfNum"></param>
        /// <returns></returns>
        private IDeviceResponse MoveCarousel(int shelfNum = 0)
        {
            ResetLog();

            Telegram.Length = 0;
            Telegram.Append('\x0002');
            Telegram.Append(CarAddress);
            Telegram.Append("3");                      //sub chanel value
            Telegram.Append("0000");
            Telegram.Append("G");
            Telegram.Append(shelfNum.ToString("000"));
            Telegram.Append('\x0003');
            Telegram.Append("s");
            TargetShelf = shelfNum;

            return(TelegramResponse(1, ItemNeeded.STATUS));
        }
        /// <summary>
        /// Calls the telegramResponse method to send the data to carousel
        /// </summary>
        /// <param name="isOutsideComputer"></param>
        /// <returns></returns>
        public override IDeviceResponse GetStatus(bool isOutsideComputer = false)
        {
            ResetLog();

            int telegramLen = 0;

            Telegram.Length = 0;
            Telegram.Append('\x0002');
            Telegram.Append(CarAddress);
            Telegram.Append(isOutsideComputer ? "4" : "3");
            Telegram.Append("0000");
            Telegram.Append("SS");
            Telegram.Append('\x0003');
            Telegram.Append("s");
            telegramLen = 18;

            return(TelegramResponse(telegramLen, ItemNeeded.STATUS));
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="shelfNum"></param>
        /// <returns></returns>
        private IDeviceResponse MoveCarousel(int shelfNum)
        {
            ResetLog();

            ClearDisplay();

            Telegram.Length = 0;
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
            Telegram.Append(CarAddress);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend9);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend10);
            Telegram.Append(shelfNum.ToString(Constants.TelegramAppend.CarWhiteTelegramAppend12));
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend11);
            TargetShelf = shelfNum;

            return(TelegramResponse(1, ItemNeeded.STATUS));
        }
Exemple #6
0
        /// <summary>
        /// move device using positionNum
        /// </summary>
        /// <param name="shelfNum"></param>
        /// <param name="slot"></param>
        /// <param name="transactionData"></param>
        /// <param name="message"></param>
        /// <param name="leftOffset"></param>
        /// <param name="positionNum"></param>
        /// <param name="isOutsideComputer"></param>
        /// <returns></returns>
        public override async Task <IDeviceResponse> Move(int shelfNum   = 0, Slot slot       = null, TransactionData transactionData = null,
                                                          string message = "", int leftOffset = 0, int positionNum                    = 0, bool isOutsideComputer = false)
        {
            ResetLog();
            Telegram.Length = 0;
            Connect();
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
            Telegram.Append(CarAddress);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend9);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend10);
            Telegram.Append(shelfNum.ToString(Constants.TelegramAppend.CarWhiteTelegramAppend12));
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend11);
            TargetShelf = positionNum > 0 ? positionNum : (int)slot.Bin.Shelf.Rack.RackNum;

            _deviceResponse = TelegramResponse(1, ItemNeeded.STATUS, string.Empty);
            Disconnect();
            return(_deviceResponse);
        }
Exemple #7
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override IDeviceResponse ClearDisplay()
        {
            if (IgnoreSendMessage)
            {
                return(_deviceResponse);
            }

            Telegram.Length = 0;

            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
            Telegram.Append(BinBaseAddr.ToString());
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend7);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
            Telegram.Append(AlphaBaseAddr.ToString());
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend8);
            Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
            return(TelegramResponse(1, ItemNeeded.STATUS));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="slot"></param>
        /// <param name="isOutsideComputer"></param>
        /// <returns></returns>
        private IDeviceResponse MoveCarousel(Slot slot, bool isOutsideComputer)
        {
            ResetLog();

            int shelfNum = 0;

            if (slot.Bin.Shelf.ShelfNum != null)
            {
                shelfNum = (int)slot.Bin.Shelf.ShelfNum;
            }

            Telegram.Length = 0;
            Telegram.Append('\x0002');
            Telegram.Append(CarAddress);
            Telegram.Append(isOutsideComputer ? "4" : "3");
            Telegram.Append("0000");
            Telegram.Append("G");
            Telegram.Append(shelfNum.ToString("000"));
            Telegram.Append('\x0003');
            Telegram.Append("s");
            TargetShelf = shelfNum;

            return(TelegramResponse(1, ItemNeeded.STATUS));
        }
Exemple #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="slot"></param>
        /// <param name="quantity"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        private IDeviceResponse MoveCarousel(Slot slot, int?quantity, string message)
        {
            ResetLog();
            ClearDisplay();

            if (slot != null)
            {
                int shelfNum = (int)slot.Bin.Shelf.ShelfNum;

                Telegram.Length = 0;

                if (!IgnoreSendMessage)
                {
                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);

                    Telegram.Append(BinBaseAddr.ToString());

                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
                    Telegram.Append("{");

                    if (slot.Bin.LeftOffset != null)
                    {
                        Telegram.Append(GetAsciiEncodedPosition((int)slot.Bin.LeftOffset));
                    }
                    else
                    {
                        Telegram.Append(GetAsciiEncodedPosition((int)slot.Bin.BinNum));
                    }

                    string slotText = slot.SlotNum.ToString();

                    if (slotText.Length > 1)
                    {
                        Telegram.Append(" ");
                    }
                    else
                    {
                        Telegram.Append(slotText);
                    }

                    Telegram.Append("}");
                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);

                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);

                    Telegram.Append(AlphaBaseAddr.ToString());
                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
                    Telegram.Append("{0");

                    message = quantity.ToString();

                    if (!string.IsNullOrEmpty(slot.DispenseForm))
                    {
                        message += " " + slot.DispenseForm.Trim();
                    }

                    if (message.Length > 10)
                    {
                        message = message.Substring(0, 10);
                    }

                    message = message.PadRight(10, ' ');

                    Telegram.Append(message);
                    Telegram.Append("}");
                    Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
                }

                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend2);
                Telegram.Append(CarAddress);
                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend9);
                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend0);
                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend10);
                Telegram.Append(shelfNum.ToString(Constants.TelegramAppend.CarWhiteTelegramAppend12));
                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend3);
                Telegram.Append(Constants.TelegramAppend.CarWhiteTelegramAppend6);
                TargetShelf = shelfNum;

                return(TelegramResponse(1, ItemNeeded.STATUS));
            }
            else
            {
                return(_deviceResponse);
            }
        }