feat(ui): populate material combobox from post processors
Replaces the material textbox on EditNestInfoForm with a combobox whose items are aggregated from every loaded post processor that implements the new IMaterialProvidingPostProcessor interface. CincinnatiPostProcessor exposes its configured MaterialLibraries entries. Free-text entry still works so custom materials remain usable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ using OpenNest.CNC;
|
||||
|
||||
namespace OpenNest.Posts.Cincinnati
|
||||
{
|
||||
public sealed class CincinnatiPostProcessor : IConfigurablePostProcessor
|
||||
public sealed class CincinnatiPostProcessor : IConfigurablePostProcessor, IMaterialProvidingPostProcessor
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new()
|
||||
{
|
||||
@@ -25,6 +25,16 @@ namespace OpenNest.Posts.Cincinnati
|
||||
|
||||
object IConfigurablePostProcessor.Config => Config;
|
||||
|
||||
public IEnumerable<string> GetMaterialNames()
|
||||
{
|
||||
if (Config?.MaterialLibraries == null)
|
||||
return System.Array.Empty<string>();
|
||||
|
||||
return Config.MaterialLibraries
|
||||
.Select(e => e.Material)
|
||||
.Where(s => !string.IsNullOrWhiteSpace(s));
|
||||
}
|
||||
|
||||
public CincinnatiPostProcessor()
|
||||
{
|
||||
var configPath = GetConfigPath();
|
||||
|
||||
Reference in New Issue
Block a user