/
Panels.shtml
170 lines (141 loc) · 7.26 KB
/
Panels.shtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.17), see www.w3.org">
<!-- Copyright Bob Jacobsen 2008 -->
<title>JMRI: Creating Control Panels</title><!-- Style -->
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<link rel="stylesheet" type="text/css" href="/css/default.css"
media="screen">
<link rel="stylesheet" type="text/css" href="/css/print.css"
media="print">
<link rel="icon" href="/images/jmri.ico" type="image/png">
<link rel="home" title="Home" href="/"><!-- /Style -->
</head>
<body>
<!--#include virtual="/Header" -->
<div id="mBody">
<!--#include virtual="Sidebar" -->
<div id="mainContent">
<h1>JMRI: Creating Control Panels</h1>The JMRI libraries
contain a system for creating control panels. It's highly
customizable, and allows you to control the railroad from the
panel directly.
<h2>Contents of a panel</h2><img src=
"../../../images/PiecedPanel.gif" alt="screen shot of panel"
align="right" width="292" height="107" hspace="0" vspace="0">
<p>Clicking on a turnout symbol flips it from closed to
thrown and vice-versa. A turnout also has "unknown" and
"inconsistent" states, represented by an icon with a question
mark and X respectively. These represent a state where no
information has been received, and where the information is
internally inconsistent (e.g. both closed and thrown at the
same time).</p>
<p>"Sensors" can be used to represent occupancy indicators or
other inputs. The default icon is a small circle, with color
used to represent the state of the sensor. In the example
above there are seven sensors being driven by occupancy
indicators. Clicking on a sensor causes the sensor to
alternate between "active" and "inactive" states. With the
default icons, active is a green circle and inactive is an
empty circle. These are meant to represent a lit/dark panel
indicator. A red circle represents the "unknown" state, used
when no information has yet been received from the
layout.</p>
<h2>Creating a panel</h2>(Nick Kulp presented a nice clinic
on this topic during March 2004; his slides are <a href=
"http://jmri.org/community/clinics/NickKulpMarch2004/index.html">
available on the main JMRI web site</a>. Dick Bronson has
provided several animated introductions to PanelPro on
<a href="http://www.rr-cirkits.com/Clinics/Clinics.html">his
own web pages</a>.
<p>Panels are made with a "Panel Editor", which allows you to
place images to represent turnouts, sensors (on some systems)
and trackwork.</p>
<p>You start the editor by selecting "New Panel...", then
"Panel Editor" from the "Panels" menu on the main window.
You'll get a blank control panel, plus the editor window:
<a href="../../../images/paneleditor.gif"><img src=
"../../../images/paneleditor.gif" alt=
"screen shot of panel editor" align="right" width="208"
height="364" hspace="0" vspace="0"></a></p>
<p><a name="editor" id="editor">From the top, this
contains:</a></p>
<ul>
<li>Two text fields specifying where (in pixels) new
components will be inserted on the panel. You can generally
ignore these, as once the components has been inserted you
can drag it around by holding the meta (Apple, command,
etc) key down.</li>
<li>A button to pick a background image. The editor's
drawing capability is rudimentary and likely to stay that
way for a long time. To create CTC panels, complex track
diagrams, etc, its easier to draw them in some other
program and insert them as the background image for a JMRI
control panel.</li>
<li>A button to add a text label. Put the desired text in
the field and click the button. You can slide the label
around after inserting it, but you currently can't edit the
text later.</li>
<li>A button to add an icon as a label. This is a way to
add track symbols, etc. To see or select the icon, click on
the "Edit icon..." button.</li>
<li>Two sections for adding left- and right-bound turnouts.
These actually work the same way, only with different icons
to represent the states of the turnouts. Enter the turnout
number (e.g. 23) and click "Add turnout:". If you'd prefer
a different graphic for the closed and thrown states, you
can change their icons with the "Edit icon..." button.</li>
<li>A section for adding a sensor. Type the sensor number
(e.g. 74 or LS74) in the field and click "Add
sensor:".</li>
<li>A section for adding a signal head. Type the signal
head number in the field and click "Add sensor:".</li>
</ul>
<p>Each of these also has a "Edit icons..." button, which
allows you to select which icons will be shown for the
turnout, sensor, etc that you are about to add.</p>
<p>After getting the panel the way you want, you can use the
"Store panel..." entry in the "Panels" menu to write it to an
XML file.</p>
<h3>Icons</h3>The Panel Editor is icon based. The JMRI
library contains lots of contributed icons for representing
CTC panels, LEDs, etc. You can browse through them with the
tree in the bottom of the editor frame. Perhaps the best way
to see what each looks like is to select it in the tree, then
click on the icon next to the "Add icon" button. That will
load it.
<p>For little bits of track, e.g. to connect turnouts, you
might want</p>
<pre>
resources -> icons -> small schematics ->tracksegments
</pre>then block.gif, etc.
<p>We do need to do a better job of organizing those...</p>
<h3>Other types of panels</h3>Because Panel Editor is
icon-based, you can create panels that look any way you want.
For example, instead of using track-schematic icons for
turnouts, you could use small images of the levers and plates
on CTC machine. This would give you "mechanical" levers you
can flip back and forth with a click.
<p>To make this really easy, we need to have a better editor.
And making a "real" CTC panel will require better signal
logic to handle the code buttons, etc. If you've got opinions
on how this should work, please send comments!</p>
<h2>Using the panel</h2>To command a turnout to change state
(e.g. closed to thrown), click on it.
<p>To move it around, you "meta-drag" it. On a Mac, that's
"hold the cmd key and drag with the cursor"; on windows, it
might be the Windows or control key. Or it might be a
right-drag. Sorry, I don't have a Windows machine here to
figure it out.</p>
<p>There's also a pop-up menu (ctrl-click on a Mac) that will
let you rotate the icon so that it points in whatever
direction you want.</p>
<!--#include virtual="/Footer" -->
</div><!-- closes #mainContent-->
</div><!-- closes #mBody-->
</body>
</html>