Beispiel #1
0
        private void tsmi_getTXFFCHistoryFromWeb_Click(object sender, EventArgs e)
        {
            Application.DoEvents();
            TXFFC_HtmlDataClass rder       = new TXFFC_HtmlDataClass(GlobalClass.TypeDataPoints["TXFFC"]);
            TXFFCExpectReader   er         = new TXFFCExpectReader();
            string StrBegDate              = "2018-08-25";
            ExpectList <TimeSerialData> el = er.GetMissedData <TimeSerialData>(true, StrBegDate);

            for (int i = 0; i < el.Count; i++)
            {
                ExpectList <TimeSerialData> tmpList = new ExpectList <TimeSerialData>();
                DateTime endT  = el[i].OpenTime;
                DateTime begT  = el[i].OpenTime.AddMinutes(-1 * el[i].MissedCnt - 1);
                DateTime tt    = DateTime.Parse(begT.ToShortDateString());
                DateTime begT0 = tt;
                while (tt <= endT)
                {
                    string strTt = tt.ToString("yyyy-MM-dd");
                    for (int j = 1; j <= 29; j++)
                    {
                        ExpectList <TimeSerialData> wlist = rder.getHistoryData <TimeSerialData>(strTt, j);//取到web
                        tmpList = ExpectList <TimeSerialData> .Concat(tmpList, wlist);

                        Application.DoEvents();
                        Thread.Sleep(800);
                    }
                    tt = tt.AddDays(1);
                }
                ExpectList <TimeSerialData> currEl = er.ReadHistory <TimeSerialData>(begT0.ToString(), endT.AddDays(1).ToString());
                er.SaveHistoryData(er.getNewestData(tmpList, currEl));
            }
        }
Beispiel #2
0
        private void tsmi_getTXFFCHistoryTxtData_Click(object sender, EventArgs e)
        {
            TXFFCExpectReader   er   = new TXFFCExpectReader();
            TXFFC_HtmlDataClass rder = new TXFFC_HtmlDataClass(GlobalClass.TypeDataPoints["TXFFC"]);
            string strFolder         = @"C:\Users\zhouys\Desktop\TXFFC";
            string fileType          = "txt";

            DirectoryInfo dir = new DirectoryInfo(strFolder);

            FileInfo[] fil = dir.GetFiles();
            foreach (FileInfo f in fil)
            {
                long size = f.Length;
                if (f.FullName.ToLower().Substring(f.FullName.Length - fileType.Length) != fileType.ToLower())
                {
                    continue;//非指定类型跳过
                }
                ExpectList <TimeSerialData> el     = rder.getFileData <TimeSerialData>(f.FullName);
                TXFFCExpectReader           rd     = new TXFFCExpectReader();
                ExpectList <TimeSerialData> currEl = rd.ReadHistory <TimeSerialData>();
                rd.SaveHistoryData(rd.getNewestData(el, currEl));
                //currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1));
                //FillOrgData(listView_TXFFCData, currEl);
            }
        }