Search in sources :

Example 1 with NceMessage

use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.

the class NceConsistEngines method getNceConsist.

// Read 16 bytes of NCE CS memory
private void getNceConsist(int cR) {
    NceMessage m = readConsistMemory(cR);
    tc.sendNceMessage(m, this);
    // wait for read to complete
    readWait();
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 2 with NceMessage

use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.

the class NceConsistEngines method readConsistMemory.

// Reads 16 bytes of NCE consist memory
private NceMessage readConsistMemory(int num) {
    int nceConsistAddr = (num * REPLY_16) + CS_CONSIST_MEM;
    // Expect 16 byte response
    replyLen = REPLY_16;
    waiting++;
    byte[] bl = NceBinaryCommand.accMemoryRead(nceConsistAddr);
    NceMessage m = NceMessage.createBinaryMessage(tc, bl, REPLY_16);
    return m;
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 3 with NceMessage

use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.

the class NceShowCabPanel method setUsbCabMemoryPointer.

// USB set cab memory pointer
private void setUsbCabMemoryPointer(int cab, int offset) {
    // Expect 1 byte response
    replyLen = NceMessage.REPLY_1;
    waiting++;
    byte[] bl = NceBinaryCommand.usbMemoryPointer(cab, offset);
    NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
    tc.sendNceMessage(m, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 4 with NceMessage

use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.

the class ClockMonPanel method issueClockRatio.

private void issueClockRatio(int r) {
    byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accSetClockRatio(r);
    NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CMD_CLOCK_SET_REPLY_SIZE);
    waiting++;
    waitingForCmdRatio = true;
    tc.sendNceMessage(cmdNce, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 5 with NceMessage

use of jmri.jmrix.nce.NceMessage in project JMRI by JMRI.

the class ClockMonPanel method issueClockSetMem.

private void issueClockSetMem(int hh, int mm, int ss) {
    byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accMemoryWriteN(CS_CLOCK_MEM_ADDR + CS_CLOCK_SECONDS, 3);
    cmd[4] = (byte) ss;
    cmd[5] = (byte) mm;
    cmd[6] = (byte) hh;
    NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CMD_MEM_SET_REPLY_SIZE);
    waiting++;
    waitingForCmdTime = true;
    tc.sendNceMessage(cmdNce, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Aggregations

NceMessage (jmri.jmrix.nce.NceMessage)46 IOException (java.io.IOException)3 BufferedReader (java.io.BufferedReader)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 FileReader (java.io.FileReader)2 JFileChooser (javax.swing.JFileChooser)2 JPanel (javax.swing.JPanel)2 NceReply (jmri.jmrix.nce.NceReply)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1