diff --git a/BPASmart.ConfigurationSoftware/App.xaml.cs b/BPASmart.ConfigurationSoftware/App.xaml.cs index 0693a9c4..789f24b8 100644 --- a/BPASmart.ConfigurationSoftware/App.xaml.cs +++ b/BPASmart.ConfigurationSoftware/App.xaml.cs @@ -8,6 +8,8 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; using BPA.Communication; +using System.IO; +using System.Diagnostics; namespace BPASmart.ConfigurationSoftware { diff --git a/BPASmart.ConfigurationSoftware/MainWindow.xaml b/BPASmart.ConfigurationSoftware/MainWindow.xaml index d9667c3a..8c1edbe8 100644 --- a/BPASmart.ConfigurationSoftware/MainWindow.xaml +++ b/BPASmart.ConfigurationSoftware/MainWindow.xaml @@ -155,7 +155,7 @@ - + @@ -204,7 +204,6 @@ - - + @@ -227,12 +226,15 @@ Grid.Row="1" Width="auto" Height="auto" - Content="{Binding MainContent}" Margin="0,0,0,5" Grid.RowSpan="3" /> + Margin="0,0,0,5" + Content="{Binding MainContent}" /> + + @@ -257,19 +259,10 @@ Grid.Row="2" Height="2" HorizontalAlignment="Stretch" - Background="Blue" Grid.RowSpan="2" /> + Background="Blue" /> - - - - + diff --git a/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs b/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs index 8ae5ebae..e1fb9a9d 100644 --- a/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs +++ b/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs @@ -18,6 +18,7 @@ using System.Collections.Concurrent; using System.IO.Pipes; using BPA.Communication; using System.Threading; +using BeDesignerSCADA.ViewModel; namespace BPASmart.ConfigurationSoftware { @@ -51,7 +52,6 @@ namespace BPASmart.ConfigurationSoftware Directory.CreateDirectory(path); Json.Data.ProjectPath = path; Json.Data.ProjectName = objModel.ProjectName; - FileConfigModel.ConstPath = objModel.ProjectPath; Head = objModel.ProjectName; Save(); FileHelper.GetInstance.RegisterOpenFileType(); @@ -68,6 +68,7 @@ namespace BPASmart.ConfigurationSoftware OpenVarManagerCommand = new RelayCommand(() => { Json.Data.ProjectPath = Json.Data.ProjectPath; + FileConfigModel.ConstPath = Json.Data.ProjectPath; Json.Save(); if (File.Exists(FileConfigModel.VarManagerPath)) { @@ -96,11 +97,6 @@ namespace BPASmart.ConfigurationSoftware mainCanvasPanels.ElementAt(index).MainCanvasPanelModel.VariableManagerPath(FileConfigModel.VarConfigPath); MainContent = mainCanvasPanels.ElementAt(index).MainCanvasPanelModel; } - //var res = mainCanvasPanels.FirstOrDefault(p => p.PageName == o.ToString()); - //if (res != null) - //{ - // MainContent = res.MainCanvasPanelModel; - //} }); SaveProjectCommand = new RelayCommand(() => @@ -124,6 +120,7 @@ namespace BPASmart.ConfigurationSoftware { if (s == PipeTopic.VarSave) { + DataBusModel.GetInstance().RefreshVariableManager(FileConfigModel.VarConfigPath); for (int i = 0; i < mainCanvasPanels.Count; i++) { mainCanvasPanels.ElementAt(i).MainCanvasPanelModel.VariableManagerPath(FileConfigModel.VarConfigPath); @@ -142,6 +139,8 @@ namespace BPASmart.ConfigurationSoftware if (Json.Data.ProjectName != null && Json.Data.ProjectName.Length > 0) { Head = Json.Data.ProjectName; + FileConfigModel.ConstPath = Json.Data.ProjectPath; + DataBusModel.GetInstance().RefreshVariableManager(FileConfigModel.VarConfigPath); } if (Json.Data.Pages?.Count > 0)