Browse Source

1.check load function bugs fix
2.statistic ui viewmodel add

hecl 1 year ago
parent
commit
ed38ed5c95

+ 8 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -197,6 +197,7 @@
     <Compile Include="ViewModels\SETMOperationViewModel.cs" />
     <Compile Include="ViewModels\SeTMViewModel.cs" />
     <Compile Include="ViewModels\SignalTowerConfigViewModel.cs" />
+    <Compile Include="ViewModels\StatisticsViewModel.cs" />
     <Compile Include="ViewModels\SystemConfigViewModel.cs" />
     <Compile Include="ViewModels\TMOperationViewModel.cs" />
     <Compile Include="ViewModels\TMViewModel.cs" />
@@ -304,6 +305,9 @@
     <Compile Include="Views\SignalTowerConfigView.xaml.cs">
       <DependentUpon>SignalTowerConfigView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\StatisticsView.xaml.cs">
+      <DependentUpon>StatisticsView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\SystemConfigView.xaml.cs">
       <DependentUpon>SystemConfigView.xaml</DependentUpon>
     </Compile>
@@ -492,6 +496,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\StatisticsView.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\SystemConfigView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 334 - 0
Venus/Venus_MainPages/ViewModels/StatisticsViewModel.cs

@@ -0,0 +1,334 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Data;
+using System.Linq;
+using System.Windows;
+using System.Windows.Data;
+using Aitex.Core.RT.Log;
+using Aitex.Core.Util;
+using MECF.Framework.Common.CommonData;
+using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.OperationCenter;
+using OpenSEMI.ClientBase;
+//using SciChart.Core.Extensions;
+//using VirgoUI.Client.Models.Sys;
+
+namespace Venus_MainPages.ViewModels
+{
+    public class StatsDataListItem : NotifiableItem
+    {
+        public string Name { get; set; }
+        public string Value { get; set; }
+        public string Description { get; set; }
+        public string Total { get; set; }
+        public string LastUpdateTime { get; set; }
+        public string LastResetTime { get; set; }
+        public string LastResetTotalTime { get; set; }
+        public string WarningValue { get; set; }
+        public string WarningValueSetPoint { get; set; }
+        public bool WarningEnable { get; set; }
+        public string AlarmValue { get; set; }
+        public string AlarmValueSetPoint { get; set; }
+        public bool AlarmEnable { get; set; }
+
+        public bool AlarmTextSaved { get; set; }
+        public bool WarningTextSaved { get; set; }
+        public bool IsVisible { get; set; }
+    }
+
+    public class StatsDataListItemRFAndPump : NotifiableItem
+    {
+        public string Name { get; set; }
+        public string Description { get; set; }
+        public string LastPMTime { get; set; }
+        public string fromLastPM { get; set; }
+        public string Total { get; set; }
+        public string PMInterval { get; set; }
+        public string PMIntervalSetPoint { get; set; }
+        public bool AlarmEnable { get; set; }
+
+        public bool PMIntervalTextSaved { get; set; }
+    }
+
+    public class StatisticsViewModel : Binding
+    {
+        private int MenuPermission
+        {
+            //get
+            //{
+            //    return ClientApp.Instance.GetPermission("Statistics");
+            //}
+            get; set;
+        }
+
+        public ObservableCollection<StatsDataListItem> StatData
+        {
+            get;
+            set;
+        }
+
+        public ObservableCollection<StatsDataListItemRFAndPump> StatDataRFAndPump
+        {
+            get;
+            set;
+        }
+
+        //protected override void OnInitialize()
+        //{
+        //    StatData = new ObservableCollection<StatsDataListItem>();
+        //    StatDataRFAndPump = new ObservableCollection<StatsDataListItemRFAndPump>();
+
+        //    base.OnInitialize();
+        //}
+
+        //protected override void OnActivate()
+        //{
+        //    base.OnActivate();
+
+        //}
+
+        //protected override void OnDeactivate(bool close)
+        //{
+        //    base.OnDeactivate(close);
+        //}
+
+        //protected override void Poll()
+        //{
+        //    try
+        //    {
+                
+
+        //        string sql = $"SELECT * FROM \"stats_data\" order by \"name\" ASC;";
+
+        //        DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
+
+        //        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+        //        {
+        //            if (dbData == null || dbData.Rows.Count == 0)
+        //                return;
+
+        //            string[] clearedNameList = Array.ConvertAll<StatsDataListItem, string>(StatData.ToArray(), x => x.Name);
+
+        //            List<string> removableList = new List<string>();
+
+        //            if (clearedNameList.Length > 0)
+        //                removableList = clearedNameList.ToList();
+
+        //            for (int i = 0; i < dbData.Rows.Count; i++)
+        //            {
+        //                if (!dbData.Rows[i]["is_visible"].Equals(DBNull.Value) && !Convert.ToBoolean(dbData.Rows[i]["is_visible"].ToString()))
+        //                    continue;
+
+        //                string name = dbData.Rows[i]["name"].ToString();
+        //                //removableList.RemoveIfContains(name);
+
+        //                StatsDataListItem item = StatData.FirstOrDefault(x => x.Name == name);
+        //                if (item == null)
+        //                {
+        //                    item = new StatsDataListItem();
+        //                    item.Name = dbData.Rows[i]["name"].ToString();
+        //                    item.AlarmEnable = false;
+        //                    item.WarningEnable = false;
+        //                    item.IsVisible = true;
+        //                    item.AlarmTextSaved = true;
+        //                    item.WarningTextSaved = true;
+        //                    item.AlarmValueSetPoint = dbData.Rows[i]["alarm_value"].ToString();
+        //                    item.WarningValueSetPoint = dbData.Rows[i]["warning_value"].ToString();
+        //                    StatData.Add(item);
+        //                }
+                        
+        //                item.Description = dbData.Rows[i]["description"].ToString();
+        //                item.Value = dbData.Rows[i]["value"].ToString();
+        //                item.Total = dbData.Rows[i]["total"].ToString();
+
+        //                if (!dbData.Rows[i]["enable_warning"].Equals(DBNull.Value))
+        //                    item.WarningEnable = Convert.ToBoolean(dbData.Rows[i]["enable_warning"].ToString());
+
+        //                item.WarningValue = dbData.Rows[i]["warning_value"].ToString();
+
+        //                if (!dbData.Rows[i]["enable_alarm"].Equals(DBNull.Value))
+        //                    item.AlarmEnable = Convert.ToBoolean(dbData.Rows[i]["enable_alarm"].ToString());
+
+        //                item.AlarmValue = dbData.Rows[i]["alarm_value"].ToString();  
+
+        //                if (!dbData.Rows[i]["last_update_time"].Equals(DBNull.Value))
+        //                    item.LastUpdateTime = ((DateTime)dbData.Rows[i]["last_update_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
+
+        //                if (!dbData.Rows[i]["last_reset_time"].Equals(DBNull.Value))
+        //                    item.LastResetTime = ((DateTime)dbData.Rows[i]["last_reset_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
+
+        //                if (!dbData.Rows[i]["last_total_reset_time"].Equals(DBNull.Value))
+        //                    item.LastResetTotalTime = ((DateTime)dbData.Rows[i]["last_total_reset_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
+
+        //                item.InvokePropertyChanged(nameof(item.AlarmValue));
+        //                item.InvokePropertyChanged(nameof(item.WarningValue));
+        //                item.InvokePropertyChanged(nameof(item.Value));
+        //                item.InvokePropertyChanged(nameof(item.Total));
+        //                item.InvokePropertyChanged(nameof(item.LastUpdateTime));
+        //                item.InvokePropertyChanged(nameof(item.LastResetTime));
+        //                item.InvokePropertyChanged(nameof(item.LastResetTotalTime));
+        //            }
+
+        //            foreach (var name in removableList)
+        //            {
+        //                StatsDataListItem item = StatData.FirstOrDefault(x => x.Name == name);
+        //                if (item != null)
+        //                    StatData.Remove(item);
+        //            }
+
+        //        }));
+
+
+        //        string sqlrfpump = $"SELECT * FROM \"stats_data_rf_pump\" order by \"name\" ASC;";
+
+        //        DataTable dbDataRFPump = QueryDataClient.Instance.Service.QueryData(sqlrfpump);
+
+        //        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+        //        {
+        //            if (dbDataRFPump == null || dbDataRFPump.Rows.Count == 0)
+        //                return;
+
+        //            string[] clearedNameList = Array.ConvertAll<StatsDataListItemRFAndPump, string>(StatDataRFAndPump.ToArray(), x => x.Name);
+
+        //            List<string> removableList = new List<string>();
+
+        //            if (clearedNameList.Length > 0)
+        //                removableList = clearedNameList.ToList();
+
+        //            for (int i = 0; i < dbDataRFPump.Rows.Count; i++)
+        //            {
+
+        //                string name = dbDataRFPump.Rows[i]["name"].ToString();
+        //                //removableList.RemoveIfContains(name);
+
+        //                StatsDataListItemRFAndPump item = StatDataRFAndPump.FirstOrDefault(x => x.Name == name);
+        //                if (item == null)
+        //                {
+        //                    item = new StatsDataListItemRFAndPump();
+        //                    item.Name = dbDataRFPump.Rows[i]["name"].ToString();
+        //                    item.AlarmEnable = false;
+        //                    item.PMIntervalTextSaved = true;
+        //                    item.PMIntervalSetPoint = dbDataRFPump.Rows[i]["pm_interval"].ToString();
+        //                    StatDataRFAndPump.Add(item);
+        //                }
+
+        //                item.Description = dbDataRFPump.Rows[i]["description"].ToString();
+        //                if (!dbDataRFPump.Rows[i]["enable_alarm"].Equals(DBNull.Value))
+        //                    item.AlarmEnable = Convert.ToBoolean(dbDataRFPump.Rows[i]["enable_alarm"].ToString());
+
+        //                item.fromLastPM = dbDataRFPump.Rows[i]["from_last_pm"].ToString();
+        //                item.PMInterval = dbDataRFPump.Rows[i]["pm_interval"].ToString();
+        //                item.Total = dbDataRFPump.Rows[i]["total"].ToString();
+
+        //                if (!dbDataRFPump.Rows[i]["last_pm_time"].Equals(DBNull.Value))
+        //                    item.LastPMTime = ((DateTime)dbDataRFPump.Rows[i]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
+
+        //                item.InvokePropertyChanged(nameof(item.Name));
+        //                item.InvokePropertyChanged(nameof(item.AlarmEnable));
+        //                item.InvokePropertyChanged(nameof(item.Description));
+        //                item.InvokePropertyChanged(nameof(item.Total));
+        //                item.InvokePropertyChanged(nameof(item.fromLastPM));
+        //                item.InvokePropertyChanged(nameof(item.PMInterval));
+        //                item.InvokePropertyChanged(nameof(item.LastPMTime));
+        //            }
+
+        //            foreach (var name in removableList)
+        //            {
+        //                StatsDataListItemRFAndPump item = StatDataRFAndPump.FirstOrDefault(x => x.Name == name);
+        //                if (item != null)
+        //                    StatDataRFAndPump.Remove(item);
+        //            }
+
+        //        }));
+        //    }
+        //    catch (Exception e)
+        //    {
+        //    }
+        //}
+
+        public void ResetValue(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.Stats.ResetValue", item.Name);
+        }
+
+        public void ResetEnableAlarm(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.Stats.EnableAlarm", item.Name, item.AlarmEnable);
+        }
+
+        public void ResetEnableWarning(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.Stats.EnableWarning", item.Name, item.WarningEnable);
+        }
+
+        public void SetAlarmValue(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            if (string.IsNullOrEmpty(item.AlarmValueSetPoint) ||
+                !int.TryParse(item.AlarmValueSetPoint, out int setValue))
+            {
+                DialogBox.ShowWarning("Alarm value not valid");
+                return;
+            }
+
+            InvokeClient.Instance.Service.DoOperation("System.Stats.SetAlarmValue", item.Name, setValue);
+
+            item.AlarmTextSaved = true;
+            item.InvokePropertyChanged(nameof(item.AlarmTextSaved));
+        }
+
+        public void SetWarningValue(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            if (string.IsNullOrEmpty(item.WarningValueSetPoint) ||
+                !int.TryParse(item.WarningValueSetPoint, out int setValue))
+            {
+                DialogBox.ShowWarning("Warning value not valid");
+                return;
+            }
+
+            InvokeClient.Instance.Service.DoOperation("System.Stats.SetWarningValue", item.Name, setValue);
+
+            item.WarningTextSaved = true;
+            item.InvokePropertyChanged(nameof(item.WarningTextSaved));
+        }
+        
+        public void ResetTotalValue(StatsDataListItem item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.Stats.ResetTotalValue", item.Name);
+        }
+
+        public void ResetTimeValue(StatsDataListItemRFAndPump item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.ResetValue", item.Name);
+        }
+
+        public void ResetRFEnableAlarm(StatsDataListItemRFAndPump item)
+        {
+            if (MenuPermission != 3) return;
+            InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.EnableAlarm", item.Name, item.AlarmEnable);
+        }
+
+        public void SetPMIntervalValue(StatsDataListItemRFAndPump item)
+        {
+            if (MenuPermission != 3) return;
+            if (string.IsNullOrEmpty(item.PMIntervalSetPoint) ||
+                !int.TryParse(item.PMIntervalSetPoint, out int setValue))
+            {
+                DialogBox.ShowWarning("PM Interval value not valid");
+                return;
+            }
+
+            InvokeClient.Instance.Service.DoOperation("System.StatsRFAndPump.SetPMIntervalValue", item.Name, setValue);
+
+            item.PMIntervalTextSaved = true;
+            item.InvokePropertyChanged(nameof(item.PMIntervalTextSaved));
+        }
+    }
+}

+ 329 - 0
Venus/Venus_MainPages/Views/StatisticsView.xaml

@@ -0,0 +1,329 @@
+<UserControl x:Class="Venus_MainPages.Views.StatisticsView"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+             xmlns:cal="http://www.caliburn.org"     
+             xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
+             mc:Ignorable="d" >
+    <Grid HorizontalAlignment="Left">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="300"/>
+            <RowDefinition Height="300"/>
+        </Grid.RowDefinitions>
+        <TabControl Grid.Row="0">
+            <TabItem Header="Statistic Item List ">
+
+                <DataGrid Grid.Row="1" AlternationCount="2" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
+                  VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
+                  ItemsSource="{Binding StatData}" Margin="0,5,0,0" >
+
+                    <DataGrid.Columns>
+                        <DataGridTemplateColumn Header="Name" Width="220">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
+                                </TextBlock>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Last Reset Time" Width="200">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding LastResetTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Value" Width="80">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Value}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Width="130">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Reset Value" Width="120" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="ResetValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Enable Warning" Width="120">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <CheckBox Height="35" Width="35" VerticalContentAlignment="Center" IsChecked="{Binding WarningEnable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Checked">
+                                                <cal:ActionMessage MethodName="ResetEnableWarning">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                            <i:EventTrigger EventName="Unchecked">
+                                                <cal:ActionMessage MethodName="ResetEnableWarning">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </CheckBox>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+
+                        <DataGridTemplateColumn Header="Warning Value" Width="100">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding WarningValue}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Warning Value Set" Width="130">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <ctrl:TextBoxEx Text="{Binding Path=WarningValueSetPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextSaved="{Binding WarningTextSaved, Mode=TwoWay}" Width="110" Height="25"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Width="80">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Set" Width="60" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="SetWarningValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Enable Alarm" Width="120">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <CheckBox Height="35" Width="35" VerticalContentAlignment="Center" IsChecked="{Binding AlarmEnable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Checked">
+                                                <cal:ActionMessage MethodName="ResetEnableAlarm">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                            <i:EventTrigger EventName="Unchecked">
+                                                <cal:ActionMessage MethodName="ResetEnableAlarm">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </CheckBox>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+
+                        <DataGridTemplateColumn Header="Alarm Value" Width="100">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding AlarmValue}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Alarm Value Set" Width="120">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <ctrl:TextBoxEx Text="{Binding Path=AlarmValueSetPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextSaved="{Binding AlarmTextSaved, Mode=TwoWay}" Width="110" Height="25"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Width="80">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Set" Width="60" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="SetAlarmValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+
+                        <DataGridTemplateColumn Header="Last Reset Total" Width="200">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding LastResetTotalTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Total" Width="80">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Total}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Width="130"  >
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Reset Total" Width="120" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="ResetTotalValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                    </DataGrid.Columns>
+                </DataGrid>
+
+ 
+            </TabItem>
+        </TabControl>
+        <TabControl Grid.Row="1">
+            <TabItem Header="Statistic Item List RF And Pump">
+
+                <DataGrid Grid.Row="1" AlternationCount="2" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
+                  VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
+                  ItemsSource="{Binding StatDataRFAndPump}" Margin="0,5,0,0" >
+
+                    <DataGrid.Columns>
+                        <DataGridTemplateColumn Header="Name" Width="220">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
+                                    </TextBlock>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Last Reset Time" Width="200">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding LastPMTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="From Last Reset(Hour)" Width="160">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding fromLastPM}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Width="130">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Reset Value" Width="120" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="ResetTimeValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Total(Hour)" Width="150">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Total}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="PM Interval Value(Hour)" Width="170">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding PMInterval}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="PM Interval Value Set(Hour)" Width="190">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <ctrl:TextBoxEx Text="{Binding Path=PMIntervalSetPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextSaved="{Binding PMIntervalTextSaved, Mode=TwoWay}" Width="110" Height="25"/>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+                        
+                        <DataGridTemplateColumn Width="80">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Button Content="Set" Width="60" Height="25" FontSize="12">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Click">
+                                                <cal:ActionMessage MethodName="SetPMIntervalValue">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </Button>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                        <DataGridTemplateColumn Header="Enable Alarm" Width="120">
+                            <DataGridTemplateColumn.CellTemplate>
+                                <DataTemplate>
+                                    <CheckBox Height="35" Width="35" VerticalContentAlignment="Center" IsChecked="{Binding AlarmEnable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="Checked">
+                                                <cal:ActionMessage MethodName="ResetRFEnableAlarm">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                            <i:EventTrigger EventName="Unchecked">
+                                                <cal:ActionMessage MethodName="ResetRFEnableAlarm">
+                                                    <cal:Parameter Value="{Binding }" />
+                                                </cal:ActionMessage>
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                    </CheckBox>
+                                </DataTemplate>
+                            </DataGridTemplateColumn.CellTemplate>
+                        </DataGridTemplateColumn>
+
+                    </DataGrid.Columns>
+                </DataGrid>
+
+
+            </TabItem>
+        </TabControl>
+    </Grid>
+    
+</UserControl>

+ 15 - 0
Venus/Venus_MainPages/Views/StatisticsView.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace Venus_MainPages.Views
+{
+    /// <summary>
+    /// Interaction logic for IOView.xaml
+    /// </summary>
+    public partial class StatisticsView : UserControl
+    {
+        public StatisticsView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 144 - 77
Venus/Venus_RT/Devices/TM/HongHuVR.cs

@@ -9,6 +9,7 @@ using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Diagnostics.Tracing;
 using System.Linq;
 using System.Runtime.InteropServices;
@@ -56,7 +57,8 @@ namespace Venus_RT.Devices.VCE
 
         //private readonly Regex _rex_check_load = new Regex(@"LOAD\s+(A|B)\s+(\w+)\s*");
         private readonly Regex _rex_check_load = new Regex(@"CHECK LOAD\s*");
-
+        private readonly Regex _rex_rq_load_A = new Regex(@"LOAD\sA\s.*");
+        private readonly Regex _rex_rq_load_B = new Regex(@"LOAD\sB\s.*");
         private readonly Regex _rex_error_code = new Regex(@"_ERR\s+(\d+)\s*");
         private RobotMoveInfo _robotMoveInfo = new RobotMoveInfo();
         public RobotMoveInfo TMRobotMoveInfo { get { return _robotMoveInfo; } }
@@ -273,13 +275,13 @@ namespace Venus_RT.Devices.VCE
         {
             _currentStep = VRStep.ReQueryLoadA;
             _status = RState.Running;
-            return _SendCommand($"RQ LOAD ARM A");
+            return _SendCommand("RQ LOAD ARM A");
         }
         public bool ReQueryLoadB()
         {
-            _currentStep = VRStep.ReQueryLoadA;
+            _currentStep = VRStep.ReQueryLoadB;
             _status = RState.Running;
-            return _SendCommand($"RQ LOAD ARM B");
+            return _SendCommand("RQ LOAD ARM B");
         }
         private bool _SendCommand(string cmd)
         {
@@ -308,100 +310,165 @@ namespace Venus_RT.Devices.VCE
             return true;
         }
 
-        private void OnReceiveMessage(string RevMsg)
+        private void OnReceiveMessage(string revMsg)
         {
-            LOG.WriteSingeLine(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"Receive message from TMRobot: {RevMsg}, while {_currentStep}");
-            RevMsg = RevMsg.Trim();
-            if (_rex_error_code.IsMatch(RevMsg))
+            string[] ResMsgs = revMsg.Split('\n');
+            foreach (string revRawMsg in ResMsgs)
             {
-                _IsHomed = false;
-                _status = RState.Failed;
+                if (string.IsNullOrWhiteSpace(revRawMsg)) continue;
+                string RevMsg = revRawMsg.Trim();
+                LOG.WriteSingeLine(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"Receive message from TMRobot: {RevMsg}, while {_currentStep}");
+                if (_rex_error_code.IsMatch(RevMsg))
+                {
+                    _IsHomed = false;
+                    _status = RState.Failed;
 
-                var results = _rex_error_code.Match(RevMsg);
-                ErrorMessageHandler(results.Groups[1].Value);
-                return;
-            }
+                    var results = _rex_error_code.Match(RevMsg);
+                    ErrorMessageHandler(results.Groups[1].Value);
+                    return;
+                }
 
-            switch (_currentStep)
-            {
-                case VRStep.Goto:
-                case VRStep.Halt:
-                case VRStep.Move:
-                case VRStep.Xfer:
-                case VRStep.Pick:
-                case VRStep.PickExtend:
-                case VRStep.PickRetract:
-                case VRStep.Place:
-                case VRStep.PlaceExtend:
-                case VRStep.PlaceRetract:
-                    {
-                        if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                switch (_currentStep)
+                {
+                    case VRStep.Goto:
+                    case VRStep.Halt:
+                    case VRStep.Move:
+                    case VRStep.Xfer:
+                    case VRStep.Pick:
+                    case VRStep.PickExtend:
+                    case VRStep.PickRetract:
+                    case VRStep.Place:
+                    case VRStep.PlaceExtend:
+                    case VRStep.PlaceRetract:
                         {
-                            _currentStep = VRStep.Idle;
-                            _status = RState.End;
+                            if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                            {
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                            }
+                            else
+                            {
+                                ReportWrongMsg(RevMsg);
+                            }
+
+                            if (_currentStep != VRStep.PickExtend && _currentStep != VRStep.PlaceExtend)
+                                SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.TMRobot);
                         }
-                        else
+                        break;
+                    case VRStep.Home:
                         {
-                            ReportWrongMsg(RevMsg);
-                        }
-
-                        if (_currentStep != VRStep.PickExtend && _currentStep != VRStep.PlaceExtend)
-                            SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.TMRobot);
-                    }
-                    break;
-                case VRStep.Home:
-                    {
 
-                        if (RevMsg.Trim() == "_RDY")
+                            if (RevMsg.Trim() == "_RDY")
+                            {
+                                //CheckLoad(Hand.Blade1);
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                                _IsHomed = true;
+                                SetRobotMovingInfo(RobotAction.Homing, Hand.Both, ModuleName.SETM);
+                            }
+                            else
+                                ReportWrongMsg(RevMsg);
+                        }
+                        break;
+                    case VRStep.CheckLoad_ArmA:
                         {
-                            //CheckLoad(Hand.Blade1);
-                            _currentStep = VRStep.Idle;
-                            _status = RState.End;
-                            _IsHomed = true;
-                            SetRobotMovingInfo(RobotAction.Homing, Hand.Both, ModuleName.SETM);
+                            if (_rex_check_load.IsMatch(RevMsg))
+                            {
+                                GetCheckLoadResult(RevMsg);
+
+                                //CheckLoad(Hand.Blade2);
+                            }
+
+                            if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                            {
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                            }
                         }
-                        else
-                            ReportWrongMsg(RevMsg);
-                    }
-                    break;
-                case VRStep.CheckLoad_ArmA:
-                    {
-                        if (_rex_check_load.IsMatch(RevMsg))
+                        break;
+                    case VRStep.CheckLoad_ArmB:
                         {
-                            GetCheckLoadResult(RevMsg);
-
-                            //CheckLoad(Hand.Blade2);
+                            if (_rex_check_load.IsMatch(RevMsg))
+                            {
+                                GetCheckLoadResult(RevMsg);
+
+                                //_currentStep = VRStep.Idle;
+                                //_status = RState.End;
+                                //_IsHomed = true;
+                            }
+                            if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                            {
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                            }
                         }
+                        break;
+                    case VRStep.ReQueryLoadA:
+                        if (_rex_rq_load_A.IsMatch(RevMsg))
+                        {
+                            string WaferStatus = RevMsg.Split(' ')[2];
+                            //LOG.Write(eEvent.WARN_DEFAULT_WARN, ModuleName.TMRobot, WaferStatus);
+                            if (WaferStatus.Contains("ON") && WaferManager.Instance.CheckNoWafer(ModuleName.TMRobot, 0))
+                            {
+                                WaferManager.Instance.CreateWafer(ModuleName.TMRobot, 0, Aitex.Core.Common.WaferStatus.Normal);
+                            }
+                            if (WaferStatus.Contains("OFF"))
+                            {
+                                //LOG.Write(eEvent.WARN_DEFAULT_WARN, ModuleName.TMRobot, "contains off");
+                                WaferManager.Instance.DeleteWafer(ModuleName.TMRobot, 0);
+                            }
 
-                        if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                        }
+                        else
                         {
-                            _currentStep = VRStep.Idle;
-                            _status = RState.End;
+                            if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                            {
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                            }
+                            else
+                            {
+                                ReportWrongMsg(RevMsg);
+                            }
                         }
-                    }
-                    break;
-                case VRStep.CheckLoad_ArmB:
-                    {
-                        if (_rex_check_load.IsMatch(RevMsg))
+                        break;
+
+                    case VRStep.ReQueryLoadB:
+                        if (_rex_rq_load_B.IsMatch(RevMsg))
                         {
-                            GetCheckLoadResult(RevMsg);
 
-                            //_currentStep = VRStep.Idle;
-                            //_status = RState.End;
-                            //_IsHomed = true;
+                            string WaferStatus = RevMsg.Split(' ')[2];
+                            //LOG.Write(eEvent.WARN_DEFAULT_WARN, ModuleName.TMRobot, WaferStatus);
+                            if (WaferStatus.Contains("ON") && WaferManager.Instance.CheckNoWafer(ModuleName.TMRobot, 1))
+                            {
+                                WaferManager.Instance.CreateWafer(ModuleName.TMRobot, 1, Aitex.Core.Common.WaferStatus.Normal);
+                            }
+                            if (WaferStatus.Contains("OFF"))
+                            {
+                                WaferManager.Instance.DeleteWafer(ModuleName.TMRobot, 1);
+                            }
+
                         }
-                        if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                        else
                         {
-                            _currentStep = VRStep.Idle;
-                            _status = RState.End;
+                            if (RevMsg.Trim() == "_RDY" || (RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
+                            {
+                                _currentStep = VRStep.Idle;
+                                _status = RState.End;
+                            }
+                            else
+                            {
+                                ReportWrongMsg(RevMsg);
+                            }
                         }
-                    }
-                    break;
-                default:
-                    if (!RevMsg.Contains("_EVENT"))
-                        ReportWrongMsg(RevMsg);
-                    break;
+                        break;
+                    default:
+                        if (!RevMsg.Contains("_EVENT"))
+                            ReportWrongMsg(RevMsg);
+                        break;
+                }
             }
+            
         }
 
         private void GetCheckLoadResult(string revMsg)

+ 0 - 24
Venus/Venus_RT/Modules/TM/MFHomeRoutine.cs

@@ -17,10 +17,6 @@ namespace Venus_RT.Modules.TM
             kLidDelay,
             kRobot,
             kRobotDelay,
-            RobotBlade1CheckLoad,
-            RobotBlade2CheckLoad,
-            QueryARMA,
-            QueryARMB,
             kSlitDoor,
             kSlitDoorDelay,
             kPump,
@@ -71,10 +67,6 @@ namespace Venus_RT.Modules.TM
             Runner.Delay(HomeStep.kLidDelay,        500)
                   .Run(HomeStep.kRobot,             HomeRobot,      CheckRobotReady,       _robotHomingTimeout)
                   .Delay(HomeStep.kRobotDelay,      500)
-                  .Run(HomeStep.RobotBlade1CheckLoad, Blade1CheckLoad, CheckRobotReady, _robotHomingTimeout)
-                  .Run(HomeStep.RobotBlade2CheckLoad, Blade2CheckLoad, CheckRobotReady, _robotHomingTimeout)
-                  .Run(HomeStep.QueryARMA, ReQueryLoadA, CheckRobotReady, _robotHomingTimeout)
-                  .Run(HomeStep.QueryARMB, ReQueryLoadB, CheckRobotReady, _robotHomingTimeout)
                   .Run(HomeStep.kSlitDoor,          HomeSlitDoor,   CheckSlitDoorReady,    _slitDoorHomingTimeout)
                   .Delay(HomeStep.kSlitDoorDelay,   500)
                   .Run(HomeStep.kPump,              HomePump,       CheckPumpReady,        _pumpHomingTimeout)
@@ -84,22 +76,6 @@ namespace Venus_RT.Modules.TM
 
             return Runner.Status;
         }
-        private bool Blade1CheckLoad()
-        {
-            return _robot.CheckLoad(Hand.Blade1);
-        }
-        private bool ReQueryLoadA()
-        {
-            return _robot.ReQueryLoadA();
-        }
-        private bool ReQueryLoadB()
-        {
-            return _robot.ReQueryLoadB();
-        }
-        private bool Blade2CheckLoad()
-        {
-            return _robot.CheckLoad(Hand.Blade2);
-        }
 
         private bool HomeRobot()
         {

+ 12 - 1
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFHomeRoutine.cs

@@ -20,6 +20,8 @@ namespace Venus_RT.Modules.TM.VenusEntity
             seRobotHome,
             seRobotBlade1CheckLoad,
             seRobotBlade2CheckLoad,
+            QueryARMA,
+            QueryARMB,
             seRobotDelay,
             seSlitDoor,
             seSlitDoorDelay,
@@ -66,6 +68,8 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 Runner.Run(HomeStep.seRobotHome, HomeRobot, CheckRobotReady, _robotHomingTimeout)
                       .Run(HomeStep.seRobotBlade1CheckLoad, Blade1CheckLoad, CheckRobotReady, _robotHomingTimeout)
                       .Run(HomeStep.seRobotBlade2CheckLoad, Blade2CheckLoad, CheckRobotReady, _robotHomingTimeout)
+                      .Run(HomeStep.QueryARMA, ReQueryLoadA, CheckRobotReady, _robotHomingTimeout)
+                      .Run(HomeStep.QueryARMB, ReQueryLoadB, CheckRobotReady, _robotHomingTimeout)
                       .Delay(HomeStep.seRobotDelay, 500)
                       .Run(HomeStep.seSlitDoor, HomeSlitDoor, CheckSlitDoorReady, _slitDoorHomingTimeout)
                       .Delay(HomeStep.seSlitDoorDelay, 500)
@@ -83,7 +87,14 @@ namespace Venus_RT.Modules.TM.VenusEntity
             return _vpa.Status == RState.End;
             //return true;
         }
-
+        private bool ReQueryLoadA()
+        {
+            return _robot.ReQueryLoadA();
+        }
+        private bool ReQueryLoadB()
+        {
+            return _robot.ReQueryLoadB();
+        }
         private bool HomeVPA()
         {
             //vpa home