eDosStation/TestEpdBaseClr/Program.cs

75 lines
2.3 KiB
C#
Raw Normal View History

2026-07-28 16:36:22 +02:00
using EpdBaseClr;
using System;
2025-12-04 06:35:41 +01:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestEpdBaseClr
{
internal class Program
{
static EpdBaseClr.Epd2 epdDevice;
static void init()
{
2026-07-28 16:36:22 +02:00
epdDevice = new EpdBaseClr.Epd2(3, false);
2025-12-04 06:35:41 +01:00
//epdDevice.SetFeedbackSound(thisStation.useBeep, thisStation.useBeepMK3());
epdDevice.EpdRead += EpdDevice_EpdRead; epdDevice.EpdError += EpdDevice_EpdError; epdDevice.EpdTO += EpdDevice_EpdTO;
epdDevice.EpdProgress += EpdDevice_EpdProgress;
}
private static void EpdDevice_EpdProgress(EpdBaseClr.Epd2 Sender, int e)
{
//throw new NotImplementedException();
System.Diagnostics.Debug.WriteLine("Epd progress: " + e.ToString());
2025-12-04 06:35:41 +01:00
}
private static void EpdDevice_EpdTO(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdTOEventArgs e)
{
2026-01-07 14:16:45 +01:00
//throw new NotImplementedException();
System.Diagnostics.Debug.WriteLine("Epd TimeOut");
2025-12-04 06:35:41 +01:00
}
private static void EpdDevice_EpdError(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdErrorEventArgs e)
{
2026-07-28 16:36:22 +02:00
System.Diagnostics.Debug.WriteLine("Epd Error: " + e.ErrorEPD.ToString());
2026-01-07 14:16:45 +01:00
//throw new NotImplementedException();
2025-12-04 06:35:41 +01:00
}
private static void EpdDevice_EpdRead(EpdBaseClr.Epd2 Sender, EpdBaseClr.EpdEventArgs e)
{
2026-01-07 14:16:45 +01:00
//throw new NotImplementedException();
var i = epdDevice.EpdID;
System.Diagnostics.Debug.WriteLine("EpdID: " + i.ToString());
2025-12-04 06:35:41 +01:00
}
2026-07-28 16:36:22 +02:00
static async Task Main(string[] args)
2025-12-04 06:35:41 +01:00
{
init();
2026-07-28 16:36:22 +02:00
Task w;
while (true)
{
System.Diagnostics.Debug.WriteLine("Wait");
w= epdDevice.Wait(20000, 2);
//System.Threading.Thread.Sleep(3000); epdDevice.OnCancelRequested();
w.Wait();
epdDevice.WaitEnd();
2025-12-04 06:35:41 +01:00
2026-07-28 16:36:22 +02:00
}
2026-01-07 14:16:45 +01:00
Console.ReadKey();
2025-12-04 06:35:41 +01:00
Einde();
}
private static void Einde()
{
epdDevice.WaitEnd();
epdDevice.Dispose();
epdDevice = null;
}
}
}