diff --git a/FSI.BT.Tools/App.xaml.cs b/FSI.BT.Tools/App.xaml.cs index 2aaef5a..828afdd 100644 --- a/FSI.BT.Tools/App.xaml.cs +++ b/FSI.BT.Tools/App.xaml.cs @@ -1,8 +1,12 @@ using Hardcodet.Wpf.TaskbarNotification; using NHotkey; using NHotkey.Wpf; +using System.Collections; using System.Windows; using System.Windows.Input; +using FSI.Lib.Helpers; +using FSI.Lib.CompareNetObjects; +using FSI.Lib.Guis.SetSizePosExWindow; namespace FSI.BT.Tools { @@ -31,13 +35,24 @@ namespace FSI.BT.Tools Global.FrmRadialMenu = new FrmRadialMenu(); - Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.WinCC( + Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.ViewModel.ViewModelWinCC( Global.Settings.SieTiaWinCCMsgMgtAutostart, Global.Settings.SieTiaWinCCMsgMgtUpdateIntervall, Global.Settings.SieTiaWinCCMsgMgtWindowsName, Global.Settings.SieTiaWinCCMsgMgtClassName, Global.Settings.SieTiaWinCCMsgMgtBtnName - ); + ); + + Global.Iba = new Lib.Guis.IbaDirSync.ViewModel.ViewModelIba( + Global.Settings.IbaRecordDestinationath, + Global.Settings.IbaRecordSourcePath, + Global.Settings.IbaAutoSync + ); + + Global.WindowMgt = new Lib.Guis.SetSizePosExWindow.ViewModel.ViewModelWindow(); + Global.WindowMgt.AutoStart = Global.Settings.WindowMgtAutostart; + Global.WindowMgt.UpdateIntervall = Global.Settings.WindowMgtUpdateInterval; + } private void ShowRadialMenu(object sender, HotkeyEventArgs e) @@ -60,7 +75,22 @@ namespace FSI.BT.Tools private void Application_Exit(object sender, ExitEventArgs e) { - Global.Settings.Save(); + AppSettings tmpSetting = new AppSettings(Global.Settings.FileName); + tmpSetting.Load(); + + CompareLogic compareLogic = new CompareLogic(); + ComparisonResult result = compareLogic.Compare(Global.Settings, tmpSetting); + if (!result.AreEqual) + { + Global.Settings.Save(); + } + + if (Global.Iba.RoboCopy != null) + { + Global.Iba.RoboCopy.Stop(); + Global.Iba.RoboCopy.Dispose(); + } } + } } \ No newline at end of file diff --git a/FSI.BT.Tools/AppSettings.cs b/FSI.BT.Tools/AppSettings.cs index ba48a98..569e6b0 100644 --- a/FSI.BT.Tools/AppSettings.cs +++ b/FSI.BT.Tools/AppSettings.cs @@ -1,10 +1,11 @@ using FSI.Lib.WinSettings; +using System.Collections.ObjectModel; namespace FSI.BT.Tools { public class AppSettings : XmlSettings { - + public AppSettings(string fileName) : base(fileName) { TimeStampFormat = "_yyyyMMdd_HHmmss"; @@ -15,9 +16,9 @@ namespace FSI.BT.Tools [EncryptedSetting] public string[] Users { get; set; } [EncryptedSetting] - public string[] Admins{ get; set; } + public string[] Admins { get; set; } [EncryptedSetting] - public string SuperAdmin{ get; set; } + public string SuperAdmin { get; set; } public string TimeStampFormat { get; set; } public string[] SieSimaticManagerExe { get; set; } public string[] SieTiaV13Exe { get; set; } @@ -62,5 +63,16 @@ namespace FSI.BT.Tools public string SieTiaWinCCMsgMgtWindowsName { get; set; } public string SieTiaWinCCMsgMgtClassName { get; set; } public string SieTiaWinCCMsgMgtBtnName { get; set; } + public bool IbaAutoSync { get; set; } + public string IbaRecordSourcePath { get; set; } + public string IbaRecordDestinationath { get; set; } + public string[] WindowMgtName { get; set; } + public string[] WindowMgtClassName { get; set; } + public int WindowMgtUpdateInterval { get; set; } + public bool WindowMgtAutostart { get; set; } + public int[] WindowMgtX { get; set; } + public int[] WindowMgtY { get; set; } + public int[] WindowMgtHeight { get; set; } + public int[] WindowMgtWight { get; set; } } } diff --git a/FSI.BT.Tools/Commands/LoginCommand.cs b/FSI.BT.Tools/Commands/LoginCommand.cs index 23bdb5d..376fc36 100644 --- a/FSI.BT.Tools/Commands/LoginCommand.cs +++ b/FSI.BT.Tools/Commands/LoginCommand.cs @@ -12,7 +12,7 @@ namespace FSI.BT.Tools.Commands Lib.Guis.AutoPw.FrmMain frmMain = new Lib.Guis.AutoPw.FrmMain() { CloseAtLostFocus = false, - WindowStartupLocation = WindowStartupLocation.CenterOwner, + WindowStartupLocation = WindowStartupLocation.CenterScreen, }; frmMain.ShowDialog(); diff --git a/FSI.BT.Tools/Commands/OpenAppCommand.cs b/FSI.BT.Tools/Commands/OpenAppCommand.cs index 9eb8988..bcce347 100644 --- a/FSI.BT.Tools/Commands/OpenAppCommand.cs +++ b/FSI.BT.Tools/Commands/OpenAppCommand.cs @@ -57,7 +57,7 @@ namespace FSI.BT.Tools.Commands { ShowPdf = false, CloseAtLostFocus = true, - WindowStartupLocation = WindowStartupLocation.CenterOwner, + WindowStartupLocation = WindowStartupLocation.CenterScreen, Path = Global.Settings.EplPrjPath, EplExes = Global.Settings.EplExe, }; @@ -69,7 +69,7 @@ namespace FSI.BT.Tools.Commands { ShowPdf = true, CloseAtLostFocus = true, - WindowStartupLocation = WindowStartupLocation.CenterOwner, + WindowStartupLocation = WindowStartupLocation.CenterScreen, Path = Global.Settings.EplPdfPath, }; frmMainEplPdf.Show(); @@ -114,7 +114,7 @@ namespace FSI.BT.Tools.Commands { Password = GetType().Namespace.ToString(), CloseAtLostFocus = true, - WindowStartupLocation = WindowStartupLocation.CenterOwner, + WindowStartupLocation = WindowStartupLocation.CenterScreen, }; frmMainDeEnCrypt.Show(); return; diff --git a/FSI.BT.Tools/Commands/ProcessCommand.cs b/FSI.BT.Tools/Commands/ProcessCommand.cs index 560e282..d348b29 100644 --- a/FSI.BT.Tools/Commands/ProcessCommand.cs +++ b/FSI.BT.Tools/Commands/ProcessCommand.cs @@ -1,4 +1,5 @@ using System.Windows; +using System.Windows.Data; namespace FSI.BT.Tools.Commands { @@ -10,9 +11,33 @@ namespace FSI.BT.Tools.Commands public override void Execute(object parameter) { Gui.FrmProcesses frm = new Gui.FrmProcesses(); + frm.WinCC = Global.WinCC; + frm.Iba = Global.Iba; + Global.Window.Load(); + frm.WindowMgt = Global.WindowMgt; + frm.Closed += Frm_Closed; frm.ShowDialog(); } + private void Frm_Closed(object sender, System.EventArgs e) + { + Global.WinCC = ((Gui.FrmProcesses)sender).WinCC; + + Global.Settings.SieTiaWinCCMsgMgtAutostart = Global.WinCC.WinCC.AutoStart; + Global.Settings.SieTiaWinCCMsgMgtUpdateIntervall = Global.WinCC.WinCC.UpdateIntervall; + Global.Settings.SieTiaWinCCMsgMgtWindowsName = Global.WinCC.WinCC.WindowsName; + Global.Settings.SieTiaWinCCMsgMgtClassName = Global.WinCC.WinCC.WindowsClassName; + Global.Settings.SieTiaWinCCMsgMgtBtnName = Global.WinCC.WinCC.ButtonName; + + Global.Iba = ((Gui.FrmProcesses)sender).Iba; + Global.Settings.IbaRecordDestinationath = Global.Iba.Iba.Destination; + Global.Settings.IbaRecordSourcePath = Global.Iba.Iba.Source; + Global.Settings.IbaAutoSync = Global.Iba.Iba.AutoStart; + + Global.WindowMgt = ((Gui.FrmProcesses)sender).WindowMgt; + Global.Window.Save(); + } + public override bool CanExecute(object parameter) { return Global.AdminRights; diff --git a/FSI.BT.Tools/FSI.BT.Tools.xml b/FSI.BT.Tools/FSI.BT.Tools.xml index 9a29e0e..053807b 100644 --- a/FSI.BT.Tools/FSI.BT.Tools.xml +++ b/FSI.BT.Tools/FSI.BT.Tools.xml @@ -2,7 +2,9 @@ +I945AMzKKYBAAAAB21haWVyX3M= e+Dt7FRUDDoBAAAAB21haWVyX3M= + _yyyyMMdd_HHmmss + C:\Program Files (x86)\Siemens\Step7\S7BIN\S7tgtopx.exe C:\Program Files (x86)\Siemens\Automation\Portal V13\Bin\Siemens.Automation.Portal.exe C:\Program Files\Siemens\Automation\Portal V14\Bin\Siemens.Automation.Portal.exe @@ -29,6 +31,7 @@ C:\Program Files\RealVNC\VNC Viewer\vncviewer.exe,c:\Users\maier_s\OneDrive - Fondium Group GmbH\Documents\Apps\VNC-Viewer-6.20.113-Windows-64bit.exe C:\Program Files\RealVNC\VNC Viewer\vncaddrbook.exe C:\Program Files\iba\ibaAnalyzer\ibaAnalyzer.exe + http://desiaugetwf/web/?AspxAutoDetectCookieSupport=1 http://10.10.1.42/SKSchichtbuchWeb/de-DE/Plugin/ShiftBook/ShiftBook/IR http://10.10.1.42/SKChangeTrackerWeb/de-DE/Plugin/ChangeTracker @@ -39,11 +42,17 @@ http://desiaugetc7-088:3000/ http://desiaugetc7-088:3001/en/home https://mingle-portal.eu1.inforcloudsuite.com/FONDIUM_prd + \\10.10.1.40\Betriebstechnik\Eplan \\fondium.org\DESI$\AUG_Abteilung\Betriebstechnik\EPL\P8\Data\Projekte\FSI\ + true 10 #32770 Zur Kenntnis genommen + + true + d:\tmp + c:\tmp \ No newline at end of file diff --git a/FSI.BT.Tools/FrmRadialMenu.xaml.cs b/FSI.BT.Tools/FrmRadialMenu.xaml.cs index 9c564b0..a077c8a 100644 --- a/FSI.BT.Tools/FrmRadialMenu.xaml.cs +++ b/FSI.BT.Tools/FrmRadialMenu.xaml.cs @@ -18,7 +18,7 @@ namespace FSI.BT.Tools InitializeComponent(); DataContext = this; _isOpenHome = true; - tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor; + tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor + "b"; } #region Home diff --git a/FSI.BT.Tools/Global.cs b/FSI.BT.Tools/Global.cs index 0feecf0..a50041c 100644 --- a/FSI.BT.Tools/Global.cs +++ b/FSI.BT.Tools/Global.cs @@ -1,5 +1,6 @@ -using FSI.Lib.Guis.SieTiaWinCCMsgMgt; -using FSI.Lib.WinSettings; +using FSI.Lib.Guis.IbaDirSync.ViewModel; +using FSI.Lib.Guis.SetSizePosExWindow.ViewModel; +using FSI.Lib.Guis.SieTiaWinCCMsgMgt.ViewModel; using Hardcodet.Wpf.TaskbarNotification; namespace FSI.BT.Tools @@ -8,10 +9,45 @@ namespace FSI.BT.Tools { public static FrmRadialMenu FrmRadialMenu { get; set; } public static TaskbarIcon TaskbarIcon { get; set; } - public static WinCC WinCC { get; set; } + public static ViewModelWinCC WinCC { get; set; } public static AppSettings Settings { get; set; } + public static ViewModelIba Iba { get; set; } + public static ViewModelWindow WindowMgt { get; set; } public static bool UserRights { get; set; } public static bool AdminRights { get; set; } public static bool SuperAdminRights { get; set; } + + public static class Window + { + public static void Load() + { + for (int i = 0; i < Global.Settings.WindowMgtName.Length; i++) + { + WindowMgt.Windows.Add(new Lib.Guis.SetSizePosExWindow.Model.Window + { + Name = Global.Settings.WindowMgtName[i], + ClassName = Global.Settings.WindowMgtClassName[i], + Height = Global.Settings.WindowMgtHeight[i], + Width = Global.Settings.WindowMgtWight[i], + X = Global.Settings.WindowMgtX[i], + Y = Global.Settings.WindowMgtY[i], + }); + } + } + + public static void Save() + { + for (int i = 0; i < Global.WindowMgt.Windows.Count; i++) + { + Global.Settings.WindowMgtName[i] = Global.WindowMgt.Windows[i].Name; + Global.Settings.WindowMgtClassName[i] = Global.WindowMgt.Windows[i].ClassName; + Global.Settings.WindowMgtHeight[i] = Global.WindowMgt.Windows[i].Height; + Global.Settings.WindowMgtWight[i] = Global.WindowMgt.Windows[i].Width; + Global.Settings.WindowMgtX[i] = Global.WindowMgt.Windows[i].X; + Global.Settings.WindowMgtY[i] = Global.WindowMgt.Windows[i].Y; + } + } + } + } } diff --git a/FSI.BT.Tools/Gui/FrmProcesses.xaml b/FSI.BT.Tools/Gui/FrmProcesses.xaml index 9b123f6..1fd2053 100644 --- a/FSI.BT.Tools/Gui/FrmProcesses.xaml +++ b/FSI.BT.Tools/Gui/FrmProcesses.xaml @@ -5,33 +5,311 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FSI.BT.Tools.Gui" mc:Ignorable="d" - Title="FrmProcesses" - Height="450" - Width="800"> + Title="FSI.BT.Tools Prozesse" + SizeToContent="WidthAndHeight" + Height="Auto" + Width="Auto"> - - - - - - - - - - - + + + + + + + + + - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +