Search in sources :

Example 36 with NceMessage

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

the class NceShowCabPanel method readCabMemory1.

// Reads 1 byte of NCE cab memory 
private void readCabMemory1(int cabNum, int offset) {
    int nceCabAddr = getNceCabAddr(cabNum, offset);
    // Expect 1 byte response
    replyLen = NceMessage.REPLY_1;
    waiting++;
    byte[] bl = NceBinaryCommand.accMemoryRead1(nceCabAddr);
    NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
    tc.sendNceMessage(m, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 37 with NceMessage

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

the class NceShowCabPanel method writeUsbCabMemory1.

// USB Write 1 byte of NCE cab memory 
private void writeUsbCabMemory1(int value) {
    // Expect 1 byte response
    replyLen = NceMessage.REPLY_1;
    waiting++;
    byte[] bl = NceBinaryCommand.usbMemoryWrite1((byte) value);
    NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
    tc.sendNceMessage(m, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 38 with NceMessage

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

the class NceShowCabPanel method writeCabMemory1.

// Write 1 byte of NCE cab memory 
private void writeCabMemory1(int cabNum, int offset, int value) {
    int nceCabAddr = getNceCabAddr(cabNum, offset);
    // Expect 1 byte response
    replyLen = NceMessage.REPLY_1;
    waiting++;
    byte[] bl = NceBinaryCommand.accMemoryWrite1(nceCabAddr);
    bl[3] = (byte) value;
    NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
    tc.sendNceMessage(m, this);
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 39 with NceMessage

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

the class ClockMonPanel method issueReadFormatRequest.

@SuppressWarnings("unused")
private void issueReadFormatRequest() {
    if (!waitingForCmdRead) {
        byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accMemoryRead(CS_CLOCK_MEM_ADDR);
        NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CS_CLOCK_MEM_SIZE);
        waiting++;
        waitingForCmdRead = true;
        tc.sendNceMessage(cmdNce, this);
    }
    updateFormatFromRead = true;
}
Also used : NceMessage(jmri.jmrix.nce.NceMessage)

Example 40 with NceMessage

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

the class ClockMonPanel method issueReadRatioRequest.

@SuppressWarnings("unused")
private void issueReadRatioRequest() {
    if (!waitingForCmdRead) {
        byte[] cmd = jmri.jmrix.nce.NceBinaryCommand.accMemoryRead(CS_CLOCK_MEM_ADDR);
        NceMessage cmdNce = jmri.jmrix.nce.NceMessage.createBinaryMessage(tc, cmd, CS_CLOCK_MEM_SIZE);
        waiting++;
        waitingForCmdRead = true;
        tc.sendNceMessage(cmdNce, this);
    }
    updateRatioFromRead = true;
}
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