Fix Siemens HN Behaviour

This commit is contained in:
Nicola Carminati
2018-07-12 10:16:41 +02:00
parent 79d78bae86
commit 266dff6e8f
3 changed files with 33 additions and 18 deletions
+9 -2
View File
@@ -151,8 +151,15 @@ namespace CMS_Client.Browser_Tools
if (val < 0 || val > (NcWindow.NcWindowCommand.Count - 1))
return;
NcWindow.SendCommandKey(NcWindow.NcWindowCommand[val]);
NcWindow.SendCommandKey(NcWindow.NcWindowCommand[val]);
if (NcWindow.State == NcState.SHOW)
{
Thread.Sleep(1000);
mainForm.HideNCWindow();
mainForm.ShowNCWindow();
NcWindow.ActivateNcWindow();
}
}
//Get command vounts to HMI
+19 -16
View File
@@ -87,14 +87,17 @@ namespace CMS_Client.View
if (this.WindowState == FormWindowState.Minimized)
{
NcWindow.ShowTaskBar();
if (Config.VendorHmiConfig.Enabled)
NcFrm.Hide();
//if (Config.VendorHmiConfig.Enabled)
//NcFrm.Hide();
}
else
{
NcWindow.ShowNcWindow();
if (Config.VendorHmiConfig.Enabled)
NcFrm.Show();
if (Config.VendorHmiConfig.Enabled)
{
HideNCWindow();
ShowNCWindow();
}
}
//Refresh Browser Paint
@@ -515,9 +518,9 @@ namespace CMS_Client.View
{
this.Owner = null;
this.NcFrm.Owner = this;
this.NcFrm.TopMost = true;
this.NcFrm.TopMost = false;
}
}
this.NcFrm.TopMost = true;
this.NcFrm.TopMost = false;
});
else
@@ -526,9 +529,9 @@ namespace CMS_Client.View
{
this.Owner = null;
this.NcFrm.Owner = this;
this.NcFrm.TopMost = true;
this.NcFrm.TopMost = false;
}
}
this.NcFrm.TopMost = true;
this.NcFrm.TopMost = false;
}
}
@@ -551,9 +554,9 @@ namespace CMS_Client.View
if (this.NcFrm.Owner != null)
{
this.NcFrm.Owner = null;
this.TopMost = true;
this.TopMost = false;
}
}
this.TopMost = true;
this.TopMost = false;
});
else
@@ -561,9 +564,9 @@ namespace CMS_Client.View
if (this.NcFrm.Owner != null)
{
this.NcFrm.Owner = null;
this.TopMost = true;
this.TopMost = false;
}
}
this.TopMost = true;
this.TopMost = false;
}
}
}
+5
View File
@@ -524,6 +524,11 @@ namespace CMS_Client.View
SendKeys.SendWait(CMD);
}
}
public static void ActivateNcWindow()
{
SetForegroundWindow(ncprocess.MainWindowHandle);
}
#endregion
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////