|
@@ -33,6 +33,7 @@ using Venus_Themes.UserControls;
|
|
|
using Aitex.Core.UI.Control;
|
|
|
using System.Windows.Annotations;
|
|
|
using System.Runtime.Serialization;
|
|
|
+using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
|
namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
@@ -50,7 +51,10 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private RecipeItem selectedRecipeItem;
|
|
|
private bool m_IsShowStep;
|
|
|
-
|
|
|
+ private int m_PageCount;
|
|
|
+ private int m_onePageCounts = 7;
|
|
|
+ private int m_Total;
|
|
|
+ private bool m_FirstLoadFlag = true;
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -90,6 +94,23 @@ namespace Venus_MainPages.ViewModels
|
|
|
get { return m_IsShowStep; }
|
|
|
set { SetProperty(ref m_IsShowStep, value); }
|
|
|
}
|
|
|
+
|
|
|
+ public int PageCount
|
|
|
+ {
|
|
|
+ get { return m_PageCount; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_PageCount, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public int Total
|
|
|
+ {
|
|
|
+ get { return m_Total; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_Total, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 命令
|
|
@@ -146,10 +167,69 @@ namespace Venus_MainPages.ViewModels
|
|
|
#region 命令方法
|
|
|
private void OnLoadPd(Object eventView)
|
|
|
{
|
|
|
- this.view = (ProcessHistoryView)eventView;
|
|
|
- this.view.wfTimeFrom.Value = DateTime.Today;
|
|
|
- this.view.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
|
|
|
- this.LoadRecipeCheckBox();
|
|
|
+ if (m_FirstLoadFlag)
|
|
|
+ {
|
|
|
+ this.view = (ProcessHistoryView)eventView;
|
|
|
+ this.view.wfTimeFrom.Value = DateTime.Today;
|
|
|
+ this.view.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
|
|
|
+ this.LoadRecipeCheckBox();
|
|
|
+ this.view.pageControl.CurrentPageChanged += PageControl_CurrentPageChanged;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ private void PageControl_CurrentPageChanged(int currentPage)
|
|
|
+ {
|
|
|
+ PageChanged(currentPage);
|
|
|
+ }
|
|
|
+ public void PageChanged(int CurrentPage)
|
|
|
+ {
|
|
|
+ Recipes.Clear();
|
|
|
+ string sql = $"SELECT * FROM \"process_data\" where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(SelectedValuePM))
|
|
|
+ {
|
|
|
+ string[] pms = SelectedValuePM.Split(',');
|
|
|
+ if (pms.Length > 0)
|
|
|
+ {
|
|
|
+ sql += " and (FALSE ";
|
|
|
+ foreach (var pm in pms)
|
|
|
+ {
|
|
|
+ sql += $" OR \"process_in\"='{pm}' ";
|
|
|
+ }
|
|
|
+ sql += " ) ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(RecipeName))
|
|
|
+ {
|
|
|
+ sql += string.Format(" and lower(\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
|
|
|
+ }
|
|
|
+ sql += $" order by \"process_begin_time\" ASC limit {m_onePageCounts} offset {(CurrentPage - 1) * m_onePageCounts};";
|
|
|
+
|
|
|
+ DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (dbData == null || dbData.Rows.Count == 0) return;
|
|
|
+
|
|
|
+ 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();
|
|
|
+ item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
|
|
+ item.Status = dbData.Rows[i]["process_status"].ToString();
|
|
|
+ item.SlotID = dbData.Rows[i]["slot_id"].ToString();
|
|
|
+ item.RecipeType = dbData.Rows[i]["recipe_type"].ToString();
|
|
|
+ item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
|
|
+ if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
|
|
+ item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
|
|
+ item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Recipes.Add(item);
|
|
|
+ }
|
|
|
}
|
|
|
private void LoadRecipeCheckBox()
|
|
|
{
|
|
@@ -219,7 +299,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
item.Status = dbData.Rows[i]["process_status"].ToString();
|
|
|
item.SlotID = dbData.Rows[i]["slot_id"].ToString();
|
|
|
item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
|
|
- item.RecipeType= dbData.Rows[i]["recipe_type"].ToString();
|
|
|
+ item.RecipeType = dbData.Rows[i]["recipe_type"].ToString();
|
|
|
if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
|
|
item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
|
@@ -241,6 +321,34 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
try
|
|
|
{
|
|
|
+ string sqlGetCount = $"SELECT COUNT(*) FROM \"process_data\" where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(SelectedValuePM))
|
|
|
+ {
|
|
|
+ string[] pms = SelectedValuePM.Split(',');
|
|
|
+ if (pms.Length > 0)
|
|
|
+ {
|
|
|
+ sqlGetCount += " and (FALSE ";
|
|
|
+ foreach (var pm in pms)
|
|
|
+ {
|
|
|
+ sqlGetCount += $" OR \"process_in\"='{pm}' ";
|
|
|
+ }
|
|
|
+ sqlGetCount += " ) ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(RecipeName))
|
|
|
+ {
|
|
|
+ sqlGetCount += string.Format(" and lower(\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
|
|
|
+ }
|
|
|
+ sqlGetCount += " ;";
|
|
|
+
|
|
|
+ Total = QueryDataClient.Instance.Service.GetDBEventAllCount(sqlGetCount);
|
|
|
+
|
|
|
+ PageCount = (Total / m_onePageCounts) + 1;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
string sql = $"SELECT * FROM \"process_data\" where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
|
|
|
|
|
|
if (!string.IsNullOrEmpty(SelectedValuePM))
|
|
@@ -261,34 +369,32 @@ namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
|
sql += string.Format(" and lower(\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
|
|
|
}
|
|
|
- sql += " order by \"process_begin_time\" DESC;";
|
|
|
+ sql += $" order by \"process_begin_time\" ASC limit {m_onePageCounts} offset {(1 - 1) * m_onePageCounts};";
|
|
|
|
|
|
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
|
|
|
|
|
|
|
|
- System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
- {
|
|
|
- if (dbData == null || dbData.Rows.Count == 0) return;
|
|
|
|
|
|
- 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();
|
|
|
- item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
|
|
- item.Status = dbData.Rows[i]["process_status"].ToString();
|
|
|
- item.SlotID = dbData.Rows[i]["slot_id"].ToString();
|
|
|
- item.RecipeType = dbData.Rows[i]["recipe_type"].ToString();
|
|
|
- item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
|
|
- if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
|
|
- item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
|
|
- item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- Recipes.Add(item);
|
|
|
- }
|
|
|
- }));
|
|
|
+ if (dbData == null || dbData.Rows.Count == 0) return;
|
|
|
+
|
|
|
+ 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();
|
|
|
+ item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
|
|
+ item.Status = dbData.Rows[i]["process_status"].ToString();
|
|
|
+ item.SlotID = dbData.Rows[i]["slot_id"].ToString();
|
|
|
+ item.RecipeType = dbData.Rows[i]["recipe_type"].ToString();
|
|
|
+ item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
|
|
+ if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
|
|
+ item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
|
|
+ item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Recipes.Add(item);
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
@@ -485,7 +591,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
}
|
|
|
Compare(OldPdKeyDataCollection, PdKeyDataCollection);
|
|
|
PdKeyDataCollection = DeepCopyJson(OldPdKeyDataCollection);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void Compare(ObservableCollection<PdKeyData> olddata, ObservableCollection<PdKeyData> newdata)
|
|
@@ -513,8 +619,8 @@ namespace Venus_MainPages.ViewModels
|
|
|
}
|
|
|
public void UpdateData(RecipeItem dataLog)
|
|
|
{
|
|
|
- OnClearData();
|
|
|
-
|
|
|
+ OnClearData();
|
|
|
+
|
|
|
}
|
|
|
public void CheckRecipe(string RecipeGuid)
|
|
|
{
|
|
@@ -575,13 +681,13 @@ namespace Venus_MainPages.ViewModels
|
|
|
int k = 1;
|
|
|
result[Keys[i]].ForEach(point =>
|
|
|
{
|
|
|
- ProcessData.Add(new HistoryDataItem() { dateTime= point.dateTime, dbName= Keys[i],value= point.value });
|
|
|
+ ProcessData.Add(new HistoryDataItem() { dateTime = point.dateTime, dbName = Keys[i], value = point.value });
|
|
|
points.Add(new Point() { X = point.dateTime.ToOADate(), Y = point.value });
|
|
|
k += 1;
|
|
|
});
|
|
|
cls.Add(points);
|
|
|
}
|
|
|
- for (int i = 0; i <PdKeyDataCollection.Count(); i++)
|
|
|
+ for (int i = 0; i < PdKeyDataCollection.Count(); i++)
|
|
|
{
|
|
|
var _color = PdKeyDataCollection[i].Color.Color;
|
|
|
view.MyDrawGraphicsControl.m_PenCollencteions[i] = new System.Drawing.Pen(System.Drawing.Color.FromArgb(_color.A, _color.R, _color.G, _color.B), 2);
|
|
@@ -601,13 +707,15 @@ namespace Venus_MainPages.ViewModels
|
|
|
if (IsShowStep)
|
|
|
{
|
|
|
var item2 = QueryDataClient.Instance.Service.GetHistorySteps(Convert.ToDateTime(selectedRecipeItem?.StartTime), Convert.ToDateTime(selectedRecipeItem?.EndTime));
|
|
|
- if (item2 != null)
|
|
|
+
|
|
|
+ item2?.ForEach(x =>
|
|
|
{
|
|
|
- item2.ForEach(x =>
|
|
|
+ if (x.RecipeId == selectedRecipeItem.Chamber)
|
|
|
{
|
|
|
this.view.MyDrawGraphicsControl.YPoints.Add(new Venus_Core.StepItem() { StartValue = x.StartTime.ToOADate(), Information = $"{x.RecipeId}\n{x.StepNo}\n{x.StartTime.ToString("HH:mm:ss:fff")}" });
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
private void CloseAll(ObservableCollection<ParameterNode> parameterNodes)
|
|
@@ -630,7 +738,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
PdKeyDataCollection.Clear();
|
|
|
this.view.MyDrawGraphicsControl.ClearPlotPoints();
|
|
|
CloseAll(ParameterNodes);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
public void ColorChanged()
|
|
|
{
|
|
@@ -641,22 +749,22 @@ namespace Venus_MainPages.ViewModels
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
- #region 数据类
|
|
|
- public class RecipeItem : BindableBase
|
|
|
- {
|
|
|
- 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 string RecipeType { get; set; }
|
|
|
+ #region 数据类
|
|
|
+ public class RecipeItem : BindableBase
|
|
|
+ {
|
|
|
+ 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 string RecipeType { get; set; }
|
|
|
}
|
|
|
public class StepData
|
|
|
{
|
|
@@ -674,20 +782,20 @@ namespace Venus_MainPages.ViewModels
|
|
|
public string SettingTime { get; set; }
|
|
|
}
|
|
|
public class PdKeyData : BindableBase, ICloneable
|
|
|
+ {
|
|
|
+ public string Key { get; set; }
|
|
|
+ public SolidColorBrush _Color;
|
|
|
+ public SolidColorBrush Color
|
|
|
{
|
|
|
- public string Key { get; set; }
|
|
|
- public SolidColorBrush _Color;
|
|
|
- public SolidColorBrush Color
|
|
|
- {
|
|
|
- get { return _Color; }
|
|
|
- set { SetProperty(ref _Color, value); }
|
|
|
- }
|
|
|
- public int UniqueId { get; set; }
|
|
|
- public object Clone()
|
|
|
- {
|
|
|
- return MemberwiseClone();
|
|
|
- }
|
|
|
+ get { return _Color; }
|
|
|
+ set { SetProperty(ref _Color, value); }
|
|
|
}
|
|
|
- #endregion
|
|
|
-
|
|
|
+ public int UniqueId { get; set; }
|
|
|
+ public object Clone()
|
|
|
+ {
|
|
|
+ return MemberwiseClone();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
}
|