55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using Newtonsoft.Json;
|
|
|
|
namespace LaaProduction
|
|
{
|
|
//class Programm
|
|
//{
|
|
// static void Main()
|
|
// {
|
|
// var api = new LaaProductionAPI();
|
|
// var login = api.Login("Druckpruefung", 1, 0, 130, "zlatev", "rd");
|
|
// var inspections = api.GetPendingInspections();
|
|
// var requestQAP = api.SendQAPReady(0, 0);
|
|
// }
|
|
//}
|
|
|
|
public class Model
|
|
{
|
|
public Time A { get; set; } = 200;
|
|
|
|
public Time B { get; set; } = 400;
|
|
|
|
public Time C { get; set; } = 600;
|
|
}
|
|
|
|
public class Programm
|
|
{
|
|
static void Main()
|
|
{
|
|
Time time = new byte[] { 0x00, 0x01 };
|
|
byte[] x = time;
|
|
|
|
System.Console.WriteLine($"Double seconds: 960.0sec");
|
|
System.Console.WriteLine($"Time in seconds: {time.Seconds:f2}");
|
|
System.Console.WriteLine($"Time in minutes: {time.Minutes:f2}");
|
|
System.Console.WriteLine($"Time in hours: {time.Hours:f2}");
|
|
|
|
var hours = time.Hours;
|
|
|
|
time = hours * 60 * 60;
|
|
System.Console.WriteLine($"Double hours: {hours:f2}h");
|
|
System.Console.WriteLine($"Time in hours: {time.Hours:f2}");
|
|
System.Console.WriteLine($"Time in minutes: {time.Minutes:f2}");
|
|
System.Console.WriteLine($"Time in seconds: {time.Seconds:f2}");
|
|
System.Console.WriteLine("===================================================================");
|
|
|
|
var model = new Model();
|
|
var toJson = JsonConvert.SerializeObject(model, Formatting.Indented);
|
|
System.Console.WriteLine($"Time to JSON: {toJson}");
|
|
|
|
var fromJson = JsonConvert.DeserializeObject<Time>(toJson);
|
|
System.Console.WriteLine($"Time to JSON: {fromJson}");
|
|
}
|
|
}
|
|
}
|