Save last
This commit is contained in:
19
ApiServer/Structures/Analog.cs
Normal file
19
ApiServer/Structures/Analog.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApiServer.Structures
|
||||
{
|
||||
public class Analog
|
||||
{
|
||||
public string Start { get { return start.ToString("yyyy.MM.dd HH:mm:ss"); } }
|
||||
public DateTime start = new DateTime();
|
||||
public double? Value { get; set; }
|
||||
}
|
||||
public class AnalogArr
|
||||
{
|
||||
public int Index { get; set; }
|
||||
public Analog[] Analogs { get; set; }
|
||||
}
|
||||
}
|
21
ApiServer/Structures/Discret.cs
Normal file
21
ApiServer/Structures/Discret.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApiServer.Structures
|
||||
{
|
||||
public class Discret
|
||||
{
|
||||
public int Index { get; set; }
|
||||
public string Start { get { return start.ToString("yyyy.MM.dd HH:mm:ss"); } }
|
||||
public DateTime start = new DateTime();
|
||||
public byte? State { get; set; }
|
||||
}
|
||||
public class DiscretMatrix
|
||||
{
|
||||
public string Dt { get { return start.ToString("yyyy.MM.dd HH:mm:ss"); } }
|
||||
public DateTime start = new DateTime();
|
||||
public byte?[] M { get; set; }
|
||||
}
|
||||
}
|
15
ApiServer/Structures/Protect.cs
Normal file
15
ApiServer/Structures/Protect.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApiServer.Structures
|
||||
{
|
||||
public class Protect
|
||||
{
|
||||
public byte Index { get; set; }
|
||||
public byte State { get; set; }
|
||||
public DateTime start;
|
||||
public string Start { get { return start.ToString("yyyy.MM.dd HH.mm.ss.fff"); } }
|
||||
}
|
||||
}
|
32
ApiServer/Structures/TechCycle.cs
Normal file
32
ApiServer/Structures/TechCycle.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApiServer.Structures
|
||||
{
|
||||
public class TechCycle
|
||||
{
|
||||
public sbyte Index { get; set; }
|
||||
public string Start { get { return start.ToString("yyyy.MM.dd HH:mm:ss"); } }
|
||||
public DateTime start = new DateTime();
|
||||
|
||||
public TechCycle(DateTime date, string line)
|
||||
{
|
||||
var splits = line.Split('\t');
|
||||
if (splits[0] == "00")
|
||||
this.Index = -1;
|
||||
else
|
||||
this.Index = sbyte.Parse(splits[0]);
|
||||
var times = splits[1].Split(":");
|
||||
this.start = new DateTime(
|
||||
date.Year,
|
||||
date.Month,
|
||||
date.Day,
|
||||
int.Parse(times[0]),
|
||||
int.Parse(times[1]),
|
||||
int.Parse(times[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user