use of jmri.progdebugger.ProgDebugger in project JMRI by JMRI.
the class AddressedHighCvProgrammerFacadeTest method testCvLimit.
public void testCvLimit() {
ProgDebugger dp = new ProgDebugger();
dp.setTestReadLimit(256);
dp.setTestWriteLimit(256);
Programmer p = new AddressedHighCvProgrammerFacade(dp, "256", "253", "254", "255", "100");
Assert.assertTrue("CV limit read OK", p.getCanRead("1024"));
Assert.assertTrue("CV limit write OK", p.getCanWrite("1024"));
Assert.assertTrue("CV limit read fail", !p.getCanRead("1025"));
Assert.assertTrue("CV limit write fail", !p.getCanWrite("1025"));
}
use of jmri.progdebugger.ProgDebugger in project JMRI by JMRI.
the class AddressedHighCvProgrammerFacadeTest method testWriteReadIndexed.
public void testWriteReadIndexed() throws jmri.ProgrammerException, InterruptedException {
ProgDebugger dp = new ProgDebugger();
dp.setTestReadLimit(256);
dp.setTestWriteLimit(256);
Programmer p = new AddressedHighCvProgrammerFacade(dp, "256", "253", "254", "255", "100");
ProgListener l = new ProgListener() {
@Override
public void programmingOpReply(int value, int status) {
log.debug("callback value=" + value + " status=" + status);
replied = true;
readValue = value;
}
};
p.writeCV("258", 12, l);
waitReply();
Assert.assertTrue("target not written", !dp.hasBeenWritten(258));
Assert.assertEquals("index H written", 2, dp.getCvVal(253));
Assert.assertEquals("index L written", 58, dp.getCvVal(254));
Assert.assertEquals("value written", 12, dp.getCvVal(255));
p.readCV("258", l);
waitReply();
Assert.assertEquals("read back", 12, readValue);
}
use of jmri.progdebugger.ProgDebugger in project JMRI by JMRI.
the class OffsetHighCvProgrammerFacadeTest method testWriteReadIndexed.
public void testWriteReadIndexed() throws jmri.ProgrammerException, InterruptedException {
ProgDebugger dp = new ProgDebugger();
dp.setTestReadLimit(256);
dp.setTestWriteLimit(256);
Programmer p = new OffsetHighCvProgrammerFacade(dp, "256", "7", "10", "100");
ProgListener l = new ProgListener() {
@Override
public void programmingOpReply(int value, int status) {
log.debug("callback value=" + value + " status=" + status);
replied = true;
readValue = value;
}
};
p.writeCV("258", 12, l);
waitReply();
Assert.assertTrue("target not written", !dp.hasBeenWritten(258));
Assert.assertEquals("index written", 20, dp.getCvVal(7));
Assert.assertEquals("value written", 12, dp.getCvVal(58));
p.readCV("258", l);
waitReply();
Assert.assertEquals("read back", 12, readValue);
}
use of jmri.progdebugger.ProgDebugger in project JMRI by JMRI.
the class ResettingOffsetHighCvProgrammerFacadeTest method testCvLimit.
public void testCvLimit() {
ProgDebugger dp = new ProgDebugger();
dp.setTestReadLimit(256);
dp.setTestWriteLimit(256);
Programmer p = new ResettingOffsetHighCvProgrammerFacade(dp, "256", "7", "10", "100", "200");
Assert.assertTrue("CV limit read OK", p.getCanRead("1024"));
Assert.assertTrue("CV limit write OK", p.getCanWrite("1024"));
Assert.assertTrue("CV limit read fail", !p.getCanRead("1025"));
Assert.assertTrue("CV limit write fail", !p.getCanWrite("1025"));
}
use of jmri.progdebugger.ProgDebugger in project JMRI by JMRI.
the class FnMapPanelTest method testLargeNumbers.
public void testLargeNumbers() {
ProgDebugger p = new ProgDebugger();
VariableTableModel tableModel = new VariableTableModel(new JLabel(""), new String[] { "Name", "Value" }, new CvTableModel(new JLabel(""), p), new IndexedCvTableModel(new JLabel(""), p));
List<Integer> varsUsed = null;
Element model = new Element("model");
model.setAttribute("numFns", "28");
new FnMapPanel(tableModel, varsUsed, model);
}
Aggregations