Mass orders/grouping interface

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

I'd rather have a better interface to ordering multiple trains than shared orders. As it is, with four trains there's no easy way to verify whether they all share the same order list, or there are two pairs of trains sharing identical order lists. With 400 trains it's not manageable.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
LilDood
Director
Director
Posts: 544
Joined: 01 Jan 2006 16:53
Location: Oop Nerth (England)

Post by LilDood »

*cough* 1year 9 month time gap *cough*
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Brianetta wrote:I'd rather have a better interface to ordering multiple trains than shared orders. As it is, with four trains there's no easy way to verify whether they all share the same order list, or there are two pairs of trains sharing identical order lists. With 400 trains it's not manageable.
How about that (complete explanation here):
Image
Last edited by gigajum on 24 Aug 2006 12:52, edited 1 time in total.
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

Brianetta wrote:I'd rather have a better interface to ordering multiple trains than shared orders. As it is, with four trains there's no easy way to verify whether they all share the same order list, or there are two pairs of trains sharing identical order lists. With 400 trains it's not manageable.
I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
Attachments
same orders.PNG
same orders.PNG (156.31 KiB) Viewed 1972 times
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

nycom wrote:I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
A patch/diff file would me interest me more, nice anyway :)
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

gigajum wrote:
nycom wrote:I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
A patch/diff file would me interest me more, nice anyway :)
Sorry, I forgot to add the diff...
Attachments
same_orders_r6083.diff
(21.53 KiB) Downloaded 356 times
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

nycom wrote:I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
Ah handy! But not a complete solution
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

the diff file wrote:

Code: Select all

Index: lang/english.txt
===================================================================
--- lang/english.txt	(revision 6083)
+++ lang/english.txt	(working copy)
@@ -2852,6 +2854,13 @@
....
....
+
+
+####### Nycom
+
+STR_SORT_BY_WAITINGCARGO			:Waiting Cargo
+STR_SORT_BY_RATING						:Rating
+STR_SORT_BY_VISITING_VEHICLE 	:Visiting Vehicle
+STR_SORT_BY_DROPDOWN_TYPE			:{BLACK}Type
+STR_0198_BAD_PROFIT_THIS_YEAR_BAD_LAST_YEAR                     :{TINYFONT}{BLACK}Profit cette année: {RED}{CURRENCY} {BLACK}(l'an dernier: {RED}{CURRENCY})
+STR_0198_BAD_PROFIT_THIS_YEAR_GOOD_LAST_YEAR                    :{TINYFONT}{BLACK}Profit cette année: {RED}{CURRENCY} {BLACK}(l'an dernier: {GREEN}{CURRENCY})
+STR_0198_GOOD_PROFIT_THIS_YEAR_BAD_LAST_YEAR                    :{TINYFONT}{BLACK}Profit cette année: {GREEN}{CURRENCY} {BLACK}(l'an dernier: {RED}{CURRENCY})
+STR_0198_GOOD_PROFIT_THIS_YEAR_GOOD_LAST_YEAR                    :{TINYFONT}{BLACK}Profit cette année: {GREEN}{CURRENCY} {BLACK}(l'an dernier: {GREEN}{CURRENCY})
+STR_VEHICLE_COUNT												:{BLACK}Vehicles counts : {LTBLUE}{COMMA}
+####### Nycom
That is the english lang file, so there is only english allowed. I don't know what language it is, looks like french. If it is french then it is wrong in the english lang file.

WTF?
the diff file wrote:

Code: Select all

--- network.h	(revision 6083)
+++ network.h	(working copy)
@@ -3,7 +3,7 @@
 #ifndef NETWORK_H
 #define NETWORK_H
 
-#define NOREV_STRING "norev000"
+#define NOREV_STRING "v6083 - Custombridgehead 20+"
 
 #ifdef ENABLE_NETWORK
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

I made this patch a few months ago.
I am the only user, so I don't translate all strings to english.

I forgot to delete some lines in the diff.
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

Brianetta wrote:I'd rather have a better interface to ordering multiple trains than shared orders. As it is, with four trains there's no easy way to verify whether they all share the same order list, or there are two pairs of trains sharing identical order lists. With 400 trains it's not manageable.
right on. This becomes even more problematic as we move to larger and larger maps.
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

mexicoshanty wrote:
MeusH wrote:I wouldn't force all vehicles in a group to have the same orders.
That's one of the main point of the routes, if we didn't have that feature we'd have to call it groups of vehicles or something. I guess this is an extension of the sharing of orders feature currently implemented but just in a way that is more informative and easier to manage.
Well why won't we have both enchanced shared orders (with ability to see all trains having these orders, just like guys above proposed), AND grouping interface, where you can make groups independent from orders?
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

MeusH wrote:Well why won't we have both enchanced shared orders (with ability to see all trains having these orders, just like guys above proposed)
Because i don't just want to see which trains have those orders. I have to find a train with those orders first, which can be extremely difficult on a large map with hundreds of trains. Also when assigning orders it can be hard to find a train with orders you want to share with. A solution where groups are named and share orders would solve that.
MeusH wrote: AND grouping interface, where you can make groups independent from orders?
I don't particually see a reason why you would want to group of trains that don't share the same orders. Apart from seeing statistical information about how much profit or loss they make. Even in that case by dividing up the groups on a per order sequence basis you would get a more accurate indication of that routes profit and loss. Or maybe you want to group trains geographically for the sole purpose of sending them to the depo when you upgrade the track system? In which case im sure you can click more than twice to cover the groups you need to send to the depo.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

nycom wrote:I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
nice patch, but a bit messy code and no support for planes or ships. I will clean this up, make a function for all vehicle types (avoiding dublicated code) and with a few other changes and we will see the result. I think this patch got a good chance of getting committed, but not in it's current form.

As for the grouping thing, the idea itself is still good, but not as needed anymore as it was without this patch. I will postpone groups until this patch is finished. Usage of groups will also change a bit as it's not needed to make individual lines anymore, more like train types (say 10 lines can share a group since they are the same types and can share autoreplace orders)
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Bjarni wrote:
nycom wrote:I made a little patch.
I add a details button in the train orders windows.
When you click on details, you can see all trains which share the same order list.
nice patch, but a bit messy code and no support for planes or ships. I will clean this up, make a function for all vehicle types (avoiding dublicated code) and with a few other changes and we will see the result. I think this patch got a good chance of getting committed, but not in it's current form.
How about making list of routes (shared orders) accessible from vehicle list window, instead of "details" somewere in single vehicle's window?
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

MeusH wrote:How about making list of routes (shared orders) accessible from vehicle list window, instead of "details" somewere in single vehicle's window?
I think it's ok to have the button where it is so you can find all vehicles, that shares orders with the one you just selected. The question is if we should add a list/button somewhere else as well.
First of all, I like to get this to work with some nice code. So far I have managed to delete the profit patch (one patch at a time, thank you), removed some dublicated code and removed some unneeded calculations (but likely not enough to make the user notice the speedup). It's still far from done though.
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

I rewrote the patch.
Now, it woks for all vehicles. I make a function for all vehicles type.
Attachments
same_orders_r6134.diff
(28.13 KiB) Downloaded 360 times
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

nycom wrote:I rewrote the patch.
Now, it woks for all vehicles. I make a function for all vehicles type.
poor timing. I just finished editing your patch to handle all vehicle types and some other stuff as well.
It's actually interesting to see your patch since it does nearly the same as mine, but now the code is totally different.

list of changes:
  • the two buttons are disabled (waiting for new functions like sending all vehicles in the list to a depot)
  • windows are now numbered based on order index instead of VehicleID. This allows only one window of the same set of orders
  • ability to close orders window without closing the list of vehicles with shared orders
  • reused a lot of existing code, making it easier to maintain and the diff smaller (and in theory, the resulting binary will be smaller as well)
  • removed the profit part of the patch. It's a nice feature, but it's a different feature and it deserves a patch of it's own
  • Rewrote strings to avoid an issue where plural was set incorrectly (did you test your patch? It will set plural after unitnumber instead of number of vehicles in the shared list)
  • whatever I forgot to write because it's late
so now we got two patches to do this job.... not ideal, but it could be worse :?

btw I didn't test my diff much. Feel free to do so :wink:
Attachments
shared_orders_bjarni.diff
My version of the patch based on nycom's patch
(22.25 KiB) Downloaded 333 times
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

Wow you work fast Bjarni. Will have to wait till i get home to test it though. I will let you know how it goes.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

ok, I committed version of the patch, but it ended up a lot different from the diff I uploaded here. I solved some issues in it and made the code look a lot nicer. I also changed the GUI as I got complains that it had become too long. I added the vehicle icons from the station windows (one in each window).

I'm not sure how many unchanged lines there are compared to the diff I got from nycom, but it's not many.
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

Hello,

There is two little bug in your patch if we choose to list all trains on a station.
- First, the caption is false, it shows "Shared orders of XXX vehicles" instead of "Station Name - XXX trains".
- Also, the "replace vehicles" and "new vehicles" are disabled.

These bugs are caused by the line code in the functions PlayerXXXWndProc

Code: Select all

OrderID order = GB(w->window_number, 16, 16);
StationID station = (w->window_number & SHARE_FLAG) ? INVALID_STATION : order;

if the test (w->window_number & SHARE_FLAG) is false => station != INVALID_STATION and order != INVALID_ORDER

The fix resolves these problems.
Attachments
same_orders_fix_r6179.diff
(3.64 KiB) Downloaded 321 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 19 guests