]> git.tdb.fi Git - r2c2.git/log
r2c2.git
11 years agoFix some bugs in tools
Mikko Rasa [Sat, 24 Aug 2013 07:48:34 +0000 (10:48 +0300)]
Fix some bugs in tools

11 years agoImprove algorithms in several editing tools
Mikko Rasa [Mon, 19 Aug 2013 16:21:51 +0000 (19:21 +0300)]
Improve algorithms in several editing tools

11 years agoImprove block recreation algorithms
Mikko Rasa [Mon, 19 Aug 2013 16:06:42 +0000 (19:06 +0300)]
Improve block recreation algorithms

These changes result in a more than 100% performance improvement in
operations that create and delete a lot of tracks, such as the extend
tool.

11 years agoSplit the Manipulator class into several Tools
Mikko Rasa [Mon, 19 Aug 2013 14:37:08 +0000 (17:37 +0300)]
Split the Manipulator class into several Tools

It was getting a bit huge and unwieldy, especially with things like
terrain editing on the horizon.  Not all tools need the same information
or in the same format.

11 years agoAdd a utility function to get path length from Track
Mikko Rasa [Thu, 15 Aug 2013 15:06:37 +0000 (18:06 +0300)]
Add a utility function to get path length from Track

This shortens the incantation to get the length of the active path.

11 years agoComplete BR 50's rod setup
Mikko Rasa [Wed, 14 Aug 2013 14:12:55 +0000 (17:12 +0300)]
Complete BR 50's rod setup

11 years agoSupport mirroring only a subset of rods based on a tag filter
Mikko Rasa [Wed, 14 Aug 2013 14:08:20 +0000 (17:08 +0300)]
Support mirroring only a subset of rods based on a tag filter

11 years agoRemove an unused enum from Vehicle
Mikko Rasa [Sun, 11 Aug 2013 12:35:12 +0000 (15:35 +0300)]
Remove an unused enum from Vehicle

11 years agoImmediately update rods when a vehicle is created
Mikko Rasa [Sun, 11 Aug 2013 12:33:46 +0000 (15:33 +0300)]
Immediately update rods when a vehicle is created

The initial positions are not guaranteed to, and usually do not satisfy
the constraints.

11 years agoRewrite rod simulation code
Mikko Rasa [Sun, 11 Aug 2013 12:28:13 +0000 (15:28 +0300)]
Rewrite rod simulation code

Instead of trying to get a perfect solution on the first try, solve rod
interconnection constraints iteratively.  This simplifies the code and
allows for certain rod configurations that would have been prohibitively
difficult to solve exactly.

It's now also possible to create a mirrored set of rods on the other side
of the locomotive with a single statement.

11 years agoRemove the now-unused async picking code from Engineer
Mikko Rasa [Fri, 9 Aug 2013 17:41:04 +0000 (20:41 +0300)]
Remove the now-unused async picking code from Engineer

11 years agoMinor fixes
Mikko Rasa [Fri, 9 Aug 2013 17:38:20 +0000 (20:38 +0300)]
Minor fixes

11 years agoMove goto destination picking to RouterPanel
Mikko Rasa [Fri, 9 Aug 2013 17:35:37 +0000 (20:35 +0300)]
Move goto destination picking to RouterPanel

11 years agoAdd a utility class to display a TrackChain as a path
Mikko Rasa [Fri, 9 Aug 2013 16:39:05 +0000 (19:39 +0300)]
Add a utility class to display a TrackChain as a path

11 years agoUse Widget::find_ancestor to reduce code duplication
Mikko Rasa [Fri, 9 Aug 2013 10:54:57 +0000 (13:54 +0300)]
Use Widget::find_ancestor to reduce code duplication

11 years agoCorrect camera distance in side view
Mikko Rasa [Fri, 9 Aug 2013 10:33:07 +0000 (13:33 +0300)]
Correct camera distance in side view

11 years agoAvoid infinite loops in VehiclePlacement in certain situations
Mikko Rasa [Fri, 9 Aug 2013 10:32:14 +0000 (13:32 +0300)]
Avoid infinite loops in VehiclePlacement in certain situations

11 years agoFix a crash when reversing certain TrackOffsetIters
Mikko Rasa [Fri, 9 Aug 2013 10:31:28 +0000 (13:31 +0300)]
Fix a crash when reversing certain TrackOffsetIters

11 years agoReserve enough blocks for the entire train when placing
Mikko Rasa [Fri, 9 Aug 2013 10:30:30 +0000 (13:30 +0300)]
Reserve enough blocks for the entire train when placing

11 years agoBetter visualization for placing a train
Mikko Rasa [Thu, 8 Aug 2013 16:13:39 +0000 (19:13 +0300)]
Better visualization for placing a train

Still far from perfect, but it's a start.

11 years agoFix allocation display when a train is chasing another
Mikko Rasa [Fri, 2 Aug 2013 14:58:45 +0000 (17:58 +0300)]
Fix allocation display when a train is chasing another

11 years agoSplit vehicle placement code to a separate class
Mikko Rasa [Fri, 2 Aug 2013 14:55:48 +0000 (17:55 +0300)]
Split vehicle placement code to a separate class

I'm going to need this elsewhere soon.

11 years agoStore all axles in a single array
Mikko Rasa [Thu, 25 Jul 2013 14:48:34 +0000 (17:48 +0300)]
Store all axles in a single array

11 years agoCreate a common base class for Vehicle3D parts
Mikko Rasa [Thu, 25 Jul 2013 14:24:26 +0000 (17:24 +0300)]
Create a common base class for Vehicle3D parts

11 years agoProperly detect blocks as critical when a train is not moving
Mikko Rasa [Tue, 23 Jul 2013 13:43:20 +0000 (16:43 +0300)]
Properly detect blocks as critical when a train is not moving

11 years agoIgnore path change events on currently occupied blocks
Mikko Rasa [Tue, 23 Jul 2013 13:42:34 +0000 (16:42 +0300)]
Ignore path change events on currently occupied blocks

11 years agoAvoid a temporary inconsistent state while reserving the first block
Mikko Rasa [Tue, 23 Jul 2013 13:41:35 +0000 (16:41 +0300)]
Avoid a temporary inconsistent state while reserving the first block

11 years agoUse the tilt member in OrientedPoint in certain objects
Mikko Rasa [Tue, 23 Jul 2013 13:40:35 +0000 (16:40 +0300)]
Use the tilt member in OrientedPoint in certain objects

11 years agoRename TrackPoint to a more generic OrientedPoint
Mikko Rasa [Tue, 23 Jul 2013 13:35:36 +0000 (16:35 +0300)]
Rename TrackPoint to a more generic OrientedPoint

The grade member was also changed to a tilt angle, which is a better match
to how Object orientation is specified.

11 years agoCreate another track iterator class that holds an offset as well
Mikko Rasa [Mon, 22 Jul 2013 19:12:42 +0000 (22:12 +0300)]
Create another track iterator class that holds an offset as well

11 years agoMake use of View3D in engineer
Mikko Rasa [Sun, 21 Jul 2013 15:25:59 +0000 (18:25 +0300)]
Make use of View3D in engineer

11 years agoNew approach for displaying track state
Mikko Rasa [Sat, 20 Jul 2013 16:03:17 +0000 (19:03 +0300)]
New approach for displaying track state

Paths can now be displayed over either rail in addition to the center of
the track.  Track circuit and allocation state are displayed separately,
allowing more information to be shown.

Instead of pre-creating a path for each track, only create them as needed.
Local controller objects are much more manageable than bundling everything
into one giant class.

11 years agoAdd an out-of-bounds check to SpeedQuantizer::get_speed
Mikko Rasa [Thu, 11 Jul 2013 11:40:13 +0000 (14:40 +0300)]
Add an out-of-bounds check to SpeedQuantizer::get_speed

Just in case the previous fix wasn't the only place that could generate
bogus values.

11 years agoFix uninitialized variables in Intellibox driver
Mikko Rasa [Thu, 11 Jul 2013 11:38:23 +0000 (14:38 +0300)]
Fix uninitialized variables in Intellibox driver

Uninitialized pending_half_step caused wonky loco speed events to be
emitted, resulting in out-of-bounds access in speed quantizer.

11 years agoUse beam gates for positioning vehicles
Mikko Rasa [Wed, 10 Jul 2013 18:39:34 +0000 (21:39 +0300)]
Use beam gates for positioning vehicles

11 years agoRefactor and fix vehicle positioning logic
Mikko Rasa [Wed, 10 Jul 2013 17:31:22 +0000 (20:31 +0300)]
Refactor and fix vehicle positioning logic

11 years agoFix block releasing logic
Mikko Rasa [Wed, 10 Jul 2013 17:04:26 +0000 (20:04 +0300)]
Fix block releasing logic

The previous attempt didn't release any blocks if the last vehicle was
still behind the last active sensor, which is almost always the case.  And
if it did manage to release anything, it would have released too much.

11 years agoMove driver.add_sensor call where it belongs
Mikko Rasa [Mon, 8 Jul 2013 22:10:23 +0000 (01:10 +0300)]
Move driver.add_sensor call where it belongs

11 years agoBasic support for beam gate sensors
Mikko Rasa [Mon, 8 Jul 2013 18:10:30 +0000 (21:10 +0300)]
Basic support for beam gate sensors

11 years agoSupport inverted sensors that give low output when active
Mikko Rasa [Mon, 8 Jul 2013 17:17:03 +0000 (20:17 +0300)]
Support inverted sensors that give low output when active

11 years agoAdd a non-const overload of Layout3D::get_catalogue
Mikko Rasa [Mon, 8 Jul 2013 17:00:31 +0000 (20:00 +0300)]
Add a non-const overload of Layout3D::get_catalogue

This is necessary for automatic loading of resources.

11 years agoAdd a function to retrieve track attachments in order
Mikko Rasa [Mon, 8 Jul 2013 16:59:34 +0000 (19:59 +0300)]
Add a function to retrieve track attachments in order

11 years agoSome more refactoring of BlockAllocator
Mikko Rasa [Mon, 8 Jul 2013 15:02:18 +0000 (18:02 +0300)]
Some more refactoring of BlockAllocator

11 years agoImmediately update the matrix after creating an Object3D
Mikko Rasa [Sun, 7 Jul 2013 22:13:59 +0000 (01:13 +0300)]
Immediately update the matrix after creating an Object3D

This fixes a problem with the catalogue layout's contents being displayed
incorrectly.

11 years agoDon't reset router to free run mode until allocator has deactivated
Mikko Rasa [Sun, 7 Jul 2013 22:05:57 +0000 (01:05 +0300)]
Don't reset router to free run mode until allocator has deactivated

Setting route causes stop_at information to be cleared.  If the allocator
is still active when this happens, it will allocate more blocks.

11 years agoRefactor BlockAllocator to be more sensor-oriented
Mikko Rasa [Sun, 7 Jul 2013 21:59:27 +0000 (00:59 +0300)]
Refactor BlockAllocator to be more sensor-oriented

This is necessary for soon-to-be implemented beam gate sensors.

11 years agoKeep TrackAttachment offset within allowed limits
Mikko Rasa [Sun, 7 Jul 2013 21:23:32 +0000 (00:23 +0300)]
Keep TrackAttachment offset within allowed limits

11 years agoAdd a virtual get_block function to Sensor
Mikko Rasa [Sun, 7 Jul 2013 21:20:00 +0000 (00:20 +0300)]
Add a virtual get_block function to Sensor

11 years agoOnly create track circuits for blocks that need one
Mikko Rasa [Sun, 7 Jul 2013 20:28:12 +0000 (23:28 +0300)]
Only create track circuits for blocks that need one

11 years agoRemove a hack that is no longer necessary
Mikko Rasa [Sun, 7 Jul 2013 13:43:40 +0000 (16:43 +0300)]
Remove a hack that is no longer necessary

11 years agoRemove deprecated datafile statement aliases
Mikko Rasa [Sat, 6 Jul 2013 18:49:21 +0000 (21:49 +0300)]
Remove deprecated datafile statement aliases

11 years agoUse generic objects in Layout3D
Mikko Rasa [Sat, 6 Jul 2013 18:32:19 +0000 (21:32 +0300)]
Use generic objects in Layout3D

11 years agoPrevent segfault during layout destruction
Mikko Rasa [Fri, 5 Jul 2013 15:32:13 +0000 (18:32 +0300)]
Prevent segfault during layout destruction

11 years agoAdd an abstraction for things that are attached to tracks
Mikko Rasa [Thu, 4 Jul 2013 20:51:15 +0000 (23:51 +0300)]
Add an abstraction for things that are attached to tracks

11 years agoUse event-based matrix updates for objects
Mikko Rasa [Thu, 4 Jul 2013 19:33:42 +0000 (22:33 +0300)]
Use event-based matrix updates for objects

11 years agoIntroduce a tilt (vertical angle) property to Object
Mikko Rasa [Thu, 4 Jul 2013 19:13:04 +0000 (22:13 +0300)]
Introduce a tilt (vertical angle) property to Object

11 years agoComplete rewrite of the engineer UI
Mikko Rasa [Mon, 1 Jul 2013 13:38:59 +0000 (16:38 +0300)]
Complete rewrite of the engineer UI

The fixed column of train controls was getting unwieldy with lots of
trains, and side dialogs didn't move with their associated train panel.
Now, all dialogs are movable and train controls only appear when
requested.  Most of the former side dialogs have been integrated into the
train dialog as tabs.

11 years agoFurther adjustments to changes in GLtk
Mikko Rasa [Mon, 1 Jul 2013 10:44:06 +0000 (13:44 +0300)]
Further adjustments to changes in GLtk

Layout subclasses were transformed to Arrangements, and Lists and
Dropdowns work a bit differently.

11 years agoDon't continue reserving until the turnout is done changing its path
Mikko Rasa [Sun, 30 Jun 2013 20:32:19 +0000 (23:32 +0300)]
Don't continue reserving until the turnout is done changing its path

11 years agoCount reserved distance correctly in reverse direction
Mikko Rasa [Sun, 30 Jun 2013 20:19:38 +0000 (23:19 +0300)]
Count reserved distance correctly in reverse direction

11 years agoDelete auxiliary objects together with Vehicle3D
Mikko Rasa [Fri, 28 Jun 2013 19:41:02 +0000 (22:41 +0300)]
Delete auxiliary objects together with Vehicle3D

11 years agoAdd signals for adding and removing vehicles
Mikko Rasa [Fri, 28 Jun 2013 19:24:13 +0000 (22:24 +0300)]
Add signals for adding and removing vehicles

11 years agoActivate allocator if an AI intends to move
Mikko Rasa [Fri, 28 Jun 2013 19:23:03 +0000 (22:23 +0300)]
Activate allocator if an AI intends to move

11 years agoMake train advancement logic more robust
Mikko Rasa [Wed, 26 Jun 2013 21:23:27 +0000 (00:23 +0300)]
Make train advancement logic more robust

11 years agoSet pending_block when a block can't be allocated
Mikko Rasa [Wed, 26 Jun 2013 19:09:28 +0000 (22:09 +0300)]
Set pending_block when a block can't be allocated

This got accientally removed in dda1e6c

11 years agoGive vehicle types a simple box geometry
Mikko Rasa [Tue, 25 Jun 2013 16:12:38 +0000 (19:12 +0300)]
Give vehicle types a simple box geometry

11 years agoMake vehicles aware of which train they are in
Mikko Rasa [Tue, 25 Jun 2013 16:12:22 +0000 (19:12 +0300)]
Make vehicles aware of which train they are in

11 years agoRedesign the train activation system
Mikko Rasa [Tue, 25 Jun 2013 15:39:14 +0000 (18:39 +0300)]
Redesign the train activation system

It was getting rather messy and there was one or two bugs where block
allocation didn't resume correctly.  The flag now resides in
BlockAllocator.  Rather than poking at it directly, AIs can express an
intention of moving the train.  This should help keep things in sync
with each other.

11 years agoEmit a signal before changing the path of a turnout
Mikko Rasa [Tue, 25 Jun 2013 15:28:38 +0000 (18:28 +0300)]
Emit a signal before changing the path of a turnout

Since changing the path is an asynchronous operation, this lets other
components react to an impending change.

11 years agoAngle must be divided by the correct type
Mikko Rasa [Tue, 25 Jun 2013 11:59:42 +0000 (14:59 +0300)]
Angle must be divided by the correct type

11 years agoFix BlockAllocator so that it actually compiles
Mikko Rasa [Tue, 25 Jun 2013 11:20:55 +0000 (14:20 +0300)]
Fix BlockAllocator so that it actually compiles

11 years agoFix some issues with BlockAllocator::release_blocks_end
Mikko Rasa [Wed, 19 Jun 2013 13:28:38 +0000 (16:28 +0300)]
Fix some issues with BlockAllocator::release_blocks_end

11 years agoUse std::find to locate block iterators in BlockAllocator
Mikko Rasa [Wed, 19 Jun 2013 13:25:08 +0000 (16:25 +0300)]
Use std::find to locate block iterators in BlockAllocator

11 years agoArrange widgets in Designer with GLtk::Layout
Mikko Rasa [Sun, 9 Jun 2013 20:03:17 +0000 (23:03 +0300)]
Arrange widgets in Designer with GLtk::Layout

11 years agoMake the simulation independent of wall clock time
Mikko Rasa [Sun, 9 Jun 2013 08:39:05 +0000 (11:39 +0300)]
Make the simulation independent of wall clock time

Layout now holds a Clock object, which keeps track of simulated absolute
time and can advance faster (or slower) than the system clock.

11 years agoRemove the scripting-based timetable
Mikko Rasa [Sun, 9 Jun 2013 08:32:21 +0000 (11:32 +0300)]
Remove the scripting-based timetable

I'm going to implement a proper timetable soon, but some other changes
need to happen first.

11 years agoBetter algorithms for dealing with turnouts in a Route
Mikko Rasa [Sat, 8 Jun 2013 18:46:54 +0000 (21:46 +0300)]
Better algorithms for dealing with turnouts in a Route

11 years agoMake use of the unified storage class for other parts of Layout
Mikko Rasa [Fri, 7 Jun 2013 19:08:14 +0000 (22:08 +0300)]
Make use of the unified storage class for other parts of Layout

11 years agoStreamline various block-related algorithms
Mikko Rasa [Fri, 7 Jun 2013 16:18:04 +0000 (19:18 +0300)]
Streamline various block-related algorithms

11 years agoEnsure that turnout tracks have a turnout id
Mikko Rasa [Fri, 7 Jun 2013 16:17:19 +0000 (19:17 +0300)]
Ensure that turnout tracks have a turnout id

11 years agoCreate a base class to handle common operations in Block, Route and Zone
Mikko Rasa [Fri, 7 Jun 2013 10:40:16 +0000 (13:40 +0300)]
Create a base class to handle common operations in Block, Route and Zone

11 years agoReduce interface clutter in Layout by storing Objects in a uniform way
Mikko Rasa [Wed, 5 Jun 2013 10:53:12 +0000 (13:53 +0300)]
Reduce interface clutter in Layout by storing Objects in a uniform way

11 years agoHandle sensors in a separate class
Mikko Rasa [Tue, 4 Jun 2013 11:34:58 +0000 (14:34 +0300)]
Handle sensors in a separate class

11 years agoTighten safety measures
Mikko Rasa [Mon, 3 Jun 2013 19:27:22 +0000 (22:27 +0300)]
Tighten safety measures

Remove opportunistic freeing of blocks from behind the train and counting
of noncritical blocks from the simulated vehicle position.  Both features
are now implemented in terms of what can be ascertained from sensors.  I'm
developing infrared gates which will provide similar functionality with
actual physical (or simulated) feedback.

11 years agoFix a problem with TrackIter::block_iter at end of line
Mikko Rasa [Mon, 3 Jun 2013 18:39:25 +0000 (21:39 +0300)]
Fix a problem with TrackIter::block_iter at end of line

If the track iterator was already on the last track, the check for
returning an empty block iterator would not get executed, and the throw
at the end of the function would get triggered.

11 years agoImprove the interface and algorithms of BlockAllocator
Mikko Rasa [Mon, 3 Jun 2013 18:31:12 +0000 (21:31 +0300)]
Improve the interface and algorithms of BlockAllocator

11 years agoSimplify some interfaces by using track and block iterators
Mikko Rasa [Sat, 1 Jun 2013 08:02:39 +0000 (11:02 +0300)]
Simplify some interfaces by using track and block iterators

11 years agoSplit block allocation to a separate class
Mikko Rasa [Fri, 31 May 2013 22:06:20 +0000 (01:06 +0300)]
Split block allocation to a separate class

11 years agoPull the SetFlag class from mspcore
Mikko Rasa [Fri, 31 May 2013 21:57:21 +0000 (00:57 +0300)]
Pull the SetFlag class from mspcore

11 years agoDon't fail when adding multiple tracks to an initially empty Route
Mikko Rasa [Wed, 29 May 2013 20:33:52 +0000 (23:33 +0300)]
Don't fail when adding multiple tracks to an initially empty Route

11 years agoReport all missing flags in bad_route
Mikko Rasa [Wed, 29 May 2013 20:32:09 +0000 (23:32 +0300)]
Report all missing flags in bad_route

This was the intention from the beginning, but somehow else statements
slipped in.

11 years agoNew routing system for trains
Mikko Rasa [Wed, 29 May 2013 17:48:38 +0000 (20:48 +0300)]
New routing system for trains

The earlier code routed each train separately and tried to deal with
conflicts as they arose.  The new system instead considers the entire
layout and simultaneously finds routes for all trains.  It is able to
have trains wait for each other, and in the future many new tricks can
be added.

11 years agoPlug several memory leaks
Mikko Rasa [Sat, 25 May 2013 23:13:33 +0000 (02:13 +0300)]
Plug several memory leaks

11 years agoAdd the signal to the catalogue layout
Mikko Rasa [Sat, 25 May 2013 23:12:45 +0000 (02:12 +0300)]
Add the signal to the catalogue layout

11 years agoRegister pre-existing signals in Layout3D constructor
Mikko Rasa [Sat, 25 May 2013 23:11:43 +0000 (02:11 +0300)]
Register pre-existing signals in Layout3D constructor

11 years agoDon't force signals to be positioned next to track
Mikko Rasa [Sat, 25 May 2013 23:00:12 +0000 (02:00 +0300)]
Don't force signals to be positioned next to track

They can now be positioned freely and will logically attach to a nearby
track.

11 years agoSnap to segments in both directions
Mikko Rasa [Sat, 25 May 2013 22:59:11 +0000 (01:59 +0300)]
Snap to segments in both directions

Choose whichever is closer to the current rotation.

11 years agoRefactor TrackIter::block_iter
Mikko Rasa [Sat, 25 May 2013 22:54:24 +0000 (01:54 +0300)]
Refactor TrackIter::block_iter

The new implementation is slightly more efficient in certain cases and
won't choke at the end of a line.

11 years agoMake use of the geometry part of libmspmath
Mikko Rasa [Thu, 23 May 2013 20:12:00 +0000 (23:12 +0300)]
Make use of the geometry part of libmspmath

11 years agoDon't zero slope for tracks not connected on both ends
Mikko Rasa [Sun, 19 May 2013 12:31:46 +0000 (15:31 +0300)]
Don't zero slope for tracks not connected on both ends

Since check_slope is now called implicitly when linking tracks together,
loading layouts with sloped tracks wasn't working properly.