You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.8 KiB
C#

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<ETakeTrayFlowStep>("TakeTrayFlow", tv_TakeTrayFlow);
//LoadFlowStep<EFiberWarningPressFlowStep>("FiberWarningPressFlow", tv_FiberWarningPressFlow);
timer1.Interval = 500;
timer1.Enabled = true;
}
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)
{
if (DischargeFlow.Instance.GetCurStep().ToString() != lblDischargeFlow.Text)
{
lblDischargeFlow.Text = DischargeFlow.Instance.GetCurStep().ToString();
}
if (StockTakeFlow.Instance.GetCurStep().ToString() != lblStockLoadProductFlow.Text)
{
lblStockLoadProductFlow.Text = StockTakeFlow.Instance.GetCurStep().ToString();
}
if (StockPlaceFlow.Instance.GetCurStep().ToString() != lblStockPlaceFlow.Text)
{
lblStockPlaceFlow.Text = StockPlaceFlow.Instance.GetCurStep().ToString();
}
if (FixturePlaceFlow.Instance.GetCurStep().ToString() != lblFixturePlaceFlow.Text)
{
lblFixturePlaceFlow.Text = FixturePlaceFlow.Instance.GetCurStep().ToString();
}
if (FixtureTakeFlow.Instance.GetCurStep().ToString() != lblFixtureTakeFlow.Text)
{
lblFixtureTakeFlow.Text = FixtureTakeFlow.Instance.GetCurStep().ToString();
}
if (GrrFlow.Instance.GetCurStep().ToString() != lblGrrFlow.Text)
{
lblGrrFlow.Text = GrrFlow.Instance.GetCurStep().ToString();
}
}
}
}