Client Bug Fixes. Added GPU-CPU Rendering in XML Config
@@ -67,6 +67,7 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Config.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="TranspColor" minOccurs='1' maxOccurs='1'/>
|
||||
<xs:element name="RenderingMethod" minOccurs='1' maxOccurs='1'/>
|
||||
<xs:element name="RunningOnSecondaryScreen" minOccurs='1' maxOccurs='1'/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
@@ -22,7 +24,6 @@
|
||||
<xs:element name="VendorHmi">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Enabled" minOccurs='1' maxOccurs='1'/>
|
||||
<xs:element name="Type" minOccurs='1' maxOccurs='1'/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Config>
|
||||
<Client>
|
||||
<TranspColor>#00FF00</TranspColor>
|
||||
<TranspColor>#FF00FF</TranspColor>
|
||||
<RenderingMethod>GPU</RenderingMethod> <!-- GPU/CPU -->
|
||||
<RunningOnSecondaryScreen>false</RunningOnSecondaryScreen>
|
||||
</Client>
|
||||
<Connection>
|
||||
<Url>http://localhost:9000/index.html</Url>
|
||||
@@ -9,8 +11,7 @@
|
||||
<DeleteCahceFolderOnStartup>false</DeleteCahceFolderOnStartup>
|
||||
</Connection>
|
||||
<VendorHmi>
|
||||
<Enabled>false</Enabled>
|
||||
<Type>1</Type>
|
||||
<Type>OSAI</Type><!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
|
||||
</VendorHmi>
|
||||
<ExtSoftwares>
|
||||
<Software>
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace Client.Config
|
||||
{
|
||||
public class ConfigController
|
||||
{
|
||||
const String ChromeScheme = "chrome";
|
||||
|
||||
public static void ReadStartupConfig()
|
||||
{
|
||||
int SoftwareId = 0;
|
||||
@@ -35,7 +37,9 @@ namespace Client.Config
|
||||
.Descendants(Constants.CLIENT_CONFIG_KEY)
|
||||
.Select(x => new SubModels.Client()
|
||||
{
|
||||
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value)
|
||||
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
|
||||
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
|
||||
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value)
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.ConnectionConfig = xmlConfigFile
|
||||
@@ -51,7 +55,7 @@ namespace Client.Config
|
||||
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
|
||||
.Select(x => new SubModels.VendorHmi()
|
||||
{
|
||||
Enabled = ValidateOpenHmi(x.Element("Enabled").Value),
|
||||
Enabled = ValidateOpenHmi(x.Element("Type").Value),
|
||||
Type = ValidateNcType(x.Element("Type").Value)
|
||||
}).FirstOrDefault();
|
||||
|
||||
@@ -75,9 +79,7 @@ namespace Client.Config
|
||||
if (!String.IsNullOrWhiteSpace(Arguments.Url))
|
||||
Config.ConnectionConfig.Url = ValidateArgumentUrl(Arguments.Url);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static void ValidationHandler(object sender, ValidationEventArgs e)
|
||||
{
|
||||
@@ -91,7 +93,7 @@ namespace Client.Config
|
||||
private static String ValidateUrl(String value)
|
||||
{
|
||||
Uri NewUrl;
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile))
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - Url"" is not a valid URL");
|
||||
@@ -101,7 +103,7 @@ namespace Client.Config
|
||||
private static String ValidateArgumentUrl(String value)
|
||||
{
|
||||
Uri NewUrl;
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile))
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Argument Url Error: is not a valid URL");
|
||||
@@ -120,35 +122,65 @@ namespace Client.Config
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Constants.Rendering ValidateRendering(string value)
|
||||
{
|
||||
if (value.ToUpper().Equals("CPU"))
|
||||
return Constants.Rendering.CPU;
|
||||
else if (value.ToUpper().Equals("GPU"))
|
||||
return Constants.Rendering.GPU;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateSecScreen(string value)
|
||||
{
|
||||
Boolean secScreen;
|
||||
if (Boolean.TryParse(value, out secScreen))
|
||||
return secScreen;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Boolean ValidateOpenHmi(String value)
|
||||
{
|
||||
Boolean OpenHmi;
|
||||
if (Boolean.TryParse(value, out OpenHmi))
|
||||
return OpenHmi;
|
||||
String Nc = value.ToUpper();
|
||||
|
||||
if (Nc.Equals("NO_NC"))
|
||||
return false;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""VendorHmi - Enabled"" is not a valid Boolean Type");
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static ushort ValidateNcType(String value)
|
||||
{
|
||||
ushort Nc;
|
||||
String Nc = value.ToUpper();
|
||||
|
||||
if (ushort.TryParse(value, out Nc) && Nc <= 3)
|
||||
return Nc;
|
||||
if (Nc.Equals("NO_NC") || Nc.Equals("DEMO"))
|
||||
return 0;
|
||||
else if(Nc.Equals("FANUC"))
|
||||
return 1;
|
||||
else if (Nc.Equals("SIEMENS"))
|
||||
return 2;
|
||||
else if (Nc.Equals("OSAI"))
|
||||
return 3;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""VendorHmi - Type"" is not a valid NC Type");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static ushort ValidateClientID(String value)
|
||||
{
|
||||
ushort Client;
|
||||
@@ -211,9 +243,7 @@ namespace Client.Config
|
||||
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
|
||||
MemoryStream m = new MemoryStream();
|
||||
im.Save(m, ImageFormat.Png);
|
||||
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
|
||||
|
||||
|
||||
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,14 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Client.Utils.Constants;
|
||||
|
||||
namespace Client.Config.SubModels
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
public Color TranspColor { get; set; }
|
||||
public Rendering RenderingMethod { get; set; }
|
||||
public Boolean RunningOnSecondaryScreen { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Client.Utils
|
||||
public static String STARTUP_CONFIG_PATH = BASE_PATH + "Config.xml";
|
||||
|
||||
|
||||
//Config Names and Paths
|
||||
//Config Names
|
||||
|
||||
public const string CONFIG_KEY = "Config";
|
||||
public const string CLIENT_CONFIG_KEY = "Client";
|
||||
@@ -24,11 +24,17 @@ namespace Client.Utils
|
||||
public const string VENDORHMI_CONFIG_KEY = "VendorHmi";
|
||||
public const string EXTSFT_CONFIG_KEY = "ExtSoftwares";
|
||||
public const string SFT_CONFIG_KEY = "Software";
|
||||
public enum Rendering {GPU = 0, CPU = 1 };
|
||||
|
||||
|
||||
|
||||
//BROWSER OBJECT NAME -> The first letter must be Lower-Case (CEF Settings)
|
||||
public const String BROWSER_JS_OBJ_NAME = "cmsClient";
|
||||
|
||||
|
||||
//Nc States
|
||||
public enum NcState { HIDE = 0, SHOW = 1,READONLY = 2 };
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static Client.Utils.Constants;
|
||||
|
||||
namespace CMS_Client.Browser_Tools
|
||||
{
|
||||
@@ -21,9 +22,7 @@ namespace CMS_Client.Browser_Tools
|
||||
//The first letter of All PUBLIC Variables and Methods must be Lower-Case (CEF Settings)
|
||||
|
||||
private MainForm mainForm;
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#region CONSTRUCTOR_METHOD
|
||||
//Constructor Method
|
||||
@@ -94,14 +93,25 @@ namespace CMS_Client.Browser_Tools
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#region NC_BEHAVIOUR_METHODS
|
||||
|
||||
//Move NC Window
|
||||
public void moveNcWindow(int X,int Y)
|
||||
|
||||
public void setNcWindowState(int stato)
|
||||
{
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
NcWindow.MoveNcWindow(X, Y);
|
||||
NcWindow.SetState((NcState)stato);
|
||||
|
||||
if (NcWindow.State == NcState.SHOW)
|
||||
mainForm.ShowNCWindow();
|
||||
else
|
||||
mainForm.HideNCWindow();
|
||||
}
|
||||
public int getNcWindowState()
|
||||
{
|
||||
return (int) NcWindow.State;
|
||||
}
|
||||
|
||||
public string getScreenBase64()
|
||||
{
|
||||
return NcWindow.NcCapture;
|
||||
}
|
||||
#endregion
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace CMS_Client.Browser_Tools
|
||||
|
||||
//F12 -> Show Dev Tools
|
||||
case KeyF12: browser.ShowDevTools(); break;
|
||||
|
||||
|
||||
//F4 -> Exit application
|
||||
case KeyF4: Application.Exit(); break;
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CMS_Client.Browser_Tools.SubModels
|
||||
{
|
||||
public class Drive
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public int Type { get; set; }
|
||||
public String Letter { get; set; }
|
||||
public String BasePath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CMS_Client.Browser_Tools.SubModels
|
||||
{
|
||||
public class FSItem
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public bool IsDirectory { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\CMS_Icon.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Resources\Client_Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -86,7 +86,7 @@
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<OutputPath>..\Step\bin\Client_Release\x64\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -114,6 +114,7 @@
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@@ -193,9 +194,6 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\CMS_LOGO.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\SIEMENS_ICON.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\SinumerikHmi.ico" />
|
||||
</ItemGroup>
|
||||
@@ -224,6 +222,9 @@
|
||||
<Name>Client.Utils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Client_Icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\cef.redist.x64.3.2987.1601\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.2987.1601\build\cef.redist.x64.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
After Width: | Height: | Size: 66 KiB |
@@ -40,7 +40,10 @@ namespace CMS_Client
|
||||
);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
//Run the Loading Form
|
||||
Application.Run(new LoadingForm());
|
||||
|
||||
|
||||
@@ -60,6 +60,16 @@ namespace CMS_Client.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca una risorsa localizzata di tipo System.Drawing.Icon simile a (Icona).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon Client_Icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Client_Icon", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca una risorsa localizzata di tipo System.Drawing.Icon simile a (Icona).
|
||||
/// </summary>
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Client_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Client_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="CMS_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\CMS_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -28,132 +28,161 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.StatusLBL = new System.Windows.Forms.TextBox();
|
||||
this.ErrorLBL = new System.Windows.Forms.TextBox();
|
||||
this.CloseLabel = new System.Windows.Forms.Label();
|
||||
this.tableLayout = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.TitlePanel = new System.Windows.Forms.Panel();
|
||||
this.VersionLBL = new System.Windows.Forms.Label();
|
||||
this.MainPanel = new System.Windows.Forms.Panel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.VersionLBL = new System.Windows.Forms.TextBox();
|
||||
this.ErrorLBL = new System.Windows.Forms.Label();
|
||||
this.StatusLBL = new System.Windows.Forms.Label();
|
||||
this.tableLayout.SuspendLayout();
|
||||
this.TitlePanel.SuspendLayout();
|
||||
this.MainPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// StatusLBL
|
||||
//
|
||||
this.StatusLBL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.StatusLBL.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(113)))), ((int)(((byte)(120)))));
|
||||
this.StatusLBL.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.StatusLBL.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.StatusLBL.ForeColor = System.Drawing.Color.White;
|
||||
this.StatusLBL.HideSelection = false;
|
||||
this.StatusLBL.Location = new System.Drawing.Point(12, 133);
|
||||
this.StatusLBL.Name = "StatusLBL";
|
||||
this.StatusLBL.ReadOnly = true;
|
||||
this.StatusLBL.ShortcutsEnabled = false;
|
||||
this.StatusLBL.Size = new System.Drawing.Size(309, 13);
|
||||
this.StatusLBL.TabIndex = 1;
|
||||
this.StatusLBL.TabStop = false;
|
||||
this.StatusLBL.UseWaitCursor = true;
|
||||
//
|
||||
// ErrorLBL
|
||||
//
|
||||
this.ErrorLBL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ErrorLBL.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(113)))), ((int)(((byte)(120)))));
|
||||
this.ErrorLBL.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.ErrorLBL.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.ErrorLBL.ForeColor = System.Drawing.Color.Maroon;
|
||||
this.ErrorLBL.HideSelection = false;
|
||||
this.ErrorLBL.Location = new System.Drawing.Point(12, 152);
|
||||
this.ErrorLBL.Multiline = true;
|
||||
this.ErrorLBL.Name = "ErrorLBL";
|
||||
this.ErrorLBL.ReadOnly = true;
|
||||
this.ErrorLBL.ShortcutsEnabled = false;
|
||||
this.ErrorLBL.Size = new System.Drawing.Size(309, 37);
|
||||
this.ErrorLBL.TabIndex = 4;
|
||||
this.ErrorLBL.TabStop = false;
|
||||
this.ErrorLBL.UseWaitCursor = true;
|
||||
//
|
||||
// CloseLabel
|
||||
//
|
||||
this.CloseLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CloseLabel.AutoSize = true;
|
||||
this.CloseLabel.Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
||||
this.CloseLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.CloseLabel.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.CloseLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.CloseLabel.ForeColor = System.Drawing.Color.White;
|
||||
this.CloseLabel.Location = new System.Drawing.Point(304, 9);
|
||||
this.CloseLabel.Location = new System.Drawing.Point(565, 9);
|
||||
this.CloseLabel.Name = "CloseLabel";
|
||||
this.CloseLabel.Size = new System.Drawing.Size(21, 20);
|
||||
this.CloseLabel.Size = new System.Drawing.Size(31, 30);
|
||||
this.CloseLabel.TabIndex = 5;
|
||||
this.CloseLabel.Text = "X";
|
||||
this.CloseLabel.UseWaitCursor = true;
|
||||
this.CloseLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.CloseLabel.Click += new System.EventHandler(this.CloseLabel_Click);
|
||||
this.CloseLabel.MouseEnter += new System.EventHandler(this.CloseLabel_MouseEnter);
|
||||
this.CloseLabel.MouseLeave += new System.EventHandler(this.CloseLabel_MouseLeave);
|
||||
//
|
||||
// pictureBox1
|
||||
// tableLayout
|
||||
//
|
||||
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
this.tableLayout.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pictureBox1.Image = global::CMS_Client.Properties.Resources.CMS_LOGO;
|
||||
this.pictureBox1.ImageLocation = "";
|
||||
this.pictureBox1.InitialImage = global::CMS_Client.Properties.Resources.CMS_LOGO;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(309, 96);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox1.TabIndex = 3;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.UseWaitCursor = true;
|
||||
this.tableLayout.ColumnCount = 1;
|
||||
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 826F));
|
||||
this.tableLayout.Controls.Add(this.TitlePanel, 0, 0);
|
||||
this.tableLayout.Controls.Add(this.MainPanel, 0, 2);
|
||||
this.tableLayout.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayout.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.tableLayout.Name = "tableLayout";
|
||||
this.tableLayout.RowCount = 3;
|
||||
this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 49F));
|
||||
this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayout.Size = new System.Drawing.Size(602, 410);
|
||||
this.tableLayout.TabIndex = 7;
|
||||
//
|
||||
// TitlePanel
|
||||
//
|
||||
this.TitlePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.TitlePanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(38)))), ((int)(((byte)(128)))));
|
||||
this.TitlePanel.Controls.Add(this.CloseLabel);
|
||||
this.TitlePanel.Controls.Add(this.VersionLBL);
|
||||
this.TitlePanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.TitlePanel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.TitlePanel.Name = "TitlePanel";
|
||||
this.TitlePanel.Size = new System.Drawing.Size(826, 49);
|
||||
this.TitlePanel.TabIndex = 0;
|
||||
//
|
||||
// VersionLBL
|
||||
//
|
||||
this.VersionLBL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.VersionLBL.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(113)))), ((int)(((byte)(120)))));
|
||||
this.VersionLBL.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.VersionLBL.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.VersionLBL.ForeColor = System.Drawing.Color.Navy;
|
||||
this.VersionLBL.HideSelection = false;
|
||||
this.VersionLBL.Location = new System.Drawing.Point(12, 114);
|
||||
this.VersionLBL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.VersionLBL.Font = new System.Drawing.Font("Work Sans", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.VersionLBL.ForeColor = System.Drawing.Color.White;
|
||||
this.VersionLBL.Location = new System.Drawing.Point(12, 9);
|
||||
this.VersionLBL.Name = "VersionLBL";
|
||||
this.VersionLBL.ReadOnly = true;
|
||||
this.VersionLBL.ShortcutsEnabled = false;
|
||||
this.VersionLBL.Size = new System.Drawing.Size(309, 13);
|
||||
this.VersionLBL.TabIndex = 6;
|
||||
this.VersionLBL.TabStop = false;
|
||||
this.VersionLBL.UseWaitCursor = true;
|
||||
this.VersionLBL.Size = new System.Drawing.Size(453, 30);
|
||||
this.VersionLBL.TabIndex = 0;
|
||||
this.VersionLBL.Text = "Title";
|
||||
this.VersionLBL.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// MainPanel
|
||||
//
|
||||
this.MainPanel.Controls.Add(this.pictureBox1);
|
||||
this.MainPanel.Controls.Add(this.ErrorLBL);
|
||||
this.MainPanel.Controls.Add(this.StatusLBL);
|
||||
this.MainPanel.Location = new System.Drawing.Point(3, 52);
|
||||
this.MainPanel.Name = "MainPanel";
|
||||
this.MainPanel.Size = new System.Drawing.Size(599, 358);
|
||||
this.MainPanel.TabIndex = 1;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.pictureBox1.Image = global::CMS_Client.Properties.Resources.CMS_LOGO;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(6, 0);
|
||||
this.pictureBox1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(587, 110);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox1.TabIndex = 3;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// ErrorLBL
|
||||
//
|
||||
this.ErrorLBL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ErrorLBL.Font = new System.Drawing.Font("Work Sans", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.ErrorLBL.ForeColor = System.Drawing.Color.Brown;
|
||||
this.ErrorLBL.Location = new System.Drawing.Point(6, 274);
|
||||
this.ErrorLBL.Name = "ErrorLBL";
|
||||
this.ErrorLBL.Size = new System.Drawing.Size(587, 74);
|
||||
this.ErrorLBL.TabIndex = 2;
|
||||
this.ErrorLBL.Text = "Error";
|
||||
this.ErrorLBL.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
|
||||
//
|
||||
// StatusLBL
|
||||
//
|
||||
this.StatusLBL.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.StatusLBL.Font = new System.Drawing.Font("Work Sans", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.StatusLBL.Location = new System.Drawing.Point(82, 110);
|
||||
this.StatusLBL.Name = "StatusLBL";
|
||||
this.StatusLBL.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0);
|
||||
this.StatusLBL.Size = new System.Drawing.Size(437, 164);
|
||||
this.StatusLBL.TabIndex = 1;
|
||||
this.StatusLBL.Text = "Status";
|
||||
this.StatusLBL.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// LoadingForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(113)))), ((int)(((byte)(120)))));
|
||||
this.ClientSize = new System.Drawing.Size(333, 201);
|
||||
this.Controls.Add(this.VersionLBL);
|
||||
this.Controls.Add(this.CloseLabel);
|
||||
this.Controls.Add(this.ErrorLBL);
|
||||
this.Controls.Add(this.StatusLBL);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(602, 409);
|
||||
this.Controls.Add(this.tableLayout);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = global::CMS_Client.Properties.Resources.CMS_Icon;
|
||||
this.Icon = global::CMS_Client.Properties.Resources.Client_Icon;
|
||||
this.Name = "LoadingForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Loading CMS Client";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.LoadingForm_Load);
|
||||
this.tableLayout.ResumeLayout(false);
|
||||
this.TitlePanel.ResumeLayout(false);
|
||||
this.MainPanel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox StatusLBL;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.TextBox ErrorLBL;
|
||||
private System.Windows.Forms.Label CloseLabel;
|
||||
private System.Windows.Forms.TextBox VersionLBL;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayout;
|
||||
private System.Windows.Forms.Panel TitlePanel;
|
||||
private System.Windows.Forms.Label VersionLBL;
|
||||
private System.Windows.Forms.Panel MainPanel;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Label StatusLBL;
|
||||
private System.Windows.Forms.Label ErrorLBL;
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,21 @@ namespace CMS_Client.View
|
||||
|
||||
|
||||
|
||||
//Set Opacity of the Window
|
||||
private void setOpacity(double opacity)
|
||||
{
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke((MethodInvoker)delegate () { this.Opacity = opacity; });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Opacity = opacity;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Close the Window
|
||||
private void closeWindow()
|
||||
{
|
||||
@@ -105,6 +120,9 @@ namespace CMS_Client.View
|
||||
//Main Void of the background Task
|
||||
private void BagroundWorker()
|
||||
{
|
||||
//Set App Opacity
|
||||
setOpacity(1);
|
||||
|
||||
//Show the loading state on the app ICON
|
||||
this.Invoke((MethodInvoker)delegate () {TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle); });
|
||||
|
||||
@@ -116,13 +134,20 @@ namespace CMS_Client.View
|
||||
setStatus("Connecting to " + Config.ConnectionConfig.Url + "...", "");
|
||||
do { } while (!testConnection(new Uri(Config.ConnectionConfig.Url))) ;
|
||||
|
||||
//Set App Opacity (Only Siemens)
|
||||
if(Config.VendorHmiConfig.Type == 2)
|
||||
setOpacity(0.85);
|
||||
|
||||
//Open Nc Window
|
||||
setStatus("Opening the NC Window... ", "");
|
||||
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
if (!OpenNcWindow())
|
||||
return;
|
||||
|
||||
|
||||
//Set App Opacity
|
||||
setOpacity(1);
|
||||
|
||||
//Setup The Browser
|
||||
if (!SetupBrowser())
|
||||
return;
|
||||
@@ -185,20 +210,26 @@ namespace CMS_Client.View
|
||||
Boolean Connected = false;
|
||||
|
||||
//Try to connect
|
||||
try
|
||||
if(url.Scheme == Uri.UriSchemeHttps || url.Scheme == Uri.UriSchemeHttp)
|
||||
{
|
||||
ConnTestRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||
ConnTestRequest.Timeout = (int)(TimerTest);
|
||||
ConnTestRequest.KeepAlive = false;
|
||||
ConnTestResponse = (HttpWebResponse)ConnTestRequest.GetResponse();
|
||||
ConnTestError = ConnTestResponse.StatusCode.ToString();
|
||||
Connected = (ConnTestResponse.StatusCode == HttpStatusCode.OK) ? true : false;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
Connected = false;
|
||||
ConnTestError = ex.Status.ToString();
|
||||
try
|
||||
{
|
||||
ConnTestRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||
ConnTestRequest.Timeout = (int)(TimerTest);
|
||||
ConnTestRequest.KeepAlive = false;
|
||||
ConnTestResponse = (HttpWebResponse)ConnTestRequest.GetResponse();
|
||||
ConnTestError = ConnTestResponse.StatusCode.ToString();
|
||||
Connected = (ConnTestResponse.StatusCode == HttpStatusCode.OK) ? true : false;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
Connected = false;
|
||||
ConnTestError = ex.Status.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
Connected = true;
|
||||
|
||||
|
||||
//Check if it's connected
|
||||
if (Connected)
|
||||
@@ -264,5 +295,6 @@ namespace CMS_Client.View
|
||||
CloseLabel.ForeColor = Color.White;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ namespace CMS_Client.View
|
||||
this.ClientSize = new System.Drawing.Size(1920, 1080);
|
||||
this.DoubleBuffered = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = global::CMS_Client.Properties.Resources.CMS_Icon;
|
||||
this.Icon = global::CMS_Client.Properties.Resources.Client_Icon;
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(1920, 1080);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(1844, 1078);
|
||||
this.MinimumSize = new System.Drawing.Size(500, 500);
|
||||
this.Name = "MainForm";
|
||||
this.Opacity = 0D;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
|
||||
@@ -11,10 +11,13 @@ using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -30,7 +33,7 @@ namespace CMS_Client.View
|
||||
public Boolean Error;
|
||||
public String ErrorInfo;
|
||||
}
|
||||
|
||||
Random rnd = new Random();
|
||||
|
||||
//Internal Variables
|
||||
private ChromiumWebBrowser CefBrowser;
|
||||
@@ -39,13 +42,13 @@ namespace CMS_Client.View
|
||||
private NcForm NcFrm;
|
||||
private static IntPtr MainHandle;
|
||||
private static IntPtr NcHandle;
|
||||
private int X = 0, Y = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#region WINDOW_START_&_BEHAVIOUR_METHOD
|
||||
//Instance Method
|
||||
public MainForm()
|
||||
{
|
||||
|
||||
//Start Chromium Settings
|
||||
InitializeCefSettings();
|
||||
|
||||
@@ -62,7 +65,6 @@ namespace CMS_Client.View
|
||||
this.Text = AssemblyInfo.AssemblyProduct + " " + AssemblyInfo.AssemblyVersion;
|
||||
this.Opacity = 0.0;
|
||||
|
||||
|
||||
//Initialize the Nc-Form
|
||||
InitializeNcForm();
|
||||
|
||||
@@ -71,15 +73,15 @@ namespace CMS_Client.View
|
||||
|
||||
//Load the page
|
||||
CefBrowser.Load(Config.ConnectionConfig.Url);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//On windows-Load Method
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
//Force to use on Screen 1
|
||||
this.DesktopLocation = new Point(0, 0);
|
||||
{
|
||||
this.DesktopLocation = new Point(X,Y);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,22 +111,28 @@ namespace CMS_Client.View
|
||||
//Before closing the Window -> Remove the Browser (Increase the speed of closing window)
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
if(!this.IsDisposed)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
this.Invoke((MethodInvoker)delegate () {
|
||||
try
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
this.Invoke((MethodInvoker)delegate () {
|
||||
if (!CefBrowser.IsDisposed)
|
||||
this.Controls.Remove(CefBrowser);
|
||||
});
|
||||
|
||||
else
|
||||
{
|
||||
if (!CefBrowser.IsDisposed)
|
||||
this.Controls.Remove(CefBrowser);
|
||||
});
|
||||
|
||||
else
|
||||
{
|
||||
if (!CefBrowser.IsDisposed)
|
||||
this.Controls.Remove(CefBrowser);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Close the NC HMI && Stop Following Nc
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
@@ -148,6 +156,9 @@ namespace CMS_Client.View
|
||||
{
|
||||
//Set the Transparency Key
|
||||
TransparencyKey = Config.ClientConfig.TranspColor;
|
||||
|
||||
//Calculate Window Position
|
||||
CalcWindowPosition();
|
||||
}
|
||||
|
||||
|
||||
@@ -157,12 +168,10 @@ namespace CMS_Client.View
|
||||
{
|
||||
//Create the Nc-Form
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
{
|
||||
NcFrm = new NcForm();
|
||||
NcFrm.Show();
|
||||
this.Owner = NcFrm;
|
||||
this.TopLevel = true;
|
||||
{
|
||||
NcFrm = new NcForm(TransparencyKey,X,Y);
|
||||
NcHandle = NcFrm.Handle;
|
||||
NcFrm.Show();
|
||||
}
|
||||
|
||||
//Steup the Step variables
|
||||
@@ -181,16 +190,19 @@ namespace CMS_Client.View
|
||||
//Setup the Browser Cache
|
||||
CefBrowserSettings.CachePath = Constants.BROWSER_CACHE_FOLDER;
|
||||
|
||||
//Setup best rendering performances | Must DISABLE GPU for transparent method! -> inside SetOffScreenRenderingBestPerformanceArgs method
|
||||
CefBrowserSettings.SetOffScreenRenderingBestPerformanceArgs();
|
||||
//Setup CEF
|
||||
if (Config.ClientConfig.RenderingMethod == Constants.Rendering.CPU)
|
||||
CefBrowserSettings.SetOffScreenRenderingBestPerformanceArgs();
|
||||
|
||||
CefBrowserSettings.CefCommandLineArgs.Add("disable-pinch", "1");
|
||||
CefBrowserSettings.CefCommandLineArgs.Add("enable-transparent-visuals", "1");
|
||||
|
||||
|
||||
|
||||
Debug.WriteLine("[{0}]", string.Join(", ", CefBrowserSettings.CefCommandLineArgs));
|
||||
//allow windowless rendering
|
||||
CefBrowserSettings.WindowlessRenderingEnabled = true;
|
||||
|
||||
//Initialize CEF
|
||||
Cef.EnableHighDPISupport();
|
||||
Cef.Initialize(CefBrowserSettings);
|
||||
}
|
||||
|
||||
@@ -202,7 +214,6 @@ namespace CMS_Client.View
|
||||
//Create the Instance
|
||||
CefBrowser = new ChromiumWebBrowser("");
|
||||
|
||||
|
||||
//Set the Dock Property
|
||||
CefBrowser.Dock = DockStyle.Fill;
|
||||
|
||||
@@ -218,6 +229,7 @@ namespace CMS_Client.View
|
||||
|
||||
//Insert into Form
|
||||
this.Controls.Add(CefBrowser);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -244,11 +256,6 @@ namespace CMS_Client.View
|
||||
//if the State is NOT "loading"
|
||||
if (!e.IsLoading)
|
||||
{
|
||||
//Set cursor
|
||||
Application.UseWaitCursor = true;
|
||||
if(NcFrm != null)
|
||||
NcFrm.UseWaitCursor = true;
|
||||
|
||||
//Show the Main Window, when the page is loaded
|
||||
ShowWindow();
|
||||
|
||||
@@ -269,19 +276,11 @@ namespace CMS_Client.View
|
||||
//if the State is NOT "loading"
|
||||
else
|
||||
{
|
||||
//Set cursor
|
||||
Application.UseWaitCursor = false;
|
||||
if (NcFrm != null)
|
||||
NcFrm.UseWaitCursor = false;
|
||||
|
||||
//Set the Load-Error global variable to FALSE
|
||||
LoadingError.Error = false;
|
||||
|
||||
//Set the title of the window in "Loading"
|
||||
SetWindowTitle("Loading...");
|
||||
|
||||
//Show the loading state on the app ICON
|
||||
//TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,8 +334,6 @@ namespace CMS_Client.View
|
||||
//Set Window Title
|
||||
private void SetWindowTitle(String Title)
|
||||
{
|
||||
|
||||
|
||||
//Setup product label
|
||||
if (Environment.Is64BitProcess)
|
||||
Title = Application.ProductName + " x64 | " + Title;
|
||||
@@ -352,6 +349,71 @@ namespace CMS_Client.View
|
||||
this.Text = Title;
|
||||
}
|
||||
|
||||
|
||||
//Show NC Method
|
||||
public void ShowNCWindow()
|
||||
{
|
||||
if (!Config.VendorHmiConfig.Enabled)
|
||||
return;
|
||||
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
if (this.InvokeRequired)
|
||||
this.Invoke((MethodInvoker)delegate () {
|
||||
this.Owner = null;
|
||||
this.NcFrm.Owner = this;
|
||||
this.NcFrm.TopMost = true;
|
||||
this.NcFrm.TopMost = false;
|
||||
});
|
||||
|
||||
else
|
||||
{
|
||||
this.Owner = null;
|
||||
this.NcFrm.Owner = this;
|
||||
this.NcFrm.TopMost = true;
|
||||
this.NcFrm.TopMost = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Hide NC Method
|
||||
public void HideNCWindow()
|
||||
{
|
||||
if (!Config.VendorHmiConfig.Enabled)
|
||||
return;
|
||||
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
if (this.InvokeRequired)
|
||||
this.Invoke((MethodInvoker)delegate () {
|
||||
this.NcFrm.Owner = null;
|
||||
this.TopMost = true;
|
||||
this.TopMost = false;
|
||||
});
|
||||
|
||||
else
|
||||
{
|
||||
this.NcFrm.Owner = null;
|
||||
this.TopMost = true;
|
||||
this.TopMost = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//CAlculate Window Position
|
||||
private void CalcWindowPosition()
|
||||
{
|
||||
//Position of the Window
|
||||
if (Screen.AllScreens.Length > 1 && Config.ClientConfig.RunningOnSecondaryScreen)
|
||||
{
|
||||
Screen ps = Screen.AllScreens.FirstOrDefault(S => S.Primary == true);
|
||||
Screen ss = Screen.AllScreens.FirstOrDefault(S => S.Primary == false);
|
||||
X = ps.Bounds.Width;
|
||||
if(ss.Bounds.Top != 0)
|
||||
Y = ss.Bounds.Top;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(113)))), ((int)(((byte)(120)))));
|
||||
this.ClientSize = new System.Drawing.Size(1920, 1080);
|
||||
this.ClientSize = new System.Drawing.Size(1920, 1280);
|
||||
this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "NcForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "NcForm";
|
||||
this.UseWaitCursor = true;
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -12,12 +12,16 @@ namespace CMS_Client.View
|
||||
{
|
||||
public partial class NcForm : Form
|
||||
{
|
||||
public NcForm()
|
||||
public NcForm(Color TranspColor,int PosX,int PosY)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//Force to use on Screen 1
|
||||
this.DesktopLocation = new Point(0, 0);
|
||||
this.DesktopLocation = new Point(PosX, PosY);
|
||||
|
||||
//If is on top -> Transp.color
|
||||
this.TransparencyKey = TranspColor;
|
||||
this.BackColor = this.TransparencyKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
using Client.Config;
|
||||
using Client.Utils;
|
||||
using CMS_Client.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static Client.Utils.Constants;
|
||||
|
||||
namespace CMS_Client.View
|
||||
{
|
||||
@@ -43,6 +47,8 @@ namespace CMS_Client.View
|
||||
private static String processpath = "";
|
||||
public static Process NcProcess { get { return ncprocess; } }
|
||||
private static Process ncprocess;
|
||||
public static String NcCapture { get { return ncCapture; } }
|
||||
private static String ncCapture;
|
||||
|
||||
private static int LastX, LastY;
|
||||
private static int LastWidth = 1024, LastHeight = 768;
|
||||
@@ -64,7 +70,10 @@ namespace CMS_Client.View
|
||||
private static IntPtr ActualHND;
|
||||
private static IntPtr LastHookedHND;
|
||||
private static IntPtr NcHND;
|
||||
private static Thread FocusTask;
|
||||
private static Thread CaptureThread;
|
||||
|
||||
public static NcState State { get { return state; } }
|
||||
private static NcState state;
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +169,12 @@ namespace CMS_Client.View
|
||||
return 2;
|
||||
|
||||
//Set the first founded process
|
||||
ncprocess = processes[0];
|
||||
ncprocess = processes[0];
|
||||
|
||||
Thread.Sleep(1000);
|
||||
|
||||
//Set the kill method
|
||||
ncprocess.Exited += OnprocessExit;
|
||||
}
|
||||
|
||||
//Set Window Started => true
|
||||
@@ -186,9 +200,7 @@ namespace CMS_Client.View
|
||||
style = GetWindowLong(ncprocess.MainWindowHandle, GWL_STYLE);
|
||||
SetWindowLong(ncprocess.MainWindowHandle, GWL_STYLE, (style & ~WS_CAPTION & ~WS_THICKFRAME));
|
||||
|
||||
//Resize the Window
|
||||
ResizeAndMoveNcWindow((Screen.PrimaryScreen.Bounds.Width / 2) - (LastWidth / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (LastHeight / 2), LastWidth, LastHeight);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -254,6 +266,14 @@ namespace CMS_Client.View
|
||||
|
||||
|
||||
|
||||
//Set State
|
||||
public static void SetState(NcState St)
|
||||
{
|
||||
state = St;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Show Windows Taskbar
|
||||
public static void ShowTaskBar()
|
||||
{
|
||||
@@ -278,53 +298,6 @@ namespace CMS_Client.View
|
||||
|
||||
|
||||
|
||||
//Resize NC Window
|
||||
public static void ResizeNcWindow(int width, int height)
|
||||
{
|
||||
LastWidth = width;
|
||||
LastHeight = height;
|
||||
|
||||
//Win32 Method
|
||||
if (ncprocess != null && windowstarted)
|
||||
{
|
||||
MoveWindow(ncprocess.MainWindowHandle, LastX, LastY, LastWidth, LastHeight, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Move NC Window
|
||||
public static void MoveNcWindow(int X, int Y)
|
||||
{
|
||||
LastX = X;
|
||||
LastY = Y;
|
||||
|
||||
//Win32 Method
|
||||
if (ncprocess != null && windowstarted)
|
||||
{
|
||||
MoveWindow(ncprocess.MainWindowHandle, LastX, LastY, LastWidth, LastHeight, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Resize & Move NC Window
|
||||
public static void ResizeAndMoveNcWindow(int X, int Y, int width, int height)
|
||||
{
|
||||
LastX = X;
|
||||
LastY = Y;
|
||||
LastWidth = width;
|
||||
LastHeight = height;
|
||||
|
||||
//Win32 Method
|
||||
if (ncprocess != null && windowstarted)
|
||||
{
|
||||
MoveWindow(ncprocess.MainWindowHandle, LastX, LastY, LastWidth, LastHeight, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Set NC Icon
|
||||
public static void SetNcIcon(Icon icon)
|
||||
{
|
||||
@@ -379,17 +352,31 @@ namespace CMS_Client.View
|
||||
|
||||
//Set the parent of the window
|
||||
SetParent(ncprocess.MainWindowHandle, NcHandle);
|
||||
MoveWindow(ncprocess.MainWindowHandle, LastX, LastY, LastWidth, LastHeight, true);
|
||||
|
||||
//Get the Process-Id
|
||||
GetWindowThreadProcessId(MainViewHandle, out MainProcessPID);
|
||||
GetWindowThreadProcessId(ncprocess.MainWindowHandle, out NcProcessPID);
|
||||
|
||||
//Resize the Window
|
||||
ResizeAndMoveNcWindow(64, 176, 1024, 768);
|
||||
|
||||
//Start the Hook
|
||||
if (MainViewHandle != IntPtr.Zero && ncprocess.MainWindowHandle != IntPtr.Zero && MainProcessPID != 0 && NcProcessPID != 0 && windowstarted)
|
||||
{
|
||||
{
|
||||
//Detach the hook
|
||||
if (hhook != IntPtr.Zero)
|
||||
UnhookWinEvent(hhook);
|
||||
|
||||
//Attach the new hook
|
||||
procDelegate = new WinEventDelegate(WinEventProc);
|
||||
hhook = SetWinEventHook(EVENT_OBJECT_FOCUS, EVENT_OBJECT_FOCUS, IntPtr.Zero, procDelegate, 0, 0, WINEVENT_OUTOFCONTEXT);
|
||||
|
||||
//Start the new Thread of Image Captutre
|
||||
if (CaptureThread != null)
|
||||
CaptureThread.Abort();
|
||||
CaptureThread = new Thread(new ThreadStart(CaptureCycle));
|
||||
|
||||
CaptureThread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,6 +391,9 @@ namespace CMS_Client.View
|
||||
//Detach the hook
|
||||
if (hhook != IntPtr.Zero)
|
||||
UnhookWinEvent(hhook);
|
||||
|
||||
if (CaptureThread != null)
|
||||
CaptureThread.Abort();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -520,6 +510,22 @@ namespace CMS_Client.View
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Resize & Move NC Window
|
||||
private static void ResizeAndMoveNcWindow(int X, int Y, int width, int height)
|
||||
{
|
||||
LastX = X;
|
||||
LastY = Y;
|
||||
LastWidth = width;
|
||||
LastHeight = height;
|
||||
|
||||
//Win32 Method
|
||||
if (ncprocess != null && windowstarted)
|
||||
{
|
||||
MoveWindow(ncprocess.MainWindowHandle, LastX, LastY, LastWidth, LastHeight, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Setup the Path/Name of the process Method
|
||||
private static void SetupNcProcess()
|
||||
@@ -572,6 +578,14 @@ namespace CMS_Client.View
|
||||
|
||||
|
||||
|
||||
// On Process Kill
|
||||
private static void OnprocessExit(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Hide All windows Process
|
||||
private static void hideAllProcWindows(String ProcessName)
|
||||
{
|
||||
@@ -777,19 +791,65 @@ namespace CMS_Client.View
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
|
||||
|
||||
[DllImport("User32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool ShowOwnedPopups(IntPtr hwnd, bool show);
|
||||
|
||||
[DllImport("dwmapi.dll")]
|
||||
static extern int DwmRegisterThumbnail(IntPtr dest, IntPtr src, out IntPtr thumb);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT
|
||||
{
|
||||
public int Left; // x position of upper-left corner
|
||||
public int Top; // y position of upper-left corner
|
||||
public int Right; // x position of lower-right corner
|
||||
public int Bottom; // y position of lower-right corner
|
||||
public int Left;
|
||||
public int Top;
|
||||
public int Right;
|
||||
public int Bottom;
|
||||
}
|
||||
|
||||
public static void CaptureCycle()
|
||||
{
|
||||
RECT rc = new RECT();
|
||||
Graphics gr;
|
||||
bool success=false;
|
||||
Bitmap bmp;
|
||||
MemoryStream m = new MemoryStream();
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
if(state == NcState.READONLY)
|
||||
{
|
||||
Thread.BeginThreadAffinity();
|
||||
m = new MemoryStream();
|
||||
String Base64Capture;
|
||||
if (ncprocess != null && ncprocess.MainWindowHandle != IntPtr.Zero)
|
||||
{
|
||||
GetWindowRect(ncprocess.MainWindowHandle, out rc);
|
||||
bmp = new Bitmap(rc.Right - rc.Left, rc.Bottom - rc.Top);
|
||||
gr = Graphics.FromImage(bmp);
|
||||
success = PrintWindow(ncprocess.MainWindowHandle, gr.GetHdc(), 0);
|
||||
gr.ReleaseHdc();
|
||||
if (success && bmp != null)
|
||||
{
|
||||
bmp.Save(m, ImageFormat.Png);
|
||||
Base64Capture = Convert.ToBase64String(m.ToArray());
|
||||
ncCapture = "data:image/png;base64," + Base64Capture;
|
||||
}
|
||||
m.Dispose();
|
||||
bmp.Dispose();
|
||||
gr.Dispose();
|
||||
}
|
||||
Thread.EndThreadAffinity();
|
||||
}
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -69,5 +69,35 @@ namespace Step.UI.Properties {
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca una risorsa localizzata di tipo System.Drawing.Icon simile a (Icona).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon Step_Disconnected {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Step_Disconnected", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca una risorsa localizzata di tipo System.Drawing.Icon simile a (Icona).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon Step_Error {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Step_Error", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca una risorsa localizzata di tipo System.Drawing.Icon simile a (Icona).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon Step_Icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Step_Icon", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,13 @@
|
||||
<data name="CMS_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\CMS_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Step_Disconnected" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Step_Disconnected.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Step_Error" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Step_Error.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Step_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Step_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 66 KiB |
@@ -91,5 +91,14 @@
|
||||
<Name>Step.Utils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Step_Icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Step_Error.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Step_Disconnected.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -166,6 +166,7 @@
|
||||
<Content Include="App.Release.config">
|
||||
<DependentUpon>App.config</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Step_Icon.ico" />
|
||||
<Content Include="wwwroot\.bowerrc">
|
||||
<DependentUpon>bower.json</DependentUpon>
|
||||
</Content>
|
||||
@@ -327,6 +328,9 @@
|
||||
<PropertyGroup>
|
||||
<StartupObject>Step.Application</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Step_Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
|
||||
|
After Width: | Height: | Size: 66 KiB |
@@ -8,7 +8,23 @@
|
||||
<link rel="stylesheet" href="bootstrap.min.css" >
|
||||
<script src="bootstrap.min.js" ></script>
|
||||
<style>
|
||||
|
||||
#nc{
|
||||
background-color: rgb(245, 245, 245);
|
||||
width: 1024px;
|
||||
height:768px;
|
||||
|
||||
}
|
||||
|
||||
#hover {
|
||||
z-index: 10;
|
||||
display: block;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(168, 168, 168, 0.4);
|
||||
}
|
||||
</style>
|
||||
<script lang="javascript">
|
||||
|
||||
@@ -16,9 +32,9 @@
|
||||
|
||||
//Paolo lo so che è fatto da schifo, ma è solo un esempio per vedere se funzionava tutto...
|
||||
if(typeof cmsClient !== 'undefined')
|
||||
{
|
||||
{
|
||||
|
||||
$(".supp").show();
|
||||
|
||||
//Processi da lanciare sul client, con le relative icone in Base64
|
||||
var obj = JSON.parse(cmsClient.getConfiguredProcesses());
|
||||
TestHtml = "";
|
||||
@@ -43,6 +59,11 @@
|
||||
cmsClient.openOrStartProcess($(this).parent().parent().find(".path").html());
|
||||
});
|
||||
|
||||
|
||||
$('.test').click(function() {
|
||||
alert("asd");
|
||||
});
|
||||
|
||||
//Pulsanti gestione finestra
|
||||
$( '#hideBTN' ).on('click',function() {
|
||||
cmsClient.minimizeForm();
|
||||
@@ -58,15 +79,59 @@
|
||||
|
||||
$('#Vers').val(cmsClient.getChromiumVersion());
|
||||
$('#CliId').val(cmsClient.getClientID());
|
||||
|
||||
|
||||
cmsClient.hideNcWindow();
|
||||
|
||||
//Pulsanti gestione NC
|
||||
$( '#showNC' ).on('click',function() {
|
||||
cmsClient.showNcWindow();
|
||||
$('#hover').hide();
|
||||
$('#NCRead').hide();
|
||||
});
|
||||
//Pulsanti gestione NC
|
||||
$( '#hideNC' ).on('click',function() {
|
||||
cmsClient.hideNcWindow();
|
||||
$('#hover').show();
|
||||
$('#NCRead').show();
|
||||
});
|
||||
|
||||
$("#nav-profile").on("DOMAttrModified",function(){alert("visible");});
|
||||
|
||||
}
|
||||
else
|
||||
$(".unsopp").show();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
setInterval(updateNc, 100);
|
||||
function updateNc(){
|
||||
$('#NCRead').attr("src", cmsClient.getScreenBase64());
|
||||
}
|
||||
|
||||
function listDevices(){
|
||||
var dev = JSON.parse(cmsClient.getDevices());
|
||||
TestHtml ="<div class=\"list-group\">"
|
||||
dev.forEach(
|
||||
function(element)
|
||||
{
|
||||
TestHtml += "<div class=\"test list-group-item list-group-item-action flex-column align-items-start\">";
|
||||
TestHtml += "<div class=\"d-flex w-100 justify-content-between\">"
|
||||
TestHtml += "<h5 class=\"mb-1\">" + element.Letter + ":</h5>"
|
||||
if(element.Type == 4)
|
||||
TestHtml += "<small>NET</small>"
|
||||
if(element.Type == 3)
|
||||
TestHtml += "<small>HD</small>"
|
||||
if(element.Type == 2)
|
||||
TestHtml += "<small>USB</small>"
|
||||
TestHtml += "</div><p class=\"mb-1\">" + element.Name + "</p>"
|
||||
TestHtml += "</div>"
|
||||
}
|
||||
);
|
||||
TestHtml += "</div>";
|
||||
$('#devices').html(TestHtml);
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
@@ -74,56 +139,83 @@
|
||||
<div class="container"> <br>
|
||||
<div class="unsopp" style="display: none;"><h1>Unsupported Browser</h1></div>
|
||||
<div class="supp" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-sm-12"><h1>Javascript Test: CMS-Browser</h1></div>
|
||||
</div>
|
||||
<br><br>
|
||||
<h6>Info Browser</h6>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="Vers" class="col-sm-2 col-form-label">Chromium Version: </label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly class="form-control" id="Vers" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="CliId" class="col-sm-2 col-form-label">Client Id: </label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly class="form-control" id="CliId" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12"><h1>Javascript Test: CMS-Browser</h1></div>
|
||||
</div>
|
||||
|
||||
<nav class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Home</a>
|
||||
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Nc</a>
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab"><br><br><br>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h6>Info Browser</h6>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="Vers" class="col-sm-2 col-form-label">Chromium Version: </label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly class="form-control" id="Vers" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="CliId" class="col-sm-2 col-form-label">Client Id: </label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" readonly class="form-control" id="CliId" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<h6>Hotkey</h6>
|
||||
<ul>
|
||||
<li><b>ALT+F4:</b> Chiudi applicazione</li>
|
||||
<li><b>ALT+F5:</b> Ricarica Pagina</li>
|
||||
<li><b>ALT+F12:</b> Tool Sviluppo</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<h6>Gestione Finestra Browser</h6>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<button type="button" id="hideBTN" class="btn btn-primary">Riduci ad Icona</button>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<button type="button" id="closeBTN" class="btn btn-primary">Chiudi Browser</button><br>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<button type="button" id="focusBTN" class="btn btn-primary">Forza Fuoco <span class="badge">Dopo 5 secondi</span></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div><br><br>
|
||||
<hr>
|
||||
<h6>Gestione Processi sul PC <small>(Clicca sul Pannello per lanciare l'applicativo)</small></h6>
|
||||
<div class="row" id="cards">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab"><br><br><br>
|
||||
<div class="row">
|
||||
<div class="card col-sm-11 nccont"><div id="nc" ><img id="NCRead" src="" /><div id="hover"> </div></div></div>
|
||||
<div class="col-sm-1">
|
||||
<div class="form-group row">
|
||||
<button type="button" id="showNC" class="btn btn-primary">Show Nc</button>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<button type="button" id="hideNC" class="btn btn-primary">Hide Nc</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div><br><br>
|
||||
<hr>
|
||||
<h6>Hotkey</h6>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<ul>
|
||||
<li><b>ALT+F4:</b> Chiudi applicazione</li>
|
||||
<li><b>ALT+F5:</b> Ricarica Pagina</li>
|
||||
<li><b>ALT+F12:</b> Tool Sviluppo</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><br><br>
|
||||
<hr>
|
||||
<h6>Gestione Finestra Browser</h6>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" id="hideBTN" class="btn btn-primary">Riduci ad Icona</button>
|
||||
<button type="button" id="closeBTN" class="btn btn-primary">Chiudi Browser</button>
|
||||
<button type="button" id="focusBTN" class="btn btn-primary">Forza Fuoco Browser dopo 5 secondi</button>
|
||||
</div>
|
||||
</div><br><br>
|
||||
<hr>
|
||||
<h6>Gestione Processi sul PC <small>(Clicca sul Pannello per lanciare l'applicativo)</small></h6>
|
||||
<div class="row" id="cards">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
</body>
|
||||
|
||||