-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: support for Train.xml to TrainEditor2 (WIP) #417
base: master
Are you sure you want to change the base?
Conversation
Currently, I assume the following structure for Train.xml: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Train>
<Handle>
<HandleType>Separate</HandleType>
<PowerNotches>8</PowerNotches>
<BrakeNotches>8</BrakeNotches>
<PowerNotchReduceSteps>0</PowerNotchReduceSteps>
<EbHandleBehaviour>NoAction</EbHandleBehaviour>
<LocoBrakeType>Combined</LocoBrakeType>
<LocoBrakeNotches>0</LocoBrakeNotches>
<DriverPowerNotches>8</DriverPowerNotches>
<DriverBrakeNotches>8</DriverBrakeNotches>
</Handle>
<Cab>
<Position>0, 0, 0</Position>
<DriverCar>0</DriverCar>
</Cab>
<Device>
<Ats>AtsSn</Ats>
<Atc>None</Atc>
<Eb>false</Eb>
<ConstSpeed>false</ConstSpeed>
<HoldBrake>false</HoldBrake>
<ReAdhesionDevice>TypeA</ReAdhesionDevice>
<LoadCompensatingDevice>0</LoadCompensatingDevice>
<PassAlarm>None</PassAlarm>
<DoorOpenMode>SemiAutomatic</DoorOpenMode>
<DoorCloseMode>SemiAutomatic</DoorCloseMode>
</Device>
<Cars>
<Car>
<IsMotorCar>true</IsMotorCar>
<Mass>40</Mass>
<Length>20</Length>
<Width>2.6</Width>
<Height>3.2</Height>
<CenterOfGravityHeight>1.5</CenterOfGravityHeight>
<LeftDoorWidth>1000</LeftDoorWidth>
<LeftDoorMaxTolerance>0</LeftDoorMaxTolerance>
<RightDoorWidth>1000</RightDoorWidth>
<RightDoorMaxTolerance>0</RightDoorMaxTolerance>
<FrontAxle>8</FrontAxle>
<RearAxle>-8</RearAxle>
<FrontBogie>
<FrontAxle>0</FrontAxle>
<RearAxle>0</RearAxle>
<Reversed>false</Reversed>
<Object />
</FrontBogie>
<RearBogie>
<FrontAxle>0</FrontAxle>
<RearAxle>0</RearAxle>
<Reversed>false</Reversed>
<Object />
</RearBogie>
<ExposedFrontalArea>5</ExposedFrontalArea>
<UnexposedFrontalArea>1.6</UnexposedFrontalArea>
<Performance>
<Deceleration>1</Deceleration>
<CoefficientOfStaticFriction>0.35</CoefficientOfStaticFriction>
<CoefficientOfRollingResistance>0.0025</CoefficientOfRollingResistance>
<AerodynamicDragCoefficient>1.2</AerodynamicDragCoefficient>
</Performance>
<Delay>
<DelayPower>
<Up>0, 0, 0, 0, 0, 0, 0, 0</Up>
<Down>0, 0, 0, 0, 0, 0, 0, 0</Down>
</DelayPower>
<DelayBrake>
<Up>0, 0, 0, 0, 0, 0, 0, 0</Up>
<Down>0, 0, 0, 0, 0, 0, 0, 0</Down>
</DelayBrake>
<DelayLocoBrake>
<Up></Up>
<Down />
</DelayLocoBrake>
</Delay>
<Move>
<JerkPowerUp>1000</JerkPowerUp>
<JerkPowerDown>1000</JerkPowerDown>
<JerkBrakeUp>1000</JerkBrakeUp>
<JerkBrakeDown>1000</JerkBrakeDown>
<BrakeCylinderUp>300</BrakeCylinderUp>
<BrakeCylinderDown>200</BrakeCylinderDown>
</Move>
<Brake>
<BrakeType>ElectromagneticStraightAirBrake</BrakeType>
<LocoBrakeType>NotFitted</LocoBrakeType>
<BrakeControlSystem>None</BrakeControlSystem>
<BrakeControlSpeed>0</BrakeControlSpeed>
</Brake>
<Pressure>
<BrakeCylinderServiceMaximumPressure>480</BrakeCylinderServiceMaximumPressure>
<BrakeCylinderEmergencyMaximumPressure>480</BrakeCylinderEmergencyMaximumPressure>
<MainReservoirMinimumPressure>690</MainReservoirMinimumPressure>
<MainReservoirMaximumPressure>780</MainReservoirMaximumPressure>
<BrakePipeNormalPressure>490</BrakePipeNormalPressure>
</Pressure>
<Acceleration>
<Entry>1, 1, 25, 25, 1</Entry>
</Acceleration>
<Motor>
<PowerTracks>
<Track>
<Pitch>
<Vertex>0.0, 0.0</Vertex>
</Pitch>
<Volume>
<Vertex>0.0, 0.0</Vertex>
</Volume>
<SoundIndex>
<Vertex>0.0, 0.0</Vertex>
</SoundIndex>
</Track>
</PowerTracks>
<BrakeTracks>
<Track>
<Pitch>
<Vertex>0.0, 0.0</Vertex>
</Pitch>
<Volume>
<Vertex>0.0, 0.0</Vertex>
</Volume>
<SoundIndex>
<Vertex>0.0, 0.0</Vertex>
</SoundIndex>
</Track>
</BrakeTracks>
</Motor>
<Reversed>false</Reversed>
<Object></Object>
<LoadingSway>false</LoadingSway>
</Car>
</Cars>
<Couplers>
<Coupler>
<Min>0.27</Min>
<Max>0.33</Max>
<Object></Object>
</Coupler>
</Couplers>
</Train>
</openBVE> Are there any missing items or improvements? |
Initial Thoughts:
Secondary:
|
<openBVE>
<Train>
<Cab>
<Position>0, 0, 0</Position>
<DriverCar>0</DriverCar>
</Cab>
</Train>
</openBVE> Change as follows: <openBVE>
<Train>
<InitialDriverCar>0</InitialDriverCar>
<Cars>
<Car>
<Cab>
<DriverPosition>0, 0, 0</DriverPosition>
<Panel>panel.xml</Panel>
</Cab>
</Car>
</Cars>
</Train>
</openBVE>
<openBVE>
<Train>
<Cars>
<Car>
<Delay>
<Power>
<Up>0, 0, 0, 0, 0, 0, 0, 0</Up>
<Down>0, 0, 0, 0, 0, 0, 0, 0</Down>
</Power>
<Brake>
<Up>0, 0, 0, 0, 0, 0, 0, 0</Up>
<Down>0, 0, 0, 0, 0, 0, 0, 0</Down>
</Brake>
<LocoBrake>
<Up></Up>
<Down />
</LocoBrake>
</Delay>
</Car>
</Cars>
</Train>
</openBVE>
|
That's correct for the first, although we already have an existing InteriorView node. The second:
Opening a random OdaykufanATS equipped train (Chasanai 5000 series) has a whole bunch of changable parameters for the devices:
Whilst obviously, we don't support these at the minute, I think it makes sense to allow the format to be extended if required in the future. The 5th I don't know on, it's something that can be done either way. |
Thank you for the detailed explanation. |
I made TrainEditor2 read and write Train.xml. Also, I want to put Up and Down in the Move section of Train.xml. <Move>
<JerkPower>300, 580</JerkPower>
<JerkBrake>300, 580</JerkBrake>
<BrakeCylinder>300, 200</BrakeCylinder>
</Move> Are there any other sections I should summarize? I make the Brake section refinement and ReAdhesionDevice configurable for each car. |
Train.xml format was updated again. @leezer3 - Please tell me your opinion. I searched for the format of MSTS, but did not understand. |
Units:
The required unit is entered as a textual string at the end of the number, and the parser internally then converts the string into what it uses inside. I can see plenty of ways for this to go wrong, but it'd be helpful to have, as it makes building something from a prototype much easier when you can just enter the 'real' numbers rather than having to abstractly convert them into what the sim uses internally. Nowhere near a request but rather a half-baked idea- Say if you think it's a bad one! In general, this seems very reasonable (and TBQH the first version or two are likely to have a little trial and error involved). |
Units have been implemented for some items. Ex) <MinimumPressure Unit="Kilopascal">690</MinimumPressure> The abbreviation kPa can also be used. |
Now that is brilliant, hadn't thought of using an attribute but it makes perfect sense! |
Thanks! I will proceed as it is. |
I have completed adding units. |
As with other configuration files, I changed the internal path of the intermediate file to a relative path. |
bad6395
to
438f090
Compare
5f23a6d
to
a53fd14
Compare
This PR change unlimited number of tracks for motor sounds. (#349)This feature is not intended to be available in Train.dat. It will be available in Train.xml.I have not tested more than three tracks yet.Update: 2020/01/14
I change the purpose of this PR to add support for Train.xml to TrainEditor2.
Therefore, I want to determine the specifications of Train.xml.