58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using EgwProxy.Emmegi.DTO;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlTypes;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace EgwProxy.Emmegi
|
|
{
|
|
public class CallManager
|
|
{
|
|
|
|
public CallManager(string baseUrl, int port, string workstationId)
|
|
{
|
|
BaseUrl = baseUrl;
|
|
Port= port;
|
|
WorkstationId = workstationId;
|
|
}
|
|
|
|
/// <summary>
|
|
/// restituisce stato impianto nel formato specifico
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public StatusDTO GetCurrentStatus()
|
|
{
|
|
StatusDTO answ = new StatusDTO();
|
|
|
|
// chiamo
|
|
string xmlRaw = @"<?xml version=""1.0"" encoding=""UTF-8""?>
|
|
<result_workstation_status>
|
|
<workstation>
|
|
<id id=""C129696"" />
|
|
<status>ON</status>
|
|
<status_timestamp>2025-07-10 11:30:31</status_timestamp>
|
|
<operator>unknown</operator>
|
|
<job_id>TAGLIO SINGOLO</job_id>
|
|
<operations>194312</operations>
|
|
<tot_operations>194312</tot_operations>
|
|
</workstation>
|
|
</result_workstation_status>";
|
|
// deserializzo
|
|
var serializer = new XmlSerializer(typeof(StatusDTO));
|
|
using (var reader = new StringReader(xmlRaw))
|
|
{
|
|
answ = (StatusDTO)serializer.Deserialize(reader);
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
private string BaseUrl = "";
|
|
private int Port = 0;
|
|
private string WorkstationId = "";
|
|
}
|
|
}
|