Refactoring: MODELS

This commit is contained in:
Samuele Locatelli
2020-06-19 19:06:02 +02:00
parent 50c4d72464
commit 5d3edf46c6
18 changed files with 42 additions and 32 deletions
+4 -1
View File
@@ -22,7 +22,10 @@ using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
public static class ThreadsFunctions
{
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThModules
{
public class DTOModule
{
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThModules
{
public class DTOModuleConfigModel
{
@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThModules
{
public class DTOModulesBlock
{
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.ThermoProd
namespace Thermo.Active.Model.DTOModels.ThProd
{
public enum Status
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Thermo.Active.Model.ConfigModels;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThRecipe
{
public class DTORecipeConfigModel
{
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThRecipe
{
[JsonConverter(typeof(StringEnumConverter))]
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThRecipe
{
public class DTORecipeParam
{
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
namespace Thermo.Active.Model.DTOModels.ThWarmers
{
public class DTOWarmers
{
+9 -11
View File
@@ -105,12 +105,12 @@
<Compile Include="DTOModels\DTOAxesModel.cs" />
<Compile Include="DTOModels\DTOAxisNameModel.cs" />
<Compile Include="DTOModels\DTOClientConfigurationModel.cs" />
<Compile Include="DTOModels\Recipe\DTOModule.cs" />
<Compile Include="DTOModels\Recipe\DTOModuleConfigModel.cs" />
<Compile Include="DTOModels\Recipe\DTOModulesBlock.cs" />
<Compile Include="DTOModels\Recipe\DTOWarmers.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeParam.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeConfigModel .cs" />
<Compile Include="DTOModels\ThModules\DTOModule.cs" />
<Compile Include="DTOModels\ThModules\DTOModuleConfigModel.cs" />
<Compile Include="DTOModels\ThModules\DTOModulesBlock.cs" />
<Compile Include="DTOModels\ThWarmers\DTOWarmers.cs" />
<Compile Include="DTOModels\ThRecipe\DTORecipeParam.cs" />
<Compile Include="DTOModels\ThRecipe\DTORecipeConfigModel .cs" />
<Compile Include="DTOModels\DTONetworkMonitor.cs" />
<Compile Include="DTOModels\DTOCmsConnectGateway.cs" />
<Compile Include="DTOModels\JobModels\DTOGenericParamModel.cs" />
@@ -120,7 +120,7 @@
<Compile Include="DTOModels\DTOQueueModel.cs" />
<Compile Include="DTOModels\JobModels\DTOMetadataFieldsModel.cs" />
<Compile Include="DTOModels\JobModels\DTOMetadataModel.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeOverview.cs" />
<Compile Include="DTOModels\ThRecipe\DTORecipeOverview.cs" />
<Compile Include="DTOModels\Scada\DTOScadaModel.cs" />
<Compile Include="DTOModels\Scada\ScadaSchemaModel.cs" />
<Compile Include="DTOModels\MaintenanceModels\DTOExpiredMaintenanceModel.cs" />
@@ -143,7 +143,7 @@
<Compile Include="DTOModels\MaintenanceModels\DTOMaintenanceNoteModel.cs" />
<Compile Include="DTOModels\MaintenanceModels\DTONewMaintenanceModel.cs" />
<Compile Include="DatabaseModels\MaintenanceNoteModel.cs" />
<Compile Include="DTOModels\ThermoProd\DTOProdCycle.cs" />
<Compile Include="DTOModels\ThProd\DTOProdCycle.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DatabaseModels\UserModel.cs">
<Generator>DtsGenerator</Generator>
@@ -169,9 +169,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="DTOModels\ThermoModules\" />
<Folder Include="DTOModels\ThermoRecipe\" />
<Folder Include="DTOModels\ThermoWarmers\" />
<Folder Include="DTOModels\Recipe\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
+5 -2
View File
@@ -22,7 +22,10 @@ using System.Text.RegularExpressions;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
namespace Thermo.Active.NC
{
@@ -1478,7 +1481,7 @@ namespace Thermo.Active.NC
/// Gestione strobe richiesta cambio modo
/// </summary>
/// <returns></returns>
public CmsError StrobeMode(Model.DTOModels.ThermoProd.Mode mode)
public CmsError StrobeMode(Model.DTOModels.ThProd.Mode mode)
{
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
@@ -8,7 +8,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using static Thermo.Active.Config.ServerConfig;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThRecipe;
namespace Thermo.Active.Controllers.WebApi
{
@@ -12,7 +12,7 @@ using System.Web.Http;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Utils;
namespace Thermo.Active.Controllers.WebApi
@@ -12,7 +12,7 @@ using System.Web.Http;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Config;
using Thermo.Active.Utils;
@@ -40,7 +40,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThermoProd.Mode.MANUAL);
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThProd.Mode.MANUAL);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"RequestManual error | {libraryError.exception}");
@@ -69,7 +69,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThermoProd.Mode.AUTO);
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThProd.Mode.AUTO);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"RequestAuto error | {libraryError.exception}");
@@ -98,7 +98,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThermoProd.Mode.SETUP);
libraryError = ncAdapter.StrobeMode(Model.DTOModels.ThProd.Mode.SETUP);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"RequestSetup error | {libraryError.exception}");
@@ -12,7 +12,8 @@ using System.Web.Http;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.Config;
using Thermo.Active.Utils;
@@ -12,7 +12,7 @@ using System.Web.Http;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.Config;
using Thermo.Active.Utils;
@@ -14,7 +14,10 @@ using System.Threading;
using static Thermo.Active.Listeners.SignalRStaticObjects;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Config.ServerConfig;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.ThermoModels;
using System.Threading.Tasks;
@@ -2,7 +2,9 @@
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using System.Collections.Generic;
using Thermo.Active.Model.DTOModels.Recipe;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using CMS_CORE_Library.Models;
namespace Thermo.Active.Listeners