diff --git a/Matomat.sln b/Matomat.sln new file mode 100644 index 0000000..adbd7ab --- /dev/null +++ b/Matomat.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Matomat", "Matomat\Matomat.csproj", "{A8987ACE-466A-4F03-865E-B2E2494360D7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A8987ACE-466A-4F03-865E-B2E2494360D7}.Debug|x86.ActiveCfg = Debug|x86 + {A8987ACE-466A-4F03-865E-B2E2494360D7}.Debug|x86.Build.0 = Debug|x86 + {A8987ACE-466A-4F03-865E-B2E2494360D7}.Release|x86.ActiveCfg = Release|x86 + {A8987ACE-466A-4F03-865E-B2E2494360D7}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Matomat/Automat.cs b/Matomat/Automat.cs new file mode 100644 index 0000000..efd9c08 --- /dev/null +++ b/Matomat/Automat.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class Automat + { + private User user; + internal void doJob(int userId, long codeId) + { + user = findUser(userId); + if (!user.vaild()) + return; + + } + + private User findUser(int userId) + { + return new User(userId); + } + } +} diff --git a/Matomat/BarcodeReader.cs b/Matomat/BarcodeReader.cs new file mode 100644 index 0000000..ba8d4ae --- /dev/null +++ b/Matomat/BarcodeReader.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class BarcodeReader + { + internal long getCodeID() + { + return 1234567890123; + } + } +} diff --git a/Matomat/LCDDisplay.cs b/Matomat/LCDDisplay.cs new file mode 100644 index 0000000..4e9a566 --- /dev/null +++ b/Matomat/LCDDisplay.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class LCDDisplay + { + internal static void print(string text) + { + throw new NotImplementedException(); + } + + internal static void print(string text, int time) + { + throw new NotImplementedException(); + } + } +} diff --git a/Matomat/Matomat.csproj b/Matomat/Matomat.csproj new file mode 100644 index 0000000..ccd3589 --- /dev/null +++ b/Matomat/Matomat.csproj @@ -0,0 +1,63 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {A8987ACE-466A-4F03-865E-B2E2494360D7} + Exe + Properties + Matomat + Matomat + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Matomat/Program.cs b/Matomat/Program.cs new file mode 100644 index 0000000..3efa6ff --- /dev/null +++ b/Matomat/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; + +namespace Matomat +{ + class Program + { + static void Main(string[] args) + { + Worker workerObject = new Worker(); + Thread workerThread = new Thread(workerObject.DoWork); + + workerThread.Start(); + + while (!workerThread.IsAlive) ; + + while (workerThread.ThreadState == ThreadState.Running) + { + Thread.Sleep(1); + } + Console.WriteLine("main thread: Worker thread has terminated."); + } + } +} diff --git a/Matomat/Properties/AssemblyInfo.cs b/Matomat/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dd59582 --- /dev/null +++ b/Matomat/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Matomat")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Matomat")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("64099dca-753a-49a9-9d66-aee9575ad258")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Matomat/RFIDReader.cs b/Matomat/RFIDReader.cs new file mode 100644 index 0000000..b41de0a --- /dev/null +++ b/Matomat/RFIDReader.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class RFIDReader + { + internal int getCardID() + { + return 0x1234; + } + } +} diff --git a/Matomat/User.cs b/Matomat/User.cs new file mode 100644 index 0000000..3a1ed7c --- /dev/null +++ b/Matomat/User.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class User + { + private int userId; + private bool found; + + public User(int userId) + { + // TODO: Complete member initialization + this.userId = userId; + load(); + } + + private void load() + { + if (true) + this.found = false; + } + + internal bool vaild() + { + if (!found) + { + LCDDisplay.print("User wurde nich gefunden",5); + return false; + } + } + + } +} diff --git a/Matomat/Worker.cs b/Matomat/Worker.cs new file mode 100644 index 0000000..d0c6297 --- /dev/null +++ b/Matomat/Worker.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Matomat +{ + class Worker + { + private volatile bool _shouldStop; + private RFIDReader rfid; + private BarcodeReader barcode; + private Automat automat; + public Worker() + { + rfid = new RFIDReader(); + barcode = new BarcodeReader(); + automat = new Automat(); + } + public void DoWork() + { + while (!_shouldStop) + { + LCDDisplay.print("Bitte Sudierendenausweis über den RFID Leser halten."); + int userId = rfid.getCardID(); + LCDDisplay.print("Bitte Produkt / Code über den Barcodeleser halten."); + long codeId = barcode.getCodeID(); + automat.doJob(userId, codeId); + + } + Console.WriteLine("worker thread: terminating gracefully."); + } + public void RequestStop() + { + _shouldStop = true; + } + + } +}