Author Topic: Schedule features: technical discussion  (Read 5655 times)

0 Members and 1 Guest are viewing this topic.

Offline Ves

  • Devotee
  • *
  • Posts: 1436
  • Languages: EN, SV, DK
Schedule features: technical discussion
« Reply #35 on: March 15, 2018, 01:46:29 PM »
Thanks, but how do I manipulate the entry? How do I set the condition trigger to, say 5?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Schedule features: technical discussion
« Reply #36 on: March 15, 2018, 04:41:47 PM »
Are you referring to how to set and read the bitfields (of which condition_trigger) is one? If so, then you need to use the following methods as defined in schedule.h:

Code: [Select]
bool is_flag_set(schedule_entry_flag flag) const { return flag & flags; }

void set_flag(schedule_entry_flag flag) { flags |= flag; }

void clear_flag(schedule_entry_flag flag) { flags &= ~flag; }

So, if you want to check whether the condition trigger is set for a schedule entry called "kittens_entry", you would do as follows:

Code: [Select]
bool is_set = kittens_entry.is_flag_set(condition_trigger);

If you want to set the target_id_condition_trigger field, you need only set it directly from the relevant schedule_entry_t object, so, for example:

Code: [Select]
kittens_entry.target_id_condition_trigger = 5;

Does this assist?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ves

  • Devotee
  • *
  • Posts: 1436
  • Languages: EN, SV, DK
Re: Schedule features: technical discussion
« Reply #37 on: March 17, 2018, 10:58:54 PM »
Thanks, yes that does help.

Could you perhaps clarify what is the difference between:

"condition_bitfield_receiver"
and
"condition_bitfield_broadcaster"

Which one is used for what?

I have a new schedule window with some new functions, however the layout is currently horrible. It is only so you can start testing the features. The consist order management it self I have not yet begun with, I need to think what the window needs to look like and start from there somewhere.
I will upload the new schedule window soon to github!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Schedule features: technical discussion
« Reply #38 on: March 17, 2018, 11:09:21 PM »
Thank you - that is very helpful.

The condition bitfield broadcaster is the identity of the signal(s) sent to convoys upon the reaching of the relevant point in the schedule. The condition bitfield receiver is the identity of the signal(s) to which that convoy should respond at that particular point in its schedule. Does this make sense?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ves

  • Devotee
  • *
  • Posts: 1436
  • Languages: EN, SV, DK
Re: Schedule features: technical discussion
« Reply #39 on: March 17, 2018, 11:20:46 PM »
Thanks. So to rephrase it:

So when the convoy is waiting for a conditional trigger, it is waiting for the correct value from the condition_bitfield_reciever?

And directly when the convoy stops at a schedule entry, it automatically broadcasts the value set in condition_bitfield_broadcaster to other convoys?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Schedule features: technical discussion
« Reply #40 on: March 17, 2018, 11:56:41 PM »
Yes, indeed.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ves

  • Devotee
  • *
  • Posts: 1436
  • Languages: EN, SV, DK
Re: Schedule features: technical discussion
« Reply #41 on: March 18, 2018, 01:17:19 AM »
So, a first incarnation of the new schedule window is ready:

I believe the condition triggers are setup correctly, you could perhaps take a look and check that they are altered correctly.
The "lay over" and "force range stop" buttons are also in place, and they appear to be working. Again, please have a look :)
The button "modify convoy" is non functional. It only serves a function to take up space in the window to see where things might have their places.

I have altered the order of the left hand side stuff, for instance moved the "maximum wait time" to be furtherst down. It is my believe that that should be able to be used together with all modes of "wait for..."
I would like to alter the way you specify the wait for time. Currently the clock comes alive when you press the wait for time button, but I would rather have the clock come alive by a button down next to the departures/month text somewhere. Then it would be more obvious that the player decides that "this" station should wait for time, and "this" and "this" etc, and you can alter the time even if another station is selected. The "Shift value" I would like to have a douplicate in the upper left hand section, so when the "use same shift...." is unpressed, the original one in the lower section gets greyed out and the upper one gets active. Then if the "use same shift..." is ticked again, its vice versa.

Now, in the schedule entries, I have made some alterations:
I built upon the syntax "[somethingsomething]" and it is currently the initials of the commands which is showed. Im not sure if that is the best way, I could not think of any symbols that might be better suited. Now as initials, they can be used together with translator::translate, so people can translate that into their own language if wanted. However, I think that the condition triggers looks very nice with [->4] and [4->], which means reciever respectively broadcaster. It should become quite obvious once you start play around with the buttons.

Now the layout is not really finish as well as the window needs resized, but I think it is something like this I would do. There are room for more buttons and text if needed.
The couple and uncouple commands along with the specific line and convoy target id trigger I have not touched upon yet, I had an idea that some of this either was done automatically by the GUI, alternatively if it is needed, the commands could live in the modify convoy window, to have more overview there. Or do you think otherwise?

What more functions exists in this manner that would fit well into the schedule window?

Github: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/consist-order-gui

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Schedule features: technical discussion
« Reply #42 on: March 18, 2018, 02:19:29 PM »
Thank you very much for your work on this: this is most helpful.

In relation to the specification of "Wait for time", it appears that the "wait for time" button is not currently working properly, as the "Departures/month; shift" number entry fields are not activated when this is first pressed. The suggestion in relation to the placement/number of the number entry fields for the spacing shift seems sensible.

In relation to the couple/uncouple parameters, these will need to be able to be set manually in the GUI (but you might think it better to have the settings for this in the "Modify convoy" window; but I will leave that to your discretion).

As to your last question, can you elaborate on what you mean by functions existing in this manner?

Thank you again for your work - it is much appreciated. I have now incorporated this into the vehicle-management branch.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ves

  • Devotee
  • *
  • Posts: 1436
  • Languages: EN, SV, DK
Re: Schedule features: technical discussion
« Reply #43 on: March 18, 2018, 08:36:16 PM »
Thank you. I have however not altered the function of the "wait for time" at all, only where it is located!

Ok, I suspected that the coulpe and uncouple command needs to be set manually by the player, but i think that should take place in the modify convoy window.

What I meant was that I still dont feel like I have a proper overview of what new functions exists or are about to exist. I dont want to miss create the GUI for a function just because I didnt know about it! :)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Schedule features: technical discussion
« Reply #44 on: March 18, 2018, 09:28:00 PM »
Ahh, I see! If you have any specific questions, do ask, and I will endeavour to assist.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.