public static IDataParser FactoryMethod(RequestParameter reqParam)
 {
     if (reqParam.m_enKLineDataType == GShare.KLineDataType.eDay)
         return new KLineDayParser(reqParam);
     else
         throw new Exception("Parse data null");
 }
 public KLineDayParser(RequestParameter reqParam)
 {
     m_log = Log.GetInstance(GShare.cstServiceParseData);
     m_reqParam = reqParam;
     if (m_ParseParam == null)
     {
         m_ParseParam = new ParseDataParameter();
         m_ParseParam.Initial(reqParam.m_strParamPath);
     }
 }
 public static IController Factory(string strReq)
 {
     RequestParameter rp = new RequestParameter(strReq);
     if (rp.m_enRequestId == GShare.Request.eParseKLineData)
     {
         return ParseDataContorller.GetInistance(rp);
     }
     else
         throw new Exception("Controller is null");
 }
        public static ParseDataContorller GetInistance(RequestParameter param)
        {
            if (m_Instance == null)
            {
                lock (_lock)
                {
                    if (m_Instance == null)
                    {
                        m_Instance = new ParseDataContorller(param);
                    }
                }
            }

            return m_Instance;
        }
        public void MsgWatchingThread(object state)
        {
            while(!m_bQuitThread)
            {
                if (m_strRec == null || m_strRec.Length == 0)
                {
                    Thread.Sleep(1000);
                    continue;
                }
                RequestParameter rp = new RequestParameter(m_strRec);
                MsgReceived.Text = rp.m_strMsg;
                if (rp.m_enJobStatus == GShare.JobStatus.eEnd)
                    m_bQuitThread = true;

                Thread.Sleep(1000);
            }

            m_eQuitThreadEvent.Set();
        }
        public override void Run()
        {
            try
            {
                if (m_strRec == null || m_strRec.Length == 0)
                {
                    Thread.Sleep(1000);
                    return;
                }

                RequestParameter rp = new RequestParameter(m_strRec);
                IDataParser dp = DataParserFactory.FactoryMethod(rp);
                dp.Run();

                m_strRec = "";
                Thread.Sleep(1000);

            }
            catch (SystemException e)
            {
                Log.Log_Fatal(e.Message);
            }
        }
 private void Init(RequestParameter param)
 {
     m_reqParam = param;
     m_enJobStatus = GShare.JobStatus.eUndefined;
 }
 private ParseDataContorller(RequestParameter param)
 {
     Init(param);
 }