Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom animation #199

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

JasonBSteele
Copy link

@JasonBSteele JasonBSteele commented Sep 21, 2021

I've added a window to create custom animations that is based on the existing PercentageProfile work that was already done.

I added a button the the MainWindow to spawn it.

@bartdebever - hope I'm following process - first GitHub PR!

Copy link
Member

@bartdebever bartdebever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall do like the PR and changes are pretty good. For sure some editor clashes in terms of spacing we have to figure out. Please do look over the file changes yourself for the issues.

I could look into creating a .editorconfig on this branch if that would help you?
What does your development environment look like?

I've not functionally tested the PR yet, mostly cause its midnight while I'm writing this and partly cause my Nanoleafs fell down a while ago and I've been unable to hang them up again. Should be able to do a functional test next week using both the triagles and the canvas.

What devices have you tested the PR on?

Winleafs.Api/Endpoints/NanoleafEndpoint.cs Outdated Show resolved Hide resolved
Winleafs.Models/Models/Effects/CustomEffectCommand.cs Outdated Show resolved Hide resolved
/// <summary>
/// A series of frames each specifying the color for each panel
/// </summary>
public IList<Frame> Frames { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally prefer using either IEnumerable<T> or just List<T>, don't see a point in using IList<T>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So IMHO IList<T> is preferable to List<T> so we're not forcing the specific implementation of List. IEnumerable may be okay if I'm not using any IList methods. Sometimes you can end up with LINQ having to provide functionality that is already there, an example is Count. IList provides a property for Count, IEnumerable doesn't, so if you need to count the items you have to get LINQ to iterate over the IEnumerable for you using Count() rather than just using the Count property that would be there if it were an IList.

The same is true for Any(), rather than Count > 0. This isn't as bad as Count() as Any() just needs to read one item from the IEnumerable, but it is still less efficient than the Count property.

I'll see what I break if I change to IEnumerable and get back to you.

Copy link
Author

@JasonBSteele JasonBSteele Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of use of indexing, so it has to be List or IList. Personally I prefer IList as this means if we ever wanted to swap the implementation from List to a similar collection that still implements IList we would know it would definitely not break any existing code.

Winleafs.Wpf/Api/Effects/CustomEffectCommandBuilder.cs Outdated Show resolved Hide resolved
Winleafs.Wpf/Api/Effects/CustomEffectCommandBuilder.cs Outdated Show resolved Hide resolved
Winleafs.Wpf/Views/Layout/CreateEffectWindow.xaml.cs Outdated Show resolved Hide resolved
Winleafs.Wpf/Views/Layout/CreateEffectWindow.xaml.cs Outdated Show resolved Hide resolved
Winleafs.Wpf/Views/Layout/CreateEffectWindow.xaml.cs Outdated Show resolved Hide resolved
Winleafs.Wpf/Views/Layout/CreateEffectWindow.xaml.cs Outdated Show resolved Hide resolved
/// </summary>
public partial class LayoutDisplayUserControl : UserControl
{
private static readonly SolidColorBrush _lockedBorderColor = Brushes.Red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd how the formatting changed. Maybe it would be good for us to get more professional on the repository as well and add an .editorconfig @StijnOostdam

@bartdebever
Copy link
Member

Also apologies if some comments don't make a lot of sense or are placed weirdly. I'm still not used to the GitHub PR system. If you feel you'd rather explain something or talk about issues in a more personal matter, feel free to ask me for some contact details. I'm also within the Nanoleaf Discord under the name "Bort".

@JasonBSteele
Copy link
Author

@bartdebever, thanks for taking the time to review my PR - much appreciated! I have made another commit that makes the changes for all the comments I have resolved in the feedback. I have also sent yo a friend request on Nanoleaf Discord as Stellarat.

bartdebever added a commit that referenced this pull request Apr 28, 2022
Reworked the code to fit the new architecture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants