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; } }
public FrmRuntime(PlotWaterLine pPlotLine) { InitializeComponent(); mPlotLine = pPlotLine; TxtPlugCode.Items.Clear(); TxtPlugCode.Items.AddRange(CustomBaseServer.PlugCodeList.ToArray()); }
public FrmRegularGuide(string pOriHtml, HtmlTree pTree, PlotWaterLine pPlotLine) { InitializeComponent(); mWaterLine = pPlotLine; mTree = pTree; mHtml = pOriHtml; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listView1_MouseUp(object sender, MouseEventArgs e) { MenuPlotLine.Tag = null; if (e.Button == MouseButtons.Right) { ListViewItem sItem = listView1.GetItemAt(e.X, e.Y); if (sItem != null) { PlotWaterLine sPlotLine = (PlotWaterLine)sItem.Tag; MenuPlotLine修改提取配置.Visible = !sPlotLine.IsFileLine; if (sPlotLine.State == 1) //非启动状态才能编辑 { MenuPlotLine修改提取配置.Enabled = false; MenuPlotLine删除.Enabled = false; MenuPlotLine任务.Enabled = true; MenuPlotLine启动.Enabled = false; MenuPlotLine停止.Enabled = true; } else { MenuPlotLine启动.Enabled = true; MenuPlotLine删除.Enabled = true; MenuPlotLine修改提取配置.Enabled = true; MenuPlotLine停止.Enabled = false; MenuPlotLine任务.Enabled = false; } MenuPlotLine.Tag = sItem; } MenuPlotLine.Show(listView1, e.X, e.Y); } }
/// <summary> /// 停止 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuPlotLine停止_Click(object sender, EventArgs e) { if (MenuPlotLine.Tag != null) { PlotWaterLine sPlotLine = (PlotWaterLine)((ListViewItem)MenuPlotLine.Tag).Tag; sPlotLine.Stop(); } }
/// <summary> /// 启动 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuPlotLine启动_Click(object sender, EventArgs e) { if (MenuPlotLine.Tag != null) { if (treeV.SelectedNode != null && treeV.SelectedNode.ImageIndex == 2) { PlotWaterLine sPlotLine = (PlotWaterLine)((ListViewItem)MenuPlotLine.Tag).Tag; sPlotLine.Start(); } } }
/// <summary> /// 添加网页生产线 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuPlotLine添加网页生产线_Click(object sender, EventArgs e) { if (treeV.SelectedNode != null && treeV.SelectedNode.ImageIndex == 2) { OpenPlot sPlot = (OpenPlot)treeV.SelectedNode.Tag; PlotWaterLine sPlotLine = sPlot.CreateWaterLine(false, "网页生产线"); FrmPlotWaterLineGuide sFrmPlotWaterLineGuide = new FrmPlotWaterLineGuide(sPlotLine); if (sFrmPlotWaterLineGuide.ShowDialog() == DialogResult.OK) { sPlotLine.Plot = sPlot; LoadPlotWaterLineItem(sPlotLine); CrawlServer.Save(sPlot); } else { //sPlot.Remove(sPlotLine); } } }
/// <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); }