Cars and Locomotives in Car Inventory are missing #Bug


mike@...
 

hi, new user here.

I have built one track plan for a small shelf layout.
I have added a handful of cars and locomotives in my inventory.  Scrolling right it says they are “on the layout”.  

They are not.  The delete button for all of them is ghosted.  

At one time they were on the layout as I have run them. I removed them from the track plan because they were in the way of further edits, but now they are not available to put back on.

I’d like to either “reactivate” them so I can use them again, or get rid of them all and start fresh.

  1. Where might they have gone?
  2. Is there a file somewhere in the XtrackCAD libraries with the car inventory in it that I can delete to “start over”?  I have searched and searched, but no joy.  I have already tried reinstalling 5.2.2 but it has not helped with this problem.
  3. is the Car Inventory a system level file, or part of each layout track plan?
Any ideas/solutions greatly appreciated.

Thank you,
Mike


Adam Richards
 
Edited

1. Go into Train mode. 

2. The cars should be in the hotbar where you would see the tracks in “design” mode. You can select them, put them onto the layout (click once to place and left-drag to where you want them - like a turnout in the other mode. 

3. if they aren’t there, check that the scale/gauge if the layout is set correctly (they only display if that matches) If they still don’t appear you need to add them to the inventory (Manage->inventory).

Hope that helps,
Adam



mike@...
 

Layout is set to HO.

Cars are in inventory, but do not show up to add to train mode.  here's a couple of pics.  I'd love to know where it stores the cars because I can't edit this list.

@ screenshots below showing what I'm seeing.


Dave Bullis
 

Cars (CAR) records are stored in your .xtc file
(btw CARPROTO and CARPART records are stored in paramete files (.xtp))
The Inventory dialog has a Find button that is enables when you've selected a  CAR on the Layout.  This will center the canvas on the selected CAR.
The Delete button is enabled for CARs on the Shelf.
The idea is that you take the CAR off the layout by deleting it on the layout which moves to the shelf and then Delete it from the inventory to dispose of it (because you sold or junked the model)

You can remove all the cars by starting a NEW layout.
Or if you remove all the CARs on the Layout, you can Delete them all from your Inventory: <Contol-A> , Delete

Generally, the inventory represents the models you own, which is indepenent from the layout you are working on.
So you can Export them from one layout them to a .csv file and Import them to you new layout

Dave


Adam Richards
 
Edited

Check Scale/Gauge in Options->Layout.  It must match the cars definitions in the inventory to show them in the hotbar.  Once they are placed on the layout the scale/gauge doesn't matter (you can put an S gauge car on a Z gauge track, if you like. 

Adam


Adam Richards
 

Different thing - your last photo shows that at least one car does exist on the layout (there's a red dot for an engine showing).  That car at least is somewhere on the layout but not showing. So did you place Cars into a hidden layer, or off-screen, or to left or beneath the current display perhaps, or are they on hidden tracks (aka in tunnels)? 

Try "Find" in the Train Control window (it should pan the screen to where the Train (Engine+) is? 

Look at "Options->Display->Hide Cars on Hidden Tracks" and "Options->Display->Draw Tunnel" settings

Adam


Dave Bullis
 

Mike: one thing is always useful is to post your .xtc file
We might ask for other things, but .xtc is the starting point.

Dave


mike@...
 

I have tried find, repeatedly. 
I have searched every layer.
I know the loco shows up in the run menu, but it's nowhere.  If I add a new engine, it will still be there.
Here is my .xtc


Adam Richards
 

Well, first, somehow the Cars got moved to a y value of -3400.xxx inches ... You could see that they must be there somewhere because when you select all the selected area spans all the way down to the deepest y value we could see at max zoom out. 

I'm curious about how you tried to delete them from the layout.... 

But anyway, I edited the layout to put them back into the train hotbar. Attached. 


mike@...
 

I pressed left click, cut.  Many thanks for your supreme sleuthing abilities! 


mike@...
 
Edited

Please ignore the version 3 i sent later, I am new here so there is a bit of lag between me posting and my post getting approved.  I looked at the fix file you sent and copied the cars over into my version 3 where I had changed some track.  Much obliged.  Now that I know how it stores it's data I will be able to fix mess-ups in the future.

Weird though, that cutting them would cause them to go there instead of just being deleted.

I still think there are bugs though.  If I edit a car and update, the same thing happens, but now I just edit the file and fix it. 


Adam Richards
 

It is weird and needs investigating. It is not what is happening on a Mac for me at BSF.  What version and OS are you running on - looking at your images, it looks fuzzy but seems to be maybe Linux and at V5.2.2Beta -> So I am assuming you compiled yourself?  If so, on what branch and at what commit level?  

Some things that can act as diagnosis aids - after you Cut, but before you Save, if you go to the Inventory - is the car marked as "Layout" or "Shelf" in the Location column, and in Train mode is it in or not in the HotBar? 

I notice that while the tracks are being written out the entire selected set are moved by a distance of the origin of all the selected elements before writing and then back again the inverse distance afterwards so that they are placed in a defined manner on a subsequent Paste. I'm wondering if that is an issue because moving a Car runs code that tries to find a nearby track and can therefore be not an reversable function.  So I have added some code to directly ignore Cars in ExportTracks and so avoid moving them about. If you are compiling yourself you can test that out and see if it makes any difference. 

Adam

------ Background

Basically a Car object consists of two parts the inventory Item and (optionally) the T_CAR track.  When the track part is deleted, the Item->car pointer set to NULL.  This signals the code that the inventory item is not on the layout and so (when being written out) the record will be written without a position, an angle and endpoints. 

Now in XTrackCAD, there is a half-way house first where the track is marked as deleted while it lives on the Undo stack and then it is finally deleted later. The writeCar code looks at that and asks "Does this item have a car pointer that is not NULL AND is this trk not marked as deleted?" and only if that test is true does it write out the position, angle and endpts. 

So - because the Car was written out as on layout that test must have succeeded. The car to track pointer was not NULL and the track (Car) was not marked as deleted. Obviously these things would apply if Undo was done after the Cut - and I tested that out as well but all was well. 

But I noticed some non-linear behaviour when cutting tracks where the Car jumped tracks and when undone it stayed moved. That should be eliminated by simply ignoring Cars for export in Cut and Clone.  



mike@...
 

I'm on Windows 10.  I didn't compile anything that I am aware of - I just downloaded and installed.

I see there is a prior non-Beta version, 5.1.2a - is that what everyone is using?


mike@...
 

I think I will retrograde to the hot fix version and see if the problem leaves. 


Adam Richards
 

The other thing to do is to use Delete rather than Cut .

Delete simply deletes - which does what you want.

Adam