-
Notifications
You must be signed in to change notification settings - Fork 22
Added 'Locate Device' and 'Save Permanent' functionality #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Changed the BlockIdentifier of 'Set' function to temporary Added a second button for 'Save Permanent' functionality Added a new button for 'Locate Device' (See Profinet specs for exact specifications) that let's the device blink until it's told to stop
Changed the BlockIdentifier of 'Set' function to temporary Added a second button for 'Save Permanent' functionality Added a new button for 'Locate Device' (See Profinet specs for exact specifications) that let's the device blink until it's told to stop
# Conflicts: # ProfinetTools.Gui/ViewModels/SettingsViewModel.cs
fbarresi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for starting this software improvement!
Please make this changes so that I can merge your pull request.
| public ReactiveUI.ReactiveCommand SaveCommand { get; set; } | ||
| public ReactiveUI.ReactiveCommand ResetCommand { get; set; } | ||
|
|
||
| public ReactiveUI.ReactiveCommand SavePermanentCommand { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we really make two commands for saving settings?
An enum for "Permanent" and "Temporary" would be enough and would avoid code duplication.
| else | ||
| { | ||
| _signalActive = true; | ||
| var newThread = new Thread(new ThreadStart(LocationService)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Observable.Interval from System.Reactive here instead.
| return Unit.Default; | ||
| } | ||
|
|
||
| private async Task<Unit> SavePermanentDeviceSettings() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid code duplication here
| raisePropertyChanged(); | ||
| } | ||
| } | ||
| IsDeviceSelected = _selectedDevice != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Reactive Ui for that
| <Grid.RowDefinitions> | ||
| <RowDefinition Height="*"/> | ||
| <RowDefinition Height="Auto"/> | ||
| <RowDefinition Height="24.277"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid fix height definition
| } | ||
|
|
||
| public IAsyncResult BeginSetNameRequest(PhysicalAddress destination, string name) | ||
| public IAsyncResult BeginSetNameRequest(PhysicalAddress destination, string name, bool permanent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method could expect an enumerable in argument
Changed the BlockIdentifier of 'Set' function to temporary
Added a second button for 'Save Permanent' functionality
Added a new button for 'Locate Device' (See Profinet specs for exact specifications) that let's the device blink until it's told to stop