Im Porting over an application that i made for the Arduino. The application should works as follows:
Steps:
- Receive Serial Data. (Always ends in rn)
- Parse out parts of the data
- Check files on Sdcard for match. if no match stop here.
- Apply the Parsed Data to the initialization of an instance of a Struct.
- Add the Struct to an ArrayList.
- if the Structs existed for a certain amount of time, Signal the Serial port.
- After a long period of time, remove the structs.
I Made a flowchart to explain the Application:
I have the Application working, but im experiencing Data Loss issues somewhere along the Line.
Here is my Actual Request Struct:
class Request{ public int Location_index { get; set; } public char SubLocation { get; set; } public int Details_index { get; set; } public long Start_time { get; set; } public int Level { get; set; } public Request(int locIndex, char SubLoc, int Detail) { Location_index = locIndex; SubLocation = SubLoc; Details_index = Detail; Start_time = DateTime.Now.Ticks; Level = 0; } public override bool Equals(object obj) { Request ncs = obj as Request; if (ncs == null) return false; else { if (this.Location_index != ncs.Location_index) return false; if (this.SubLocation != ncs.SubLocation) return false; if (this.Details_index != ncs.Details_index) return false; return true; } }}