Elvas Tower: Justification (Alignment) for digitals in 3Dcabs - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Justification (Alignment) for digitals in 3Dcabs Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 13 September 2021 - 12:52 AM

As of now justification for digitals in 3Dcabs is not managed. All digitals are left aligned, independently from the value of the Justification() parameter in the .cvf file.
I have created a patch which introduces this feature, which is present in 2D cabs.
To avoid changes in behaviour of existing 3D cabs, I am using for alignment in 3D cabs three additional values for Justification (at the moment values from 1 to 3 are used), that is 4 for center, 5 for left and 6 for right alignment. These values are considered only for 3D cabs.

In the existing code the digits are aligned just at the left of the x value of the related matrix in the .s file. The maximum number of digits allowed is 6.
To avoid bigger changes in the code, in the patch in case of right alignment a suitable number of blanks is added in front of the digital string, e.g. if there is one digit 5 blanks are added, if there are two 4 blanks are added and so on.
In case of center alignment the same procedure is used, although of course less blanks are required.

Blueprint: https://blueprints.l...nment-in-3dcabs

A PR to the master branch has been generated. Unfortunately the code bot hasn't generated an Unstable Release and exited with this error, seen in page https://james-ross.co.uk/projects/or .


Open Rails Code Bot started at 2021-09-13 09:21:09Z
GitHub organisation:
GitHub team:
GitHub repository:
GitHub base branch:
GitHub merge branch:
Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Open_Rails_Code_Bot.GitHub.Query.GetTeamMembers(String organization, String team) in C:\Jenkins\jobs\Open Rails Code Bot\workspace\GitHub\Query.cs:line 54
at Open_Rails_Code_Bot.Program.AsyncMain(IConfigurationRoot config) in C:\Jenkins\jobs\Open Rails Code Bot\workspace\Program.cs:line 53
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Open_Rails_Code_Bot.Program.Main(String[] args) in C:\Jenkins\jobs\Open Rails Code Bot\workspace\Program.cs:line 31

#2 User is offline   superheatedsteam 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 500
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 13 September 2021 - 03:42 AM

Thank you for doing this Carlo. This is a welcome and appreciated change.

Cheers,

Marek.

#3 User is offline   akioyamamura 

  • Hostler
  • Group: Status: Active Member
  • Posts: 73
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 13 September 2021 - 07:30 AM

Awesome Carlo. Thank you!

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 13 September 2021 - 09:05 AM

Thank you! The feature is now available in OR NewYear MG rev 104.2.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users