The International Simutrans Forum


Author Topic: signal spacing  (Read 728 times)

0 Members and 1 Guest are viewing this topic.

Offline Phystam jp

  • *
  • Posts: 269
  • Pak256.Ex developer
  • Languages: JP, EN, EO
signal spacing
« on: September 06, 2019, 05:39:24 PM »
Can we show signal spacing option with meter unit? Maybe such kind of feature would be very useful to build signals automatically.

I made a small patch for this feature.
Github branch is here.

« Last Edit: September 06, 2019, 06:01:18 PM by Phystam »

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 577
  • Languages: EN, FR, DE, FI, SE
Re: signal spacing
« Reply #1 on: September 06, 2019, 11:32:26 PM »
Did you adjust the placing tool so that it places signals on diagonal track according to Euclidean distance?

Offline ACarlotti

  • *
  • Posts: 483
Re: signal spacing
« Reply #2 on: September 07, 2019, 02:16:05 AM »
I notice that the Github diff suggests that you've changed every line in those files - this usually means you've accidentally converted from LF to CRLF line endings (or vice-versa). This should probably be avoided - I think there's some Git setting to specify what line ending to use in source control. I also notice that you are defining a local variable meters_per_tile and not using it.

Finally, does your screenshot show correct values? 600m for 24 tiles looks like it might be a factor-of-ten error for a 250m/tile pakset.

Offline Phystam jp

  • *
  • Posts: 269
  • Pak256.Ex developer
  • Languages: JP, EN, EO
Re: signal spacing
« Reply #3 on: September 07, 2019, 02:51:59 AM »
Rollmaterial -- No, the tool itself is still same as previous.

ACarlotti -- Okej, I will change it.
And the screenshot is okej, since pak256-Ex pakset has 25m/tile scale.

I checked the line breaking codes --- these are... like chaos.
Code: [Select] ASCII (LF)
ai_option_t.h: ASCII (LF) ASCII (LF)
banner.h: Shift_JIS (LF) ASCII (LF)
base_info.h: ASCII (LF) Shift_JIS (LF)
baum_edit.h: ASCII (CRLF) Shift_JIS (LF)
city_info.h: Shift_JIS (CRLF) Shift_JIS (LF)
citybuilding_edit.h: ASCII (LF) Shift_JIS (LF)
citylist_frame_t.h: ASCII (CRLF) Shift_JIS (CRLF)
citylist_stats_t.h: Shift_JIS (CRLF) ASCII (CRLF)
climates.h: ASCII (CRLF)
components: ASCII Shift_JIS (LF)
convoi_detail_t.h: Shift_JIS (LF) Shift_JIS (LF)
convoi_filter_frame.h: Shift_JIS (CRLF) Shift_JIS (CRLF)
convoi_frame.h: Shift_JIS (CRLF) Shift_JIS (LF)
convoi_info_t.h: Shift_JIS (LF) ASCII (CRLF)
convoy_item.h: ASCII (CRLF) Shift_JIS (LF)
curiosity_edit.h: ASCII (LF) Shift_JIS (CRLF)
curiositylist_frame_t.h: ASCII (LF) Shift_JIS (CRLF)
curiositylist_stats_t.h: Shift_JIS (CRLF) ASCII (LF)
depot_frame.h: Shift_JIS (CRLF) Shift_JIS (LF)
display_settings.h: ASCII (LF) ASCII (LF)
enlarge_map_frame_t.h: ASCII (LF) Shift_JIS (CRLF)
extend_edit.h: ASCII (LF) Shift_JIS (LF)
fabrik_info.h: Shift_JIS (LF) ASCII (LF)
factory_chart.h: ASCII (CRLF) Shift_JIS (LF)
factory_edit.h: ASCII (LF) Shift_JIS (LF)
factorylist_frame_t.h: ASCII (LF) Shift_JIS (LF)
factorylist_stats_t.h: Shift_JIS (LF) Shift_JIS (CRLF)
goods_frame_t.h: Shift_JIS (CRLF) Shift_JIS (LF)
goods_stats_t.h: Shift_JIS (LF) Shift_JIS (LF)
ground_info.h: Shift_JIS (LF) Shift_JIS (CRLF)
gui_frame.h: Shift_JIS (LF) UTF-8 (BOM) (CRLF)
gui_theme.h: UTF-8 (BOM) (CRLF) Shift_JIS (BOM) (LF)
halt_detail.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (LF)
halt_info.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
halt_list_filter_frame.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (LF)
halt_list_frame.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (CRLF)
halt_list_stats.h: Shift_JIS (BOM) (LF) UTF-8 (BOM) (CRLF)
help_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
jump_frame.h: Shift_JIS (BOM) (LF) ASCII (BOM) (LF)
karte.h: ASCII (BOM) (LF) Shift_JIS (BOM) (LF)
kennfarbe.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (CRLF)
label_info.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (CRLF)
labellist_frame_t.h: ASCII (BOM) (CRLF) Shift_JIS (BOM) (LF)
labellist_stats_t.h: Shift_JIS (BOM) (LF) UTF-8 (BOM) (LF)
line_class_manager.h: Shift_JIS (BOM) (LF) ASCII (BOM) (CRLF)
line_item.h: ASCII (BOM) (CRLF) ASCII (BOM) (LF)
line_management_gui.h: ASCII (BOM) (LF) Shift_JIS (BOM) (CRLF)
load_relief_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
loadsave_frame.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (LF)
map_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (CRLF)
message_frame_t.h: Shift_JIS (BOM) (LF) ASCII (BOM) (LF)
message_option_t.h: ASCII (BOM) (LF) Shift_JIS (BOM) (LF)
message_stats_t.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
messagebox.h: ASCII (BOM) (LF) Shift_JIS (BOM) (LF)
money_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
obj_info.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
onewaysign_info.h: Shift_JIS (BOM) (LF) ASCII (BOM) (CRLF)
optionen.h: ASCII (BOM) (LF) ASCII (BOM) (LF)
overtaking_mode.h: ASCII (BOM) (LF) ASCII (BOM) (CRLF)
pakselector.h: ASCII (BOM) (CRLF) ASCII (BOM) (LF)
password_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
player_frame_t.h: ASCII (BOM) (CRLF) Shift_JIS (BOM) (CRLF)
privatesign_info.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
replace_frame.h: Shift_JIS (BOM) (LF) EUC-JP (BOM) (LF)
savegame_frame.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (CRLF)
scenario_frame.h: Shift_JIS (BOM) (CRLF) ASCII (BOM) (LF)
scenario_info.h: ASCII (BOM) (CRLF) UTF-8 (BOM) (LF)
schedule_gui.h: Shift_JIS (BOM) (LF) ASCII (BOM) (LF)
schedule_list.h: ASCII (BOM) (LF) Shift_JIS (BOM) (CRLF)
schiene_info.h: Shift_JIS (BOM) (LF) Shift_JIS (BOM) (LF)
server_frame.h: ASCII (BOM) (CRLF) Shift_JIS (BOM) (LF)
settings_frame.h: Shift_JIS (BOM) (CRLF) ASCII (BOM) (LF)
settings_stats.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (LF)
signal_info.h: Shift_JIS (BOM) (LF) ASCII (BOM) (CRLF)
signal_spacing.h: ASCII (BOM) (CRLF) ASCII (BOM) (LF)
simwin.h: ASCII (BOM) (LF) Shift_JIS (BOM) (CRLF)
sound_frame.h: Shift_JIS (BOM) (CRLF) Shift_JIS (BOM) (LF)
sprachen.h: ASCII (BOM) (CRLF) Shift_JIS (BOM) (CRLF)
station_building_select.h: Shift_JIS (BOM) (LF) ASCII (BOM) (CRLF)
themeselector.h: ASCII (BOM) (LF) ASCII (BOM) (LF)
times_history.h: ASCII (BOM) (LF) ASCII (BOM) (LF)
times_history_container.h: ASCII (BOM) (LF) ASCII (BOM) (LF)
times_history_entry.h: ASCII (BOM) (LF) ASCII (BOM) (LF)
tool_selector.h: ASCII (BOM) (LF) Shift_JIS (BOM) (LF)
trafficlight_info.h: Shift_JIS (BOM) (LF) UTF-8 (BOM) (LF)
vehicle_class_manager.h: Shift_JIS (BOM) (LF) ASCII (BOM) (LF)
welt.h: ASCII (BOM) (CRLF)

Offline Ranran jp

  • *
  • Posts: 490
  • Languages: ja
Oh umlaut
« Reply #4 on: September 13, 2019, 12:19:36 PM »
I checked the line breaking codes --- these are... like chaos.

This issue often bothers me. (´・ω・`)
As you all know, Simutrans was born in Germany. :hat:   The simutrans code sometimes contains umlauts.
Since umlauts cannot be displayed in the Japanese Shift-JIS environment, MSVS converts those character codes when opening a Shift-JIS format file that has them (a warning message pops out). So German characters are not preserved correctly.  :warning:
If we save that auto converted file, those characters will be garbled. Because there is no umlaut in Japanese Shift-JIS environment! The alliance between Japan and Germany has been destroyed.  ::'(
So if the file is in Shift-JIS format, I am careful not to update the German mixed lines every time. I manually exclude those lines...

And sometimes Github somehow rejects that file, so immature Ranran can not push that file directly...

Oh umlaut, umlaut! why are you umlaut? (´・ω・`)
I dropped out of the German class because I don't like you! I can not even say your name.  :P

Offline Freahk

  • *
  • Posts: 228
  • Languages: DE, EN
Re: signal spacing
« Reply #5 on: September 13, 2019, 01:17:02 PM »
+1 for "umlauts" :D Did not know these are really called umlauts. Sounds just as crazy as Schnitzel in an english sentence.

You should try to open the files in iso-8859-1 encoding, which was typicall used in Germany before utf-8 was introduced. However, this has nothing to do with linebreaks.

Also, I am wondering if there is any linebreak convention for simutrans code, so we could replace wrong linebreaks for consistency reasons.

Edit: for globalisation reasons, we should think about converting from iso-8859-1 to UTF-8, however, I am aware that this could cause problems, when not done carefully.

Offline Phystam jp

  • *
  • Posts: 269
  • Pak256.Ex developer
  • Languages: JP, EN, EO
Re: signal spacing
« Reply #6 on: November 12, 2019, 12:00:21 PM »
Now the signal spacing window looks more better like this:

Now you do not have to calculate the actual length in meters from the tile number. Just putting value in meter unit, that's all.
The diagonal length is now calculated using Euclid length.

github branch:
In this version, I fixed the LF / CRLF errors.
« Last Edit: November 12, 2019, 12:26:36 PM by Phystam »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: signal spacing
« Reply #7 on: November 13, 2019, 12:05:17 PM »

Offline Phystam jp

  • *
  • Posts: 269
  • Pak256.Ex developer
  • Languages: JP, EN, EO
Re: signal spacing
« Reply #8 on: November 13, 2019, 04:59:16 PM »
I think that we should always use the UTF8 encoding and LF line ending. If someone (maybe James or A.Carlotti) changes the text encoding system using .gitattributes, such problems will never happen...