public void Update(SlmmDto dto) { MachineDirection = dto.MowerDirection; MachineLocation = new Location() { X = dto.X, Y = dto.Y }; LawnWidth = dto.MaxX; LawnHeight = dto.MaxX; MachineRunning = dto.MowerRunning; if (StatusChanged != null) { StatusChanged(this, new RepositoryEventArgs(dto, dto.CommandLog)); } }
private void MowingMachine_StatusChanged(object sender, Machine.Events.LawnMowerMachineEventArgs e) { // Create Dto and update Repository SlmmDto dto = new SlmmDto() { X = e.MachineLocation.X, Y = e.MachineLocation.Y, CommandLog = e.CommandLog, MaxX = e.MaxX, MaxY = e.MaxY, MowerDirection = e.MachineDirection, MowerRunning = e.MachineRunning }; StatusChanged?.Invoke(this, new LawnEventArgs(dto, e.LastCommand)); }
public SlmmEventArg(SlmmDto data, string cmdLog) { lawnData = data; CommandLog = cmdLog; }