Skip to content

Commit

Permalink
VIX-3570 More enhancements and bug fixes
Browse files Browse the repository at this point in the history
VIX-3570 More enhancements and bug fixes
  • Loading branch information
johncbaur committed Aug 30, 2024
1 parent 7fc945e commit ee06d22
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 54 deletions.
42 changes: 27 additions & 15 deletions src/Vixen.Modules/Effect/Effect/FixtureEffectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ protected List<IElementNode> GetRenderNodesForFunctionIdentity(
// Find the function associated with the effect based on function identity enumeration
FixtureFunction func = fixtureProperty.FixtureSpecification.FunctionDefinitions.SingleOrDefault(function => function.FunctionIdentity == type);

// Add the node and function information to the dictionary
nodeToFunction.Add(leafNode, new (func.Label, func.Name));
// If we have not already processed this node then...
if (!nodeToFunction.ContainsKey(leafNode))
{
// Add the node and function information to the dictionary
nodeToFunction.Add(leafNode, new(func.Label, func.Name));

// Add the node to collection of render nodes
renderNodes.Add(leafNode);
// Add the node to collection of render nodes
renderNodes.Add(leafNode);
}
}
}
}
Expand Down Expand Up @@ -232,11 +236,15 @@ protected IEnumerable<Tuple<IElementNode, string>> GetRenderNodesForFunctionIden
// Find the function associated with the effect based on function identity enumeration
FixtureFunction func = fixtureProperty.FixtureSpecification.FunctionDefinitions.SingleOrDefault(function => function.FunctionIdentity == type);

// Add the function name to the collection of tags
tags.Add(leafNode, func.Name);
// If we have not already processed this node then...
if (!tags.ContainsKey(leafNode))
{
// Add the function name to the collection of tags
tags.Add(leafNode, func.Name);

// Add the leaf to the collection of nodes to return
leavesThatSupportFunction.Add(new Tuple<IElementNode, string>(leafNode, func.Label));
// Add the leaf to the collection of nodes to return
leavesThatSupportFunction.Add(new Tuple<IElementNode, string>(leafNode, func.Label));
}
}
}
}
Expand Down Expand Up @@ -589,14 +597,18 @@ protected List<FixtureFunction> GetFixtureFunctions()
// Loop over the channels of the fixture
foreach (FixtureChannel channel in fixtureSpecification.ChannelDefinitions)
{
// Get the function associated with the channel
FixtureFunction func = fixtureSpecification.FunctionDefinitions.Single(function => function.Name == channel.Function);

// If the function has not already been added then...
if (func.FunctionType != FixtureFunctionType.None && !fixtureFunctions.Contains(func))
// Guarding against a corrupted profile
if (!string.IsNullOrEmpty(channel.Function))
{
// Add the function to the collection of supported functions
fixtureFunctions.Add(func);
// Get the function associated with the channel
FixtureFunction func = fixtureSpecification.FunctionDefinitions.Single(function => function.Name == channel.Function);

// If the function has not already been added then...
if (func.FunctionType != FixtureFunctionType.None && !fixtureFunctions.Contains(func))
{
// Add the function to the collection of supported functions
fixtureFunctions.Add(func);
}
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions src/Vixen.Modules/Effect/LineDance/FanDirection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VixenModules.Effect.LineDance
{
public enum FanDirections
{
/// <summary>
/// </summary>
[Description("Fan From Edges")]
FanFromEdges,

/// <summary>
/// </summary>
[Description("Fan From Center")]
FanFromCenter,

}
}
20 changes: 19 additions & 1 deletion src/Vixen.Modules/Effect/LineDance/LineDanceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public LineDanceData()

// Default the pan increment to 80%
PanIncrement = 80;

// Default the speed to 40%
PanSpeed = 40;

// Default the hold time to 10%
HoldTime = 10;
}

#endregion
Expand All @@ -43,6 +49,9 @@ public LineDanceData()
[DataMember]
public FanModes FanMode { get; set; }

[DataMember]
public FanDirections FanDirection { get; set; }

[DataMember]
public bool InvertPan { get; set; }

Expand All @@ -58,9 +67,15 @@ public LineDanceData()
[DataMember]
public int PanIncrement { get; set; }

[DataMember]
public int PanSpeed { get; set; }

[DataMember]
public FanCenterOptions CenterHandling { get; set; }


[DataMember]
public int HoldTime { get; set; }

#endregion

#region Protected Methods
Expand All @@ -75,12 +90,15 @@ protected override EffectTypeModuleData CreateInstanceForClone()
{
Mode = Mode,
FanMode = FanMode,
FanDirection = FanDirection,
IncrementAngle = new Curve(IncrementAngle),
PanStartAngle = PanStartAngle,
CenterHandling = CenterHandling,
AdvancedOverrides = AdvancedOverrides,
PanIncrement = PanIncrement,
PanSpeed = PanSpeed,
InvertPan = InvertPan,
HoldTime = HoldTime,
};
return result;
}
Expand Down
Loading

0 comments on commit ee06d22

Please sign in to comment.