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

Allow unlimited number of TCS cabview controls #717

Merged
merged 6 commits into from Jan 19, 2023

Conversation

cesarBLG
Copy link
Contributor

@cesarBLG cesarBLG commented Oct 1, 2022

Currently the number of TCS cab view controls is hard-coded to 48. This is not enough when more than one TCS can be active at a given time. Instead of increasing the hard-coded number, this allows an unlimited number of controls in a cleaner way.
https://blueprints.launchpad.net/or/+spec/unlimited-tcs-controls

@cesarBLG cesarBLG added the enhancement New feature or request label Oct 1, 2022
Sharpe49
Sharpe49 previously approved these changes Oct 25, 2022
@Sharpe49
Copy link
Contributor

This is quite a big change. We probably need a blueprint.

@cesarBLG
Copy link
Contributor Author

Oops! I forgot it

@cesarBLG
Copy link
Contributor Author

cesarBLG commented Oct 31, 2022

Sorry, I made a mistake and pushed to this branch unintentionally.

Anyway, it conflicts with #713

@Csantucci
Copy link
Contributor

César,
I have built your branch unlimited-tcs-controls and tested it with the ETR400. When I press Ctrl, (Ctrl + ,), which activates command ControlTCSGeneric1, OR crashes with the following lines in the logfile
Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Orts.Viewer3D.RollingStock.MSTSLocomotiveViewer.b__18_73() in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\RollingStock\MSTSLocomotiveViewer.cs:line 193
at Orts.Viewer3D.RollingStock.MSTSLocomotiveViewer.HandleUserInput(ElapsedTime elapsedTime) in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\RollingStock\MSTSLocomotiveViewer.cs:line 277
at Orts.Viewer3D.RollingStock.MSTSElectricLocomotiveViewer.HandleUserInput(ElapsedTime elapsedTime) in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\RollingStock\MSTSElectricLocomotiveViewer.cs:line 75
at Orts.Viewer3D.Viewer.HandleUserInput(ElapsedTime elapsedTime) in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Viewer.cs:line 901
at Orts.Viewer3D.Viewer.Update(RenderFrame frame, Single elapsedRealTime) in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Viewer.cs:line 745
at Orts.Viewer3D.Processes.GameStateViewer3D.Update(RenderFrame frame, Double totalRealSeconds) in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Processes\GameStateViewer3D.cs:line 119
at Orts.Viewer3D.Processes.UpdaterProcess.Update() in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 131
at Orts.Viewer3D.Processes.UpdaterProcess.DoUpdate() in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 108
at Orts.Viewer3D.Processes.UpdaterProcess.UpdaterThread() in J:\Git_repositories\OR_Cesar\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 74
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

@cesarBLG
Copy link
Contributor Author

cesarBLG commented Nov 1, 2022

Thanks for pointing it, Carlo. It's weird that I didn't spot it, as I've been using these commands a lot for LZB. I've just uploaded a fix.

@Csantucci
Copy link
Contributor

It works now, thanks.

Csantucci added a commit to Csantucci/openrails that referenced this pull request Nov 2, 2022
twpol pushed a commit that referenced this pull request Nov 24, 2022
- Pull request #652 at 918fdb1: Add button functions to Raildriver
- Pull request #706 at 570ab21: Extended door functionality
- Pull request #717 at 44fa8ad: Allow unlimited number of TCS cabview controls
- Pull request #719 at 13a1638: Upgraded to MonoGame 3.8.0 (+ small update for other libraries)
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 9cffa6d: Improvements for air brakes
- Pull request #733 at 72947b0: Fixed battery switch sound being repeted
- Pull request #734 at 8f8484c: Fixed battery switch timer not working properly
- Pull request #740 at b3e66ca: Refactored the circuit breaker and the traction cut-off relay in order to use the same design pattern as the C# signal scripts (compatible with current scripts)
- Pull request #741 at 2dd56ad: Fixed brake controller script not being loaded in timetable mode
- Pull request #744 at 3c2dc07: Fixed and improved cabview control conditions related to power supply state
- Pull request #746 at 0857d9b: Website release 1.5
- Pull request #748 at 4f0e878: latitude/longitude fix for bug 1393111
- Pull request #749 at db5764c: OpenRailway Map
- Pull request #750 at 424de68: Bug fix for https://bugs.launchpad.net/or/+bug/1997482. Explore in Activity Mode, is not restored.
@cesarBLG cesarBLG added the not-for-unstable Special label to exclude a pull request from the Unstable Version label Nov 24, 2022
@cesarBLG
Copy link
Contributor Author

cesarBLG commented Nov 24, 2022

OK, so now that #713 was merged the problem is with #706. Adding the not-for-unstable tag since the conflicts are preventing the compilation of unstable versions. It's not ideal that we have this obstacles to development with PRs created months ago. Let's see if at least one of the PR blueprints is approved so I can fix the other.

@cesarBLG cesarBLG removed the not-for-unstable Special label to exclude a pull request from the Unstable Version label Jan 18, 2023
twpol pushed a commit that referenced this pull request Jan 18, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #761 at f6a3aca: fix: Allow 100% cloud-free skys by making 0% overcast = 0% clouds
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at f143fcc: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at a0eae37: OpenRailway Map enhancements
twpol pushed a commit that referenced this pull request Jan 18, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #761 at f6a3aca: fix: Allow 100% cloud-free skys by making 0% overcast = 0% clouds
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at f143fcc: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at 41c9f26: OpenRailway Map enhancements
twpol pushed a commit that referenced this pull request Jan 19, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at 3d5d238: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at 41c9f26: OpenRailway Map enhancements
twpol pushed a commit that referenced this pull request Jan 19, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at 3d5d238: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at bc8aea4: OpenRailway Map enhancements
twpol pushed a commit that referenced this pull request Jan 19, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #719 at 0f4d975: Upgraded to MonoGame 3.8.0 (+ small update for other libraries)
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at 3d5d238: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at bc8aea4: OpenRailway Map enhancements
Copy link
Contributor

@cjakeman cjakeman left a comment

Choose a reason for hiding this comment

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

Hi Cesar,

This is a very worthwhile refinement.

Approved with thanks,

Chris

twpol pushed a commit that referenced this pull request Jan 19, 2023
- Pull request #717 at 98221c0: Allow unlimited number of TCS cabview controls
- Pull request #719 at 0f4d975: Upgraded to MonoGame 3.8.0 (+ small update for other libraries)
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 83002d7: Improvements for air brakes
- Pull request #735 at b9a0ea3: Added new parameter for battery switch
- Pull request #753 at ab8fe32: Extends CabControls for user input
- Pull request #760 at 113dd63: Updated EditorConfig with .NET and StyleCop analyzer configuration
- Pull request #764 at 5f9a01b: fix: Improve sky dome distortion causing bug #1471416
- Pull request #765 at 083467b: Bug fix for https://bugs.launchpad.net/or/+bug/2002183 OK to proceed sound played wrongly
- Pull request #766 at 3d5d238: Control Car additional functionality
- Pull request #767 at 9317f8c: Refine sunrise and sunset
- Pull request #768 at bc8aea4: OpenRailway Map enhancements
@cesarBLG
Copy link
Contributor Author

Thanks, Chris

@cesarBLG cesarBLG merged commit d0b80ed into openrails:master Jan 19, 2023
twpol pushed a commit to openrails/openrails.org that referenced this pull request Jan 28, 2023
…s-controls

Allow unlimited number of TCS cabview controls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
4 participants