aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-09-10 14:30:00 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-09-10 14:30:00 +0300
commit9e4a2eb24ad1882cee1cc9d43f0af0faff2ba861 (patch)
tree553b88553729097418a697c628b8b8046e34cdd9 /Software
parent8e0ac4d5d4f097753321d64d3ca2d47b2f6b3770 (diff)
downloadTango-9e4a2eb24ad1882cee1cc9d43f0af0faff2ba861.tar.gz
Tango-9e4a2eb24ad1882cee1cc9d43f0af0faff2ba861.zip
Working on Tango.Git and Tag creation upon release.
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/App.config7
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindow.xaml2
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindowVM.cs45
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/Tango.FSE.Publisher.UI.csproj4
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs5
-rw-r--r--Software/Visual_Studio/Tango.Git/GitCommit.cs13
-rw-r--r--Software/Visual_Studio/Tango.Git/GitFile.cs14
-rw-r--r--Software/Visual_Studio/Tango.Git/GitFileState.cs14
-rw-r--r--Software/Visual_Studio/Tango.Git/GitRepositoryManager.cs132
-rw-r--r--Software/Visual_Studio/Tango.Git/Properties/AssemblyInfo.cs36
-rw-r--r--Software/Visual_Studio/Tango.Git/Tango.Git.csproj72
-rw-r--r--Software/Visual_Studio/Tango.Git/packages.config5
-rw-r--r--Software/Visual_Studio/Tango.sln34
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs21
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml12
15 files changed, 404 insertions, 12 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/App.config b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/App.config
index 3c53533de..7caec2cba 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/App.config
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/App.config
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
- </startup>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+ </startup>
<appSettings>
<add key="GatewayUrl" value="https://machineservice-gateway.azurewebsites.net" />
+ <add key="PAT" value="mxjl3ksz2uquh5ttpgjysjblxcimmj2waiq2ymw7m7listouyxkq" />
</appSettings>
</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindow.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindow.xaml
index 143113bf1..91b8bfae5 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindow.xaml
@@ -59,6 +59,8 @@
<TextBlock Margin="0 10 0 0">Password</TextBlock>
<TextBox Margin="0 5 0 0" Text="{Binding Password}"></TextBox>
+
+ <CheckBox Margin="0 20 0 0" IsChecked="{Binding CreateTag}">Create Tag On Repository</CheckBox>
</StackPanel>
</DockPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindowVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindowVM.cs
index 148ee37f6..9fce64c89 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindowVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/MainWindowVM.cs
@@ -13,6 +13,7 @@ using Tango.Core;
using Tango.Core.Commands;
using Tango.FSE.BL.Web;
using Tango.FSE.Web.Messages;
+using Tango.Git;
using Tango.MachineService.Gateway;
using Tango.Settings;
using Tango.SharedUI;
@@ -82,6 +83,13 @@ namespace Tango.FSE.Publisher.UI
set { _comments = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private bool _createTag;
+ public bool CreateTag
+ {
+ get { return _createTag; }
+ set { _createTag = value; RaisePropertyChangedAuto(); }
+ }
+
private TangoProgress<double> _progress;
public TangoProgress<double> Progress
{
@@ -202,6 +210,43 @@ namespace Tango.FSE.Publisher.UI
IsFree = false;
UpdateProgress("Publishing Tango FSE...");
+ if (CreateTag)
+ {
+ await Task.Factory.StartNew(() =>
+ {
+ String repoPath = Path.GetFullPath("../../../../../../");
+ using (GitRepositoryManager git = new GitRepositoryManager(repoPath, Email, ConfigurationManager.AppSettings.Get("PAT")))
+ {
+ UpdateProgress("Checking repository changes...");
+ int changes = git.GetChanges().Count;
+ if (changes > 0)
+ {
+ throw new InvalidOperationException($"There are {changes} uncommitted changes on the repository. Please commit and push all changes before creating the Tag");
+ }
+
+ UpdateProgress("Checking outgoing commits...");
+ int commits = git.GetOutgoingCommits().Count;
+ if (commits > 0)
+ {
+ throw new InvalidOperationException($"There are {commits} outgoing commits on the repository. Please push all commits before creating the Tag");
+ }
+
+ String tagVersion = System.Version.Parse(LocalVersion).ToString(3);
+ String tagName = $"FSE_v{tagVersion}";
+ String tagDescription = $"Snapshot of Tango FSE v{tagVersion}";
+
+ git.Progress += (x, e) =>
+ {
+ UpdateProgress($"Pushing Tag '{tagName}'...", false, e.Progress.Value, e.Progress.Maximum);
+ };
+
+ UpdateProgress($"Creating Tag '{tagName}'...", true);
+
+ git.CreatePushTag(tagName, tagDescription, "Roy Ben Shabat");
+ }
+ });
+ }
+
var settings = SettingsManager.Default.GetOrCreate<PublisherSettings>();
settings.Email = Email;
settings.Password = Password;
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/Tango.FSE.Publisher.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/Tango.FSE.Publisher.UI.csproj
index 26a0ee007..f58e3bdec 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/Tango.FSE.Publisher.UI.csproj
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Publisher.UI/Tango.FSE.Publisher.UI.csproj
@@ -108,6 +108,10 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.Git\Tango.Git.csproj">
+ <Project>{99081c0e-065c-4d68-bf60-f82330cca02d}</Project>
+ <Name>Tango.Git</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.Settings\Tango.Settings.csproj">
<Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project>
<Name>Tango.Settings</Name>
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index b0d4236bb..e594416f9 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -1695,6 +1695,11 @@ namespace Tango.Emulations.Emulators
_cancelJob = true;
}
+ public async void SetThreadLoadingState(ThreadLoadingState state)
+ {
+ await Transporter.SendResponse<StartThreadLoadingResponse>(new StartThreadLoadingResponse() { State = state, Message = $"{state.ToString()}", ErrorReason = "Fake emulator error" }, _threadLoadingToken);
+ }
+
#endregion
}
}
diff --git a/Software/Visual_Studio/Tango.Git/GitCommit.cs b/Software/Visual_Studio/Tango.Git/GitCommit.cs
new file mode 100644
index 000000000..fc388176b
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/GitCommit.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Git
+{
+ public class GitCommit
+ {
+ public String Message { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Git/GitFile.cs b/Software/Visual_Studio/Tango.Git/GitFile.cs
new file mode 100644
index 000000000..899fa839e
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/GitFile.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Git
+{
+ public class GitFile
+ {
+ public String File { get; set; }
+ public GitFileState State { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Git/GitFileState.cs b/Software/Visual_Studio/Tango.Git/GitFileState.cs
new file mode 100644
index 000000000..4c8bb6c14
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/GitFileState.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Git
+{
+ public enum GitFileState
+ {
+ Added,
+ Modified
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Git/GitRepositoryManager.cs b/Software/Visual_Studio/Tango.Git/GitRepositoryManager.cs
new file mode 100644
index 000000000..e7fdf8e32
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/GitRepositoryManager.cs
@@ -0,0 +1,132 @@
+using LibGit2Sharp;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core;
+
+namespace Tango.Git
+{
+ public class GitRepositoryManager : IDisposable
+ {
+ private Repository _repo;
+ private String _pat;
+ private String _userEmail;
+
+ public event EventHandler<TangoProgressChangedEventArgs<double>> Progress;
+
+ public GitRepositoryManager(String localFolder, String userEmail, String personalAccessToken)
+ {
+ _pat = personalAccessToken;
+ _userEmail = userEmail;
+ _repo = new Repository(localFolder);
+ }
+
+ public void CreatePushTag(String name, String description, String userName)
+ {
+ var tag = _repo.ApplyTag(name, new Signature(userName, _userEmail, DateTime.Now), description);
+
+ _repo.Network.Push(_repo.Network.Remotes.First(), tag.CanonicalName, new PushOptions()
+ {
+ CredentialsProvider = new LibGit2Sharp.Handlers.CredentialsHandler(CredentialsHandlerMethod),
+ OnPushTransferProgress = new LibGit2Sharp.Handlers.PushTransferProgressHandler(PushTagProgressHandlerMethod)
+ });
+ }
+
+ private bool PushTagProgressHandlerMethod(int current, int total, long bytes)
+ {
+ //TODO: Implement via TangoProgress & event...
+ RaiseProgress("Pushing Tag...", false, 0, total);
+ return true;
+ }
+
+ public List<GitCommit> GetOutgoingCommits(String branchName = "master")
+ {
+ List<GitCommit> commits = new List<GitCommit>();
+
+ var branch = _repo.Branches.FirstOrDefault(x => x.FriendlyName == branchName);
+
+ if (branch.TrackingDetails.AheadBy != null)
+ {
+ foreach (var commit in _repo.Commits.Take(branch.TrackingDetails.AheadBy.Value))
+ {
+ commits.Add(new GitCommit()
+ {
+ Message = commit.Message
+ });
+ }
+ }
+
+ return commits;
+ }
+
+ public List<GitCommit> GetIncomingCommits()
+ {
+ List<GitCommit> commits = new List<GitCommit>();
+
+ var trackingBranch = _repo.Head.TrackedBranch;
+ var log = _repo.Commits.QueryBy(new CommitFilter { IncludeReachableFrom = trackingBranch.Tip.Id, ExcludeReachableFrom = _repo.Head.Tip.Id });
+
+ var count = log.Count();
+
+ foreach (var commit in log)
+ {
+ commits.Add(new GitCommit()
+ {
+ Message = commit.Message
+ });
+ }
+
+ return commits;
+ }
+
+ public List<GitFile> GetChanges()
+ {
+ List<GitFile> files = new List<GitFile>();
+
+ var status = _repo.RetrieveStatus();
+
+ foreach (var file in status.Added)
+ {
+ files.Add(new GitFile()
+ {
+ File = file.FilePath,
+ State = GitFileState.Added
+ });
+ }
+
+ foreach (var file in status.Modified)
+ {
+ files.Add(new GitFile()
+ {
+ File = file.FilePath,
+ State = GitFileState.Modified
+ });
+ }
+
+ return files;
+ }
+
+ private Credentials CredentialsHandlerMethod(string url, string usernameFromUrl, SupportedCredentialTypes types)
+ {
+ return new UsernamePasswordCredentials { Username = _userEmail, Password = _pat };
+ }
+
+ protected virtual void RaiseProgress(String message, bool isIndeterminate = true, double value = 0, double maximum = 100)
+ {
+ Progress?.Invoke(this, new TangoProgressChangedEventArgs<double>(new TangoProgress<double>()
+ {
+ IsIndeterminate = isIndeterminate,
+ Message = message,
+ Value = value,
+ Maximum = maximum
+ }));
+ }
+
+ public void Dispose()
+ {
+ _repo.Dispose();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Git/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Git/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..4e07415b3
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tango.Git")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Tango.Git")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("99081c0e-065c-4d68-bf60-f82330cca02d")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Software/Visual_Studio/Tango.Git/Tango.Git.csproj b/Software/Visual_Studio/Tango.Git/Tango.Git.csproj
new file mode 100644
index 000000000..8bbf79eea
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/Tango.Git.csproj
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" />
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{99081C0E-065C-4D68-BF60-F82330CCA02D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tango.Git</RootNamespace>
+ <AssemblyName>Tango.Git</AssemblyName>
+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <Deterministic>true</Deterministic>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
+ <HintPath>..\packages\LibGit2Sharp.0.26.2\lib\net46\LibGit2Sharp.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="GitCommit.cs" />
+ <Compile Include="GitFileState.cs" />
+ <Compile Include="GitRepositoryManager.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="GitFile.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tango.Core\Tango.Core.csproj">
+ <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
+ <Name>Tango.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props'))" />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Git/packages.config b/Software/Visual_Studio/Tango.Git/packages.config
new file mode 100644
index 000000000..576f27245
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Git/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="LibGit2Sharp" version="0.26.2" targetFramework="net461" />
+ <package id="LibGit2Sharp.NativeBinaries" version="2.0.306" targetFramework="net461" />
+</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln
index e43333a4a..b1771998e 100644
--- a/Software/Visual_Studio/Tango.sln
+++ b/Software/Visual_Studio/Tango.sln
@@ -415,6 +415,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PPC.Packages.JobRunsS
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.CctOptimizer.CLI", "Utilities\Tango.CctOptimizer.CLI\Tango.CctOptimizer.CLI.csproj", "{69168924-9AA8-447D-AD64-F07DBF4F0909}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Git", "Tango.Git\Tango.Git.csproj", "{99081C0E-065C-4D68-BF60-F82330CCA02D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -3902,6 +3904,26 @@ Global
{69168924-9AA8-447D-AD64-F07DBF4F0909}.Release|x64.Build.0 = Release|Any CPU
{69168924-9AA8-447D-AD64-F07DBF4F0909}.Release|x86.ActiveCfg = Release|Any CPU
{69168924-9AA8-447D-AD64-F07DBF4F0909}.Release|x86.Build.0 = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|ARM.Build.0 = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|x64.Build.0 = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Debug|x86.Build.0 = Debug|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|ARM.ActiveCfg = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|ARM.Build.0 = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|ARM64.Build.0 = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|x64.ActiveCfg = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|x64.Build.0 = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|x86.ActiveCfg = Release|Any CPU
+ {99081C0E-065C-4D68-BF60-F82330CCA02D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -4046,12 +4068,12 @@ Global
{69168924-9AA8-447D-AD64-F07DBF4F0909} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- BuildVersion_UseGlobalSettings = False
- BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs
- BuildVersion_StartDate = 2000/1/1
- BuildVersion_UpdateFileVersion = False
- BuildVersion_UpdateAssemblyVersion = True
- BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear
SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6}
+ BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear
+ BuildVersion_UpdateAssemblyVersion = True
+ BuildVersion_UpdateFileVersion = False
+ BuildVersion_StartDate = 2000/1/1
+ BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs
+ BuildVersion_UseGlobalSettings = False
EndGlobalSection
EndGlobal
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
index 62a05472d..a66ed6b7e 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
@@ -12,6 +12,7 @@ using Tango.Transport.Servers;
using Tango.Transport.Transporters;
using Tango.Core;
using Tango.Settings;
+using Tango.PMR.ThreadLoading;
namespace Tango.MachineEM.UI.ViewModels
{
@@ -64,10 +65,30 @@ namespace Tango.MachineEM.UI.ViewModels
set { _selectedPort = value; RaisePropertyChanged(nameof(SelectedPort)); }
}
+ private ThreadLoadingState _threadLoadingState;
+ public ThreadLoadingState ThreadLoadingState
+ {
+ get { return _threadLoadingState; }
+ set { _threadLoadingState = value; OnThreadLoadingStateChanged(); }
+ }
+
+
#endregion
#region Private Methods
+ private void OnThreadLoadingStateChanged()
+ {
+ try
+ {
+ Emulator?.SetThreadLoadingState(ThreadLoadingState);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex);
+ }
+ }
+
#endregion
#region Commands
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml
index 6ebd1cde2..62bacd6d2 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml
@@ -9,6 +9,7 @@
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:vm="clr-namespace:Tango.MachineEM.UI.ViewModels"
xmlns:pmr="clr-namespace:Tango.PMR.MachineStatus;assembly=Tango.PMR"
+ xmlns:threadLoading="clr-namespace:Tango.PMR.ThreadLoading;assembly=Tango.PMR"
xmlns:local="clr-namespace:Tango.MachineEM.UI.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1300" Foreground="Gainsboro" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" >
@@ -137,11 +138,16 @@
<!--BUTTONS HERE-->
<Button Padding="10 0 0 0" Margin="5" Height="45" HorizontalContentAlignment="Left" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding AbortJobCommand}">
- <StackPanel Orientation="Horizontal">
+ <DockPanel>
<fa:ImageAwesome Icon="ExclamationTriangle" Width="16"></fa:ImageAwesome>
- <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">ABORT JOB</TextBlock>
- </StackPanel>
+ <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">ABORT JOB</TextBlock>
+ </DockPanel>
</Button>
+
+ <DockPanel Margin="5 20 5 0">
+ <TextBlock FontSize="12" DockPanel.Dock="Top">Thread Loading State</TextBlock>
+ <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Source={x:Type threadLoading:ThreadLoadingState},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding ThreadLoadingState,Mode=OneWayToSource}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox>
+ </DockPanel>
</StackPanel>
</Grid>
<TextBox x:Name="txtLog" Grid.Column="1" FontFamily="monospaced" TextChanged="txtLog_TextChanged" Text="{Binding Log}" Background="Transparent" Foreground="Red" FontSize="11" Padding="5" Style="{x:Null}" BorderThickness="0" IsReadOnly="True" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap">