Model Railroad System
2.2.2
main.h
1
// -!- c++ -!- //////////////////////////////////////////////////////////////
2
//
3
// System :
4
// Module :
5
// Object Name : $RCSfile$
6
// Revision : $Revision$
7
// Date : $Date$
8
// Author : $Author$
9
// Created By : Robert Heller
10
// Created : Tue Jul 14 12:40:17 2015
11
// Last Modified : <150725.1534>
12
//
13
// Description
14
//
15
// Notes
16
//
17
// History
18
//
19
/////////////////////////////////////////////////////////////////////////////
20
//
21
// Copyright (C) 2015 Robert Heller D/B/A Deepwoods Software
22
// 51 Locke Hill Road
23
// Wendell, MA 01379-9728
24
//
25
// This program is free software; you can redistribute it and/or modify
26
// it under the terms of the GNU General Public License as published by
27
// the Free Software Foundation; either version 2 of the License, or
28
// (at your option) any later version.
29
//
30
// This program is distributed in the hope that it will be useful,
31
// but WITHOUT ANY WARRANTY; without even the implied warranty of
32
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33
// GNU General Public License for more details.
34
//
35
// You should have received a copy of the GNU General Public License
36
// along with this program; if not, write to the Free Software
37
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
38
//
39
//
40
//
41
//////////////////////////////////////////////////////////////////////////////
42
43
#ifndef __MAIN_H
44
#define __MAIN_H
45
/** @mainpage Example Siding CTC Panels
46
*
47
* This folder contains a collection of example siding CTC panels
48
*
49
* The Azatrax_Siding.tcl file contains a simple passing siding using Azatrax
50
* devices for block occupancy detection, turnout activation, and turnout
51
* point state detection. It uses code from MRD2_Block.tcl and
52
* SR4_MRD2_Switch.tcl.
53
*
54
* @image html Azatrax_Siding_schematic.png
55
* @image latex Azatrax_Siding_schematic.png "Schematic of the track work" width=4in
56
* This is the Schematic of the track work, which is a simple siding with a
57
* passing siding.
58
* @image html Azatrax_Siding_controls.png
59
* @image latex Azatrax_Siding_controls.png "CTC Panel for the siding" width=4in
60
* This is the CTC Panel for the siding, which is simply a switch plate and code
61
* button for each of the turnouts.
62
*
63
* @dontinclude Azatrax_Siding.tcl
64
* Using the Abstract Data Types (Classes) MRD2_Block and SR4_MRD2_Switch
65
* almost all of the code is embeded in these Abstract Data Types, which makes
66
* the code here very simple. Specificly, we create a MRD2_Block object for
67
* the main and siding tracks:
68
* @skipline # Two straight
69
* @until siding
70
* Then create a connection to the SR4 for use by the two turnouts:
71
* @skipline # One SR4
72
* @until ]
73
* Then we create a SR4_MRD2_Switch object for each turnout, linking them to
74
* the main and siding tracks.
75
* @skipline # Two turnouts
76
* @until -plate SwitchPlate2
77
* Then connect the main and siding MRD2_Block objects to the SR4_MRD2_Switch
78
* objects.
79
* @skipline # Connect the siding
80
* @until siding configure
81
* Finally, we create a pair of CodeButton objects for the code buttons.
82
* @skipline # Two Code buttons
83
* @until -cpname CP2
84
* When we assembled the track work and control panel, we set the scripts to
85
* run the various callback methods:
86
* For the Main straight block, the "Occupied Script" would be
87
* "main occupiedp". For the Siding it would be "siding occupiedp".
88
* For Switches, "State Script" would be set to "switchN pointstate" and
89
* "Occupied Script" would be set to "switchN occupiedp". For the switch
90
* plates, the "Normal Script" would be "switchN motor normal" and the
91
* "Reverse Script" would be "switchN motor reverse". Finally the code
92
* buttons would have an "Action Script" of "codeN code". Thus everything is
93
* tied together. The main loop 'invokes' the track work elements, which runs
94
* the occupency methods.
95
* @skipline # Main Loop Start
96
* @until # Main Loop End
97
* The code buttons will run the switch plate functions which in turn
98
* will activate the switch machines.
99
*
100
*/
101
102
#endif
// __MAIN_H
103
Generated on Thu Jul 3 2025 00:59:05 for Model Railroad System by
1.9.1