Fixed Step.Client & Step.UI Bugs

This commit is contained in:
CMS3762\carminatini
2017-12-04 17:03:31 +01:00
parent 03786bb4f0
commit 706c4763c0
7 changed files with 57 additions and 15 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ namespace CMS_Client
{
public static class Program
{
//Set the Mutef of GUID
static Mutex CmsStepMutex = new Mutex(true, "{66fa29db-925a-402b-a4c7-d3d780fb1bc3}");
@@ -22,7 +23,7 @@ namespace CMS_Client
{
//Check the first argument -> Url
if(args.Count() > 0)
if (args.Count() > 0)
{
Uri UrlResArg;
if(Uri.TryCreate(args[0], UriKind.Absolute, out UrlResArg) && (UrlResArg.Scheme == Uri.UriSchemeHttp || UrlResArg.Scheme == Uri.UriSchemeHttps))
+2 -2
View File
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("CMS-STEP Client")]
[assembly: AssemblyTitle("CMS Step - Client")]
[assembly: AssemblyDescription("STEP Client For CMS Machines")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CMS Spa")]
[assembly: AssemblyProduct("CMS-STEP Client")]
[assembly: AssemblyProduct("CMS Step - Client")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+1 -1
View File
@@ -77,7 +77,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<OutputPath>..\Step\bin\Client\x64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
+4 -1
View File
@@ -45,7 +45,10 @@ namespace CMS_Client.View
ConnTask = Task.Run(() => BagroundWorker());
//Setup product label
VersionLBL.Text = Application.ProductName + " V" + Application.ProductVersion;
if(Environment.Is64BitProcess)
VersionLBL.Text = Application.ProductName + " V" + Application.ProductVersion + " - 64 Bit";
else
VersionLBL.Text = Application.ProductName + " V" + Application.ProductVersion + " - 32 Bit";
}
+10 -3
View File
@@ -250,8 +250,8 @@ namespace CMS_Client.View
if (CMSConfiguration.HMINcPresent)
NcWindow.StartNcFollowing(MainHandle, NcHandle, NcFrm.Width, NcFrm.Height);
//If is an Error Show the Error page TODO-> Erorr Page in HTML, nel browser!
if (LoadingError.Error)
//If is an Error Show the Error page
if (LoadingError.Error && !LoadingError.ErrorInfo.Contains("ERR_ABORTED"))
MessageBox.Show("Error While Loading the Page: " + LoadingError.ErrorInfo + "\nPress:\n - F5: reload the Page\n - F1: Back to last Page");
//Set focus on the page
@@ -327,7 +327,14 @@ namespace CMS_Client.View
//Set Window Title
private void SetWindowTitle(String Title)
{
Title = Application.ProductName + " | " + Title;
//Setup product label
if (Environment.Is64BitProcess)
Title = Application.ProductName + " x64 | " + Title;
else
Title = Application.ProductName + " x86 | " + Title;
//Invoke method if is needed or call the method in STD mode
if (this.InvokeRequired)
+28 -7
View File
@@ -3,22 +3,22 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TeamDev.SDK;
using TeamDev.SDK.MVVM;
using static Step.Config.StartupConfig;
namespace Step.UI
{
public partial class ServerControlWindow : Form
{
String HomePageUI;
public ServerControlWindow()
{
InitializeComponent();
HomePageUI = "http://localhost:" + serverConfig.ServerPort.ToString() + "index.html";
}
private static ServerControlWindow ctrlwindow = null;
@@ -64,8 +64,9 @@ namespace Step.UI
}
private void OpenUiButton_Click(object sender, EventArgs e)
{
Process.Start(Environment.CurrentDirectory + @"\Client\x86\CMS_Client.exe", "http://localhost:9000/index.html");
{
//Open CMS Client
StartCMSClient();
}
private void StopServerButton_Click(object sender, EventArgs e)
@@ -85,5 +86,25 @@ namespace Step.UI
{
MessageServices.Current.Publish("StopServer");
}
private void StartCMSClient()
{
//Setup the Path Variable
String CMSClientPath = "";
//Check if the system is 64/32 bit
if (Environment.Is64BitOperatingSystem && File.Exists(Environment.CurrentDirectory + @"\Client\x64\CMS_Client.exe"))
CMSClientPath = Environment.CurrentDirectory + @"\Client\x64\CMS_Client.exe";
else if (File.Exists(Environment.CurrentDirectory + @"\Client\x86\CMS_Client.exe"))
CMSClientPath = Environment.CurrentDirectory + @"\Client\x86\CMS_Client.exe";
if(!String.IsNullOrEmpty(CMSClientPath))
Process.Start(CMSClientPath, HomePageUI);
else
MessageBox.Show("CMS_Client.Exe not found");
}
}
}
+10
View File
@@ -77,5 +77,15 @@
<ItemGroup>
<None Include="Resources\CMS_Icon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Step.Config\Step.Config.csproj">
<Project>{3f5c2483-fc87-43ef-92a8-66ff7d0e440f}</Project>
<Name>Step.Config</Name>
</ProjectReference>
<ProjectReference Include="..\Step.Model\Step.Model.csproj">
<Project>{631375DD-06D3-49BB-8130-D9DDB34C429D}</Project>
<Name>Step.Model</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>