Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Jul 4, 2024
2 parents 9f5591d + 6e00ae2 commit 7d78ff0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.1.0
8.2.0
2 changes: 1 addition & 1 deletion src/Moryx.ControlSystem/Cells/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class Session
/// <summary>
/// Empty array of constraints
/// </summary>
protected static readonly IConstraint[] EmptyConstraints = new IConstraint[0];
protected static readonly IConstraint[] EmptyConstraints = Array.Empty<IConstraint>();

/// <summary>
/// Initialize a new resource request for a certain resource
Expand Down
12 changes: 9 additions & 3 deletions src/Moryx.ControlSystem/Jobs/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@ public Job(IRecipe recipe, int amount)
/// Classification of the job
/// </summary>
public JobClassification Classification { get; set; }


/// <summary>
/// Detailed display name of the state
/// TODO: Remove this property in next major and replace with reworked JobClassification
/// </summary>
public virtual string StateDisplayName { get; protected set; }

private IReadOnlyList<IProcess> _runningProcesses;
/// <summary>
/// Currently running processes of the job
/// </summary>
public IReadOnlyList<IProcess> RunningProcesses
{
get => _runningProcesses ?? new IProcess[0];
get => _runningProcesses ?? Array.Empty<IProcess>();
protected set => _runningProcesses = value;
}

Expand All @@ -73,7 +79,7 @@ public IReadOnlyList<IProcess> RunningProcesses
/// </summary>
public IReadOnlyList<IProcess> AllProcesses
{
get => _allProcesses ?? new IProcess[0];
get => _allProcesses ?? Array.Empty<IProcess>();
protected set => _allProcesses = value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Moryx.ControlSystem/Jobs/JobSchedulerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class JobSchedulerBase<T> : IJobScheduler
/// <summary>
/// Empty array for jobs without dependencies
/// </summary>
private readonly Job[] EmptyDependencies = new Job[0];
private readonly Job[] EmptyDependencies = Array.Empty<Job>();

/// <summary>
/// Dependency map that can be helpful for job scheduling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ActiveInstruction
/// Results of the instruction
/// </summary>
[Obsolete("Use the result objects in 'Results' property instead!")]
public IReadOnlyList<string> PossibleResults { get; set; } = new string[0];
public IReadOnlyList<string> PossibleResults { get; set; } = Array.Empty<string>();

/// <summary>
/// Possible results of the instruction
Expand Down
3 changes: 2 additions & 1 deletion src/Moryx.Orders/Assignment/Recipes/RecipeAssignmentBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -55,7 +56,7 @@ public virtual Task<IReadOnlyList<IProductRecipe>> PossibleRecipes(ProductIdenti
{
var product = ProductManagement.LoadType(identity);
if (product == null)
return Task.FromResult<IReadOnlyList<IProductRecipe>>(new IProductRecipe[0]);
return Task.FromResult<IReadOnlyList<IProductRecipe>>(Array.Empty<IProductRecipe>());

var recipes = ProductManagement.GetRecipes(product, RecipeClassification.Default | RecipeClassification.Alternative);
return Task.FromResult(recipes);
Expand Down

0 comments on commit 7d78ff0

Please sign in to comment.