RmasmDataBuffer.java 902 Bytes
package com.example.mina.server.entity;

import com.example.mina.server.base.AbstractHardwareDataBuffer;


public class RmasmDataBuffer extends AbstractHardwareDataBuffer {

    public RmasmDataBuffer(int row, int col, int maxAtten) {
        super(row, col, row, maxAtten);

        matrixData = new Entry[row][col];
        offsetData = new Entry[row];

        int offset = -79;
        int val;
        int ox;
        for (int i = 0; i < row; i++) {
            val = Math.abs(offset);
            ox = (val / 10) * 16 + (val % 10);

            if (offset < 0) {
                ox += 0x80;
            }

            offsetData[i] = new Entry(i, 0, "rr", ox, false);
            offset += 5;
        }

        for (int i = 0; i < row; i++) {
            for (int k = 0; k < col; k++) {
                matrixData[i][k] = new Entry(i, k, "kk", maxAtten, false);
            }
        }
    }

}