Example #1
0
        /// <summary>
        /// Создать шаблон запроса
        /// </summary>
        private void CreateReqTemplate()
        {
            try
            {
                if (ReqParams.CmdLine == "")
                {
                    throw new ScadaException(Localization.UseRussian ?
                                             "Командная строка пуста." :
                                             "The command line is empty.");
                }
                else
                {
                    reqTemplate = new ParamString(ReqParams.CmdLine);
                    ValidateReqTemplate();
                    sessState = SessStates.Waiting;
                }
            }
            catch (Exception ex)
            {
                sessState   = SessStates.FatalError;
                reqTemplate = null;
                WriteToLog((Localization.UseRussian ?
                            "Не удалось получить HTTP-запрос из командной строки КП: " :
                            "Unable to get HTTP request from the device command line: ") + ex.Message);
            }

            writeSessState = true;
        }
Example #2
0
        private char[] respBuf;             // буфер ответа на запрос


        /// <summary>
        /// Конструктор
        /// </summary>
        public KpHttpNotifLogic(int number)
            : base(number)
        {
            CanSendCmd   = true;
            ConnRequired = false;

            addressBook    = null;
            sessState      = SessStates.Waiting;
            writeSessState = true;
            reqTemplate    = null;
            respBuf        = new char[RespBufLen];

            InitKPTags(new List <KPTag>()
            {
                new KPTag(1, Localization.UseRussian ? "Отправлено уведомлений" : "Sent notifications")
            });
        }