|
@@ -373,79 +373,83 @@ namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
|
Task.Factory.StartNew(() =>
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
- SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
|
|
|
- this.SearchBeginTime = this.view.wfTimeFrom.Value;
|
|
|
- this.SearchEndTime = this.view.wfTimeTo.Value;
|
|
|
+ this.view.Dispatcher.Invoke(() =>
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
|
|
|
- string sqlEvent = "";
|
|
|
- string sql = "";
|
|
|
- sqlEvent = string.Format("SELECT \"event_id\", \"event_enum\", \"type\", \"occur_time\", \"level\",\"source\" , \"description\" FROM \"event_data\" where \"occur_time\" >='{0}' and \"occur_time\" <='{1}' ", SearchBeginTime.ToString("yyyyMMdd HHmmss"), SearchEndTime.ToString("yyyyMMdd HHmmss"));
|
|
|
- sqlEvent += SearchSqlString();
|
|
|
|
|
|
-
|
|
|
+ SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
|
|
|
+ this.SearchBeginTime = this.view.wfTimeFrom.Value;
|
|
|
+ this.SearchEndTime = this.view.wfTimeTo.Value;
|
|
|
|
|
|
+ string sqlEvent = "";
|
|
|
+ string sql = "";
|
|
|
+ sqlEvent = string.Format("SELECT \"event_id\", \"event_enum\", \"type\", \"occur_time\", \"level\",\"source\" , \"description\" FROM \"event_data\" where \"occur_time\" >='{0}' and \"occur_time\" <='{1}' ", SearchBeginTime.ToString("yyyyMMdd HHmmss"), SearchEndTime.ToString("yyyyMMdd HHmmss"));
|
|
|
+ sqlEvent += SearchSqlString();
|
|
|
|
|
|
- sql = sqlEvent;
|
|
|
- sql += $" order by \"occur_time\" ASC limit {m_onePageCounts} offset {(CurrentPage - 1) * m_onePageCounts};";
|
|
|
|
|
|
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
|
|
|
- {
|
|
|
+ sql = sqlEvent;
|
|
|
+ sql += $" order by \"occur_time\" ASC limit {m_onePageCounts} offset {(CurrentPage - 1) * m_onePageCounts};";
|
|
|
|
|
|
- List<EventItem> lstEvent = QueryDBEventFunc(sql);
|
|
|
|
|
|
- if (lstEvent == null)
|
|
|
- return;
|
|
|
|
|
|
- Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
+ if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
|
|
|
{
|
|
|
|
|
|
+ List<EventItem> lstEvent = QueryDBEventFunc(sql);
|
|
|
|
|
|
- string logTypeStr;
|
|
|
+ if (lstEvent == null)
|
|
|
+ return;
|
|
|
|
|
|
- foreach (EventItem ev in lstEvent)
|
|
|
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
{
|
|
|
- switch (ev.Level)
|
|
|
+
|
|
|
+
|
|
|
+ string logTypeStr;
|
|
|
+
|
|
|
+ foreach (EventItem ev in lstEvent)
|
|
|
{
|
|
|
- case EventLevel.Information: logTypeStr = "Info"; break;
|
|
|
- case EventLevel.Warning: logTypeStr = "Warning"; break;
|
|
|
- case EventLevel.Alarm: logTypeStr = "Alarm"; break;
|
|
|
- default: logTypeStr = "Undefine"; break;
|
|
|
+ switch (ev.Level)
|
|
|
+ {
|
|
|
+ case EventLevel.Information: logTypeStr = "Info"; break;
|
|
|
+ case EventLevel.Warning: logTypeStr = "Warning"; break;
|
|
|
+ case EventLevel.Alarm: logTypeStr = "Alarm"; break;
|
|
|
+ default: logTypeStr = "Undefine"; break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SearchedResult.Add(new Aitex.Core.UI.View.Common.SystemLogItem()
|
|
|
+ {
|
|
|
+ ID = ev.Id.ToString(),
|
|
|
+ Time = ((DateTime)ev.OccuringTime).ToString("yyyy/MM/dd HH:mm:ss.fff"),
|
|
|
+ LogType = logTypeStr,
|
|
|
+ Detail = ev.Description,
|
|
|
+ TargetChamber = ev.Source,
|
|
|
+ Initiator = "",
|
|
|
+ Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/MECF.Framework.Common;component/Resources/SystemLog/{0}.png", ev.Level.ToString()), UriKind.Absolute))
|
|
|
+ }); ;
|
|
|
}
|
|
|
+ RaisePropertyChanged("SearchedResult");
|
|
|
|
|
|
- SearchedResult.Add(new Aitex.Core.UI.View.Common.SystemLogItem()
|
|
|
- {
|
|
|
- ID = ev.Id.ToString(),
|
|
|
- Time = ((DateTime)ev.OccuringTime).ToString("yyyy/MM/dd HH:mm:ss.fff"),
|
|
|
- LogType = logTypeStr,
|
|
|
- Detail = ev.Description,
|
|
|
- TargetChamber = ev.Source,
|
|
|
- Initiator = "",
|
|
|
- Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/MECF.Framework.Common;component/Resources/SystemLog/{0}.png", ev.Level.ToString()), UriKind.Absolute))
|
|
|
- }); ;
|
|
|
- }
|
|
|
- RaisePropertyChanged("SearchedResult");
|
|
|
-
|
|
|
- }));
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
+ {
|
|
|
+ SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
|
|
|
+ RaisePropertyChanged("SearchedResult");
|
|
|
+ }));
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
- {
|
|
|
- SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
|
|
|
- RaisePropertyChanged("SearchedResult");
|
|
|
- }));
|
|
|
+ LOG.WriteExeption(ex);
|
|
|
}
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- LOG.WriteExeption(ex);
|
|
|
- }
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
}
|
|
@@ -471,28 +475,31 @@ namespace Venus_MainPages.ViewModels
|
|
|
sqlEvent += " ) ";
|
|
|
|
|
|
|
|
|
- sqlEvent += " and (FALSE ";
|
|
|
- if (SearchPMA) sqlEvent += " OR \"source\"='PMA' ";
|
|
|
- if (SearchPMB) sqlEvent += " OR \"source\"='PMB' ";
|
|
|
- if (SearchPMC) sqlEvent += " OR \"source\"='PMC' ";
|
|
|
- if (SearchPMD) sqlEvent += " OR \"source\"='PMD' ";
|
|
|
- if (SearchLLA) sqlEvent += " OR \"source\"='LLA' ";
|
|
|
- if (SearchLLB) sqlEvent += " OR \"source\"='LLB' ";
|
|
|
- if (SearchTM) sqlEvent += " OR \"source\"='TM' ";
|
|
|
- if (SearchTM) sqlEvent += " OR \"source\"='TMRobot' ";
|
|
|
+ if (this.view.allModuleCheckBox.IsChecked!=true)
|
|
|
+ {
|
|
|
+ sqlEvent += " and (FALSE ";
|
|
|
+ if (SearchPMA) sqlEvent += " OR \"source\"='PMA' ";
|
|
|
+ if (SearchPMB) sqlEvent += " OR \"source\"='PMB' ";
|
|
|
+ if (SearchPMC) sqlEvent += " OR \"source\"='PMC' ";
|
|
|
+ if (SearchPMD) sqlEvent += " OR \"source\"='PMD' ";
|
|
|
+ if (SearchLLA) sqlEvent += " OR \"source\"='LLA' ";
|
|
|
+ if (SearchLLB) sqlEvent += " OR \"source\"='LLB' ";
|
|
|
+ if (SearchTM) sqlEvent += " OR \"source\"='TM' ";
|
|
|
+ if (SearchTM) sqlEvent += " OR \"source\"='TMRobot' ";
|
|
|
|
|
|
- if (SearchEFEM) sqlEvent += " OR \"source\"='EfemRobot' ";
|
|
|
- if (SearchEFEM) sqlEvent += " OR \"source\"='EFEM' ";
|
|
|
+ if (SearchEFEM) sqlEvent += " OR \"source\"='EfemRobot' ";
|
|
|
+ if (SearchEFEM) sqlEvent += " OR \"source\"='EFEM' ";
|
|
|
|
|
|
- if (SearchVCEA) sqlEvent += " OR \"source\"='VCEA' ";
|
|
|
- if (SearchVCEB) sqlEvent += " OR \"source\"='VCEB' ";
|
|
|
+ if (SearchVCEA) sqlEvent += " OR \"source\"='VCEA' ";
|
|
|
+ if (SearchVCEB) sqlEvent += " OR \"source\"='VCEB' ";
|
|
|
|
|
|
- if (SearchSystem) sqlEvent += " OR \"source\"='System' ";
|
|
|
+ if (SearchSystem) sqlEvent += " OR \"source\"='System' ";
|
|
|
|
|
|
-
|
|
|
- sqlEvent += " ) ";
|
|
|
|
|
|
- //sqlEvent += $" order by \"occur_time\" DESC limit {m_onePageCounts} offset {(CurrentPage - 1) * m_onePageCounts};";
|
|
|
+ sqlEvent += " ) ";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
sql = sqlEvent;
|
|
|
|
|
|
|