123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.UI.ControlDataContext;
- using Aitex.Core.Utilities;
- using Aitex.Triton160.Common;
- namespace Aitex.Triton160.UI.ViewModel
- {
- class DataLogViewModel : UIViewModelBase
- {
- private string _culture = CultureSupported.English;
- public class DbSusceptorDetails
- {
- public string Time { get; set; }
- public string ItemType { get; set; }
- public string ItemData { get; set; }
- public string ItemDescription { get; set; }
- }
- public ProcessDataChartDataItem ProcessChartData
- {
- get;
- set;
- }
- public ObservableCollection<string> RecipeList
- {
- get; set;
- }
- public List<DataLogItem> DataLogList
- {
- get; set;
- }
- public List<HistoryDataItem> ProcessData { get; set; }
- public DataLogViewModel() : base("DataLogViewModel")
- {
- ProcessChartData = new ProcessDataChartDataItem(60000);
- Triton160UiSystem.Instance.CultureChanged += CultureChanged;
- SCLocal.SetKeys(new List<string>()
- {
- SCName.GasLineConfig_Gas1Enable,
- SCName.GasLineConfig_Gas1Name,
- SCName.GasLineConfig_Gas2Enable,
- SCName.GasLineConfig_Gas2Name,
- SCName.GasLineConfig_Gas3Enable,
- SCName.GasLineConfig_Gas3Name,
- SCName.GasLineConfig_Gas4Enable,
- SCName.GasLineConfig_Gas4Name,
- SCName.GasLineConfig_Gas5Enable,
- SCName.GasLineConfig_Gas5Name,
- SCName.RfConfig_EnablePulsingFunction,
- SCName.PressureControlConfig_EnableThrottleValve,
- SCName.PressureControlConfig_PumpEnableN2Pressure,
- SCName.PressureControlConfig_PumpEnableWaterFlow,
- });
- }
- private void CultureChanged(string s)
- {
- _culture = s;
- }
- public void UpdateRecipeList(DateTime from, DateTime to)
- {
- ObservableCollection<string> lst = new ObservableCollection<string>();
- List<string> result = Triton160UiSystem.Instance.WCF.Query.GetHistoryRecipeList(from, to);
- if (result != null)
- result.ForEach(lst.Add);
- RecipeList = lst;
- InvokePropertyChanged("RecipeList");
- }
- public void UpdateDataLogList(DateTime from, DateTime to, string recipe, string lot)
- {
- DataLogList = Triton160UiSystem.Instance.WCF.Query.GetHistoryDataLogList(from, to, recipe, lot);
- InvokePropertyChanged("DataLogList");
- }
- public void UpdateData(DataLogItem dataLog)
- {
- if (dataLog == null)
- {
- ProcessChartData.ClearData();
- return;
- }
- List<string> keys = new List<string>();
- Application.Current.Dispatcher.Invoke(new Action(() =>
- {
- Dictionary<string, Tuple<string, string, bool>> dicItems = GetDataElements(_culture);
- keys = dicItems.Keys.ToList();
- ProcessChartData.UpdateColumns(dicItems);
- }));
- ProcessData = Triton160UiSystem.Instance.WCF.Query.GetHistoryData(keys, dataLog.RecipeRunGuid);
- Application.Current.Dispatcher.Invoke(new Action(() =>
- {
- ProcessChartData.SetInfo(dataLog.LotName);
- ProcessChartData.UpdateData(ProcessData);
- }));
- }
- }
-
- }
|