|
@@ -26,27 +26,61 @@ namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
|
public class ProcessHistoryViewModel : BindableBase
|
|
|
{
|
|
|
+ #region 私有字段
|
|
|
private ProcessHistoryView view;
|
|
|
List<string> keys = new List<string>();
|
|
|
RealtimeProvider _provider = new RealtimeProvider();
|
|
|
private ObservableCollection<ParameterNode> _ParameterNodes;
|
|
|
DispatcherTimer timer = new DispatcherTimer();
|
|
|
+ ObservableCollection<PdKeyData>_PdKeyDataObservation= new ObservableCollection<PdKeyData>();
|
|
|
public List<string> RecipesAdd=new List<string>();
|
|
|
+ public List<SolidColorBrush> solidColorBrushes = new List<SolidColorBrush>();
|
|
|
DateTime currentTime;
|
|
|
+ #endregion
|
|
|
+ #region 属性
|
|
|
+ public List<HistoryDataItem> ProcessData { get; set; }
|
|
|
+ public List<Recipeslist> CheboxRecipes { get; set; }
|
|
|
+ public ProcessDataChartDataItem ProcessChartData{ get; set; }
|
|
|
+ public DateTime StartDateTime { get; set; }
|
|
|
+ public DateTime EndDateTime { get; set; }
|
|
|
+ public string SelectedValuePM { get; set; }
|
|
|
+ public string RecipeName { get; set; }
|
|
|
+ public ObservableCollection<RecipeItem> Recipes { get; set; }
|
|
|
+
|
|
|
+ public class Recipeslist
|
|
|
+ {
|
|
|
+ public string BoxName { get; set; }
|
|
|
+ }
|
|
|
+ public class RecipeAdd
|
|
|
+ {
|
|
|
+ public string Recipesname { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ public ObservableCollection<ParameterNode> ParameterNodes
|
|
|
+ {
|
|
|
+ get { return _ParameterNodes; }
|
|
|
+ set { SetProperty(ref _ParameterNodes, value); }
|
|
|
+ }
|
|
|
+ public ObservableCollection<PdKeyData> PdKeyDataCollection
|
|
|
+ {
|
|
|
+ get { return _PdKeyDataObservation; }
|
|
|
+ set { SetProperty(ref _PdKeyDataObservation,value); }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 命令
|
|
|
private DelegateCommand<object> _LoadCommandPD;
|
|
|
public DelegateCommand<object> LoadCommandPD =>
|
|
|
_LoadCommandPD ?? (_LoadCommandPD = new DelegateCommand<object>(OnLoadPd));
|
|
|
private DelegateCommand _SearchRecipeCommand;
|
|
|
public DelegateCommand SearchRecipeCommand =>
|
|
|
_SearchRecipeCommand ?? (_SearchRecipeCommand = new DelegateCommand(SearchRecipe));
|
|
|
+ private DelegateCommand<object> _PdParameterCheckCommand;
|
|
|
+ public DelegateCommand<object> PdParameterCheckCommand=>
|
|
|
+ _PdParameterCheckCommand??(_PdParameterCheckCommand=new DelegateCommand<object>(OnParameterCheck));
|
|
|
+ #endregion
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public List<HistoryDataItem> ProcessData { get; set; }
|
|
|
-
|
|
|
+ #region 构造函数
|
|
|
public ProcessHistoryViewModel()
|
|
|
{
|
|
|
ProcessChartData = new ProcessDataChartDataItem(60000);
|
|
@@ -54,17 +88,19 @@ namespace Venus_MainPages.ViewModels
|
|
|
Recipes = new ObservableCollection<RecipeItem>();
|
|
|
timer.Interval = TimeSpan.FromSeconds(0.5);
|
|
|
CheboxRecipes = new List<Recipeslist>();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- public List<Recipeslist> CheboxRecipes { get; set; }
|
|
|
- public ProcessDataChartDataItem ProcessChartData
|
|
|
- {
|
|
|
- get;
|
|
|
- set;
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Green));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Red));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Blue));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Orange));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Yellow));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.YellowGreen));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.AliceBlue));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Chocolate));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Cyan));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.DarkGreen));
|
|
|
}
|
|
|
+ #endregion
|
|
|
+ #region 命令方法
|
|
|
private void OnLoadPd(Object eventView)
|
|
|
{
|
|
|
this.view = (ProcessHistoryView)eventView;
|
|
@@ -72,53 +108,24 @@ namespace Venus_MainPages.ViewModels
|
|
|
this.view.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
|
|
|
this.LoadRecipeCheckBox();
|
|
|
}
|
|
|
+
|
|
|
private void LoadRecipeCheckBox()
|
|
|
{
|
|
|
- string path= Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes","PMA");
|
|
|
- if (Directory.Exists(path)) {
|
|
|
- string[] dir = Directory.GetFiles(path);
|
|
|
- for (int i = 0; i < dir.Length; i++)
|
|
|
+ List<string> chamber = new List<string>() { "PMA","PMB","PMC","PMD"};
|
|
|
+ CheboxRecipes.Clear();
|
|
|
+ foreach (string item in chamber)
|
|
|
+ {
|
|
|
+ string path = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", item);
|
|
|
+ if (Directory.Exists(path))
|
|
|
{
|
|
|
- CheboxRecipes.Add(new Recipeslist { BoxName = Path.GetFileName(dir[i])});
|
|
|
+ string[] dir = Directory.GetFiles(path);
|
|
|
+ for (int i = 0; i < dir.Length; i++)
|
|
|
+ {
|
|
|
+ CheboxRecipes.Add(new Recipeslist { BoxName = Path.GetFileName(dir[i]) });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public DateTime StartDateTime { get; set; }
|
|
|
- public DateTime EndDateTime { get; set; }
|
|
|
- public string SelectedValuePM { get; set; }
|
|
|
- public string RecipeName { get; set; }
|
|
|
- public class RecipeItem
|
|
|
- {
|
|
|
- public bool Selected { get; set; }
|
|
|
- public string Recipe { get; set; }
|
|
|
- public string Guid { get; set; }
|
|
|
- public string RecipeRunGuid { get; set; }
|
|
|
- public string Chamber { get; set; }
|
|
|
- public string Status { get; set; }
|
|
|
- public string StartTime { get; set; }
|
|
|
- public string EndTime { get; set; }
|
|
|
- public string LotID { get; set; }
|
|
|
- public string SlotID { get; set; }
|
|
|
- }
|
|
|
- public class Recipeslist
|
|
|
- {
|
|
|
- public string BoxName { get; set; }
|
|
|
- }
|
|
|
- public class RecipeAdd
|
|
|
- {
|
|
|
- public string Recipesname { get; set; }
|
|
|
- }
|
|
|
- public ObservableCollection<RecipeItem> Recipes { get; set; }
|
|
|
- public ObservableCollection<ParameterNode> ParameterNodes
|
|
|
- {
|
|
|
- get { return _ParameterNodes; }
|
|
|
- set { SetProperty(ref _ParameterNodes, value); }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public void SearchRecipe()
|
|
|
{
|
|
|
|
|
@@ -152,7 +159,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
sql += " order by \"process_begin_time\" ASC;";
|
|
|
|
|
|
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
{
|
|
@@ -161,7 +168,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
for (int i = 0; i < dbData.Rows.Count; i++)
|
|
|
{
|
|
|
RecipeItem item = new RecipeItem();
|
|
|
-
|
|
|
+ item.Selected = false;
|
|
|
item.Recipe = dbData.Rows[i]["recipe_name"].ToString();
|
|
|
item.Guid = dbData.Rows[i]["guid"].ToString();
|
|
|
item.RecipeRunGuid = dbData.Rows[i]["wafer_data_guid"].ToString();
|
|
@@ -271,7 +278,99 @@ namespace Venus_MainPages.ViewModels
|
|
|
return historyData;
|
|
|
|
|
|
}
|
|
|
+ private bool RefreshTreeStatusToChild(ParameterNode node)
|
|
|
+ {
|
|
|
+ if (node.ChildNodes.Count > 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < node.ChildNodes.Count; i++)
|
|
|
+ {
|
|
|
+ ParameterNode n = node.ChildNodes[i];
|
|
|
+ n.Selected = node.Selected;
|
|
|
+
|
|
|
+ if (!RefreshTreeStatusToChild(n))
|
|
|
+ {
|
|
|
+
|
|
|
+ for (int j = i; j < node.ChildNodes.Count; j++)
|
|
|
+ {
|
|
|
+ node.ChildNodes[j].Selected = !node.Selected;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private void RefreshTreeStatusToParent(ParameterNode node)
|
|
|
+ {
|
|
|
+ if (node.ParentNode != null)
|
|
|
+ {
|
|
|
+ if (node.Selected)
|
|
|
+ {
|
|
|
+ bool flag = true;
|
|
|
+ for (int i = 0; i < node.ParentNode.ChildNodes.Count; i++)
|
|
|
+ {
|
|
|
+ if (!node.ParentNode.ChildNodes[i].Selected)
|
|
|
+ {
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag)
|
|
|
+ node.ParentNode.Selected = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ node.ParentNode.Selected = false;
|
|
|
+ }
|
|
|
+ RefreshTreeStatusToParent(node.ParentNode);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void OnParameterCheck(object obj)
|
|
|
+ {
|
|
|
+ ParameterNode node = obj as ParameterNode;
|
|
|
+ if (!RefreshTreeStatusToChild(node))
|
|
|
+ {
|
|
|
+ node.Selected = !node.Selected;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RefreshTreeStatusToParent(node);
|
|
|
+ }
|
|
|
+
|
|
|
+ keys.Clear();
|
|
|
+ for (int i = 0; i < ParameterNodes.Count; i++)
|
|
|
+ {
|
|
|
+ CalKeys(ParameterNodes[i]);
|
|
|
+ }
|
|
|
+ if (keys.Count > 10)
|
|
|
+ {
|
|
|
+ WPFMessageBox.ShowWarning("最多显示10个数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ PdKeyDataCollection.Clear();
|
|
|
+ for (int i = 0; i < keys.Count; i++)
|
|
|
+ {
|
|
|
+ if (i == 10)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ PdKeyDataCollection.Add(new PdKeyData() { Key = keys[i], Color = solidColorBrushes[i] });
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
public void UpdateData(RecipeItem dataLog)
|
|
|
{
|
|
|
if (dataLog == null)
|
|
@@ -289,26 +388,24 @@ namespace Venus_MainPages.ViewModels
|
|
|
WPFMessageBox.ShowWarning("最多显示10个数据");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
- {
|
|
|
- string type = "A";
|
|
|
- string s = dataLog.Chamber;
|
|
|
-
|
|
|
- if (dataLog.Chamber == "PMA")
|
|
|
- {
|
|
|
-
|
|
|
- if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMA.BiasRf.EnableBiasRF"))
|
|
|
- type = "A";
|
|
|
- }
|
|
|
- else if (dataLog.Chamber == "PMB")
|
|
|
- {
|
|
|
-
|
|
|
- if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMB.BiasRf.EnableBiasRF"))
|
|
|
- type = "B";
|
|
|
- }
|
|
|
- }));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.view.MyDrawGraphicsControl.ClearPlotPoints();
|
|
|
DateTime dtFrom = Convert.ToDateTime(dataLog.StartTime);
|
|
|
DateTime dtTo = dtFrom.AddMinutes(10);
|
|
@@ -332,9 +429,28 @@ namespace Venus_MainPages.ViewModels
|
|
|
}
|
|
|
this.view.MyDrawGraphicsControl.PointCollections = cls;
|
|
|
this.view.MyDrawGraphicsControl.FitControl();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
+ #endregion
|
|
|
+ #region 数据类
|
|
|
+ public class RecipeItem
|
|
|
+ {
|
|
|
+ public bool Selected { get; set; }
|
|
|
+ public string Recipe { get; set; }
|
|
|
+ public string Guid { get; set; }
|
|
|
+ public string RecipeRunGuid { get; set; }
|
|
|
+ public string Chamber { get; set; }
|
|
|
+ public string Status { get; set; }
|
|
|
+ public string StartTime { get; set; }
|
|
|
+ public string EndTime { get; set; }
|
|
|
+ public string LotID { get; set; }
|
|
|
+ public string SlotID { get; set; }
|
|
|
+ }
|
|
|
+ public class PdKeyData
|
|
|
+ {
|
|
|
+ public string Key { get; set; }
|
|
|
+ public SolidColorBrush Color { get; set; }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|