mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Plugins - Load features by their info before enabling plugins
General - Added missing XML comments
This commit is contained in:
1 parent
fa26e6b7da
commit
d5d1211649
24 files changed
+241
-180
No files matched your search
@@ -38,6 +38,9 @@ namespace Artemis.Core
|
||||
/// </summary>
|
||||
public DataModelPath? EventPath { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the last time the event this condition is applied to was triggered
|
||||
/// </summary>
|
||||
public DateTime LastTrigger { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -53,7 +56,7 @@ namespace Artemis.Core
|
||||
if (_disposed)
|
||||
throw new ObjectDisposedException("DataModelConditionEvent");
|
||||
|
||||
if (EventPath?.GetValue() is not IDataModelEvent dataModelEvent)
|
||||
if (EventPath?.GetValue() is not IDataModelEvent dataModelEvent)
|
||||
return false;
|
||||
// Only evaluate to true once every time the event has been triggered since the last evaluation
|
||||
if (dataModelEvent.LastTrigger <= LastTrigger)
|
||||
@@ -67,7 +70,6 @@ namespace Artemis.Core
|
||||
|
||||
// If there are no children, we always evaluate to true whenever the event triggered
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -131,7 +133,7 @@ namespace Artemis.Core
|
||||
// Target list
|
||||
EventPath?.Save();
|
||||
Entity.EventPath = EventPath?.Entity;
|
||||
|
||||
|
||||
// Children
|
||||
Entity.Children.Clear();
|
||||
Entity.Children.AddRange(Children.Select(c => c.GetEntity()));
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace Artemis.Core
|
||||
{
|
||||
LedEntity ledEntity = new()
|
||||
{
|
||||
DeviceIdentifier = artemisLed.Device.RgbDevice.GetDeviceIdentifier(),
|
||||
DeviceIdentifier = artemisLed.Device.Identifier,
|
||||
LedName = artemisLed.RgbLed.Id.ToString()
|
||||
};
|
||||
LayerEntity.Leds.Add(ledEntity);
|
||||
@@ -578,7 +578,7 @@ namespace Artemis.Core
|
||||
List<ArtemisLed> availableLeds = devices.SelectMany(d => d.Leds).ToList();
|
||||
foreach (LedEntity ledEntity in LayerEntity.Leds)
|
||||
{
|
||||
ArtemisLed? match = availableLeds.FirstOrDefault(a => a.Device.RgbDevice.GetDeviceIdentifier() == ledEntity.DeviceIdentifier &&
|
||||
ArtemisLed? match = availableLeds.FirstOrDefault(a => a.Device.Identifier == ledEntity.DeviceIdentifier &&
|
||||
a.RgbLed.Id.ToString() == ledEntity.LedName);
|
||||
if (match != null)
|
||||
leds.Add(match);
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Artemis.Core
|
||||
|
||||
internal ArtemisDevice(IRGBDevice rgbDevice, DeviceProvider deviceProvider)
|
||||
{
|
||||
Identifier = rgbDevice.GetDeviceIdentifier();
|
||||
DeviceEntity = new DeviceEntity();
|
||||
RgbDevice = rgbDevice;
|
||||
DeviceProvider = deviceProvider;
|
||||
@@ -45,6 +46,7 @@ namespace Artemis.Core
|
||||
|
||||
internal ArtemisDevice(IRGBDevice rgbDevice, DeviceProvider deviceProvider, DeviceEntity deviceEntity)
|
||||
{
|
||||
Identifier = rgbDevice.GetDeviceIdentifier();
|
||||
DeviceEntity = deviceEntity;
|
||||
RgbDevice = rgbDevice;
|
||||
DeviceProvider = deviceProvider;
|
||||
@@ -59,6 +61,11 @@ namespace Artemis.Core
|
||||
ApplyKeyboardLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the (hopefully unique and persistent) ID of this device
|
||||
/// </summary>
|
||||
public string Identifier { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the rectangle covering the device
|
||||
/// </summary>
|
||||
@@ -336,7 +343,7 @@ namespace Artemis.Core
|
||||
internal void ApplyToEntity()
|
||||
{
|
||||
// Other properties are computed
|
||||
DeviceEntity.Id = RgbDevice.GetDeviceIdentifier();
|
||||
DeviceEntity.Id = Identifier;
|
||||
|
||||
DeviceEntity.InputIdentifiers.Clear();
|
||||
foreach (ArtemisDeviceInputIdentifier identifier in InputIdentifiers)
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace Artemis.Core
|
||||
private set => SetAndNotify(ref _absoluteRectangle, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the layout applied to this LED
|
||||
/// </summary>
|
||||
public ArtemisLedLayout? Layout { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -53,7 +56,7 @@ namespace Artemis.Core
|
||||
{
|
||||
return RgbLed.ToString();
|
||||
}
|
||||
|
||||
|
||||
internal void CalculateRectangles()
|
||||
{
|
||||
Rectangle = RgbLed.Boundary.ToSKRect();
|
||||
|
||||
@@ -5,6 +5,9 @@ using RGB.NET.Layout;
|
||||
|
||||
namespace Artemis.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a LED layout decorated with extra Artemis-specific data
|
||||
/// </summary>
|
||||
public class ArtemisLedLayout
|
||||
{
|
||||
internal ArtemisLedLayout(ArtemisLayout deviceLayout, ILedLayout led)
|
||||
|
||||
Reference in new issue
Block a user