Commit 67e5b38535bb08dc5862732e84cb2a0ae37ff817
1 parent
075c6b41
Exists in
develop
fix: 添加测试
Showing
5 changed files
with
28 additions
and
6 deletions
Show diff stats
src/main/java/com/example/mina/client/base/AbstractClient.java
... | ... | @@ -54,15 +54,17 @@ public abstract class AbstractClient { |
54 | 54 | // 等待建立连接 |
55 | 55 | connectFuture.awaitUninterruptibly(); |
56 | 56 | // 获取连接会话 |
57 | - int a = getAttenuation(3); | |
57 | + //int a = getAttenuation(3); | |
58 | 58 | |
59 | 59 | this.ioSession = connectFuture.getSession(); |
60 | + setAttenuation(clientDTO); | |
61 | + test(clientDTO); | |
60 | 62 | |
61 | - //setAttenuation(clientDTO); | |
62 | - | |
63 | - int b = getAttenuation(3); | |
63 | + //int b = getAttenuation(3); | |
64 | 64 | } |
65 | 65 | |
66 | + abstract public void test(ClientDTO clientDTO); | |
67 | + | |
66 | 68 | abstract public int getAttenuation(int col); |
67 | 69 | |
68 | 70 | /*public boolean isConnected() { | ... | ... |
src/main/java/com/example/mina/client/box/aeroflex/AeroflexClient.java
src/main/java/com/example/mina/client/box/lte3000/Lte3000Client.java
... | ... | @@ -36,6 +36,21 @@ public class Lte3000Client extends AbstractClient { |
36 | 36 | } |
37 | 37 | |
38 | 38 | @Override |
39 | + public void test(ClientDTO clientDTO) { | |
40 | + | |
41 | + boolean a = isCrossPointOn(clientDTO.getRow(),clientDTO.getCol()); | |
42 | + int c = getAttenuation(clientDTO.getCol()); | |
43 | + byte[] bytes = genCloseCommand(); | |
44 | + Entry[][] entries =getMatrix(); | |
45 | + Entry[] entry =getOffsetData(); | |
46 | + | |
47 | + int q = getAttenuation(clientDTO.getCol()); | |
48 | + clientDTO.setRow(0); | |
49 | + setAttenuation(clientDTO); | |
50 | + int w = getAttenuation(clientDTO.getCol()); | |
51 | + } | |
52 | + | |
53 | + @Override | |
39 | 54 | public void setAttenuation(ClientDTO clientDTO) { |
40 | 55 | byte[] cmd; |
41 | 56 | if (clientDTO.getRow() == 0) { | ... | ... |
src/main/java/com/example/mina/client/test/MinaClient.java
... | ... | @@ -31,7 +31,7 @@ public class MinaClient { |
31 | 31 | // cf.getSession().getCloseFuture().awaitUninterruptibly(); |
32 | 32 | // |
33 | 33 | // connector.dispose(); |
34 | - new Lte3000Client().start(ClientDTO.builder().row(0).col(3).maxAttn(5).build()); | |
34 | + new Lte3000Client().start(ClientDTO.builder().row(2).col(3).maxAttn(5).build()); | |
35 | 35 | |
36 | 36 | |
37 | 37 | } | ... | ... |
src/main/java/com/example/mina/server/base/AbstractHardwareDataBuffer.java
... | ... | @@ -51,7 +51,7 @@ public abstract class AbstractHardwareDataBuffer { |
51 | 51 | } |
52 | 52 | |
53 | 53 | public int getAttenuation(int row, int col) { |
54 | - return matrixData[row - 1][col - 1].getValue(); | |
54 | + return matrixData[row - 1][col - 1].getValue() ; | |
55 | 55 | } |
56 | 56 | |
57 | 57 | public synchronized void setOffset(int row, int val) { | ... | ... |