using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using static MagMan.Core.Enums;
namespace MagMan.Data.Tenant.DbModels
{
//
// This is here so CodeMaid doesn't reorganize this document
//
///
/// Tabella dei LOG Macchina (per macchina)
///
[Table("LogMachine")]
[Index(nameof(MachineID))]
[Index(nameof(KeyNum))]
public class LogMachineModel
{
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int LogDbId { get; set; }
///
/// Id macchina (diMagMan)
///
public int MachineID { get; set; } = 0;
///
/// Key di riferimento per il progetto
///
public int KeyNum { get; set; } = 0;
#if false
///
/// Codice Allarme
///
[Column("AlarmCode")]
public string AlarmCode { get; set; } = "";
///
/// Data Evento
///
[Column("AlarmDtEvent")]
public DateTime AlarmDatetime { get; set; } = DateTime.Now;
///
/// Messaggio Allarme
///
[Column("AlarmMessage")]
public string AlarmMessage { get; set; } = "";
///
/// Alarm Operation
///
[Column("AlarmOperation")]
public int AlarmOperation { get; set; } = 0;
///
/// Alarm Type
///
[Column("AlarmType")]
public int AlarmType { get; set; } = 0;
///
/// Esaecuzione comando corretta
///
[Column("CommExecuted")]
public bool CommandExecutedCorrectly { get; set; } = false;
///
/// Stato da enum Core
///
[Column("CommandState")]
public Core.ConstMachComm.CommandStates CommandState { get; set; } = Core.ConstMachComm.CommandStates.NULL;
///
/// Tipo Comando da enum Core
///
[Column("CommandType")]
public Core.ConstMachComm.LogCommandTypes CommandType { get; set; } = Core.ConstMachComm.LogCommandTypes.NULL;
///
/// Descrizione
///
[Column("Description")]
public string Description { get; set; } = "";
///
/// New OP State
///
[Column("NewOpState")]
public int NewOpState { get; set; } = 0;
#endif
///
/// Stato da enum Core
///
[Column("ResultType")]
public ResultTypes ResultType { get; set; } = ResultTypes.NULL;
///
/// Indirizzo VAR
///
[Column("VarAddress")]
public string VarAddress { get; set; } = "";
///
/// Valore VAR
///
[Column("VarValue")]
public string VarValue { get; set; } = "";
}
}