|
|
|
|
using Rs.MotionPlat.Flow;
|
|
|
|
|
using Rs.MotionPlat.Flow.SubFlow;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Rs.MotionPlat
|
|
|
|
|
{
|
|
|
|
|
public partial class MonitorFlow : BaseFormHeader
|
|
|
|
|
{
|
|
|
|
|
public MonitorFlow()
|
|
|
|
|
{
|
|
|
|
|
this.StartPosition = FormStartPosition.Manual;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
|
|
|
|
|
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MonitorFlow_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LoadFlowStep< EDischargeFlowStep>("DischargeFlow", tv_DischargeFlow);
|
|
|
|
|
LoadFlowStep<ETurnoverFlowStep>("TurnoverFlow", tv_TurnoverFlow);
|
|
|
|
|
LoadFlowStep<EDischargeDumpFlowStep>("DischargeDumpFlow", tv_DischargeDumpFlow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LoadFlowStep<T>(string flowname,TreeView tv) where T : Enum
|
|
|
|
|
{
|
|
|
|
|
string[] stepnames = Enum.GetNames(typeof(T));
|
|
|
|
|
TreeNode root = new TreeNode();
|
|
|
|
|
root.Text = flowname;
|
|
|
|
|
foreach (string stepname in stepnames)
|
|
|
|
|
{
|
|
|
|
|
root.Nodes.Add(new TreeNode(stepname));
|
|
|
|
|
}
|
|
|
|
|
tv.Nodes.Add(root);
|
|
|
|
|
tv.ExpandAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void timer1_Tick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string stepname = DischargeFlow.Instance.GetCurStep();
|
|
|
|
|
foreach (TreeNode tn in tv_DischargeFlow.Nodes[0].Nodes)
|
|
|
|
|
{
|
|
|
|
|
if(tn.Text== stepname)
|
|
|
|
|
{
|
|
|
|
|
tn.ForeColor = Color.Red;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tn.ForeColor = Color.Black;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stepname = TurnoverFlow.Instance.GetStep();
|
|
|
|
|
foreach (TreeNode tn in tv_TurnoverFlow.Nodes[0].Nodes)
|
|
|
|
|
{
|
|
|
|
|
if (tn.Text == stepname)
|
|
|
|
|
{
|
|
|
|
|
tn.ForeColor = Color.Red;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tn.ForeColor = Color.Black;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|