Exemplo n.º 1
0
        protected virtual void S2F37ReceiveEnableDisableEventReport(object sender, SECSEventArgs e)
        {
            try
            {
                S2F37 s2f37 = ((S2F37)e.secsHandler.Parse <S2F37>(e));
                SCUtility.secsActionRecordMsg(scApp, true, s2f37);
                //if (!isProcess(s2f37)) { return; }
                Boolean isValid = true;
                //Boolean isEnable = SCUtility.isMatche(s2f37.CEED, SECSConst.CEED_Enable);
                Boolean isEnable = s2f37.CEED[0] == 255;

                int cnt = s2f37.CEIDS.Length;
                if (cnt == 0)
                {
                    isValid &= scApp.EventBLL.enableAllEventReport(isEnable);
                }
                else
                {
                    //Check Data
                    for (int ix = 0; ix < cnt; ++ix)
                    {
                        string  ceid      = s2f37.CEIDS[ix].PadLeft(3, '0');
                        Boolean isContain = SECSConst.CEID_ARRAY.Contains(ceid.Trim());
                        if (!isContain)
                        {
                            isValid = false;
                            break;
                        }
                    }
                    if (isValid)
                    {
                        for (int ix = 0; ix < cnt; ++ix)
                        {
                            string ceid = s2f37.CEIDS[ix].PadLeft(3, '0');
                            isValid &= scApp.EventBLL.enableEventReport(ceid, isEnable);
                        }
                    }
                }

                S2F38 s2f18 = null;
                s2f18 = new S2F38()
                {
                    SystemByte    = s2f37.SystemByte,
                    SECSAgentName = scApp.EAPSecsAgentName,
                    ERACK         = isValid ? SECSConst.ERACK_Accepted : SECSConst.ERACK_Denied_At_least_one_CEID_dose_not_exist
                };

                TrxSECS.ReturnCode rtnCode = ISECSControl.replySECS(bcfApp, s2f18);
                SCUtility.secsActionRecordMsg(scApp, false, s2f18);
                if (rtnCode != TrxSECS.ReturnCode.Normal)
                {
                    logger.Warn("Reply EQPT S2F18 Error:{0}", rtnCode);
                }
            }
            catch (Exception ex)
            {
                logger.Error("MESDefaultMapAction has Error[Line Name:{0}],[Error method:{1}],[Error Message:{2}", line.LINE_ID, "S2F17_Receive_Date_Time_Req", ex.ToString());
            }
        }
Exemplo n.º 2
0
        public void Send(S2F37 msg)
        {
            XElement primary = new XElement("Primary");
            var      list    = NewItem("L", "", "LIST");

            list.Add(NewItem("CEED", "", "ASCII", msg.CEED));
            var list2 = NewItem("L", "", "LIST");

            list2.Add(NewItem("CEID", "", "ASCII", msg.CEID));
            list.Add(list2);
            primary.Add(list);
            Wrapper.SendAsync("Line05-8MMAO05", "S2F37", primary);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "serverlog.config")));
            ISecsDriverWrapper wrapper = new SecsWellWrapper();

            wrapper.Register(new MessageReceiveHandler());
            wrapper.OpenHSMSPort();
            Console.ReadLine();
            MessageSender sender = new MessageSender(wrapper);

            S2F37 s2f37 = new S2F37();

            s2f37.CEED = "abc";
            s2f37.CEID = "cba";
            sender.Send(s2f37);
            MessageReceiveHandler messageReceive = new MessageReceiveHandler();

            Console.WriteLine(messageReceive);
            Console.ReadLine();
            wrapper.CloseHSMSPort();
        }
Exemplo n.º 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
            log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "serverlog.config")));
            ISecsDriverWrapper wrapper = new SecsWellWrapper();

            wrapper.Register(new MessageReceiveHandler());
            wrapper.OpenHSMSPort();
            Console.ReadLine();
            MessageSender sender = new MessageSender(wrapper);

            S2F37 s2f37 = new S2F37();

            s2f37.CEED = "abc";
            s2f37.CEID = "cba";
            sender.Send(s2f37);
            MessageReceiveHandler messageReceive = new MessageReceiveHandler();

            Console.WriteLine(messageReceive);
            Console.ReadLine();
            wrapper.CloseHSMSPort();
        }