aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs12
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs33
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs33
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml14
7 files changed, 114 insertions, 14 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
index 4147a78ec..0395c36bb 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
@@ -87,6 +87,34 @@
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
+ </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs
index d774c14eb..bc11dfd18 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs
@@ -26,6 +26,14 @@ namespace Tango.MachineStudio.UI.Notifications
{
InitializeComponent();
this.Loaded += TextInputBoxWindow_Loaded;
+
+ ContentRendered += TextInputBoxWindow_ContentRendered;
+ }
+
+ private void TextInputBoxWindow_ContentRendered(object sender, EventArgs e)
+ {
+ txtText.Focus();
+ txtText.SelectAll();
}
private void TextInputBoxWindow_Loaded(object sender, RoutedEventArgs e)
@@ -34,12 +42,8 @@ namespace Tango.MachineStudio.UI.Notifications
ani.To = 1;
ani.Duration = TimeSpan.FromSeconds(0.5);
this.BeginAnimation(Window.OpacityProperty, ani);
-
- txtText.Focus();
}
-
-
public String Hint
{
get { return (String)GetValue(HintProperty); }
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index 29bb459ee..8eff9ea4e 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -21,6 +21,7 @@ using Tango.BL.Enumerations;
using Tango.Core.DI;
using Tango.BL.Entities;
using Tango.BL;
+using Tango.MachineStudio.UI.ViewModels;
namespace Tango.MachineStudio.UI.StudioApplication
{
@@ -45,7 +46,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
_navigationManager = navigationManager;
_openedWindows = new List<Window>();
- Application.Current.MainWindow.ContentRendered += (_, __) =>
+ Application.Current.MainWindow.ContentRendered += (_, __) =>
{
TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x => x.OnApplicationStarted());
};
@@ -150,8 +151,8 @@ namespace Tango.MachineStudio.UI.StudioApplication
await Task.Factory.StartNew(async () =>
{
- //Do Shutdown Procedures...
- foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
+ //Do Shutdown Procedures...
+ foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
{
try
{
@@ -173,7 +174,29 @@ namespace Tango.MachineStudio.UI.StudioApplication
vm.OnShuttingDown();
}
- SettingsManager.Default.GetOrCreate<MachineStudioSettings>().LastBounds = r;
+
+ var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
+ settings.LastBounds = r;
+ settings.StudioModulesBounds.Clear();
+
+
+ foreach (var window in _openedWindows.OfType<Windows.ModuleWindow>())
+ {
+ window.Invoke(() =>
+ {
+ var context = window.ModuleContext;
+
+ if (context != null)
+ {
+ settings.StudioModulesBounds.Add(new MachineStudioSettings.StudioModuleBounds()
+ {
+ Bounds = window.RestoreBounds,
+ State = window.WindowState,
+ Name = context.Module.Name,
+ });
+ }
+ });
+ }
try
{
@@ -224,7 +247,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
catch (Exception ex)
{
IsShuttingDown = false;
- LogManager.Log(ex,"An error occurred while shutting down machine studio.");
+ LogManager.Log(ex, "An error occurred while shutting down machine studio.");
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 5a646e9c0..fce0e717f 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -433,6 +433,10 @@
<Project>{d0ce8122-077d-42a2-9490-028ae4769b52}</Project>
<Name>Tango.MachineStudio.MachineDesigner</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.MachineStudio.RML\Tango.MachineStudio.RML.csproj">
+ <Project>{d0186ac0-0fcf-4d3b-9619-54812b6e524b}</Project>
+ <Name>Tango.MachineStudio.RML</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.Stubs\Tango.MachineStudio.Stubs.csproj">
<Project>{22c2aa72-9493-4d0d-b421-8ef9789fb192}</Project>
<Name>Tango.MachineStudio.Stubs</Name>
@@ -579,7 +583,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(Ta
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" />
+ <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
index 215f7afb5..4032c946c 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
@@ -149,7 +149,7 @@ namespace Tango.MachineStudio.UI.ViewModels
InvokeUI(() =>
{
- _studioModuleLoader.LoadModules();
+ //_studioModuleLoader.LoadModules();
_navigationManager.NavigateTo(NavigationView.LoginView);
IsLoading = false;
});
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index 31b2181ea..cbd58134d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -47,7 +47,7 @@ namespace Tango.MachineStudio.UI.ViewModels
/// Represents the Machine Studio main view, view model.
/// </summary>
/// <seealso cref="Tango.SharedUI.ViewModel{Tango.MachineStudio.UI.SupervisingController.IMainView}" />
- public class MainViewVM : ViewModel
+ public class MainViewVM : StudioViewModel
{
private IStudioModule _currentModule;
private INavigationManager _navigation;
@@ -296,7 +296,7 @@ namespace Tango.MachineStudio.UI.ViewModels
ConnectCommand = new RelayCommand(ConnectToMachine);
SignoutCommand = new RelayCommand(SignOut);
DisconnectCommand = new RelayCommand(DisconnectFromMachine, (x) => ApplicationManager.IsMachineConnected && !_isDisconnecting);
- OpenModuleInWindowCommand = new RelayCommand<IStudioModule>(OpenModuleInWindow);
+ OpenModuleInWindowCommand = new RelayCommand<IStudioModule>((x) => { OpenModuleInWindow(x); });
ExitCommand = new RelayCommand(ExitApplication);
UpdateCenterCommand = new RelayCommand(NavigateToUpdateCenter);
@@ -671,7 +671,7 @@ namespace Tango.MachineStudio.UI.ViewModels
/// Opens the module in a new window.
/// </summary>
/// <param name="module">The module.</param>
- private void OpenModuleInWindow(IStudioModule module)
+ private void OpenModuleInWindow(IStudioModule module, Rect? bounds = null, WindowState? state = null)
{
if (module == null) return;
@@ -697,6 +697,20 @@ namespace Tango.MachineStudio.UI.ViewModels
ModuleWindowVM vm = new ModuleWindowVM(module);
ModuleWindow window = new ModuleWindow(this, vm, view);
+ if (bounds.HasValue)
+ {
+ window.WindowStartupLocation = WindowStartupLocation.Manual;
+ window.WindowState = WindowState.Normal;
+ window.Left = bounds.Value.Left;
+ window.Top = bounds.Value.Top;
+ window.Width = bounds.Value.Width;
+ window.Height = bounds.Value.Height;
+ window.Loaded += (_, __) =>
+ {
+ window.WindowState = state.Value;
+ };
+ }
+
window.Closing += (x, y) =>
{
LogManager.Log(String.Format("Closing module '{0}' on new window...", module.Name));
@@ -847,5 +861,18 @@ namespace Tango.MachineStudio.UI.ViewModels
console.Owner = MainWindow.Instance;
console.Show();
}
+
+ public override void OnApplicationReady()
+ {
+ foreach (var item in SettingsManager.Default.GetOrCreate<MachineStudioSettings>().StudioModulesBounds)
+ {
+ var module = StudioModuleLoader.AllModules.SingleOrDefault(x => x.Name == item.Name);
+
+ if (module != null && !module.InNewWindow)
+ {
+ OpenModuleInWindow(module, item.Bounds, item.State);
+ }
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
index 26790c67d..4e3de9e60 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
@@ -110,6 +110,12 @@
<TextBlock Text="{Binding Machine.Organization.Name}" />
<TextBlock FontWeight="SemiBold" Text="Embedded Software Version:" />
<TextBlock Text="{Binding DeviceInformation.Version}" />
+ <TextBlock FontWeight="SemiBold" Text="FPGA Version:" />
+ <TextBlock>
+ <Run Text="{Binding DeviceInformation.FPGA1Version}"></Run> •
+ <Run Text="{Binding DeviceInformation.FPGA2Version}"></Run> •
+ <Run Text="{Binding DeviceInformation.FPGA3Version}"></Run>
+ </TextBlock>
<TextBlock FontWeight="SemiBold" Text="COM Port:" />
<TextBlock Text="{Binding ComPort}" />
<TextBlock FontWeight="SemiBold" Text="Device:" />
@@ -147,6 +153,14 @@
<TextBlock Text="{Binding Machine.Name}" />
<TextBlock FontWeight="SemiBold" Text="Organization:" />
<TextBlock Text="{Binding Machine.Organization.Name}" />
+ <TextBlock FontWeight="SemiBold" Text="Embedded Software Version:" />
+ <TextBlock Text="{Binding DeviceInformation.Version}" />
+ <TextBlock FontWeight="SemiBold" Text="FPGA Version:" />
+ <TextBlock>
+ <Run Text="{Binding DeviceInformation.FPGA1Version}"></Run> •
+ <Run Text="{Binding DeviceInformation.FPGA2Version}"></Run> •
+ <Run Text="{Binding DeviceInformation.FPGA3Version}"></Run>
+ </TextBlock>
<TextBlock FontWeight="SemiBold" Text="Total Bytes Sent:" />
<TextBlock Text="{Binding Adapter.TotalBytesSent,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}" />
<TextBlock FontWeight="SemiBold" Text="Total Bytes Received:" />