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

Typescript and refactoring #26

Merged
merged 35 commits into from
Sep 29, 2019
Merged

Typescript and refactoring #26

merged 35 commits into from
Sep 29, 2019

Conversation

Julusian
Copy link
Member

@Julusian Julusian commented Sep 17, 2019

This is a refactor of the module to be written in typescript. This brings some better type safety within the module and should make it easier to make small changes with certainty of not breaking anything, and ensure nothing is missed.

As an example, one advantage here is that the feedback and actions systems use enums now. If someone tries to use a feedback id that is not in that enum the compiler will complain. This is also true if it is not included in the handlers, as there is a check to ensure all values are handled in the switch cases.

It is a bit of a hack as companion core doesnt have typescript definitions, so it doesnt play nicely, but I shall try and get them to support typescript in modules to make this cleaner and easier.

As part of this, I have gone through and tested every action, feedback and preset against my 2ME running 8.0.1, and everything is working nicely. Additionally, I tested most of it against a constellation running in both HD and 8K modes.

Other improvements:

  • Better handling of unknown models. Try and parse out the various fields from the state.
  • Remove the internal state tracking, and use the state object created by atem-connection directly.
  • Improve source/macro names in the dropdowns. Use the names from the device if possible.
  • Use less hardcoded arrays of options when possible
  • Split code into shorter files, to make it easier to browse and find bits

Left to do:

… it is expected that all state will be reset and probably glitch in the ui
@krocheck
Copy link
Member

@Julusian where are you at with this ... besides the obvious from the checklist above? I'll give this a merge on your go.

@cxselph
Copy link
Collaborator

cxselph commented Sep 23, 2019

@Julusian Just poking around and testing with your update and noticed that the available USK's show up as 1-16 on each me instead of ME1 1-4, etc... for actions and same with presets at least with the constellation. I am not getting errors. I know you still have things to work on. Just thought I would let you know. Thanks for all the hard work.

{
id: Enums.Model.Constellation,
label: 'Constellation',
inputs: 40,
auxes: 24,
MEs: 4,
USKs: 16, Should be 4
DSKs: 4,
MPs: 4,
MVs: 4,
multiviewerFullGrid: true,
SSrc: 2,
macros: 100
},

@Julusian
Copy link
Member Author

@krocheck That todo list is accurate on what I have left to do. Ill try and finish it up today, then I'll let you know once it is good.

@cxselph Good spot, that should be resolved now.

@Julusian
Copy link
Member Author

@krocheck I am happy that this is working and done now.

If you are happy I can merge it and raise a pr to get the module updated in core.

@krocheck krocheck merged commit 3afea89 into bitfocus:master Sep 29, 2019
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.

None yet

3 participants