- Tutorials
- Command line:
xtrkcad [-v] [-l logfile] [-d
{logmodule}[={0,1,2,...}]] [trackfile]
- logmodule: init, malloc, error, command, shortPath,
fillElev, structure, traverseTurnout, turnout, print,
paramLayout, hotspot, switchmotor, ease, traverseJoint,
undo, pan, zoom, track, group, block, profile, curve,
carDlgList, carDlgState, join, modify
- get all logmodule values:
- Examples:
xtrkcad -l xtrkcad.log -d init -d track -d
command toto.xtc
xtrkcad -l /dev/stdout -d init -d track=4 -d
print toto.xtc
- Options / Layout:
- Preferences
- File / Parameter files / Browse
- Fleischmann
222xx
- /usr/local/share/xtrkcad/params/N-fl.xtp
- ~/xtrkcad/params/rocon_mm.xtp
- Custom
- Exemples / Examples
- Manage
- Construcció del circuit / Build layout
- seleccioneu la via a dalt / select track on top
- moveu-la a prop d'una via existent / move it next to
existing track
- trieu-ne l'orientació fent: majúscula + clic esquerre /
choose end by: shift + left click
- posicioneu-la amb la barra d'espai / fix it with space bar
- Pan
- [shift+] arroy keys
- View -> Pan/Zoom
- Selecció / Select
- Change -> Select (Ctrl + E)
- selecció de totes les vies connectades / select all
connected tracks
- Shift: to select all segment
- selecció de vies individuals / select individual tracks:
- selecció de vies entre dues vies / select all tracks
between two tracks:
- seleccioneu la primera via / select first track
- seleccioneu amb CTRL l'última via / ctrl select last
track
- seleccioneu amb majúscules totes les vies del mig /
shift to select all tracks in between
- unselect
- Move
- Change -> Move (Shift + Ctrl + M)
- Join
- movent / moving
- select section
- Change -> Join tracks
- Shift + click on end point of selected section
- click on the other section
- afegint vies flexibles / adding flex tracks
- select section
- Change -> Join tracks
- click on end point of selected section
- click on the other section
- Connect (slightly move all tracks to get a connection)
- Options -> Preferences: Connection Distance
- Change -> Connect Two Tracks
- Split
- Elevation
- if you define an elevation at one point, all connected
tracks will have the same elevation (gold)
- if you define elevation at two points, all connected
tracks will have calculated elevation (purple)
- tracks beyond those point will maintain the elevation
(gold)
- to display the grade of endpoints, set the elevation
endpoint as Grade
- Track elevations
- gold: defined
- purple: calculated
- Impressió / Print (File -> Print)
- circuit en diverses pàgines / layout in several pages
- Print Scale (tab to apply value; do not use enter)
- Page Width, Height to define dimensions for each page
(Max to set it to maximum possible value for given Print
Scale)
- Page Format to define orientation of selected part
(does not have any effect in final pdf orientation)
- select wanted pages on layout (Select All to select
them all; Clear to unselect them all)
- tot el circuit en una pàgina / all layout in one single
page
- etiqiuetes / labels
- controlled by values in Options -> Display
- Two Rail Scale < x (2x when printing)
- Label Scale <= y (y when printing, but you may
want to increase Label Font Size; if values do not
appear on display, they will not appear on print)
- Label Font Size: must be, at least, the double of
Print Scale
|
- Running
a train
- Exemples / Examples
- Help -> Examples...: cascade.xtc
- Parameters Files (app/lib/params/)
-
file |
CONTENTS |
CARPROTO |
|
|
|
|
|
|
loco
- Diesel (10101)
- Steam (10201)
- Electric (10301)
|
freight
(30100)
(Guide
to railcars) |
passenger (50100) |
Maintenance of Way (70100) |
Other (90100) |
br.xtp |
British Rolling-stock Prototype Cars |
- Diesel
- 01 02 03 04 05 06 07 08 14 15 16 17 121
141/142 143 150 153 156 158 20 31 33 33/2 37
47 56 60 66 HST
- Electric
|
|
|
|
|
eu.xtp |
European Rolling-Stock Prototype Cars |
- |
- Bogie Large Van (Cargowaggon) 20.8m
- Twin RIV Van (use in pairs)
|
|
|
|
protoam.xtp |
North American Rolling-Stock Prototype Cars |
- Diesel
- 44t
- AC4400CW, AC6000CW
- AEM7
- C30-7
- Dash 8-40B, Dash 8-40BW, Dash 8-40C, Dash
8-40CW
- DD-40X
- E8A
- F3A, F3B, F9A, F9B, FP7, F59PHI
- H15-44, H16-44, H15/16-44
- M420
- RS1, RS3, RS4/5, RS11, RSD12
- S1, S2, S3, S4
- SW7, SW9, SW1200
- U23B, U23C, U25B, U25C, U28C, U30B, U30C,
U33B, U33C, U50C
- GP7, GP9, GP35, GP38, GP39, GP40, GP40-2
- SD35, SD38, SD39, SD40, SD40-2, SD40-2F,
SD45, SD50, SD60, SD60M, SD70M, SD75M
|
- Box
(40, 50, 53, 60, 86)
- Caboose
(34 Cupola, Ext Vision)
- Gondola
(42, 50, 65)
- Flat
(42, 50, 60, 89)
- Hopper
(25, 30, 45, 67)
- Hopper,
Centerflow (36, 40, 50, 56)
- Hopper,
Covered (35, 40, 50)
- Hopper, Cyl (50, 56)
- Reefer
(36, 40, 50, 57)
- Stock
(40, 50, 60, 85)
- Tank
(28, 39, 40, 55, 60, 65)
|
|
|
|
proto-ng.xtp |
|
|
|
|
|
|
protosteam.xtp |
|
|
|
|
|
|
- Notes:
-
awk
'BEGIN {ORS=" "} $1 ~ /^CARPROTO/ && $4 ~
/10101/ {gsub(/\"/,"",$2);print $2}' protoam.xtp
- ...
- Car inventory
- és un inventori real; si poseu un cotxe al circuit,
desapareixerà de la barra. Però podeu afegir tants cotxes
com calgui / this is a real inventory: if you place a car
onto the layout, it will disappear from the hot bar. But you
can add as many cars as you need
- Posicionament d'un cotxe / Placing a car (Linux)
- seleccioneu el mode tren / select train mode
- seleccioneu un cotxe a la barra / select one car on the
hot bar
- moveu el cursor al circuit / move cursor to layout
- feu clic amb el botó dret (noel deixeu anar) i moveu el
cursor (si no moveu el cursor, el cotxe no apareixerà) /
left-click (do not release) and move the cursor (if you do
not move the cursor, the car will not be displayed)
- deixeu el cotxe allà on vulgueu / place the car where you
want
- Desviaments / Turnouts
- shift + left click to change its position
- Custom
- Manage -> Custom defined parts
- Move
- per a moure'l a un fitxer separat / to move to a
separate file (.xtp)
- la primera vegada que es crea cal posar una etiqueta /
the first time it is created, a label must be entered
- les properes vegades els elements s'afegiran al fitxer
/ next times, items are added to the file
- exemples / examples
- File format
-
Create a new: Car prototype |
cm for 1:1 |
|
- Car Length: 1524,000 (cm for 1:1 train)
- Truck Centers: 1224,280
- Width: 304,800
- Center Offset: 0,000
|
|
protoam.xtp |
inches for 1:1 |
CARPROTO "Coach, 80'" 0 50100 960.000 120.000 0 0
842.000 992.000 |
CARPROTO "elec_1524" 2 10301 600.000 120.000 0 0
482.000 632.000 |
|
inventory |
|
|
|
|
my_layout.xtc |
inches for model (e.g. 1:160) |
CAR 3 N "Unknown Coach,
80'
" 512 50100 6.000 0.750 0 0 5.263
6.200 16744448 0.000 0.000 0 0 0 0 0 0 0 0 0 "" 492
0 40.088 65.418 60.000 |
CAR 12 N "Custom
elec_1524 elec
1524
" 518 10301
3.750 0.750 0 0 3.013 3.950 16744448 0.000 0.000 0 0
0 0 0 0 0 0 0 "" 518 0 57.067 58.858 270.000 |
|
measurement on layout |
|
|
- Length: 9.520cm
- Width: 1.905cm
|
|
- 12 inches = 1 foot
- 960 inches = 80 feet
- ...
- Problemes / Problems
- ...
|
- Viewers
- XTrackViewer
- XtrackCad
3D (XTrackCAD User Group)
- XTrackCAD User Group
- Codi
- cd
Xtrk3D
- ln
-s Interface.h interface.h
- ln
-s Vertex.h vertex.h
- dotnet
build -v d
- Requisits
- Mageia 9
- sudo
dnf install glm-devel lib64glew-devel
- sudo
dnf install lib64glew-devel
- Baixada / Download
- Modificacions del codi font / Modifications on
source code
- See: linux_build.md
cd ~/src/Xtrk3DViewer/
- init git
git init
git add .
git commit -m "initial import"
- replace backslashes by slashes:
sed -i '/^#include/ s*\\*/*g'
*/*.hpp
sed -i '/^#include/ s*\\*/*g' */*.h
sed
-i '/^#include/ s*\\*/*g' */*.cpp
- link header files so as when referenced in
different case an error is not raised:
- ln
-s Interface.h
Xtrk3D/interface.h
- ln
-s Vertex.h
Xtrk3D/vertex.h
- ln
-s misc.h Xtrk3D/Misc.h
- ln
-s TrackPlan.h Xtrk3D/Trackplan.h
- or replace references to the correct file:
- sed
-i '/^#include/
s*interface.h*Interface.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/ s*vertex.h*Vertex.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/ s*Misc.h*misc.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/ s*Trackplan.h*TrackPlan.h*g'
*/*.{cpp,h,hpp}
- other references to header files:
sed -i 's*#include
"../../zip/zip_file.hpp"*#include
"zip/zip_file.hpp"*g'
./Xtrk3D/PolygonSet.cpp
- ...
- Compilació
- cmakeconverter
- dotnet-vcxproj
- Install
.NET on Linux
- (once) clone repo:
cd ~/src/
git clone
https://github.com/roozbehid/dotnet-vcxproj.git
- (once) install templates:
cd ~src/dotnet-vcxproj
dotnet new
install GCC.Build.Template
- will install gccbuild template
- to list all installed templates
- go to your project
cd ~/src/Xtrk3DViewer/
- modify the name of the configurations
(Debug|x64 -> LinuxDebug|x64):
sed -i
's/Debug|x64/LinuxDebug|x64/g'
Xtrk3DViewer.sln
sed -i
's/Debug|x64/LinuxDebug|x64/g'
*/*.vcxproj
- or set environment variables:
- export
SolutionDir=~/src/Xtrk3DViewer
- export
VCTargetsPath=.
- export
LANGUAGE=en
- add AdditionalIncludeDirectories
- ./Xtrk3D/Xtrk3D.vcxproj
<ItemDefinitionGroup
Condition="'$(Configuration)|$(Platform)'=='LinuxDebug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>../thirdparty</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
- ./Xtrk3DViewer/Xtrk3DViewer.vcxproj
- or replace references to the correct
file:
- sed
-i '/^#include/
s*interface.h*Interface.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/
s*vertex.h*Vertex.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/ s*Misc.h*misc.h*g'
*/*.{cpp,h,hpp}
- sed
-i '/^#include/ s*Trackplan.h*TrackPlan.h*g'
*/*.{cpp,h,hpp}
- other references to header files:
sed -i 's*#include
"../../zip/zip_file.hpp"*#include
"zip/zip_file.hpp"*g'
./Xtrk3D/PolygonSet.cpp
dotnet new
gccbuild
- modificarà / will modify:
- crearà / will create:
*/Microsoft.Cpp.Default.props
*/project.json
dotnet clean
-p:Configuration=LinuxDebug
-p:Platform=x64
dotnet build
-v d -p:Configuration=LinuxDebug
-p:Platform=x64
- dotnet
build -v d
- Problemes
- Flags
look to not be properly passed
to compiler #21
- EarcutWrapper.cpp(45,85):
error : invalid use of
non-static member function
‘glm::detail::tvec2<T,
P> glm::detail::tvec3<T,
P>::xy() const [with T =
float; glm::precision P =
glm::highp]’
[/disc/src/Xtrk3DViewer/Xtrk3D/Xtrk3D.vcxproj]
cd Xtrk3D; g++
-fmax-errors=1000 -I
"../thirdparty" -D_DEBUG
-D_LIB -Wall -Wno-comment
-Wno-parentheses
-Wno-missing-braces
-Wno-write-strings
-Wno-unknown-pragmas
-Wno-attributes
-fpermissive -x c++ -g2
-gdwarf-2 -m64 -c
Trackplan.cpp -o
"obj/x64/LinuxDebug/Trackplan.o"
Trackplan.cpp:425:68:
error: invalid use of member
function ‘glm::vec<2, T,
Q> glm::vec<3, T,
Q>::xy() const [with T =
float; glm::qualifier Q =
glm::packed_highp]’ (did you
forget the ‘()’ ?)
425
|
float len =
glm::length(m2.xy - m1.xy);
|
~~~^~
- glm
- versions
- thirdparty: GLM 0.9.5.4:
2014-06-21
- Linux package:
glm-devel-0.9.9.8
- error: cannot bind non-const
lvalue reference of type
'Xtrk3D::Shape&' to an
rvalue of type 'Xtrk3D::Shape'
- swizzle
- error : invalid use of
non-static member function
'glm::detail::tvec2<T,
P> glm::detail::tvec4<T,
P>::xy() const
- e.g. segment.cpp L257 has
already parenthesis
- solution: use parenthesis
everywhere
- error : cannot bind non-const
lvalue reference of type
'...&' to an rvalue of type
''
- solution: create a variable
- error : expected
primary-expression before
'struct'
g++ -fmax-errors=1000
-I "../thirdparty" -D_DEBUG
-D_LIB -Wall -Wno-comment
-Wno-parentheses
-Wno-missing-braces
-Wno-write-strings
-Wno-unknown-pragmas
-Wno-attributes
-fpermissive -x c++ -g2
-gdwarf-2 -m64
-c Structure.cpp -o
"obj/x64/LinuxDebug/Structure.o"
- solution:
- error : cannot bind non-const
lvalue reference of type
'glm::vec3&' {aka
'glm::detail::tvec3<float,
glm::highp>&'} to an
rvalue of type
'glm::detail::tvec3<float,
glm::highp>'
g++ -fmax-errors=1000
-I "../thirdparty" -D_DEBUG
-D_LIB -Wall -Wno-comment
-Wno-parentheses
-Wno-missing-braces
-Wno-write-strings
-Wno-unknown-pragmas
-Wno-attributes
-fpermissive -x c++ -g2
-gdwarf-2 -m64
-c track.cpp -o
"obj/x64/LinuxDebug/track.o"
- ...
- ...
- monodevelop
- Open: Xtrk3DViewer.sln
- Problemes:
- "This project type is not supported by
MonoDevelop"
- VSCode
- DEPRECATED:
xbuild Xtrk3D.vcxproj
- sudo
dnf install mono-devel
msbuild Xtrk3D.vcxproj
- DXF
|