Added configurations
This commit is contained in:
@@ -1,74 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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>{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Client.Config</RootNamespace>
|
||||
<AssemblyName>Client.Config</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</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="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<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="ConfigController.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SubModels\Client.cs" />
|
||||
<Compile Include="SubModels\Connection.cs" />
|
||||
<Compile Include="SubModels\Software.cs" />
|
||||
<Compile Include="SubModels\VendorHmi.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Client.Utils\Client.Utils.csproj">
|
||||
<Project>{34434b22-d546-4a5c-b575-49720c77643a}</Project>
|
||||
<Name>Client.Utils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClientValidator.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Config.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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>{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Client.Config</RootNamespace>
|
||||
<AssemblyName>Client.Config</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</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="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<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="ConfigController.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SubModels\Client.cs" />
|
||||
<Compile Include="SubModels\Connection.cs" />
|
||||
<Compile Include="SubModels\ProdSoftware.cs" />
|
||||
<Compile Include="SubModels\Software.cs" />
|
||||
<Compile Include="SubModels\VendorHmi.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Client.Utils\Client.Utils.csproj">
|
||||
<Project>{34434b22-d546-4a5c-b575-49720c77643a}</Project>
|
||||
<Name>Client.Utils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClientValidator.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Config.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -13,6 +13,7 @@ namespace Client.Config
|
||||
public static SubModels.Client ClientConfig;
|
||||
public static SubModels.Connection ConnectionConfig;
|
||||
public static SubModels.VendorHmi VendorHmiConfig;
|
||||
public static SubModels.ProdSoftware ProdSoftwareConfig;
|
||||
public static SubModels.Software[] ExtSoftwaresConfig { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -76,6 +76,8 @@ namespace Client.Config
|
||||
}
|
||||
).ToArray();
|
||||
|
||||
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
|
||||
|
||||
//ReadConfig Url compositing
|
||||
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
|
||||
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Config.SubModels
|
||||
{
|
||||
public class ProdSoftware
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,8 @@ namespace CMS_Client.Browser_Tools
|
||||
AddFunction("delPPFromJob").Execute += delPPFromJob;
|
||||
AddFunction("readJobMetadata").Execute += readJobMetadata;
|
||||
AddFunction("updateJobMetadata").Execute += updateJobMetadata;
|
||||
AddFunction("isHMIenabled").Execute += isHMIenabled;
|
||||
AddFunction("isPRODenabled").Execute += isPRODenabled;
|
||||
}
|
||||
|
||||
#endregion CONSTRUCTOR_METHOD
|
||||
@@ -212,6 +214,17 @@ namespace CMS_Client.Browser_Tools
|
||||
e.SetReturnValue((Boolean)Config.ClientConfig.ShowVirtualKeyboard);
|
||||
}
|
||||
|
||||
// Get the option of virtual Keyb configured
|
||||
private void isHMIenabled(object sender, CfrV8HandlerExecuteEventArgs e)
|
||||
{
|
||||
e.SetReturnValue((Boolean)Config.VendorHmiConfig.Enabled);
|
||||
}
|
||||
|
||||
// Get the option of virtual Keyb configured
|
||||
private void isPRODenabled(object sender, CfrV8HandlerExecuteEventArgs e)
|
||||
{
|
||||
e.SetReturnValue((Boolean)Config.ProdSoftwareConfig.Enabled);
|
||||
}
|
||||
#endregion STEP_METHODS
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+41
-18
@@ -118,12 +118,19 @@ namespace CMS_Client.View
|
||||
NcWindow.ShowTaskBar();
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
NcFrm.Hide();
|
||||
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
ProdFrm.Hide();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Config.VendorHmiConfig.Enabled && NcFrm != null)
|
||||
NcFrm.Show();
|
||||
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
ProdFrm.Show();
|
||||
|
||||
if (NcWindow.State == NcState.SHOW)
|
||||
{
|
||||
HideAUXWindow();
|
||||
@@ -165,7 +172,8 @@ namespace CMS_Client.View
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
NcWindow.CloseNcWindow(false);
|
||||
|
||||
NcWindow.CloseProdWindow(false);
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
NcWindow.CloseProdWindow(false);
|
||||
|
||||
//Close Chromium Runtime
|
||||
try
|
||||
@@ -206,11 +214,17 @@ namespace CMS_Client.View
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
{
|
||||
NcFrm = new NcForm(Config.ClientConfig.TranspColor, X, Y);
|
||||
ProdFrm = new ProdForm(Config.ClientConfig.TranspColor, X, Y);
|
||||
NcHandle = NcFrm.Handle;
|
||||
ProdHandle = ProdFrm.Handle;
|
||||
NcFrm.Show();
|
||||
}
|
||||
|
||||
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
{
|
||||
ProdFrm = new ProdForm(Config.ClientConfig.TranspColor, X, Y);
|
||||
ProdHandle = ProdFrm.Handle;
|
||||
ProdFrm.Show();
|
||||
|
||||
}
|
||||
|
||||
//Steup the Step variables
|
||||
@@ -480,7 +494,7 @@ namespace CMS_Client.View
|
||||
if (!NcWindow.isFollowing)
|
||||
{
|
||||
//Start following NC Window
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
if (Config.VendorHmiConfig.Enabled || Config.ProdSoftwareConfig.Enabled)
|
||||
NcWindow.StartNcFollowing(MainHandle, NcHandle, ProdHandle, NcFrm.Width, NcFrm.Height);
|
||||
else
|
||||
NcWindow.StartStepFollowing(MainHandle);
|
||||
@@ -585,7 +599,8 @@ namespace CMS_Client.View
|
||||
{
|
||||
Owner = null;
|
||||
NcFrm.Owner = this;
|
||||
ProdFrm.Owner = null;
|
||||
if (ProdFrm != null)
|
||||
ProdFrm.Owner = null;
|
||||
}
|
||||
NcFrm.TopMost = true;
|
||||
NcFrm.TopMost = false;
|
||||
@@ -597,7 +612,8 @@ namespace CMS_Client.View
|
||||
{
|
||||
Owner = null;
|
||||
NcFrm.Owner = this;
|
||||
ProdFrm.Owner = null;
|
||||
if (ProdFrm != null)
|
||||
ProdFrm.Owner = null;
|
||||
}
|
||||
NcFrm.TopMost = true;
|
||||
NcFrm.TopMost = false;
|
||||
@@ -608,7 +624,7 @@ namespace CMS_Client.View
|
||||
//Show NC Method
|
||||
public void ShowProdWindow()
|
||||
{
|
||||
if (!Config.VendorHmiConfig.Enabled)
|
||||
if (!Config.ProdSoftwareConfig.Enabled)
|
||||
return;
|
||||
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
@@ -621,10 +637,12 @@ namespace CMS_Client.View
|
||||
{
|
||||
Owner = null;
|
||||
ProdFrm.Owner = this;
|
||||
NcFrm.Owner = null;
|
||||
if (NcFrm != null)
|
||||
NcFrm.Owner = null;
|
||||
}
|
||||
ProdFrm.TopMost = true;
|
||||
ProdFrm.TopMost = false;
|
||||
|
||||
});
|
||||
|
||||
else
|
||||
@@ -633,7 +651,8 @@ namespace CMS_Client.View
|
||||
{
|
||||
Owner = null;
|
||||
ProdFrm.Owner = this;
|
||||
NcFrm.Owner = null;
|
||||
if (NcFrm != null)
|
||||
NcFrm.Owner = null;
|
||||
}
|
||||
ProdFrm.TopMost = true;
|
||||
ProdFrm.TopMost = false;
|
||||
@@ -646,7 +665,7 @@ namespace CMS_Client.View
|
||||
//Hide NC Method
|
||||
public void HideAUXWindow()
|
||||
{
|
||||
if (!Config.VendorHmiConfig.Enabled || NcFrm==null)
|
||||
if ((!Config.VendorHmiConfig.Enabled && !Config.ProdSoftwareConfig.Enabled) || (NcFrm==null && ProdFrm == null))
|
||||
return;
|
||||
|
||||
//Invoke method if is needed or call the method in STD mode
|
||||
@@ -655,9 +674,9 @@ namespace CMS_Client.View
|
||||
if (InvokeRequired)
|
||||
Invoke((MethodInvoker)delegate ()
|
||||
{
|
||||
if (NcFrm.Owner != null)
|
||||
if (NcFrm != null && NcFrm.Owner != null)
|
||||
NcFrm.Owner = null;
|
||||
if (ProdFrm.Owner != null)
|
||||
if (ProdFrm != null && ProdFrm.Owner != null)
|
||||
ProdFrm.Owner = null;
|
||||
TopMost = true;
|
||||
TopMost = false;
|
||||
@@ -665,9 +684,9 @@ namespace CMS_Client.View
|
||||
|
||||
else
|
||||
{
|
||||
if (NcFrm.Owner != null)
|
||||
if (NcFrm != null && NcFrm.Owner != null)
|
||||
NcFrm.Owner = null;
|
||||
if (ProdFrm.Owner != null)
|
||||
if (ProdFrm != null && ProdFrm.Owner != null)
|
||||
ProdFrm.Owner = null;
|
||||
TopMost = true;
|
||||
TopMost = false;
|
||||
@@ -703,8 +722,10 @@ namespace CMS_Client.View
|
||||
if (ss.Bounds.Width != 1920 && ss.Bounds.Height != 1080)
|
||||
{
|
||||
HideLoadingWindow();
|
||||
NcWindow.CloseNcWindow(false);
|
||||
NcWindow.CloseProdWindow(false);
|
||||
if(Config.VendorHmiConfig.Enabled)
|
||||
NcWindow.CloseNcWindow(false);
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
NcWindow.CloseProdWindow(false);
|
||||
Program.ShowAlarmAndClose("Screen resolution " + ss.Bounds.Width + "x" + ss.Bounds.Height + " is not supported");
|
||||
}
|
||||
}
|
||||
@@ -726,8 +747,10 @@ namespace CMS_Client.View
|
||||
if (ps.Bounds.Width != 1920 && ps.Bounds.Height != 1080)
|
||||
{
|
||||
HideLoadingWindow();
|
||||
NcWindow.CloseNcWindow(false);
|
||||
NcWindow.CloseProdWindow(false);
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
NcWindow.CloseNcWindow(false);
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
NcWindow.CloseProdWindow(false);
|
||||
Program.ShowAlarmAndClose("Screen resolution " + ps.Bounds.Width + "x" + ps.Bounds.Height + " is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
+48
-20
@@ -54,9 +54,6 @@ namespace CMS_Client.View
|
||||
private static Process ncprocess;
|
||||
public static Process prodProcess { get { return prodprocess; } }
|
||||
private static Process prodprocess;
|
||||
|
||||
|
||||
|
||||
public static String NcCapture { get { return ncCapture; } }
|
||||
private static String ncCapture;
|
||||
|
||||
@@ -98,6 +95,8 @@ namespace CMS_Client.View
|
||||
private static bool shiftPressed;
|
||||
private static uint KeybPID;
|
||||
public static MainForm mainFrm;
|
||||
private static string prodEXEname;
|
||||
|
||||
|
||||
public static NcState State { get { return state; } }
|
||||
private static NcState state;
|
||||
@@ -261,6 +260,7 @@ namespace CMS_Client.View
|
||||
Process[] processes;
|
||||
|
||||
ProcKilled = false;
|
||||
prodEXEname = EXEname;
|
||||
|
||||
//Set Window Started = false
|
||||
prodwindowstarted = false;
|
||||
@@ -400,9 +400,31 @@ namespace CMS_Client.View
|
||||
//Kill/Close the PROD Window
|
||||
public static void CloseProdWindow(bool forced)
|
||||
{
|
||||
Process[] processes;
|
||||
|
||||
if (prodEXEname == null)
|
||||
return;
|
||||
|
||||
//Kill the Process
|
||||
if (prodprocess != null && !prodprocess.HasExited)
|
||||
prodprocess.Kill();
|
||||
prodprocess.Kill();
|
||||
|
||||
//Read if exists a Process with correct name
|
||||
processes = Process.GetProcessesByName(prodEXEname);
|
||||
|
||||
//Wait until the process is killed
|
||||
TriedTimes = 1;
|
||||
while (processes.Length > 0 && TriedTimes < TimesToTryKill)
|
||||
{
|
||||
processes = Process.GetProcessesByName(prodEXEname);
|
||||
if (processes.Length > 0)
|
||||
{
|
||||
Thread.Sleep(WaitingMs);
|
||||
TriedTimes++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +438,7 @@ namespace CMS_Client.View
|
||||
//Show Prod Window
|
||||
public static void ShowProdWindow()
|
||||
{
|
||||
if (windowstarted)
|
||||
if (prodwindowstarted)
|
||||
ShowWindow(prodprocess.MainWindowHandle, SW_SHOWNOACTIVATE);
|
||||
}
|
||||
|
||||
@@ -431,7 +453,7 @@ namespace CMS_Client.View
|
||||
//Show Prod Window
|
||||
public static void MinimizeProdWindow()
|
||||
{
|
||||
if (windowstarted)
|
||||
if (prodwindowstarted)
|
||||
ShowWindow(prodprocess.MainWindowHandle, WS_MINIMIZE);
|
||||
}
|
||||
|
||||
@@ -446,7 +468,7 @@ namespace CMS_Client.View
|
||||
//Hide Prod Window
|
||||
public static void HideProdWindow()
|
||||
{
|
||||
if (windowstarted)
|
||||
if (prodwindowstarted)
|
||||
ShowWindow(prodprocess.MainWindowHandle, WS_HIDE);
|
||||
}
|
||||
|
||||
@@ -561,20 +583,26 @@ namespace CMS_Client.View
|
||||
MainViewHandle = Handle;
|
||||
NcHND = NcHandle;
|
||||
|
||||
//Set the parent of the window
|
||||
SetParent(ncprocess.MainWindowHandle, NcHandle);
|
||||
//Set the parent of the window
|
||||
if (windowstarted)
|
||||
SetParent(ncprocess.MainWindowHandle, NcHandle);
|
||||
|
||||
//Set the parent of the window
|
||||
SetParent(prodprocess.MainWindowHandle, ProdHandle);
|
||||
if(prodwindowstarted)
|
||||
SetParent(prodprocess.MainWindowHandle, ProdHandle);
|
||||
|
||||
//Get the Process-Id
|
||||
GetWindowThreadProcessId(MainViewHandle, out MainProcessPID);
|
||||
GetWindowThreadProcessId(ncprocess.MainWindowHandle, out NcProcessPID);
|
||||
GetWindowThreadProcessId(prodProcess.MainWindowHandle, out ProdProcessPID);
|
||||
GetWindowThreadProcessId(MainViewHandle, out MainProcessPID);
|
||||
if (windowstarted)
|
||||
GetWindowThreadProcessId(ncprocess.MainWindowHandle, out NcProcessPID);
|
||||
if (prodwindowstarted)
|
||||
GetWindowThreadProcessId(prodProcess.MainWindowHandle, out ProdProcessPID);
|
||||
|
||||
//Resize the Window
|
||||
ResizeAndMoveNcWindow(ncWindowX, ncWindowY, ncWindowWidth, ncWindowHeight);
|
||||
ResizeAndMoveProdWindow(ncWindowX, ncWindowY, ncWindowWidth, ncWindowHeight);
|
||||
//Resize the Window
|
||||
if (windowstarted)
|
||||
ResizeAndMoveNcWindow(ncWindowX, ncWindowY, ncWindowWidth, ncWindowHeight);
|
||||
if (prodwindowstarted)
|
||||
ResizeAndMoveProdWindow(ncWindowX, ncWindowY, ncWindowWidth, ncWindowHeight);
|
||||
|
||||
//Start Keyboard Hook
|
||||
if (keybhook != IntPtr.Zero)
|
||||
@@ -583,7 +611,7 @@ namespace CMS_Client.View
|
||||
keybhook = SetWindowsHookEx(WH_KEYBOARD_LL, keybDelegate, IntPtr.Zero, 0);
|
||||
|
||||
//Start the Hook
|
||||
if (MainViewHandle != IntPtr.Zero && ncprocess.MainWindowHandle != IntPtr.Zero && MainProcessPID != 0 && NcProcessPID != 0 && windowstarted)
|
||||
if (MainViewHandle != IntPtr.Zero && ncprocess.MainWindowHandle != IntPtr.Zero && MainProcessPID != 0 && (NcProcessPID != 0 || ProdProcessPID != 0))
|
||||
{
|
||||
//Detach the hook
|
||||
if (hhook != IntPtr.Zero)
|
||||
@@ -933,13 +961,13 @@ namespace CMS_Client.View
|
||||
}
|
||||
}
|
||||
//If the PID is the NC-HMI Process
|
||||
else if (ActualPID == NcProcessPID || ActualPID == ProdProcessPID)
|
||||
else if ((ActualPID == NcProcessPID && NcProcessPID != 0) || (ActualPID == ProdProcessPID && ProdProcessPID != 0))
|
||||
{
|
||||
//Hide the TaskBar
|
||||
if (Environment.OSVersion.Version.Major < 10)
|
||||
HideTaskBar();
|
||||
|
||||
if(LastHookedPID != MainProcessPID && LastHookedPID != NcProcessPID)
|
||||
if(LastHookedPID != MainProcessPID && LastHookedPID != NcProcessPID && LastHookedPID != ProdProcessPID)
|
||||
SetForegroundWindow(MainViewHandle);
|
||||
}
|
||||
//If the PID is OTHER Process
|
||||
@@ -993,7 +1021,7 @@ namespace CMS_Client.View
|
||||
GetWindowThreadProcessId(GetForegroundWindow(), out KeybPID);
|
||||
|
||||
//Filter the PID
|
||||
if (KeybPID == MainProcessPID || KeybPID == NcProcessPID)
|
||||
if (KeybPID == MainProcessPID || KeybPID == NcProcessPID || KeybPID == ProdProcessPID)
|
||||
{
|
||||
//Filter if is keydown
|
||||
if (wParam == HWND_SYSKEYDOWN)
|
||||
|
||||
+53
-28
@@ -139,11 +139,21 @@ namespace CMS_Client.View
|
||||
setOpacity(0.85);
|
||||
|
||||
//Open Nc Window
|
||||
setStatus("Opening the NC Window... ", "");
|
||||
setStatus("Opening NC Window... ", "");
|
||||
|
||||
if (Config.VendorHmiConfig.Enabled)
|
||||
if (!OpenNcWindow())
|
||||
return;
|
||||
return;
|
||||
|
||||
//Open Nc Window
|
||||
setStatus("Opening PROD Window... ", "");
|
||||
|
||||
if (Config.ProdSoftwareConfig.Enabled)
|
||||
{
|
||||
var exename = Path.GetFileNameWithoutExtension(Config.ProdSoftwareConfig.Path);
|
||||
if (!OpenProdWindow(Config.ProdSoftwareConfig.Path, exename))
|
||||
return;
|
||||
}
|
||||
|
||||
//Set App Opacity
|
||||
setOpacity(1);
|
||||
@@ -208,7 +218,7 @@ namespace CMS_Client.View
|
||||
//Check if it's connected
|
||||
if (Connected)
|
||||
{
|
||||
var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "" };
|
||||
var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "", prodEnabled = "", prodPath = "" };
|
||||
setStatus("Connected!", "");
|
||||
|
||||
//Read the configuration from Server
|
||||
@@ -224,8 +234,10 @@ namespace CMS_Client.View
|
||||
String ncVendorHMI = ConfigResponse.showHMI.ToUpper();
|
||||
Config.VendorHmiConfig.IpAddress = ConfigResponse.ncIp.ToUpper();
|
||||
Config.VendorHmiConfig.Port = ConfigResponse.ncPort.ToUpper();
|
||||
|
||||
//Read the Server Type
|
||||
String ProdEnabled = ConfigResponse.prodEnabled.ToUpper();
|
||||
String ProdPath = ConfigResponse.prodPath.ToUpper();
|
||||
|
||||
//Read the Server Type
|
||||
if (ncVendorName.Equals("DEMO"))
|
||||
Config.VendorHmiConfig.Type = 0;
|
||||
else if (ncVendorName.Equals("FANUC"))
|
||||
@@ -242,10 +254,19 @@ namespace CMS_Client.View
|
||||
}
|
||||
|
||||
//Read if the HMI must be visible
|
||||
if (ncVendorHMI.Equals("TRUE"))
|
||||
if (ncVendorHMI.ToUpper().Equals("TRUE"))
|
||||
Config.VendorHmiConfig.Enabled = true;
|
||||
else
|
||||
Config.VendorHmiConfig.Enabled = false;
|
||||
Config.VendorHmiConfig.Enabled = false;
|
||||
|
||||
|
||||
//Read if the HMI must be visible
|
||||
if (ProdEnabled.ToUpper().Equals("TRUE"))
|
||||
Config.ProdSoftwareConfig.Enabled = true;
|
||||
else
|
||||
Config.ProdSoftwareConfig.Enabled = false;
|
||||
|
||||
Config.ProdSoftwareConfig.Path = ProdPath;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -286,27 +307,9 @@ namespace CMS_Client.View
|
||||
private bool OpenNcWindow()
|
||||
{
|
||||
switch(NcWindow.StartNcWindow())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
switch (NcWindow.StartProdWindow("C:\\Windows\\System32\\notepad.exe", "notepad"))
|
||||
{
|
||||
case 0: return true;
|
||||
{
|
||||
|
||||
case 1:
|
||||
{
|
||||
setStatus("Close the application!", "PROD EXE Path not found: " + NcWindow.ProcessPath);
|
||||
return false;
|
||||
};
|
||||
|
||||
case 2:
|
||||
{
|
||||
setStatus("Close the application!", "Unable to start the PROD EXE application: ");
|
||||
return false;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
};
|
||||
case 0: return true;
|
||||
|
||||
case 1: {
|
||||
setStatus("Close the application!", "NC Path not found: " + NcWindow.ProcessPath);
|
||||
@@ -320,10 +323,32 @@ namespace CMS_Client.View
|
||||
};
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Sub-Method used to open the NC Window
|
||||
private bool OpenProdWindow(string ExePath,string ExeName)
|
||||
{
|
||||
switch (NcWindow.StartProdWindow(ExePath, ExeName))
|
||||
{
|
||||
case 0: return true;
|
||||
|
||||
case 1:
|
||||
{
|
||||
setStatus("Close the application!", "PROD EXE Path not found: " + NcWindow.ProcessPath);
|
||||
return false;
|
||||
};
|
||||
|
||||
case 2:
|
||||
{
|
||||
setStatus("Close the application!", "Unable to start the PROD EXE application: ");
|
||||
return false;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CMS_Client.View
|
||||
//If is on top -> Transp.color
|
||||
this.TransparencyKey = TranspColor;
|
||||
this.BackColor = this.TransparencyKey;
|
||||
|
||||
//this.panel1.BackColor = this.TransparencyKey;
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
<sharedName>//PARTPRG:/</sharedName>
|
||||
<installationDate>01/01/2019</installationDate>
|
||||
</ncConfig>
|
||||
<softwareProdConfig>
|
||||
<enabled>true</enabled>
|
||||
<path>C:\Program Files\Notepad++\notepad++.exe</path>
|
||||
</softwareProdConfig>
|
||||
<serverConfig>
|
||||
<serverPort>9000</serverPort>
|
||||
<serverAddress>*</serverAddress>
|
||||
|
||||
@@ -17,7 +17,14 @@
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="softwareProdConfig">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="enabled" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
|
||||
<xs:element name="path" type="xs:string" minOccurs='1' maxOccurs='1'/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="serverConfig">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Step.Config
|
||||
{
|
||||
public static ServerConfigModel ServerStartupConfig;
|
||||
public static NcConfigModel NcConfig;
|
||||
public static SoftwareProdConfigModel SoftwareProdConfig;
|
||||
public static MachineModel MachineConfig;
|
||||
public static List<MaintenanceConfigModel> MaintenancesConfig;
|
||||
|
||||
|
||||
@@ -249,6 +249,16 @@ namespace Step.Config
|
||||
InstallationDate = x.Element("installationDate").Value
|
||||
}).FirstOrDefault();
|
||||
|
||||
// Read Prod Software Config with LINQ
|
||||
SoftwareProdConfig = xmlConfigFile
|
||||
.Root
|
||||
.Descendants(PROD_SFT_CONFIG_KEY)
|
||||
.Select(x => new SoftwareProdConfigModel()
|
||||
{
|
||||
Enabled = Convert.ToBoolean(x.Element("enabled").Value),
|
||||
Path = x.Element("path").Value
|
||||
}).FirstOrDefault();
|
||||
|
||||
// Read server config with LINQ and save into static config
|
||||
ServerStartupConfig = xmlConfigFile
|
||||
.Root
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Step.Model.ConfigModels
|
||||
{
|
||||
public class SoftwareProdConfigModel
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -119,6 +119,7 @@ namespace Step.Model
|
||||
public const string SERVER_CONFIG_KEY = "serverConfig";
|
||||
|
||||
public const string NC_CONFIG_KEY = "ncConfig";
|
||||
public const string PROD_SFT_CONFIG_KEY = "softwareProdConfig";
|
||||
public const string AREAS_CONFIG_KEY = "areasConfig";
|
||||
|
||||
// Step Areas
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Step.Model.DTOModels
|
||||
public string _language { private get; set; }
|
||||
public string NcIp { get; set; }
|
||||
public ushort NcPort { get; set; }
|
||||
public bool ProdEnabled { get; set; }
|
||||
public string ProdPath { get; set; }
|
||||
|
||||
public CultureInfo DefaultLanguage
|
||||
{
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<Compile Include="ConfigModels\ServerConfigModel.cs" />
|
||||
<Compile Include="ConfigModels\AreasConfigModel.cs" />
|
||||
<Compile Include="ConfigModels\NcConfigModel.cs" />
|
||||
<Compile Include="ConfigModels\SoftwareProdConfigModel.cs" />
|
||||
<Compile Include="ConfigModels\ToolManagerConfigModel.cs" />
|
||||
<Compile Include="ConfigModels\UserSoftKeyConfigModel.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace Step.NC
|
||||
|
||||
fileInfo = new DTOActiveImageAndNameDataModel()
|
||||
{
|
||||
Image = SupportFunctions.FindImageBase64String(PART_PRG_IMAGES, name),
|
||||
Image = SupportFunctions.GetImageBase64String(PART_PRG_IMAGES, name),
|
||||
Name = Path.GetFileName(name) // TODO: Get From NC
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ namespace Step.Controllers.WebApi
|
||||
ShowHMI = NcConfig.ShowNcHMI,
|
||||
DefaultLanguage = ServerStartupConfig.Language,
|
||||
NcIp = NcConfig.NcIpAddress,
|
||||
NcPort = NcConfig.NcPort
|
||||
NcPort = NcConfig.NcPort,
|
||||
ProdEnabled = SoftwareProdConfig.Enabled,
|
||||
ProdPath = SoftwareProdConfig.Path
|
||||
};
|
||||
|
||||
return Ok(clientConfiguration);
|
||||
|
||||
@@ -86,6 +86,15 @@
|
||||
width: 1024px;
|
||||
border: none;
|
||||
}
|
||||
#prod-div{
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
height: 768px;
|
||||
width: 1024px;
|
||||
border: none;
|
||||
background-color: #bbbcbc;
|
||||
}
|
||||
|
||||
#cnc-img-fanuc{
|
||||
position: absolute;
|
||||
|
||||
@@ -17843,6 +17843,15 @@ footer .container button.big:before {
|
||||
width: 1024px;
|
||||
border: none;
|
||||
}
|
||||
.production-container .production-box .production-left-box .box-left .box-left-video #prod-div {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
height: 768px;
|
||||
width: 1024px;
|
||||
border: none;
|
||||
background-color: #bbbcbc;
|
||||
}
|
||||
.production-container .production-box .production-left-box .box-left .box-left-video #cnc-img-fanuc {
|
||||
position: absolute;
|
||||
top: 19px;
|
||||
|
||||
@@ -315,7 +315,6 @@ function HideProdProduction() {
|
||||
function ElaborateHMIStatus() {
|
||||
let hmiv = HMIvisible || HMIvisibleInProduction || PRODvisibleInProduction;
|
||||
|
||||
console.log(hmiv);
|
||||
if (!hmiv) {
|
||||
if (HMIScreenshotInterval)
|
||||
clearInterval(HMIScreenshotInterval);
|
||||
|
||||
@@ -13,6 +13,8 @@ import Component from "vue-class-component";
|
||||
import { Watch } from "vue-property-decorator";
|
||||
import { ModalHelper } from "src/components/modals";
|
||||
|
||||
declare var cmsClient;
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
softkeysPrefered, headProduction, cardAxesProduction, processSelectionMaintenance, cardProductionCms, cardScadaProduction
|
||||
@@ -50,6 +52,9 @@ export default class Production extends Vue {
|
||||
get heads() {
|
||||
return this.$store.state.machineInfo.heads;
|
||||
}
|
||||
get isProdSftEnabled() {
|
||||
return cmsClient.isPRODenabled();
|
||||
}
|
||||
get softkeyFavorite() {
|
||||
function compare(a, b) {
|
||||
if (a.id < b.id) {
|
||||
|
||||
@@ -13,15 +13,19 @@
|
||||
</div>
|
||||
<button class="btn" :class="{'pressed': activeCms}" @click="clickCms()">{{'production_box_video_button_cms' | localize("CMS")}}</button>
|
||||
<button class="btn" :class="{'pressed': activeCnc}" @click="clickCnc()">{{'production_box_video_button_cnc' | localize("CNC")}}</button>
|
||||
<button class="btn" :class="{'pressed': activeProd}" @click="clickProd()">{{'production_box_video_button_prod' | localize("PROD")}}</button>
|
||||
<button class="btn" v-if="isProdSftEnabled" :class="{'pressed': activeProd}" @click="clickProd()">{{'production_box_video_button_prod' | localize("PROD")}}</button>
|
||||
|
||||
</div>
|
||||
<div class="cnc" v-if="activeCnc || activeProd">
|
||||
<div class="cnc" v-if="activeCnc">
|
||||
<img id="cnc-img" src="assets/images/Siemens_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isSiemens()">
|
||||
<img id="cnc-img-fanuc" src="assets/images/Fanuc_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isFanuc()">
|
||||
<img id="cnc-img" src="assets/images/Osai_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isOsai()">
|
||||
<img id="cnc-img" src="assets/images/Demo_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isDemo()">
|
||||
</div>
|
||||
<div class="cnc" v-if="activeProd">
|
||||
<div id="prod-div" @click="closeAlarmsRibbon()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cms" v-if="activeCms">
|
||||
<card-production-cms></card-production-cms>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user