49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using MP.MONO.Core;
|
|
using MP.MONO.Core.DTO;
|
|
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.MONO.Data.Controllers
|
|
{
|
|
/// <summary>
|
|
/// Classe per generazione dati simulati
|
|
/// </summary>
|
|
public class SimController : IDisposable
|
|
{
|
|
|
|
public void Dispose()
|
|
{
|
|
// Clear database context
|
|
//Log.Info("Dispose di GWMSController");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Restituisce stato Macchina simulato come DTO
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MachineDTO MachineGetStatus()
|
|
{
|
|
Random rand = new Random();
|
|
int maxRun = 5;
|
|
int maxExe = 7;
|
|
|
|
MachineDTO currMachDto = new MachineDTO()
|
|
{
|
|
Manufacturer = "Egalware",
|
|
Model = "SIM Machine",
|
|
Name = "DEMO 01",
|
|
SerNumber = "2022-0001",
|
|
Mode = $"{(Enums.MachRunMode)rand.Next(0, maxRun)}",
|
|
Status = $"{(Enums.MachExeStatus)rand.Next(0, maxExe)}"
|
|
};
|
|
|
|
return currMachDto;
|
|
}
|
|
}
|
|
}
|