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.

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