mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Data model visualization - Simplified and improved VMs
Layer conditions - Added left side property selection
This commit is contained in:
1 parent
55555ed6a8
commit
4e1a09308f
38 files changed
+908
-359
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions.Abstract
|
||||
{
|
||||
public abstract class DisplayConditionPart
|
||||
{
|
||||
private readonly List<DisplayConditionPart> _children;
|
||||
|
||||
protected DisplayConditionPart()
|
||||
{
|
||||
_children = new List<DisplayConditionPart>();
|
||||
}
|
||||
|
||||
public DisplayConditionPart Parent { get; set; }
|
||||
public IReadOnlyList<DisplayConditionPart> Children => _children.AsReadOnly();
|
||||
|
||||
public void AddChild(DisplayConditionPart displayConditionPart)
|
||||
{
|
||||
if (!_children.Contains(displayConditionPart))
|
||||
{
|
||||
displayConditionPart.Parent = this;
|
||||
_children.Add(displayConditionPart);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveChild(DisplayConditionPart displayConditionPart)
|
||||
{
|
||||
if (_children.Contains(displayConditionPart))
|
||||
{
|
||||
displayConditionPart.Parent = null;
|
||||
_children.Remove(displayConditionPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions.Abstract
|
||||
{
|
||||
public abstract class LayerConditionPart
|
||||
{
|
||||
protected LayerConditionPart()
|
||||
{
|
||||
Children = new List<LayerConditionPart>();
|
||||
}
|
||||
|
||||
public List<LayerConditionPart> Children { get; set; }
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -4,9 +4,9 @@ using Artemis.Core.Plugins.Abstract.DataModels;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public class LayerCondition
|
||||
public class DisplayCondition
|
||||
{
|
||||
public Expression<Func<DataModel, bool>> ExpressionTree { get; set; }
|
||||
public LayerConditionGroup RootGroup { get; set; }
|
||||
public DisplayConditionGroup RootGroup { get; set; }
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public class LayerConditionGroup : LayerConditionPart
|
||||
public class DisplayConditionGroup : DisplayConditionPart
|
||||
{
|
||||
public BooleanOperator BooleanOperator { get; set; }
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public class LayerConditionListStatement : LayerConditionPart
|
||||
public class DisplayConditionListPredicate : DisplayConditionPart
|
||||
{
|
||||
public ListOperator ListOperator { get; set; }
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Artemis.Core.Services.Interfaces;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public abstract class LayerConditionOperator
|
||||
public abstract class DisplayConditionOperator
|
||||
{
|
||||
private IDataModelService _dataModelService;
|
||||
private bool _registered;
|
||||
+2
-2
@@ -3,12 +3,12 @@ using Artemis.Core.Models.Profile.Conditions.Abstract;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public class LayerConditionStatement : LayerConditionPart
|
||||
public class DisplayConditionPredicate : DisplayConditionPart
|
||||
{
|
||||
public Guid DataModelGuid { get; set; }
|
||||
public string PropertyPath { get; set; }
|
||||
|
||||
public LayerConditionOperator Operator { get; set; }
|
||||
public DisplayConditionOperator Operator { get; set; }
|
||||
public object Value { get; set; }
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ using System.Linq.Expressions;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
||||
{
|
||||
public class GreaterThanConditionOperator : LayerConditionOperator
|
||||
public class GreaterThanConditionOperator : DisplayConditionOperator
|
||||
{
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type>
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Artemis.Core.Extensions;
|
||||
using Artemis.Core.Models.Profile.Conditions;
|
||||
using Artemis.Core.Models.Profile.LayerProperties;
|
||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
||||
using Artemis.Core.Models.Profile.LayerShapes;
|
||||
@@ -22,6 +23,7 @@ namespace Artemis.Core.Models.Profile
|
||||
/// </summary>
|
||||
public sealed class Layer : EffectProfileElement
|
||||
{
|
||||
private DisplayConditionGroup _displayConditionGroup;
|
||||
private LayerGeneralProperties _general;
|
||||
private SKBitmap _layerBitmap;
|
||||
private BaseLayerBrush _layerBrush;
|
||||
@@ -115,6 +117,15 @@ namespace Artemis.Core.Models.Profile
|
||||
internal set => SetAndNotify(ref _layerBrush, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the root display condition group
|
||||
/// </summary>
|
||||
public DisplayConditionGroup DisplayConditionGroup
|
||||
{
|
||||
get => _displayConditionGroup;
|
||||
set => SetAndNotify(ref _displayConditionGroup, value);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[Layer] {nameof(Name)}: {Name}, {nameof(Order)}: {Order}";
|
||||
|
||||
Reference in new issue
Block a user