Added close method SignalR

This commit is contained in:
Nicola Carminati
2019-04-17 15:24:04 +02:00
parent e504daa532
commit 86f85b051b
5 changed files with 21 additions and 19 deletions
+2 -12
View File
@@ -162,17 +162,7 @@ namespace Active_Client.View
//Close the NC HMI && Stop Following Nc
if (Config.VendorHmiConfig.Enabled)
NcWindow.CloseNcWindow(false);
//Close Server
if (Config.ClientConfig.Autorun)
{
Process[] proc = Process.GetProcessesByName("Active");
foreach (Process p in proc)
{
p.Kill();
p.WaitForExit();
}
}
if (Config.ProdSoftwareConfig.Enabled)
NcWindow.CloseProdWindow(false);
@@ -189,7 +179,7 @@ namespace Active_Client.View
}
}
//Before closing the Window -> Remove the Browser (Increase the speed of closing window)
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
+7 -7
View File
@@ -90,7 +90,7 @@ namespace Step.UI
this.StopServerItem});
this.NotifyIconMenu.Name = "NotifyIconMenu";
this.NotifyIconMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.NotifyIconMenu.Size = new System.Drawing.Size(181, 76);
this.NotifyIconMenu.Size = new System.Drawing.Size(175, 54);
//
// adminMachineToolStripMenuItem
//
@@ -101,7 +101,7 @@ namespace Step.UI
this.resetSpindleHoursToolStripMenuItem,
this.resetCountersToolStripMenuItem});
this.adminMachineToolStripMenuItem.Name = "adminMachineToolStripMenuItem";
this.adminMachineToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.adminMachineToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.adminMachineToolStripMenuItem.Text = "Service";
//
// passwordToolStripMenuItem
@@ -146,12 +146,12 @@ namespace Step.UI
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(171, 6);
//
// StopServerItem
//
this.StopServerItem.Name = "StopServerItem";
this.StopServerItem.Size = new System.Drawing.Size(180, 22);
this.StopServerItem.Size = new System.Drawing.Size(174, 22);
this.StopServerItem.Text = "Close Active Server";
this.StopServerItem.Click += new System.EventHandler(this.StopServerItem_Click);
//
@@ -352,14 +352,14 @@ namespace Step.UI
// closeCMSServerToolStripMenuItem
//
this.closeCMSServerToolStripMenuItem.Name = "closeCMSServerToolStripMenuItem";
this.closeCMSServerToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.closeCMSServerToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.closeCMSServerToolStripMenuItem.Text = "Close Active Server";
this.closeCMSServerToolStripMenuItem.Click += new System.EventHandler(this.closeCMSServerToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(171, 6);
//
// serviceToolStripMenuItem
//
@@ -370,7 +370,7 @@ namespace Step.UI
this.resetSpindleHoursToolStripMenuItem1,
this.resetCountersToolStripMenuItem1});
this.serviceToolStripMenuItem.Name = "serviceToolStripMenuItem";
this.serviceToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.serviceToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.serviceToolStripMenuItem.Text = "Service";
//
// passwordToolStripMenuItem1
+6
View File
@@ -234,6 +234,12 @@ namespace Step.Controllers.SignalR
if (cmsError.IsError())
throw new HubException(cmsError.localizationKey);
}
}
public void QuitServerApp()
{
if (ServerStartupConfig.AutoOpenCmsClient)
MessageServices.Current.Publish(SEND_STOP_SERVER);
}
}
}
+2
View File
@@ -18,6 +18,7 @@ import { DEBUG_CONFIGURATION, USE_RUNTIME_CONFIGURATION } from "./config";
import { ModalHelper } from "./components/modals";
import Vue from "vue";
import { scadaService } from "./services/scadaService";
import { Hub } from "./services";
declare let cmsClient: any;
let HMIvisible = false;
@@ -126,6 +127,7 @@ if (typeof cmsClient != "undefined") {
Vue.filter('localize')("modal_confirm_close_application", "Sei sicuro di voler chiudere l'applicazione?"),
() => {
messageService.publishToChannel("close-scada");
Hub.Current.QuitServerApp();
cmsClient.closeForm();
},null ,'modal');
}
+4
View File
@@ -426,6 +426,10 @@ export class Hub {
this._hub.server.selectAxis(id);
}
public QuitServerApp() {
this._hub.server.quitServerApp();
}
public Hello() {
this._hub.server.hello();
}