Exemple #1
0
 public FrmRuntime(PlotWaterLine pPlotLine)
 {
     InitializeComponent();
     mPlotLine = pPlotLine;
     TxtPlugCode.Items.Clear();
     TxtPlugCode.Items.AddRange(CustomBaseServer.PlugCodeList.ToArray());
 }
Exemple #2
0
 public FrmRegularGuide(string pOriHtml, HtmlTree pTree, PlotWaterLine pPlotLine)
 {
     InitializeComponent();
     mWaterLine = pPlotLine;
     mTree = pTree;
     mHtml = pOriHtml;
 }
 public FrmPlotWaterLineGuide(PlotWaterLine pPlotLine)
 {
     InitializeComponent();
     //http页面请求类
     httpHelper = new HttpHelper();
     //构造函数传递当前生产线
     mPlotLine = pPlotLine;
     //网页请求语言设置
     if (mPlotLine.Chaset != null && mPlotLine.Chaset.Length > 0)
     {
         CmbChaset.Text = mPlotLine.Chaset;
     }
     else
     {
         CmbChaset.SelectedIndex = 0;
     }
     //网页请求方法设置
     if (mPlotLine.Method != null && mPlotLine.Method.Length > 0)
     {
         CmbMethod.Text = mPlotLine.Method;
     }
     else
     {
         CmbMethod.SelectedIndex = 0;
     }
 }
Exemple #4
0
 /// <summary>
 /// 创建新的生产线
 /// </summary>
 /// <param name="pIsFileLine"></param>
 /// <returns></returns>
 public PlotWaterLine CreateWaterLine(bool pIsFileLine, string pBaseName)
 {
     lock (mLocker)
     {
         PlotWaterLine sPlotWaterLine = new PlotWaterLine();
         sPlotWaterLine.Plot = this;        //将当前的专案加载到当前生产线当中
         sPlotWaterLine.ID   = GetLineID(); //根据规则生成一个生产线ID
         sPlotWaterLine.InitWaterLine();
         sPlotWaterLine.IsFileLine = pIsFileLine;
         sPlotWaterLine.Name       = GetNewLineName(pBaseName);
         Lines.Add(sPlotWaterLine);
         mLineDic[sPlotWaterLine.ID] = sPlotWaterLine;
         return(sPlotWaterLine);
     }
 }
Exemple #5
0
        public CrawlTask GetCrawlTask(int pPRI, Dictionary <string, string> pHostDic, uint pIp)
        {
            int sStartPos = mStartPos;        //生产线机会均等

            for (int i = sStartPos; i < Lines.Count; i++)
            {
                try
                {
                    PlotWaterLine sPlotWaterLine = Lines[i];
                    if (sPlotWaterLine.PRI == pPRI)
                    {
                        CrawlTask sCrawlTask = sPlotWaterLine.GetCrawlTask(pHostDic, pIp);
                        if (sCrawlTask != null)
                        {
                            if (i + 1 < Lines.Count)
                            {
                                mStartPos = i + 1;
                            }
                            else
                            {
                                mStartPos = 0;
                            }
                            return(sCrawlTask);
                        }
                    }
                }
                catch { }
            }
            for (int i = 0; i < sStartPos; i++)
            {
                try
                {
                    PlotWaterLine sPlotWaterLine = Lines[i];
                    if (sPlotWaterLine.PRI == pPRI)
                    {
                        CrawlTask sCrawlTask = sPlotWaterLine.GetCrawlTask(pHostDic, pIp);
                        if (sCrawlTask != null)
                        {
                            mStartPos = i + 1;
                            return(sCrawlTask);
                        }
                    }
                }
                catch { }
            }
            return(null);
        }
Exemple #6
0
 /// <summary>
 /// 创建新的生产线
 /// </summary>
 /// <param name="pIsFileLine"></param>
 /// <returns></returns>
 public PlotWaterLine CreateWaterLine(bool pIsFileLine, string pBaseName)
 {
     lock (mLocker)
     {
         PlotWaterLine sPlotWaterLine = new PlotWaterLine();
         sPlotWaterLine.Plot = this;//将当前的专案加载到当前生产线当中
         sPlotWaterLine.ID = GetLineID();//根据规则生成一个生产线ID
         sPlotWaterLine.InitWaterLine();
         sPlotWaterLine.IsFileLine = pIsFileLine;
         sPlotWaterLine.Name = GetNewLineName(pBaseName);
         Lines.Add(sPlotWaterLine);
         mLineDic[sPlotWaterLine.ID] = sPlotWaterLine;
         return sPlotWaterLine;
     }
 }
Exemple #7
0
        /// <summary>
        /// 加载流水线列表
        /// </summary>
        /// <param name="plotWaterLine"></param>
        private void LoadPlotWaterLineItem(PlotWaterLine pWaterLine)
        {
            PlotLineState sLineState = pWaterLine.LineState;
            ListViewItem sItem = new ListViewItem(pWaterLine.Name, sLineState.State);
            sItem.Group = listView1.Groups[pWaterLine.Group];
            sItem.SubItems.Add(pWaterLine.BaseURL);
            sItem.SubItems.Add(pWaterLine.Method);
            sItem.SubItems.Add(pWaterLine.Chaset);
            if (pWaterLine.PageFeild != null) { sItem.SubItems.Add("是"); } else { sItem.SubItems.Add(""); };
            if (pWaterLine.AutoStart)
            {
                sItem.SubItems.Add("是");
                sItem.SubItems.Add(pWaterLine.CanStartDate.ToString("yyyy-MM-dd HH:mm"));
                sItem.SubItems.Add(pWaterLine.RunSpan.ToString());
            }
            else
            {
                sItem.SubItems.Add("否");
                sItem.SubItems.Add("");
                sItem.SubItems.Add("");
            }
            sItem.SubItems.Add(sLineState.WaitTaskCount.ToString());       //待发任务
            sItem.SubItems.Add(sLineState.OnlineTaskCount.ToString());     //已发待收
            sItem.SubItems.Add(sLineState.LocalWaitCount.ToString());      //本缓待处
            sItem.SubItems.Add(sLineState.WaitDrillCount.ToString());      //已收待处
            sItem.SubItems.Add(sLineState.TotalRecieved.ToString());       //累计完成
            sItem.SubItems.Add(sLineState.DrillWaitSaveCount.ToString());  //已处待存
            sItem.SubItems.Add(sLineState.LastProduceDt.ToString("yyyy-MM-dd HH:mm:ss"));   //最近提交任务时间
            sItem.SubItems.Add(sLineState.ErrCount.ToString());            //诊断信息

            sItem.Tag = pWaterLine;

            listView1.Items.Add(sItem);
        }