Merge remote-tracking branch 'CMS/develop' into develop
This commit is contained in:
@@ -48,6 +48,7 @@ namespace Thermo.Active.Core
|
||||
{
|
||||
Thread t = new Thread(() => ThreadSetupCmsConnect());
|
||||
t.Start();
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +65,8 @@ namespace Thermo.Active.Core
|
||||
threadFunction()
|
||||
);
|
||||
t.Start();
|
||||
// aggiungo pausa x evitare sovrapposizioni chiamate
|
||||
Thread.Sleep(50);
|
||||
// Add thread to running threads list
|
||||
lock (RunningThreadsList)
|
||||
RunningThreadsList.Add(t);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Thermo.Active.App_Start
|
||||
RequestPath = PathString.Empty,
|
||||
FileSystem = new PhysicalFileSystem(WEBSITE_DIRECTORY)
|
||||
};
|
||||
|
||||
|
||||
app.UseFileServer(options);
|
||||
if (!ServerPortIsAvailable(ServerStartupConfig.ServerPort))
|
||||
{
|
||||
@@ -106,12 +106,12 @@ namespace Thermo.Active.App_Start
|
||||
app.Map("/signalr", map =>
|
||||
{
|
||||
map.UseCors(CorsOptions.AllowAll);
|
||||
|
||||
//map.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()
|
||||
//{
|
||||
// Provider = new SignalROAuthBearerProvider(),
|
||||
// AuthenticationType = AUTHENTICATION_TYPE
|
||||
//});
|
||||
|
||||
map.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()
|
||||
{
|
||||
Provider = new SignalROAuthBearerProvider(),
|
||||
AuthenticationType = AUTHENTICATION_TYPE
|
||||
});
|
||||
var hubConfiguration = new HubConfiguration
|
||||
{
|
||||
Resolver = GlobalHost.DependencyResolver,
|
||||
|
||||
@@ -304,7 +304,6 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
|
||||
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
|
||||
context.Clients.Group("ncData").recipeFullData(diffData);
|
||||
//context.Clients.Group("ncData").recipeFullData(currRecipeFull);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +351,6 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
{
|
||||
GaugeModel currGauge = gaugeData as GaugeModel;
|
||||
|
||||
// FIXME TODO: usare un foreach comparer?
|
||||
if (!LastGaugeData.Equals(currGauge))
|
||||
{
|
||||
LastGaugeData = currGauge;
|
||||
@@ -433,6 +431,8 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
group.recipeModulesData(LastModulesData);
|
||||
// Send THERMO Warmers data
|
||||
group.recipeWarmersData(LastWarmersData);
|
||||
// THERMO Gauges
|
||||
group.gaugeData(LastGaugeData);
|
||||
|
||||
Debug.WriteLine(string.Format("{0} {1} Broadcast..completed", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"), DateTime.Now.Millisecond));
|
||||
Monitor.Exit(_broadcastlock);
|
||||
|
||||
@@ -31,4 +31,4 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("0.2.3")]
|
||||
[assembly: AssemblyVersion("0.3.2")]
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<script src="Scripts/jquery.mousewheel.js"></script>
|
||||
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
|
||||
<script src="Scripts/raphael-2.1.4.min.js"></script>
|
||||
<script src="http://10.74.82.72:9000/signalr/hubs"></script>
|
||||
<script src="http://127.0.0.1:9000/signalr/hubs"></script>
|
||||
|
||||
<link href="assets/styles/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -68,33 +68,47 @@ export class Hub {
|
||||
this._hub = $.connection.ncHub;
|
||||
$.connection.hub.url = (await CONFIGURATION).api.apiServerUrl + "/signalr";
|
||||
|
||||
$.connection.hub.error(function(error, exc) {
|
||||
console.log('SignalrAdapter: ' + error, exc);
|
||||
});
|
||||
|
||||
$.connection.hub.url="http://localhost:9000/signalr";
|
||||
|
||||
// debugger
|
||||
|
||||
try { $.connection.hub.logging = true; } catch{ }
|
||||
try { $.connection.ncHub.logging = true; } catch{ }
|
||||
|
||||
// Registro le callback;
|
||||
// this._hub.client.alarms = this.manageAlarmsCallbacks;
|
||||
this._hub.client.alarms = this.manageAlarmsCallbacks;
|
||||
this._hub.client.powerOn = this.managePowerCallbacks;
|
||||
// this._hub.client.ncNetworkStatus = Hub.manageNcStatus;
|
||||
// this._hub.client.processesData = Hub.manageProcesses;
|
||||
// this._hub.client.functionalityData = Hub.functionalityData;
|
||||
// this._hub.client.expiredMaintenances = Hub.expiredMaintenances;
|
||||
this._hub.client.ncNetworkStatus = Hub.manageNcStatus;
|
||||
this._hub.client.processesData = Hub.manageProcesses;
|
||||
this._hub.client.functionalityData = Hub.functionalityData;
|
||||
this._hub.client.expiredMaintenances = Hub.expiredMaintenances;
|
||||
|
||||
// this._hub.client.ncSoftKeys = Hub.ncSoftKeyChanged;
|
||||
// this._hub.client.userSoftKeys = Hub.userSoftKeyChanged;
|
||||
// this._hub.client.headsData = Hub.headsDataChanged;
|
||||
// this._hub.client.processesData = Hub.processDataChanged;
|
||||
// this._hub.client.axesNames = Hub.axesNamesDataChanged;
|
||||
// this._hub.client.axesPositions = Hub.axesPositionsDataChanged;
|
||||
// this._hub.client.magazinesStatus = Hub.magazineStatusChanged;
|
||||
// this._hub.client.activeProgramData = Hub.activeProgramData;
|
||||
this._hub.client.ncSoftKeys = Hub.ncSoftKeyChanged;
|
||||
this._hub.client.userSoftKeys = Hub.userSoftKeyChanged;
|
||||
this._hub.client.headsData = Hub.headsDataChanged;
|
||||
this._hub.client.processesData = Hub.processDataChanged;
|
||||
this._hub.client.axesNames = Hub.axesNamesDataChanged;
|
||||
this._hub.client.axesPositions = Hub.axesPositionsDataChanged;
|
||||
this._hub.client.magazinesStatus = Hub.magazineStatusChanged;
|
||||
this._hub.client.activeProgramData = Hub.activeProgramData;
|
||||
// this._hub.client.magazineIsActive = Hub.magazineIsActive;
|
||||
// this._hub.client.m155Data = Hub.m155Data;
|
||||
// this._hub.client.partProgramQueue = Hub.partProgramQueue;
|
||||
this._hub.client.m155Data = Hub.m155Data;
|
||||
this._hub.client.partProgramQueue = Hub.partProgramQueue;
|
||||
|
||||
// this._hub.client.scadaData = Hub.scadaDataChanged;
|
||||
// this._hub.client.cmsConnectGatewayRebbot = Hub.cmsConnectGatewayRebbot;
|
||||
this._hub.client.cmsConnectGatewayRebbot = Hub.cmsConnectGatewayRebbot;
|
||||
|
||||
// qui i NUOVI metodi NUOVI dal server (Recipe, gauges) da completare lato HUB
|
||||
// this._hub.client.recipeFullData = Hub.recipeFullData;
|
||||
// this._hub.client.recipeOverData = Hub.recipeOverData;
|
||||
// this._hub.client.modulesData = Hub.modulesData;
|
||||
// this._hub.client.warmersData = Hub.warmersData;
|
||||
// this._hub.client.gaugeData = Hub.gaugeData;
|
||||
|
||||
// sottoscrivere qui i metodi NUOVI dal server (Recipe, gauges)
|
||||
|
||||
this._hub.client.logout = this.logout;
|
||||
|
||||
@@ -109,7 +123,8 @@ export class Hub {
|
||||
Hub.manageServerStatus("disconnected");
|
||||
console.log("SERVER CONNECTION: restart-connection")
|
||||
setTimeout(function () {
|
||||
$.connection.hub.start({ transport: ['serverSentEvents'] });
|
||||
$.connection.hub.start();
|
||||
// $.connection.hub.start({ transport: ['serverSentEvents'] });
|
||||
}, 5000); // Restart connection after 5 seconds.
|
||||
});
|
||||
// $.connection.hub.stateChanged(async (state) => {
|
||||
@@ -122,7 +137,8 @@ export class Hub {
|
||||
// }
|
||||
// })
|
||||
|
||||
$.connection.hub.start({ transport: ['serverSentEvents'] });
|
||||
$.connection.hub.start();
|
||||
// $.connection.hub.start({ transport: ['serverSentEvents'] });
|
||||
|
||||
this.checkShowAxes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user