Bläddra i källkod

1.Gas Leak Check 加上Penning Guage信号显示
2.解决eventView 日志 读取bug

lixiang 7 månader sedan
förälder
incheckning
46d2717838

+ 76 - 69
Venus/Venus_MainPages/ViewModels/EventViewModel.cs

@@ -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;
 
 

+ 12 - 0
Venus/Venus_MainPages/ViewModels/KeplerGasLeakCheckViewModel.cs

@@ -151,6 +151,8 @@ namespace Venus_MainPages.ViewModels
         private Stopwatch stopwatch = new Stopwatch();
         private PressureType m_PressureType;
         private bool m_firstLoadFlag = true;
+        private float m_PenningPressure;
+
         #endregion
 
         #region  属性
@@ -760,6 +762,14 @@ namespace Venus_MainPages.ViewModels
             get { return m_PurgeValveIsOpen; }
             set { SetProperty(ref m_PurgeValveIsOpen, value); }
         }
+        public float PenningPressure
+        {
+            get { return m_PenningPressure; }
+            set
+            {
+                SetProperty(ref m_PenningPressure, value);
+            }
+        }
         #endregion
 
         #region 命令
@@ -1018,6 +1028,7 @@ namespace Venus_MainPages.ViewModels
             MFCN2Data = (AITMfcData)RtDataValues[$"{ModuleName}.MfcN2"];
             N2Purge2ValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.ValveN2Purge2.IsOpen");
             PurgeValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.ValvePurge.IsOpen");
+            PenningPressure = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.PenningPressure");
 
             //if (ChamberType == JetChamber.VenusSE)
             //{
@@ -1167,6 +1178,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.IsOnline");
             m_RtDataKeys.Add($"{ModuleName}.ValveN2Purge2.IsOpen");
             m_RtDataKeys.Add($"{ModuleName}.ValvePurge.IsOpen");
+            m_RtDataKeys.Add($"{ModuleName}.PenningPressure");
 
 
         }

+ 1 - 1
Venus/Venus_MainPages/Views/EventView.xaml

@@ -101,7 +101,7 @@
                     <TextBox Margin="5,0,0,0" FontSize="14" Text="{Binding SearchKeyWords,UpdateSourceTrigger=PropertyChanged}" Width="170"/>
                 </StackPanel>-->
                 <StackPanel HorizontalAlignment="Left">
-                    <CheckBox Content="All"     FontSize="14" Margin="5" Width="120">
+                    <CheckBox Content="All"     FontSize="14" Margin="5" Width="120" x:Name="allModuleCheckBox">
                         <CheckBox.IsChecked>
                             <MultiBinding Converter="{StaticResource AllNoneCheckboxConverter}">
                                 <Binding ElementName="SystemCheckBox" Path="IsChecked"/>

+ 4 - 4
Venus/Venus_MainPages/Views/KeplerGasLeakCheckView.xaml

@@ -681,9 +681,9 @@
 
                 
 
-                <TextBlock Text="V4" Canvas.Left="1131" Canvas.Top="320" FontSize="14"/>
+                <TextBlock Text="V4" Canvas.Left="1142" Canvas.Top="320" FontSize="14"/>
                 <ctrls:FlowPipe  Height="8"  Width="100" Canvas.Left="1114" Canvas.Top="342"   />
-                <customControls:CommonValveControl   ValveOrientation="Horizontal" Status="{Binding PenningGaugeValveIsOpen,Mode=TwoWay}" Height="20" Width="20" Canvas.Left="1130" Canvas.Top="336" IsCanEdit="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" Tag="59" Command="{Binding ControlValveCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}"/>
+                <customControls:CommonValveControl   ValveOrientation="Horizontal" Status="{Binding PenningGaugeValveIsOpen,Mode=TwoWay}" Height="20" Width="20" Canvas.Left="1140" Canvas.Top="336" IsCanEdit="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" Tag="59" Command="{Binding ControlValveCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}"/>
                 <ctrls:TextboxWithLabel  Canvas.Top="316" Canvas.Left="1170" LabelValue="{Binding PressureType, StringFormat=Penning Guage({0})}" TextBoxValue="{Binding PenningPressure,StringFormat='F1'}" TextBoxColor="#E6ECF5"/>
 
                 <ctrls:ChamberWithHeater Canvas.Left="880" Canvas.Top="250" 
@@ -717,13 +717,13 @@
                             </DataTemplate>
                         </DataGridTextColumn.HeaderTemplate>
                     </DataGridTextColumn>
-                    <DataGridTextColumn Width="150" Binding="{Binding StartPressure}" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                    <!--<DataGridTextColumn Width="150" Binding="{Binding StartPressure}" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
                         <DataGridTextColumn.HeaderTemplate >
                             <DataTemplate>
                                 <TextBlock Text="Penning Guage Pressure" />
                             </DataTemplate>
                         </DataGridTextColumn.HeaderTemplate>
-                    </DataGridTextColumn>
+                    </DataGridTextColumn>-->
                     <DataGridTextColumn Width="120" Binding="{Binding StartPressure}" CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
                         <DataGridTextColumn.HeaderTemplate >
                             <DataTemplate>

+ 4 - 4
Venus/Venus_UI/Views/ShellView.xaml.cs

@@ -764,10 +764,10 @@ namespace Venus_UI.Views
 
         private async void Window_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
         {
-            this.buttonList[1].IsChecked = true;
-            await System.Threading.Tasks.Task.Delay(1);
-            SaveWindowContent(this, "test.jpg");
-            this.buttonList[0].IsChecked = true;
+            //this.buttonList[1].IsChecked = true;
+            //await System.Threading.Tasks.Task.Delay(1);
+            //SaveWindowContent(this, "test.jpg");
+            //this.buttonList[0].IsChecked = true;
         }
 
     }