Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63e636cd36 | |||
| 1458a4cf5d | |||
| 6cf7331081 | |||
| 43402a785f | |||
| 88561778ce | |||
| 0d395fca33 | |||
| 09fea8f0e3 | |||
| 42531aac49 | |||
| bbfc3ca64d | |||
| 50e76bd30c | |||
| 6f6559ce67 | |||
| 5c2f69b8d2 |
@@ -4,7 +4,7 @@
|
||||
<ncVendor>S7NET</ncVendor>
|
||||
<!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI/S7NET -->
|
||||
<showNcHMI>false</showNcHMI>
|
||||
<ncIpAddress>192.168.214.1</ncIpAddress>
|
||||
<ncIpAddress>192.168.0.102</ncIpAddress>
|
||||
<ncPort>102</ncPort>
|
||||
<machineModel>Thermo 2020</machineModel>
|
||||
<sharedPath>C:\CMS\Recipes\</sharedPath>
|
||||
|
||||
@@ -193,34 +193,45 @@ public static class ThreadsFunctions
|
||||
StatReset();
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
CmsError libraryError = NO_ERROR;
|
||||
// Run loop until NC is connected
|
||||
while (!ncAdapter.numericalControl.NC_IsConnected())
|
||||
try
|
||||
{
|
||||
// Try reconnection
|
||||
libraryError = ncAdapter.Connect();
|
||||
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
|
||||
ManageLibraryError(libraryError);
|
||||
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
|
||||
// Run loop until NC is connected
|
||||
while (!ncAdapter.numericalControl.NC_IsConnected())
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
// Try reconnection
|
||||
libraryError = ncAdapter.Connect();
|
||||
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
|
||||
ManageLibraryError(libraryError);
|
||||
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
|
||||
// Send status to UI
|
||||
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
|
||||
// Send status to signalr
|
||||
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
|
||||
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
// Send status to UI
|
||||
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
|
||||
// Send status to signalr
|
||||
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
|
||||
if (!libraryError.IsError())
|
||||
{
|
||||
if (ServerStartupConfig.AutoOpenCmsClient)
|
||||
StartCMSClient();
|
||||
|
||||
Thread.Sleep(1000);
|
||||
// Start/Restart NC threads
|
||||
ThreadsHandler.StartWorkers();
|
||||
reconnectionIsRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!libraryError.IsError())
|
||||
catch (ThreadAbortException ex)
|
||||
{
|
||||
if (ServerStartupConfig.AutoOpenCmsClient)
|
||||
StartCMSClient();
|
||||
|
||||
// Start/Restart NC threads
|
||||
ThreadsHandler.StartWorkers();
|
||||
reconnectionIsRunning = false;
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +337,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -501,6 +516,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ManageWatchdog()
|
||||
@@ -547,6 +566,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadAlarms()
|
||||
@@ -591,6 +614,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadAreaData()
|
||||
@@ -633,6 +660,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -686,6 +717,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -735,6 +770,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadEnabledFunctionality()
|
||||
@@ -779,6 +818,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadExpiredMaintenances()
|
||||
@@ -833,6 +876,11 @@ public static class ThreadsFunctions
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -877,6 +925,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadM154Data()
|
||||
@@ -1051,6 +1103,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadMComandsData()
|
||||
@@ -1097,6 +1153,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadModulesData()
|
||||
@@ -1139,6 +1199,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadPowerOnData()
|
||||
@@ -1181,6 +1245,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadProcessesPPStatus()
|
||||
@@ -1227,6 +1295,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadProdCycleData()
|
||||
@@ -1270,6 +1342,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadProdInfoData()
|
||||
@@ -1313,6 +1389,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadProdPanelData()
|
||||
@@ -1356,6 +1436,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadRecipeData()
|
||||
@@ -1431,6 +1515,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadScadaData()
|
||||
@@ -1476,6 +1564,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadUserSoftKeysData()
|
||||
@@ -1520,6 +1612,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadWarmersData()
|
||||
@@ -1572,6 +1668,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void RestoreConnection()
|
||||
@@ -1665,6 +1765,10 @@ public static class ThreadsFunctions
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void StartCMSClient()
|
||||
|
||||
@@ -21,6 +21,12 @@ namespace Thermo.Active.Database.Controllers
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
@@ -80,11 +86,6 @@ namespace Thermo.Active.Database.Controllers
|
||||
return prodData;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get record by NumDone
|
||||
|
||||
@@ -2569,8 +2569,10 @@ namespace Thermo.Active.NC
|
||||
|
||||
ThermoModels.HistorySheet sheetRaw = new ThermoModels.HistorySheet();
|
||||
libraryError = numericalControl.PLC_RHistorySheets(ref sheetRaw);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
if(sheetRaw.newData)
|
||||
if (sheetRaw.newData)
|
||||
{
|
||||
|
||||
using (HistorySheetsController HSC = new HistorySheetsController())
|
||||
|
||||
@@ -47,6 +47,10 @@ namespace Thermo.Active.Utils
|
||||
{
|
||||
Log.Info(message);
|
||||
}
|
||||
public static void LogDebug(string message)
|
||||
{
|
||||
Log.Debug(message);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Security.Principal;
|
||||
using Thermo.Active.Config;
|
||||
using Thermo.Active.Database.Controllers;
|
||||
using Thermo.Active.Model.DatabaseModels;
|
||||
using Thermo.Active.Utils;
|
||||
using static Thermo.Active.Config.ServerConfig;
|
||||
using static Thermo.Active.Listeners.SignalRStaticObjects;
|
||||
using static Thermo.Active.Model.Constants;
|
||||
@@ -28,7 +29,11 @@ namespace Thermo.Active.Attributes
|
||||
// Find user session on this machine
|
||||
SessionModel session = sessionsController.FindSessionByToken(token);
|
||||
if (session == null)
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | AuthorizeHubConnection | session == null");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return base.AuthorizeHubConnection(hubDescriptor, request);
|
||||
@@ -39,11 +44,16 @@ namespace Thermo.Active.Attributes
|
||||
var connectionId = hubIncomingInvokerContext.Hub.Context.ConnectionId;
|
||||
var request = hubIncomingInvokerContext.Hub.Context.Request;
|
||||
var token = request.QueryString.Get("Authorization");
|
||||
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
// check authorization
|
||||
if (!CheckAuthorization(FunctionAccess, token, out int machineId, out int userId))
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | AuthorizeHubMethodInvocation | CheckAuthorization == false");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var claims = new ClaimsIdentity(AUTHENTICATION_TYPE);
|
||||
claims.AddClaim(new Claim(USER_ID_KEY, userId.ToString()));
|
||||
@@ -66,11 +76,17 @@ namespace Thermo.Active.Attributes
|
||||
// Find user session on this machine
|
||||
SessionModel session = sessionsController.FindSessionByToken(token);
|
||||
if (session == null)
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | session == null");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the machine is the same where the user logged in
|
||||
if (session.MachineUser.MachineId != MachineConfig.MachineId)
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | session.MachineUser.MachineId != MachineConfig.MachineId | " + session.MachineUser.MachineId + "," + MachineConfig.MachineId);
|
||||
return false;
|
||||
}
|
||||
|
||||
machineId = session.MachineUser.MachineId;
|
||||
userId = session.MachineUser.UserId;
|
||||
@@ -91,12 +107,18 @@ namespace Thermo.Active.Attributes
|
||||
if (Action == ACTIONS.READ)
|
||||
{ // Check read permissions
|
||||
if (functionAccess.ReadLevelMin > machineUser.Role.Level)
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess.ReadLevelMin > machineUser.Role.Level | " + functionAccess.ReadLevelMin + "," + machineUser.Role.Level);
|
||||
return false; // Not authorized
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Check write permissions
|
||||
if (functionAccess.WriteLevelMin > machineUser.Role.Level)
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess.WriteLevelMin > machineUser.Role.Level | " + functionAccess.WriteLevelMin + "," + machineUser.Role.Level);
|
||||
return false; // Not authorized
|
||||
}
|
||||
}
|
||||
|
||||
// Check if PLC bit exists
|
||||
@@ -105,13 +127,21 @@ namespace Thermo.Active.Attributes
|
||||
// Check if functionality is enabled by PLC
|
||||
var functionalityIsEnabled = LastRuntimeFunctionality.Where(x => x.Name == functionName).FirstOrDefault();
|
||||
if (functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false)
|
||||
return false;
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false | " + functionalityIsEnabled + "," + functionalityIsEnabled.Enabled);
|
||||
return false; // Not authorized
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess != null && ServerConfigController.CheckAreaStatus(functionAccess.Area) | " + functionAccess + "," + functionAccess.Area);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Authorized
|
||||
ThermoActiveLogger.LogInfo($"SignalRAuthorizeAttribute | CheckAuthorization | Authorized | ");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,14 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/maintenance_manager")]
|
||||
public class ApiMaintenanceController : ApiController
|
||||
public class ApiMaintenanceController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("maintenances"), HttpGet]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.READ)]
|
||||
|
||||
@@ -10,7 +10,7 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/authorization")]
|
||||
public class AuthorizationController : ApiController
|
||||
public class AuthorizationController : ApiController
|
||||
{
|
||||
[Route("functions"), HttpGet]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.GENERAL, Action = ACTIONS.READ)]
|
||||
|
||||
@@ -13,12 +13,14 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/user_softkey")]
|
||||
public class FavoriteUserSoftkeyController : ApiController
|
||||
public class FavoriteUserSoftkeyController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
|
||||
[Route("favorite"), HttpGet]
|
||||
|
||||
@@ -12,12 +12,14 @@ using static Thermo.Active.Utils.LanguageController;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/language")]
|
||||
public class LanguageController : ApiController
|
||||
public class LanguageController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("languages"), HttpGet]
|
||||
public IHttpActionResult GetLanguageList()
|
||||
|
||||
@@ -8,12 +8,14 @@ using Thermo.Active.Utils;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/ModBlock")]
|
||||
public class ModulesController : ApiController
|
||||
public class ModulesController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("current"), HttpGet]
|
||||
public IHttpActionResult GetCurrentModules()
|
||||
|
||||
@@ -8,13 +8,15 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/nc")]
|
||||
public class NcApiController : ApiController
|
||||
public class NcApiController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
#endif
|
||||
[Route("generic_data"), HttpGet]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.NC_DATA, Action = ACTIONS.READ)]
|
||||
public IHttpActionResult GetNcGenericData()
|
||||
|
||||
@@ -11,13 +11,16 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/prod")]
|
||||
public class ProdController : ApiController
|
||||
public class ProdController : aBaseApiController //ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Request mode SETUP
|
||||
/// </summary>
|
||||
|
||||
@@ -26,12 +26,14 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/recipe")]
|
||||
public class RecipeController : ApiController
|
||||
public class RecipeController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("overview"), HttpGet]
|
||||
public IHttpActionResult GetOverview()
|
||||
|
||||
@@ -13,12 +13,14 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
|
||||
[RoutePrefix("api/scada")]
|
||||
public class ScadaController : ApiController
|
||||
public class ScadaController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("list"), HttpGet]
|
||||
public IHttpActionResult GetScadaList()
|
||||
|
||||
@@ -8,12 +8,14 @@ using Thermo.Active.Utils;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/starred_softkey")]
|
||||
public class StarredUserSoftKeyController : ApiController
|
||||
public class StarredUserSoftKeyController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
[Route("get"), HttpGet]
|
||||
public IHttpActionResult GetStarredUserSoftkey()
|
||||
|
||||
@@ -29,12 +29,15 @@ using static Thermo.Active.Model.Constants;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/underthehood")]
|
||||
public class UnderTheHoodController : ApiController
|
||||
public class UnderTheHoodController : aBaseApiController // ApiController
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
|
||||
[ResponseType(typeof(DTOCycleLog))]
|
||||
[Route("CycleLogRefresh"), HttpGet]
|
||||
|
||||
@@ -18,14 +18,16 @@ using System.Linq;
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
[RoutePrefix("api/warmers")]
|
||||
public class WarmersController : ApiController
|
||||
public class WarmersController : aBaseApiController // ApiController
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
#endif
|
||||
|
||||
protected static Dictionary<int, ThermoPoint> MeasurePoints = new Dictionary<int, ThermoPoint>();
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using Thermo.Active.NC;
|
||||
|
||||
namespace Thermo.Active.Controllers.WebApi
|
||||
{
|
||||
public class aBaseApiController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto adapter condiviso da WebAPI
|
||||
/// </summary>
|
||||
protected static NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
#if false
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (ncAdapter != null)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,4 +30,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("1.1.185")]
|
||||
[assembly: AssemblyVersion("1.1.186")]
|
||||
|
||||
@@ -222,6 +222,7 @@
|
||||
<Compile Include="Attributes\WebApiAuthorizeAttribute.cs" />
|
||||
<Compile Include="Attributes\SignalRAuthorizeAttribute.cs" />
|
||||
<Compile Include="Controllers\SignalR\NcHub.cs" />
|
||||
<Compile Include="Controllers\WebApi\aBaseApiController.cs" />
|
||||
<Compile Include="Controllers\WebApi\ApiAlarmController.cs" />
|
||||
<Compile Include="Controllers\WebApi\UnderTheHoodController.cs" />
|
||||
<Compile Include="Controllers\WebApi\SchedTaskController.cs" />
|
||||
|
||||
@@ -119,6 +119,9 @@ namespace Thermo.Active
|
||||
ListenersHandler.Stop();
|
||||
// Close WinForm
|
||||
ServerControlWindow.Stop();
|
||||
|
||||
// force close
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private static bool ValidateAddress(string Addr)
|
||||
|
||||
+2
-2
@@ -42,8 +42,8 @@ export default class SVGCaricatore extends Vue{
|
||||
minoreuguale:string="<=";
|
||||
|
||||
getPositionSheet(id,col){
|
||||
var vent = ((this.larghTelaioSVG + (this.dimVentose*2)) / (this.numVentose +1));
|
||||
var posX = (id*vent ) - (this.dimVentose*2);
|
||||
var vent = (this.larghTelaioSVG - (this.dimVentose*2)) / (this.numVentose -1);
|
||||
var posX = (id-1)*vent;
|
||||
if(col == 1)
|
||||
return "translate(-630 -147) translate(50 25) translate(580 122) translate(0 70) translate(0 0) translate("+ posX + ")";
|
||||
else if(col == 2)
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
.bitSelect .form.error {
|
||||
outline: 2px #d0021b auto !important;
|
||||
}
|
||||
.bitSelect .form.disabled {
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.bitSelect .form i {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
|
||||
@@ -19,6 +19,16 @@
|
||||
padding-right: 25px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&.error{
|
||||
outline: 2px #d0021b auto !important;
|
||||
}
|
||||
|
||||
&.disabled{
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
|
||||
i {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
|
||||
@@ -23,6 +23,13 @@ export default class bitSelect extends Vue {
|
||||
this.value.setpointHMI = v;
|
||||
}
|
||||
|
||||
openclose(){
|
||||
if(!this.value || !this.value.status || !this.value.status.enabled)
|
||||
return
|
||||
|
||||
this.opened = !this.opened
|
||||
}
|
||||
|
||||
get currentValue() {
|
||||
let result = []
|
||||
for (let index = 0; index < this.bitSize; index++) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="bitSelect">
|
||||
<div
|
||||
class="form"
|
||||
@click="opened = !opened"
|
||||
@click="openclose"
|
||||
:class="{'error': value && value.status && value.status.hasError, 'disabled': value && value.status && !value.status.enabled}"
|
||||
>
|
||||
{{currentValue}}
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ export default class outputRow extends Vue {
|
||||
async force(value: number) {
|
||||
if(!this.item.isForced && (this.item.forcedValue === undefined || value != this.item.forcedValue))
|
||||
{
|
||||
ModalHelper.AskConfirm( this.$options.filters.localize("Richiesta di conferma","modal_confirm_title"),
|
||||
this.$options.filters.localize("Confirm?","softkey_confirm"),
|
||||
ModalHelper.AskConfirm( this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"),
|
||||
this.$options.filters.localize("softkey_confirm", "Confirm?"),
|
||||
async() => {
|
||||
await underTheHoodService.forceChannel(this.group, this.item, value);
|
||||
}, null, "modal");
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
}
|
||||
.main-container th.lastre-recipe,
|
||||
.main-container td.lastre-recipe {
|
||||
width: 30%;
|
||||
width: 20%;
|
||||
}
|
||||
.main-container th.lastre-numpezzo,
|
||||
.main-container td.lastre-numpezzo {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
.main-container th.lastre-type,
|
||||
.main-container td.lastre-type {
|
||||
width: 10%;
|
||||
width: 20%;
|
||||
}
|
||||
.main-container th.lastre-value,
|
||||
.main-container td.lastre-value {
|
||||
|
||||
+2
-2
@@ -11,13 +11,13 @@
|
||||
width: 20%;
|
||||
}
|
||||
&.lastre-recipe {
|
||||
width: 30%;
|
||||
width: 20%;
|
||||
}
|
||||
&.lastre-numpezzo {
|
||||
width: 10%;
|
||||
}
|
||||
&.lastre-type {
|
||||
width: 10%;
|
||||
width: 20%;
|
||||
}
|
||||
&.lastre-value {
|
||||
width: 30%;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
<td>{{item.recipeName}}</td>
|
||||
<td class="left">{{item.numDone}}</td>
|
||||
<td class="left">{{convertType(item.typeVal)}}</td>
|
||||
<td class="left">{{item.firstVal}} [{{item.secondVal}}, {{item.thirdVal}}]</td>
|
||||
<td class="left">{{item.firstVal | round(1)}} [{{item.secondVal | round(1)}}, {{item.thirdVal | round(1)}}]</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user