Browse Source

1.Add recipe save as/rename function Messagebox and invalid recipename Messagebox
2.Vensus se/de switch io sensor enhance

hecl 10 months ago
parent
commit
0390869f30

+ 4 - 4
Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs

@@ -1889,8 +1889,8 @@ namespace Venus_MainPages.ViewModels
                 IsWaterFlowOk = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsWaterFlowOk");
                 IsTurboPumpInterlock = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsTurboPumpInterlock");
                 IsCDAOK = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsCDA_OK");
-                SensorGasBoxDoor = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.GasBoxDoorSW.Value");
-                SensorGasBoxPressure = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.GasBoxPressureSW.Value");
+                SensorGasBoxDoor = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IoSensor.GasBoxDoorSW.Value");
+                SensorGasBoxPressure = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IoSensor.GasBoxPressureSW.Value");
 
                 IsATM = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsATM");
                 IsVAC = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsVAC");
@@ -2063,8 +2063,8 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.SourceRFFanInterlock");
             m_RtDataKeys.Add($"{ModuleName}.IsTurboPumpInterlock");
 
-            m_RtDataKeys.Add($"{ModuleName}.GasBoxDoorSW.Value");
-            m_RtDataKeys.Add($"{ModuleName}.GasBoxPressureSW.Value");
+            m_RtDataKeys.Add($"{ModuleName}.IoSensor.GasBoxDoorSW.Value");
+            m_RtDataKeys.Add($"{ModuleName}.IoSensor.GasBoxPressureSW.Value");
 
             //m_RtDataKeys.Add($"{ModuleName}.WallTempFeedBack");
             m_RtDataKeys.Add($"{ModuleName}.Chiller.IsOn");

+ 4 - 4
Venus/Venus_MainPages/ViewModels/OverVenusSEViewModel.cs

@@ -1849,8 +1849,8 @@ namespace Venus_MainPages.ViewModels
                 IsWaterFlowOk = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsWaterFlowOk");
                 IsTurboPumpInterlock = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsTurboPumpInterlock");
                 IsCDAOK = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsCDA_OK");
-                SensorGasBoxDoor = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.GasBoxDoorSW.Value");
-                SensorGasBoxPressure = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.GasBoxPressureSW.Value");
+                SensorGasBoxDoor = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IoSensor.GasBoxDoorSW.Value");
+                SensorGasBoxPressure = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IoSensor.GasBoxPressureSW.Value");
 
                 IsATM = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsATM");
                 IsVAC = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsVAC");
@@ -2034,8 +2034,8 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.SourceRFFanInterlock");
             m_RtDataKeys.Add($"{ModuleName}.IsTurboPumpInterlock");
 
-            m_RtDataKeys.Add($"{ModuleName}.GasBoxDoorSW.Value");
-            m_RtDataKeys.Add($"{ModuleName}.GasBoxPressureSW.Value");
+            m_RtDataKeys.Add($"{ModuleName}.IoSensor.GasBoxDoorSW.Value");
+            m_RtDataKeys.Add($"{ModuleName}.IoSensor.GasBoxPressureSW.Value");
 
             //m_RtDataKeys.Add($"{ModuleName}.WallTempFeedBack");
             m_RtDataKeys.Add($"{ModuleName}.Chiller.IsOn");

+ 43 - 23
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -30,6 +30,7 @@ using Venus_MainPages.Unity;
 using Venus_MainPages.Views;
 using Venus_Themes.UserControls;
 using WPF.Themes.UserControls;
+using MessageBox = System.Windows.MessageBox;
 using RecipeStep = Venus_Core.RecipeStep;
 
 namespace Venus_MainPages.ViewModels
@@ -218,14 +219,17 @@ namespace Venus_MainPages.ViewModels
             }
         }
         private void OnSaveRecipe()
-        {        
-            var inUseRecipe= QueryDataClient.Instance.Service.GetData($"Scheduler.InUsingRecipe");
-            if (inUseRecipe != null)
+        {
+            if (WPFMessageBox.ShowQuestion($"Save recipe file?", "") == MessageBoxResult.Yes)
             {
-                if ((inUseRecipe as List<string>).Contains($"{ModuleName}.{CurrentRecipe.Header.Type}.{CurrentRecipeName}"))
+                var inUseRecipe = QueryDataClient.Instance.Service.GetData($"Scheduler.InUsingRecipe");
+                if (inUseRecipe != null)
                 {
-                    WPFMessageBox.ShowError($"{CurrentRecipeName} Recipe is In Use,can not edit");
-                    return;
+                    if ((inUseRecipe as List<string>).Contains($"{ModuleName}.{CurrentRecipe.Header.Type}.{CurrentRecipeName}"))
+                    {
+                        WPFMessageBox.ShowError($"{CurrentRecipeName} Recipe is In Use,can not edit");
+                        return;
+                    }
                 }
             }
 
@@ -591,21 +595,29 @@ namespace Venus_MainPages.ViewModels
                 return;
             }
             var newName = Interaction.InputBox(" ", "Save As Recipe", CurrentRecipeName, -1, -1);
+            newName=newName.Trim();
             if (newName != CurrentRecipeName && newName != "")
             {
                 var newRecipe = CurrentRecipe;
-                newRecipe.Header.Name = newName;
-                newRecipe.Header.CreateTime = DateTime.Now.ToString();
-                //var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
-                //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
-                if (SaveAsRecipeWithType(newName, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(newRecipe)))
+                if (WPFMessageBox.ShowQuestion($"Save recipe file {newName} ?", "") == MessageBoxResult.Yes)
                 {
-                    UpdateRecipeFileList();
-                    CurrentRecipeName = newName;
-                    LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
-                    LoadRecipe(CurrentRecipe);
+                    MessageBox.Show($"Save as recipe  {newName} ?", "Save As Recipe", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
+                    newRecipe.Header.Name = newName;
+                    newRecipe.Header.CreateTime = DateTime.Now.ToString();
+                    //var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
+                    //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                    if (SaveAsRecipeWithType(newName, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(newRecipe)))
+                    {
+                        UpdateRecipeFileList();
+                        CurrentRecipeName = newName;
+                        LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
+                        LoadRecipe(CurrentRecipe);
+                    }
                 }
-                
+            }
+            else if (newName == CurrentRecipeName || newName == "")
+            {
+                WPFMessageBox.Show("Please input right recipename", MessageBoxButton.OK);
             }
         }
         private void menuItem_MouseClick_RenameRecipe(object sender, RoutedEventArgs e)
@@ -615,16 +627,24 @@ namespace Venus_MainPages.ViewModels
                 return;
             }
             var newName = Interaction.InputBox(" ", "Rename Recipe", CurrentRecipeName, -1, -1);
+            newName = newName.Trim();
             if (newName != CurrentRecipeName && newName != "")
             {
                 var newRecipe = CurrentRecipe;
-                newRecipe.Header.Name = newName;
-                newRecipe.Header.CreateTime = DateTime.Now.ToString();
-                var oldrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, CurrentRecipeName + ".rcp");
-                var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
-                File.Delete(oldrecipePath);
-                File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
-                UpdateRecipeFileList();
+                if (WPFMessageBox.ShowQuestion($"Save recipe file {newName} ?", "") == MessageBoxResult.Yes)
+                {
+                    newRecipe.Header.Name = newName;
+                    newRecipe.Header.CreateTime = DateTime.Now.ToString();
+                    var oldrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, CurrentRecipeName + ".rcp");
+                    var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
+                    File.Delete(oldrecipePath);
+                    File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                    UpdateRecipeFileList();
+                }
+            }
+            else if(newName == CurrentRecipeName|| newName=="")
+            {
+                WPFMessageBox.Show("Please input right recipename",MessageBoxButton.OK);
             }
         }
         public bool SaveAsRecipe(string recipeName, string recipeContent)

+ 19 - 4
Venus/Venus_MainPages/ViewModels/StatisticsViewModel.cs

@@ -14,6 +14,7 @@ using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.OperationCenter;
 using OpenSEMI.ClientBase;
 using Venus_Core;
+using System.Windows.Threading;
 //using SciChart.Core.Extensions;
 //using VirgoUI.Client.Models.Sys;
 
@@ -64,14 +65,28 @@ namespace Venus_MainPages.ViewModels
             
             StatData = new ObservableCollection<StatsDataListItem>();
             StatDataRFAndPump = new ObservableCollection<StatsDataListItemRFAndPump>();
-            PollData();
-            _timer = new PeriodicJob(200, this.OnTimer, "Database cleaner", true);
-            _timer.Start();
+            DispatcherTimer timer = new DispatcherTimer();
+            timer.Interval = TimeSpan.FromSeconds(6);
+            timer.Tick += timer_Tick;
+            timer.Start();
+            
+            //_timer = new PeriodicJob(200, this.OnTimer, "Database cleaner", true);
+            //_timer.Start();
          }
+        void timer_Tick(object sender, EventArgs e)
+        {
+            try
+            {
+                PollData();
+            }
+            catch (Exception ex) { }
+        }
         private DelegateCommand _ResetCommnad;
         public DelegateCommand ResetCommnad =>
             _ResetCommnad ?? (_ResetCommnad = new DelegateCommand(Resets));
-
+        private DelegateCommand<StatsDataListItem> _ResetTotalCommnad;
+        public DelegateCommand<StatsDataListItem> ResetTotalCommnad =>
+            _ResetTotalCommnad ?? (_ResetTotalCommnad = new DelegateCommand<StatsDataListItem>(ResetTotalValue));
         private DelegateCommand<StatsDataListItem> _ResetValueCommnad;
         public DelegateCommand<StatsDataListItem> ResetValueCommnad =>
             _ResetValueCommnad ?? (_ResetValueCommnad = new DelegateCommand<StatsDataListItem>(ResetValue));

+ 1 - 1
Venus/Venus_MainPages/ViewModels/VATPerformanceViewModel.cs

@@ -233,7 +233,7 @@ namespace Venus_MainPages.ViewModels
         }
         private void OnSave()
         {
-            SerializeHelper.Instance.WriteToJsonFile<VATPerformanceResult>(m_VATPerformanceResult, $"VATPerformanceResult/{m_VATPerformanceResult.GasName}/{DateTime.Now.ToString("yyyyMMddHHmm")}.json");
+            SerializeHelper.Instance.WriteToJsonFile<VATPerformanceResult>(m_VATPerformanceResult, $"VATPerformanceResult/{m_VATPerformanceResult.GasName}/{ModuleName}/{DateTime.Now.ToString("yyyyMMddHHmm")}.json");
         }
         #endregion
        

+ 2 - 3
Venus/Venus_MainPages/Views/StatisticsView.xaml

@@ -166,7 +166,7 @@
                         <DataGridTemplateColumn Width="130"  >
                             <DataGridTemplateColumn.CellTemplate>
                                 <DataTemplate>
-                                    <Button Content="Reset Total" Command="{Binding DataContext.ResetTotalValue, ElementName=stastic}" CommandParameter="{Binding }" Width="120" Height="25" FontSize="12">
+                                    <Button Content="Reset Total" Command="{Binding DataContext.ResetTotalCommnad, ElementName=stastic}" CommandParameter="{Binding }" Width="120" Height="25" FontSize="12">
                                     </Button>
                                 </DataTemplate>
                             </DataGridTemplateColumn.CellTemplate>
@@ -179,8 +179,7 @@
             </TabItem>
         </TabControl>
         <TabControl Grid.Row="1">
-            <TabItem Header="RF And Pump">
-
+            <TabItem Header="RF">
                 <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" >

+ 0 - 2
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -129,8 +129,6 @@ namespace Venus_RT.Devices
         public JetVenusDEPM(ModuleName moduleName) : base(moduleName)
         {
             Module = moduleName;
-            DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
-            DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
             _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
             _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
             _linerDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LinerDoor}");

+ 0 - 2
Venus/Venus_RT/Devices/JetVenusSEPM.cs

@@ -152,8 +152,6 @@ namespace Venus_RT.Devices
         #region 构造函数
         public JetVenusSEPM(ModuleName moduleName) : base(moduleName)
         {
-            DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
-            DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
             Module = moduleName;
             _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
             _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");