Merge branch 'develop' into Testing/NuGetDll

This commit is contained in:
Samuele Locatelli
2021-04-23 18:27:39 +02:00
10 changed files with 597 additions and 153 deletions
+45 -21
View File
@@ -1,32 +1,56 @@
Public Module ConstMachComm
Public Enum ResultTypes
EXECUTED
RESULT
Public Enum ResultTypes As Integer
NULL = 0
EXECUTED = 1
RESULT = 2
End Enum
Public Enum CommandTypes As Integer
ERROR_ = 0
CONNECT = 1
DISCONNECT = 2
START = 3
SOFTSTART = 4
STOP_ = 5
RESET = 6
STEP_ = 7
SETPOINT = 8
SENDPROG = 9
REMOVEPROG = 10
REMOVEALLPROG = 11
READ = 12
WRITE = 13
DELETEALARMS = 14
SETOP = 15
ERROR_ = 1
CONNECT = 2
DISCONNECT = 3
START = 4
SOFTSTART = 5
STOP_ = 6
RESET = 7
STEP_ = 8
SETPOINT = 9
SENDPROG = 10
REMOVEPROG = 11
REMOVEALLPROG = 12
READ = 13
WRITE = 14
DELETEALARMS = 15
SETOP = 16
End Enum
Public Enum LogCommandTypes As Integer
NULL = 0
ERROR_ = 1
CONNECT = 2
DISCONNECT = 3
START = 4
SOFTSTART = 5
STOP_ = 6
RESET = 7
STEP_ = 8
SETPOINT = 9
SENDPROG = 10
REMOVEPROG = 11
REMOVEALLPROG = 12
READ = 13
WRITE = 14
DELETEALARMS = 15
SETOP = 16
ALARM = 17
NEWOP = 18
End Enum
Public Enum CommandStates As Integer
ERROR_ = 0
OK = 1
NULL = 0
ERROR_ = 1
OK = 2
End Enum
End Module
+169 -52
View File
@@ -1,61 +1,178 @@
Public Class MachLog
Private m_CommandType As CommandTypes
Private m_CommandState As CommandStates
Private m_ResultType As ResultTypes
Private m_Description As String
Private m_AlarmOperation As Integer
Private m_AlarmType As Integer
Private m_AlarmMessage As String
Private m_AlarmCode As String
Private m_AlarmDateTime As String
Private m_newOpState As Integer
Private m_CommandExecutedCorrectly As Boolean
Private m_VarAddress As String
Private m_VarValue As String
#Region "Private Fields"
Public Delegate Sub ResultCallbackDlg(CommandType As CommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
Public Delegate Sub AlarmCallbackDlg(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
Public Delegate Sub OpStateCallbackDlg(newOpState As Integer)
Public Delegate Sub ReadVarCallbackDlg(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
Private m_AlarmCode As String
Private m_AlarmDateTime As Date
Private m_AlarmMessage As String
Private m_AlarmOperation As Integer
Private m_AlarmType As Integer
Private m_CommandExecutedCorrectly As Boolean
Private m_CommandState As CommandStates
Private m_CommandType As LogCommandTypes
Private m_Description As String
Protected Sub New()
End Sub
Private m_newOpState As Integer
Friend Shared Function CreateResultLog(CommandType As CommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_CommandState = CommandState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_Description = Description
Return NewMachLog
End Function
Private m_ResultType As ResultTypes
Friend Shared Function CreateAlarmLog(CommandType As CommandTypes, AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmCode = AlarmCode
NewMachLog.m_AlarmDateTime = AlarmDateTime
Return NewMachLog
End Function
Private m_VarAddress As String
Friend Shared Function CreateOPStateLog(CommandType As CommandTypes, newOpState As Integer)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_newOpState = newOpState
Return NewMachLog
End Function
Private m_VarValue As String
Friend Shared Function CreateAlarmLog(CommandType As CommandTypes, CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_AlarmOperation = CommandExecutedCorrectly
NewMachLog.m_AlarmType = VarAddress
NewMachLog.m_AlarmMessage = VarValue
Return NewMachLog
End Function
#End Region
End Class
#Region "Protected Constructors"
Protected Sub New()
End Sub
#End Region
#Region "Public Properties"
Public ReadOnly Property AlarmCode As String
Get
Return m_AlarmCode
End Get
End Property
Public ReadOnly Property AlarmDateTime As Date
Get
Return m_AlarmDateTime
End Get
End Property
Public ReadOnly Property AlarmMessage As String
Get
Return m_AlarmMessage
End Get
End Property
Public ReadOnly Property AlarmOperation As Integer
Get
Return m_AlarmOperation
End Get
End Property
Public ReadOnly Property AlarmType As Integer
Get
Return m_AlarmType
End Get
End Property
Public ReadOnly Property CommandExecutedCorrectly As Boolean
Get
Return m_CommandExecutedCorrectly
End Get
End Property
Public ReadOnly Property CommandState As CommandStates
Get
Return m_CommandState
End Get
End Property
Public ReadOnly Property CommandType As LogCommandTypes
Get
Return m_CommandType
End Get
End Property
Public ReadOnly Property Description As String
Get
Return m_Description
End Get
End Property
Public ReadOnly Property newOpState As Integer
Get
Return m_newOpState
End Get
End Property
Public ReadOnly Property ResultType As ResultTypes
Get
Return m_ResultType
End Get
End Property
Public ReadOnly Property VarAddress As String
Get
Return m_VarAddress
End Get
End Property
Public ReadOnly Property VarValue As String
Get
Return m_VarValue
End Get
End Property
#End Region
#Region "Internal Methods"
Friend Shared Function CreateAlarmLog(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.ALARM
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmCode = AlarmCode
NewMachLog.m_AlarmDateTime = AlarmDateTime
Return NewMachLog
End Function
Friend Shared Function CreateOPStateLog(newOpState As Integer)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.NEWOP
NewMachLog.m_newOpState = newOpState
Return NewMachLog
End Function
Friend Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandTypes.READ
NewMachLog.m_AlarmOperation = CommandExecutedCorrectly
NewMachLog.m_AlarmType = VarAddress
NewMachLog.m_AlarmMessage = VarValue
Return NewMachLog
End Function
Friend Shared Function CreateResultLog(CommandType As LogCommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_CommandState = CommandState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_Description = Description
Return NewMachLog
End Function
#End Region
#Region "Public Methods"
Public Shared Function CreateMacLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
Dim NewMachLog As New MachLog
NewMachLog.m_AlarmCode = AlarmCode
NewMachLog.m_AlarmDateTime = AlarmDateTime
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
NewMachLog.m_CommandState = CommandState
NewMachLog.m_CommandType = CommandType
NewMachLog.m_Description = Description
NewMachLog.m_newOpState = newOpState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_VarAddress = VarAddress
NewMachLog.m_VarValue = VarValue
Return NewMachLog
End Function
#End Region
End Class
@@ -26,29 +26,61 @@ namespace EgtBEAMWALL.DataLayer.Controllers
#region Public Methods
/// <summary>
/// Conversion of base class to DB model class
/// </summary>
/// <param name="coreMacLog"></param>
/// <returns></returns>
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
{
LogMachineModel answ = new LogMachineModel();
if (coreMacLog != null)
{
answ = new LogMachineModel()
{
AlarmCode = coreMacLog.AlarmCode,
AlarmDatetime = coreMacLog.AlarmDateTime,
AlarmMessage = coreMacLog.AlarmMessage,
AlarmOperation = coreMacLog.AlarmOperation,
AlarmType = coreMacLog.AlarmType,
CommandExecutedCorrectly = coreMacLog.CommandExecutedCorrectly,
CommandState = coreMacLog.CommandState,
CommandType = coreMacLog.CommandType,
Description = coreMacLog.Description,
NewOpState = coreMacLog.newOpState,
ResultType = coreMacLog.ResultType,
VarAddress = coreMacLog.VarAddress,
VarValue = coreMacLog.VarValue
};
}
return answ;
}
/// <summary>
/// Conversion from DB to Core class
/// </summary>
/// <param name="dbLog"></param>
/// <returns></returns>
public static Core.MachLog ConvertToCore(LogMachineModel dbLog)
{
var newRecord = Core.MachLog.CreateMacLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
return newRecord;
}
/// <summary>
/// Create machine LOG record
/// </summary>
/// <param name="machineId"></param>
/// <param name="dtCreated"></param>
/// <param name="fileName"></param>
/// <param name="dtExported"></param>
/// <param name="sn"></param>
/// <param name="description"></param>
/// <param name="eventType"></param>
/// <param name="message"></param>
/// <param name="value"></param>
/// <param name="newLogMac"></param>
/// <returns></returns>
public bool Create(string machineId, DateTime dtCreated, string fileName, DateTime dtExported, int sn, string description, Core.EventType eventType, string message, double value)
public bool Create(LogMachineModel newLogMac)
{
bool fatto = false;
try
{
try
{
LogMachineModel newItem = new LogMachineModel() { MachineId = machineId, DtEvent = dtCreated, CncFileName = fileName, DtExported = dtExported, SN = sn, Description = description, EventType = eventType, Message = message, Value = value };
// Add to database
dbCtx.LogMachineList.Add(newItem);
dbCtx.LogMachineList.Add(newLogMac);
// Commit changes
dbCtx.SaveChanges();
}
@@ -62,6 +94,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return fatto;
}
/// <summary>
/// Create machine LOG record (da modello dati CORE)
/// </summary>
/// <param name="newLogMac"></param>
/// <returns></returns>
public bool Create(Core.MachLog newMachLog)
{
var dbLogModel = ConvertFromCore(newMachLog);
return Create(dbLogModel);
}
/// <summary>
/// Delete by key
/// </summary>
@@ -113,13 +156,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogMachineModel> GetPaginatedAsc(DateTime dtStart, DateTime dtEnd)
public List<LogMachineModel> GetAsc(DateTime dtStart, DateTime dtEnd)
{
// retrieve
return dbCtx
.LogMachineList
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
.OrderBy(x => x.DtEvent)
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
.OrderBy(x => x.AlarmDatetime)
.ToList();
}
@@ -129,13 +172,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogMachineModel> GetPaginatedDesc(DateTime dtStart, DateTime dtEnd)
public List<LogMachineModel> GetDesc(DateTime dtStart, DateTime dtEnd)
{
// retrieve
return dbCtx
.LogMachineList
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
.OrderByDescending(x => x.DtEvent)
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
.OrderByDescending(x => x.AlarmDatetime)
.ToList();
}
@@ -107,6 +107,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return answ;
}
#if false
/// <summary>
/// Conversion of base class to DB model class
/// </summary>
@@ -136,6 +137,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
}
return answ;
}
#endif
/// <summary>
/// Create record on DB
+29 -21
View File
@@ -11,7 +11,7 @@ using System.Data.Entity.Infrastructure.MappingViews;
[assembly: DbMappingViewCacheTypeAttribute(
typeof(EgtBEAMWALL.DataLayer.DatabaseContext),
typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySetsa95a868b62cc753257f94e9de93da89a15deb865d6b60b5e975a50d917c6ee74))]
typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySets991d60e8c06fb7a14542a1fa467435dadb8759ce92cff08ef069c8042ed59eec))]
namespace Edm_EntityMappingGeneratedViews
{
@@ -23,14 +23,14 @@ namespace Edm_EntityMappingGeneratedViews
/// Implements a mapping view cache.
/// </summary>
[GeneratedCode("Entity Framework 6 Power Tools", "0.9.2.0")]
internal sealed class ViewsForBaseEntitySetsa95a868b62cc753257f94e9de93da89a15deb865d6b60b5e975a50d917c6ee74 : DbMappingViewCache
internal sealed class ViewsForBaseEntitySets991d60e8c06fb7a14542a1fa467435dadb8759ce92cff08ef069c8042ed59eec : DbMappingViewCache
{
/// <summary>
/// Gets a hash value computed over the mapping closure.
/// </summary>
public override string MappingHashValue
{
get { return "a95a868b62cc753257f94e9de93da89a15deb865d6b60b5e975a50d917c6ee74"; }
get { return "991d60e8c06fb7a14542a1fa467435dadb8759ce92cff08ef069c8042ed59eec"; }
}
/// <summary>
@@ -404,19 +404,23 @@ namespace Edm_EntityMappingGeneratedViews
{
return new DbMappingView(@"
SELECT VALUE -- Constructing LogMachineModel
[CodeFirstDatabaseSchema.LogMachineModel](T1.LogMachineModel_DbId, T1.LogMachineModel_CncFileName, T1.LogMachineModel_Description, T1.LogMachineModel_DtEvent, T1.LogMachineModel_DtExported, T1.LogMachineModel_EventType, T1.LogMachineModel_MachineId, T1.LogMachineModel_Message, T1.LogMachineModel_SN, T1.LogMachineModel_Value)
[CodeFirstDatabaseSchema.LogMachineModel](T1.LogMachineModel_DbId, T1.LogMachineModel_AlarmCode, T1.LogMachineModel_AlarmDtEvent, T1.LogMachineModel_AlarmMessage, T1.LogMachineModel_AlarmOperation, T1.LogMachineModel_AlarmType, T1.LogMachineModel_CommExecuted, T1.LogMachineModel_CommandState, T1.LogMachineModel_CommandType, T1.LogMachineModel_Description, T1.LogMachineModel_NewOpState, T1.LogMachineModel_ResultType, T1.LogMachineModel_VarAddress, T1.LogMachineModel_VarValue)
FROM (
SELECT
T.LogDbId AS LogMachineModel_DbId,
T.CncFileName AS LogMachineModel_CncFileName,
T.AlarmCode AS LogMachineModel_AlarmCode,
T.AlarmDatetime AS LogMachineModel_AlarmDtEvent,
T.AlarmMessage AS LogMachineModel_AlarmMessage,
T.AlarmOperation AS LogMachineModel_AlarmOperation,
T.AlarmType AS LogMachineModel_AlarmType,
T.CommandExecutedCorrectly AS LogMachineModel_CommExecuted,
CAST(T.CommandState AS [Edm.Int32]) AS LogMachineModel_CommandState,
CAST(T.CommandType AS [Edm.Int32]) AS LogMachineModel_CommandType,
T.Description AS LogMachineModel_Description,
T.DtEvent AS LogMachineModel_DtEvent,
T.DtExported AS LogMachineModel_DtExported,
CAST(T.EventType AS [Edm.Int32]) AS LogMachineModel_EventType,
T.MachineId AS LogMachineModel_MachineId,
T.Message AS LogMachineModel_Message,
T.SN AS LogMachineModel_SN,
T.[Value] AS LogMachineModel_Value,
T.NewOpState AS LogMachineModel_NewOpState,
CAST(T.ResultType AS [Edm.Int32]) AS LogMachineModel_ResultType,
T.VarAddress AS LogMachineModel_VarAddress,
T.VarValue AS LogMachineModel_VarValue,
True AS _from0
FROM DatabaseContext.LogMachineList AS T
) AS T1");
@@ -430,19 +434,23 @@ namespace Edm_EntityMappingGeneratedViews
{
return new DbMappingView(@"
SELECT VALUE -- Constructing LogMachineList
[EgtBEAMWALL.DataLayer.LogMachineModel](T1.LogMachineModel_LogDbId, T1.LogMachineModel_CncFileName, T1.LogMachineModel_Description, T1.LogMachineModel_DtEvent, T1.LogMachineModel_DtExported, T1.LogMachineModel_EventType, T1.LogMachineModel_MachineId, T1.LogMachineModel_Message, T1.LogMachineModel_SN, T1.LogMachineModel_Value)
[EgtBEAMWALL.DataLayer.LogMachineModel](T1.LogMachineModel_LogDbId, T1.LogMachineModel_AlarmCode, T1.LogMachineModel_AlarmDatetime, T1.LogMachineModel_AlarmMessage, T1.LogMachineModel_AlarmOperation, T1.LogMachineModel_AlarmType, T1.LogMachineModel_CommandExecutedCorrectly, T1.LogMachineModel_CommandState, T1.LogMachineModel_CommandType, T1.LogMachineModel_Description, T1.LogMachineModel_NewOpState, T1.LogMachineModel_ResultType, T1.LogMachineModel_VarAddress, T1.LogMachineModel_VarValue)
FROM (
SELECT
T.DbId AS LogMachineModel_LogDbId,
T.CncFileName AS LogMachineModel_CncFileName,
T.AlarmCode AS LogMachineModel_AlarmCode,
T.AlarmDtEvent AS LogMachineModel_AlarmDatetime,
T.AlarmMessage AS LogMachineModel_AlarmMessage,
T.AlarmOperation AS LogMachineModel_AlarmOperation,
T.AlarmType AS LogMachineModel_AlarmType,
T.CommExecuted AS LogMachineModel_CommandExecutedCorrectly,
CAST(T.CommandState AS [EgtBEAMWALL.DataLayer.CommandStates]) AS LogMachineModel_CommandState,
CAST(T.CommandType AS [EgtBEAMWALL.DataLayer.LogCommandTypes]) AS LogMachineModel_CommandType,
T.Description AS LogMachineModel_Description,
T.DtEvent AS LogMachineModel_DtEvent,
T.DtExported AS LogMachineModel_DtExported,
CAST(T.EventType AS [EgtBEAMWALL.DataLayer.EventType]) AS LogMachineModel_EventType,
T.MachineId AS LogMachineModel_MachineId,
T.Message AS LogMachineModel_Message,
T.SN AS LogMachineModel_SN,
T.[Value] AS LogMachineModel_Value,
T.NewOpState AS LogMachineModel_NewOpState,
CAST(T.ResultType AS [EgtBEAMWALL.DataLayer.ResultTypes]) AS LogMachineModel_ResultType,
T.VarAddress AS LogMachineModel_VarAddress,
T.VarValue AS LogMachineModel_VarValue,
True AS _from0
FROM CodeFirstDatabase.LogMachineModel AS T
) AS T1");
@@ -16,10 +16,52 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
#region Public Properties
/// <summary>
/// File CNC di riferimento
/// Codice Allarme
/// </summary>
[Column("CncFileName")]
public string CncFileName { get; set; } = "";
[Column("AlarmCode")]
public string AlarmCode { get; set; } = "";
/// <summary>
/// Data Evento
/// </summary>
[Column("AlarmDtEvent")]
public DateTime AlarmDatetime { get; set; } = DateTime.Now;
/// <summary>
/// Messaggio Allarme
/// </summary>
[Column("AlarmMessage")]
public string AlarmMessage { get; set; } = "";
/// <summary>
/// Alarm Operation
/// </summary>
[Column("AlarmOperation")]
public int AlarmOperation { get; set; } = 0;
/// <summary>
/// Alarm Type
/// </summary>
[Column("AlarmType")]
public int AlarmType { get; set; } = 0;
/// <summary>
/// Esaecuzione comando corretta
/// </summary>
[Column("CommExecuted")]
public bool CommandExecutedCorrectly { get; set; } = false;
/// <summary>
/// Stato da enum Core
/// </summary>
[Column("CommandState")]
public Core.ConstMachComm.CommandStates CommandState { get; set; } = Core.ConstMachComm.CommandStates.NULL;
/// <summary>
/// Tipo Comando da enum Core
/// </summary>
[Column("CommandType")]
public Core.ConstMachComm.LogCommandTypes CommandType { get; set; } = Core.ConstMachComm.LogCommandTypes.NULL;
/// <summary>
/// Descrizione
@@ -27,51 +69,41 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("Description")]
public string Description { get; set; } = "";
/// <summary>
/// Data Evento
/// </summary>
[Column("DtEvent")]
public DateTime DtEvent { get; set; }
/// <summary>
/// Data Esportazione
/// </summary>
[Column("DtExported")]
public DateTime DtExported { get; set; }
/// <summary>
/// Tipo evento da enum Core
/// </summary>
[Column("EventType")]
public Core.EventType EventType { get; set; } = Core.EventType.ND;
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int LogDbId { get; set; }
/// <summary>
/// New OP State
/// </summary>
[Column("NewOpState")]
public int NewOpState { get; set; } = 0;
/// <summary>
/// Stato da enum Core
/// </summary>
[Column("ResultType")]
public Core.ConstMachComm.ResultTypes ResultType { get; set; } = Core.ConstMachComm.ResultTypes.NULL;
/// <summary>
/// Indirizzo VAR
/// </summary>
[Column("VarAddress")]
public string VarAddress { get; set; } = "";
/// <summary>
/// Valore VAR
/// </summary>
[Column("VarValue")]
public string VarValue { get; set; } = "";
#endregion Public Properties
#if false
/// <summary>
/// MachineId del BTL
/// </summary>
[Column("MachineId")]
public string MachineId { get; set; } = "";
/// <summary>
/// Messaggio
/// </summary>
[Column("Message")]
public string Message { get; set; } = "";
/// <summary>
/// Seriale
/// </summary>
[Column("SN")]
public int SN { get; set; } = 0;
/// <summary>
/// Valore Associato
/// </summary>
[Column("Value")]
public double Value { get; set; } = 0;
#endregion Public Properties
#endif
}
}
@@ -96,6 +96,10 @@
<Compile Include="Migrations\202104150749157_FullDbInit.designer.cs">
<DependentUpon>202104150749157_FullDbInit.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202104231625149_LogMachineUpgrade.cs" />
<Compile Include="Migrations\202104231625149_LogMachineUpgrade.designer.cs">
<DependentUpon>202104231625149_LogMachineUpgrade.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -113,6 +117,9 @@
<EmbeddedResource Include="Migrations\202104150749157_FullDbInit.resx">
<DependentUpon>202104150749157_FullDbInit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202104231625149_LogMachineUpgrade.resx">
<DependentUpon>202104231625149_LogMachineUpgrade.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
@@ -0,0 +1,29 @@
// <auto-generated />
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
public sealed partial class LogMachineUpgrade : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(LogMachineUpgrade));
string IMigrationMetadata.Id
{
get { return "202104231625149_LogMachineUpgrade"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,56 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class LogMachineUpgrade : DbMigration
{
public override void Up()
{
AddColumn("dbo.LogMachine", "AlarmCode", c => c.String(unicode: false));
AddColumn("dbo.LogMachine", "AlarmDtEvent", c => c.DateTime(nullable: false, precision: 0));
AddColumn("dbo.LogMachine", "AlarmMessage", c => c.String(unicode: false));
AddColumn("dbo.LogMachine", "AlarmOperation", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "AlarmType", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "CommExecuted", c => c.Boolean(nullable: false));
AddColumn("dbo.LogMachine", "CommandState", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "CommandType", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "NewOpState", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "ResultType", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "VarAddress", c => c.String(unicode: false));
AddColumn("dbo.LogMachine", "VarValue", c => c.String(unicode: false));
DropColumn("dbo.LogMachine", "CncFileName");
DropColumn("dbo.LogMachine", "DtEvent");
DropColumn("dbo.LogMachine", "DtExported");
DropColumn("dbo.LogMachine", "EventType");
DropColumn("dbo.LogMachine", "MachineId");
DropColumn("dbo.LogMachine", "Message");
DropColumn("dbo.LogMachine", "SN");
DropColumn("dbo.LogMachine", "Value");
}
public override void Down()
{
AddColumn("dbo.LogMachine", "Value", c => c.Double(nullable: false));
AddColumn("dbo.LogMachine", "SN", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "Message", c => c.String(unicode: false));
AddColumn("dbo.LogMachine", "MachineId", c => c.String(unicode: false));
AddColumn("dbo.LogMachine", "EventType", c => c.Int(nullable: false));
AddColumn("dbo.LogMachine", "DtExported", c => c.DateTime(nullable: false, precision: 0));
AddColumn("dbo.LogMachine", "DtEvent", c => c.DateTime(nullable: false, precision: 0));
AddColumn("dbo.LogMachine", "CncFileName", c => c.String(unicode: false));
DropColumn("dbo.LogMachine", "VarValue");
DropColumn("dbo.LogMachine", "VarAddress");
DropColumn("dbo.LogMachine", "ResultType");
DropColumn("dbo.LogMachine", "NewOpState");
DropColumn("dbo.LogMachine", "CommandType");
DropColumn("dbo.LogMachine", "CommandState");
DropColumn("dbo.LogMachine", "CommExecuted");
DropColumn("dbo.LogMachine", "AlarmType");
DropColumn("dbo.LogMachine", "AlarmOperation");
DropColumn("dbo.LogMachine", "AlarmMessage");
DropColumn("dbo.LogMachine", "AlarmDtEvent");
DropColumn("dbo.LogMachine", "AlarmCode");
}
}
}
File diff suppressed because one or more lines are too long