Skip to content

Commit 96baba8

Browse files
committed
deleted unused functionalities
1 parent 5d13ace commit 96baba8

1 file changed

Lines changed: 14 additions & 69 deletions

File tree

App/Harp.Behavior.Design/ViewModels/MyDeviceViewModel.cs

Lines changed: 14 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,15 +3127,6 @@ public BehaviorViewModel()
31273127
//Log.Error(ex, "Error saving configuration with error: {Exception}", ex));
31283128
Console.WriteLine($"Error saving configuration with error: {ex}"));
31293129

3130-
/* Rgb0ApplyConfigurationCommand =
3131-
ReactiveCommand.CreateFromObservable<Unit, Unit>(ExecuteRgb0ApplyConfiguration);*/
3132-
//Rgb0ApplyConfigurationCommand.IsExecuting.ToPropertyEx(this, x => x.IsSaving);
3133-
//Rgb0ApplyConfigurationCommand.ThrownExceptions.Subscribe(ex =>
3134-
// //Log.Error(ex, "Error saving configuration with error: {Exception}", ex));
3135-
// Console.WriteLine($"Error saving configuration with error: {ex}"));
3136-
3137-
3138-
31393130
ResetConfigurationCommand = ReactiveCommand.CreateFromObservable(ResetConfiguration, canChangeConfig);
31403131
ResetConfigurationCommand.IsExecuting.ToPropertyEx(this, x => x.IsResetting);
31413132
ResetConfigurationCommand.ThrownExceptions.Subscribe(ex =>
@@ -3521,6 +3512,7 @@ public BehaviorViewModel()
35213512
// force initial population of currently connected ports
35223513
LoadUsbInformation();
35233514
}
3515+
35243516
private IObservable<Unit> ExecuteSavePulseConfigDO0()
35253517
{
35263518
return Observable.StartAsync(async () =>
@@ -3537,6 +3529,7 @@ await WriteAndLogAsync(
35373529
"PulseDO0");
35383530
});
35393531
}
3532+
35403533
private IObservable<Unit> ExecuteSavePulseConfigDO1()
35413534
{
35423535
return Observable.StartAsync(async () =>
@@ -3559,6 +3552,7 @@ await WriteAndLogAsync(
35593552
"PulseDO1");
35603553
});
35613554
}
3555+
35623556
private IObservable<Unit> ExecuteSavePulseConfigDO2()
35633557
{
35643558
return Observable.StartAsync(async () =>
@@ -3575,6 +3569,7 @@ await WriteAndLogAsync(
35753569
"PulseDO2");
35763570
});
35773571
}
3572+
35783573
private IObservable<Unit> ExecuteSavePulseConfigDO3()
35793574
{
35803575
return Observable.StartAsync(async () =>
@@ -5435,18 +5430,18 @@ public IObservable<string> GenerateEventMessages()
54355430
observer.OnNext($"Camera1: {result}");
54365431
}
54375432

5438-
var DigitalInputStateResult = await device.ReadDigitalInputStateAsync(cancellationToken);
5439-
DigitalInputState = DigitalInputStateResult;
5440-
observer.OnNext($"DigitalInputState: {DigitalInputStateResult}");
5433+
var digitalInputStateResult = await device.ReadDigitalInputStateAsync(cancellationToken);
5434+
DigitalInputState = digitalInputStateResult;
5435+
observer.OnNext($"DigitalInputState: {digitalInputStateResult}");
54415436

5442-
var PortDIOStateEventResult = await device.ReadPortDIOStateEventAsync(cancellationToken);
5443-
PortDIOStateEvent = PortDIOStateEventResult;
5444-
observer.OnNext($"PortDIOStateEvent: {PortDIOStateEventResult}");
5437+
var portDIOStateEventResult = await device.ReadPortDIOStateEventAsync(cancellationToken);
5438+
PortDIOStateEvent = portDIOStateEventResult;
5439+
observer.OnNext($"PortDIOStateEvent: {portDIOStateEventResult}");
54455440

5446-
// NOTE: These in the yalm are yet not considered events but write
5447-
var OutputStateResult = await device.ReadOutputStateAsync(cancellationToken);
5448-
OutputState = OutputStateResult;
5449-
observer.OnNext($"OutputState: {OutputStateResult}");
5441+
// NOTE: These in the yaml are yet not considered events but write
5442+
var outputStateResult = await device.ReadOutputStateAsync(cancellationToken);
5443+
OutputState = outputStateResult;
5444+
observer.OnNext($"OutputState: {outputStateResult}");
54505445

54515446
// Wait a short while before polling again. Adjust delay as necessary.
54525447
await Task.Delay(TimeSpan.FromMilliseconds(10), cancellationToken);
@@ -5794,54 +5789,4 @@ private void SubscribeToEvents()
57945789
);
57955790
}
57965791

5797-
5798-
public class ArrayItemWrapper<T> : ReactiveObject
5799-
{
5800-
public int Index { get; }
5801-
5802-
[Reactive]
5803-
public T Value { get; set; }
5804-
5805-
public ArrayItemWrapper(int index, T value)
5806-
{
5807-
Index = index;
5808-
Value = value;
5809-
}
5810-
}
5811-
5812-
public class RgbColorItem : ReactiveObject
5813-
{
5814-
[Reactive] public int Index { get; set; }
5815-
[Reactive] public Color Color { get; set; }
5816-
[Reactive] public byte Red { get; set; }
5817-
[Reactive] public byte Green { get; set; }
5818-
[Reactive] public byte Blue { get; set; }
5819-
5820-
public RgbColorItem(int index, byte red, byte green, byte blue)
5821-
{
5822-
Index = index;
5823-
Red = red;
5824-
Green = green;
5825-
Blue = blue;
5826-
Color = Color.FromRgb(red, green, blue);
5827-
5828-
// Setup reactive properties to update the array when color changes
5829-
this.WhenAnyValue(x => x.Color)
5830-
.Subscribe(color =>
5831-
{
5832-
Red = color.R;
5833-
Green = color.G;
5834-
Blue = color.B;
5835-
});
5836-
5837-
// Update Color when individual RGB components change
5838-
this.WhenAnyValue(x => x.Red, x => x.Green, x => x.Blue)
5839-
.Skip(1)
5840-
.Subscribe(tuple =>
5841-
{
5842-
var (r, g, b) = tuple;
5843-
Color = Color.FromRgb(r, g, b);
5844-
});
5845-
}
5846-
}
58475792
}

0 commit comments

Comments
 (0)