use of jmri.jmrix.loconet.locostats.swing.LocoStatsPanel in project JMRI by JMRI.
the class LocoStatsFrameTest method testLocoBufferFormat.
@Test
public void testLocoBufferFormat() throws Exception {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
LocoStatsPanel p = getFrame("LocoBuffer Stats Window", 150);
p.requestUpdate();
// initialize with a null traffic controller
p.stats = new jmri.jmrix.loconet.locostats.LocoStatsFunc(null);
p.stats.message(new LocoNetMessage(new int[] { LnConstants.OPC_PEER_XFER, 0x10, 0x50, 0x50, 0x01, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }));
JFrame f = jmri.util.JmriJFrame.getFrame("LocoBuffer Stats Window");
Assert.assertTrue("found frame", f != null);
f.dispose();
}
use of jmri.jmrix.loconet.locostats.swing.LocoStatsPanel in project JMRI by JMRI.
the class LocoStatsFrameTest method testMS100Format.
@Test
public void testMS100Format() throws Exception {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
LocoStatsPanel p = getFrame("MS100 Stats Window", 450);
p.requestUpdate();
Assert.assertNotNull("p isn't supposed to be null", p);
// initialize with a null traffic controller
p.stats = new jmri.jmrix.loconet.locostats.LocoStatsFunc(null);
p.stats.message(new LocoNetMessage(new int[] { LnConstants.OPC_PEER_XFER, 0x10, 0x22, 0x22, 0x01, 0x00, 1, 2, 0x20, 4, 0x00, 5, 6, 0, 0, 0 }));
JFrame f = jmri.util.JmriJFrame.getFrame("MS100 Stats Window");
Assert.assertTrue("found frame", f != null);
f.dispose();
}
use of jmri.jmrix.loconet.locostats.swing.LocoStatsPanel in project JMRI by JMRI.
the class LocoStatsPanelTest method testCTor.
@Test
public void testCTor() {
LocoStatsPanel t = new LocoStatsPanel();
Assert.assertNotNull("exists", t);
}
use of jmri.jmrix.loconet.locostats.swing.LocoStatsPanel in project JMRI by JMRI.
the class LocoStatsFrameTest method getFrame.
LocoStatsPanel getFrame(String title, int offset) throws Exception {
JmriJFrame f = new JmriJFrame();
LocoStatsPanel p = new LocoStatsPanel() {
@Override
public void requestUpdate() {
// replace actual transmit
updateRequestPending = true;
}
};
p.initComponents();
f.getContentPane().add(p);
f.setTitle(title);
f.setLocation(0, offset);
f.pack();
f.setVisible(true);
return p;
}
use of jmri.jmrix.loconet.locostats.swing.LocoStatsPanel in project JMRI by JMRI.
the class LocoStatsFrameTest method testPR2Format.
@Test
public void testPR2Format() throws Exception {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
LocoStatsPanel p = getFrame("PR2 Stats Window", 300);
p.requestUpdate();
// initialize with a null traffic controller
p.stats = new jmri.jmrix.loconet.locostats.LocoStatsFunc(null);
p.stats.message(new LocoNetMessage(new int[] { LnConstants.OPC_PEER_XFER, 0x10, 0x22, 0x22, 0x01, 0x00, 1, 2, 0, 4, 0x00, 5, 6, 0, 0, 0 }));
JFrame f = jmri.util.JmriJFrame.getFrame("PR2 Stats Window");
Assert.assertTrue("found frame", f != null);
f.dispose();
}
Aggregations