Timeline view animation

This commit is contained in:
2023-07-11 17:59:29 +02:00
parent b1898e1120
commit b11fd13913
4 changed files with 104 additions and 52 deletions

View File

@@ -16,6 +16,7 @@ public class ParallelCommands : IDisposable
public IObservable<IChangeSet<CommandTimeState>> Commands { get; }
public BindedCollection<CommandTimeState> CommandsCollection { get; }
public int CommandCount => _commands.Count;
public PointInTime? Result { get; private set; }

View File

@@ -115,18 +115,28 @@ public class CommandScheduler : ICommandScheduler
private async void ExecutorOnCommandFinished(object? sender, ICommand command)
{
var firstCommandBlock = _commandsToRun
.Items
.FirstOrDefault();
var state = firstCommandBlock
?.CommandsCollection
.Collection
?.FirstOrDefault(c => c.Command == command);
await RunWithLockAsync(async () =>
{
var firstCommandBlock = _commandsToRun
.Items
.FirstOrDefault();
var state = firstCommandBlock
?.CommandsCollection
.Collection
?.FirstOrDefault(c => c.Command == command);
if (state is null) return;
if (state is null) return;
state.ExecutionState = ExecutionState.Finished;
if (firstCommandBlock is not null) await firstCommandBlock.RemoveCommand(command);
state.ExecutionState = ExecutionState.Finished;
if (firstCommandBlock is not null)
{
await firstCommandBlock.RemoveCommand(command);
if (firstCommandBlock.CommandCount == 0)
{
_commandsToRun.Remove(firstCommandBlock);
}
}
});
}
private async Task RefreshCommands()