Пример #1
0
        public clsMS860(Function.Util.XML xml, string strNode)
        {
            xml.chNode2Root();
            xml.chSingleNode(strNode);

            string strCom      = xml.GetSingleNodeValue("COMPORT");
            string strBaudrate = xml.GetSingleNodeValue("BAUDRATE");
            string strPARITY   = xml.GetSingleNodeValue("PARITY");
            string strDATABITS = xml.GetSingleNodeValue("DATABITS");
            string strSTOPBITS = xml.GetSingleNodeValue("STOPBITS");

            clsSn = new Function.Comm.Serial(strCom, int.Parse(strBaudrate), strPARITY, int.Parse(strDATABITS), strSTOPBITS);
            clsSn.OnDataReceived += new Serial.delReceive(clsSn_DataReceived);
        }
Пример #2
0
        public clsEpcMW(Function.Util.XML clsXml, OracleDB.strConnect _strConn)
        {
            clsXml.chNode2Root();

            string strSystemID = clsXml.GetSingleNodeValue("SystemInfo/PROGRAMID");

            strConn = _strConn;

            initXmlSetting(strSystemID, clsXml);
        }
Пример #3
0
        //public clsEpcMW(string strUrl, string strUrl_ALE, string strRicName, AntControlMode antMode, int intPort, int intAlarmId, int intGreenId)
        //{
        //    initClass(strUrl, strUrl_ALE, strRicName, antMode, intPort, intAlarmId, intGreenId);
        //}


        private void initXmlSetting(string strSystemID, Function.Util.XML clsXml)
        {
            try
            {
                clsXml.chNode2Root();
                //clsXml.chSingleNode(@"SETTING/" + strSystemID);
                //SYSTEMID = clsXml.GetSingleNodeValue("SYSTEMID");

                clsXml.chNode2Root();
                clsXml.chSingleNode("EpcMW");

                string strUrl     = clsXml.GetSingleNodeValue("URL");
                string strUrl_ALE = clsXml.GetSingleNodeValue("URL_ALE");

                int intAlarmId = Convert.ToInt32(clsXml.GetSingleNodeValue("AlarmID"));
                int intGreenId = Convert.ToInt32(clsXml.GetSingleNodeValue("GreenID"));

                clsXml.chSingleNode(strSystemID);

                string         strRicName = clsXml.GetSingleNodeValue("RICNAME");
                AntControlMode antMode    = (AntControlMode)Convert.ToInt32(clsXml.GetSingleNodeValue("DefaultAntMode"));


                int intPort = Convert.ToInt32(clsXml.GetSingleNodeValue("ServerPort"));
                strEcSpecName      = clsXml.GetSingleNodeValue("ECSPECNAME");
                intReadingDuration = Convert.ToInt32(clsXml.GetSingleNodeValue("ReadingDuration"));
                intWritingDuration = Convert.ToInt32(clsXml.GetSingleNodeValue("WritingDuration"));

                initClass(strUrl, strUrl_ALE, strRicName, antMode, intPort, intAlarmId, intGreenId);
            }
            catch (Exception ex)
            {
                SP_SMS_SET_ERROR(ex);
                throw;
            }
        }
Пример #4
0
        private void evtReceiveRequest(Socket soc, byte[] byt)
        {
            string str = Encoding.UTF8.GetString(byt);

            try
            {
                //받은 파일을 xml로 전환
                Function.Util.XML clsXml = new Function.Util.XML(Function.Util.XML.enXmlType.String, str);

                clsXml.xml.Save(@"c:\xml.xml");

                clsXml.chSingleNode("report/group");
                int      intCnt   = Convert.ToInt32(clsXml.GetSingleNodeValue("groupCount/count"));
                int      i        = 0;
                string[] strTagID = new string[intCnt];


                //clsXml.chSingleNode("groupList");
                string st = string.Empty;
                foreach (XmlNode xn in clsXml.GetNodeList("groupList/member"))
                {
                    strTagID[i] = xn.SelectSingleNode("epc").InnerText;

                    if (st == string.Empty)
                    {
                        st = "수신 TagID : ";
                    }
                    else
                    {
                        st += "/";
                    }

                    st += strTagID[i];

                    i++;
                }

                clsLog.WLog(st);

                ThreadPool.QueueUserWorkItem(new WaitCallback(ReceiveTagId), strTagID);
            }
            catch (Exception ex)
            {
                clsLog.WLog_Exception("evtReceiveRequest", ex);
                clsLog.WLog("Received String : " + str);
            }
        }