/// <summary> /// Communication callback function /// </summary> /// <param name="cmd"></param> public void CommCallbackCaller(CommEvent cmd) { if (CommEvents != null) { CommEvents(this, cmd); } }
public void CommEventCallback(object sender, CommEvent cmd) { if (cmd == CommEvent.CommOpen) { HWID = GetHWID(Comm.GetCommStatus()); } }
public void CommCallbackCaller(object o, CommEvent cmd) { CommEventHandler commEvents = CommEvents; if (commEvents != null) { commEvents(this, cmd); } }
public void CommEventCallbackCaller(CommEvent cmd) { Encoding encoding = Encoding.GetEncoding("Windows-1252"); CommEventHandler commEvents = CommEvents; if (commEvents != null) { commEvents(this, cmd); } }
public void CommCallback(object sender, CommEvent cmd) { if (cmd == CommEvent.CommOpen) { IsCommEnabled = true; } else if (cmd == CommEvent.CommLost) { IsCommEnabled = false; } CommEventCallbackCaller(cmd); }
static EventBase GetFakeEvent() { var selector = Faker.NumberFaker.Number(0, 5); switch (selector) { case 0: var e = new DoorEvent { Eventno = count++, EventType = DoorEventEventType.DoorEvent, Doors = new DoorsSchema { Event = count++, Left = new Doorpos { Count = Faker.NumberFaker.Number(0, 65000), Open = Faker.BooleanFaker.Boolean() }, Right = new Doorpos { Count = Faker.NumberFaker.Number(0, 65000), Open = Faker.BooleanFaker.Boolean() } } }; return(e); case 1: var le = new LightEvent { Eventno = count++, EventType = LightEventEventType.LightEvent, Lights = new LightsSchema { Event = Faker.NumberFaker.Number(0, 11), Frontpass = Faker.BooleanFaker.Boolean(), Rearpass = Faker.BooleanFaker.Boolean(), Left = new Lightpos { Count = Faker.NumberFaker.Number(0, 65000), Lit = Faker.BooleanFaker.Boolean() }, Right = new Lightpos { Count = Faker.NumberFaker.Number(0, 65000), Lit = Faker.BooleanFaker.Boolean() }, Rear = new Lightpos { Count = Faker.NumberFaker.Number(0, 65000), Lit = Faker.BooleanFaker.Boolean() } } }; return(le); case 2: var re = new RelocatedEvent { EventType = RelocatedEventEventType.RelocatedEvent, Location = GetFakeLocation() }; return(re); case 3: var pe = new PowerEvent { EventType = PowerEventEventType.PowerEvent, Msg = Faker.TextFaker.Sentence() }; return(pe); case 4: var ce = new CommEvent { EventType = CommEventEventType.CommEventSuccess, Conncount = count++, Humidity = Faker.NumberFaker.Number(0, 100), Tempf = Faker.NumberFaker.Number(0, 100), Msgnum = count, Msg = Faker.TextFaker.Sentence() }; return(ce); case 5: var cee = new CommEvent { EventType = CommEventEventType.CommEventError, Conncount = count++, Humidity = Faker.NumberFaker.Number(0, 100), Tempf = Faker.NumberFaker.Number(0, 100), Msgnum = count, Msg = Faker.TextFaker.Sentence() }; return(cee); default: return(null); } }
private void CommCallback(object o, CommEvent cmd) { }
public void CommCallback(object sender, CommEvent cmd) { CommCallbackCaller(this, cmd); }