Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosConnectRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosConnectRoot
Commits
b04958e5
Commit
b04958e5
authored
May 22, 2020
by
高东东
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gaodongdong' into develop
parents
224b64bc
4de510b1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
3 deletions
+57
-3
ClientHandler.java
...ava/com/yeejoin/amos/iec104/tcp/client/ClientHandler.java
+4
-1
IEC104NewHandler.java
.../com/yeejoin/amos/iec104/tcp/client/IEC104NewHandler.java
+5
-1
ApduQueue.java
.../com/yeejoin/amos/iec104/tcp/client/invoke/ApduQueue.java
+0
-0
IeShort.java
...main/java/com/yeejoin/amos/iec104/tcp/entity/IeShort.java
+37
-0
InformationObject.java
...com/yeejoin/amos/iec104/tcp/entity/InformationObject.java
+11
-1
No files found.
YeeAmosIec104IntfServer/src/main/java/com/yeejoin/amos/iec104/tcp/client/ClientHandler.java
View file @
b04958e5
...
...
@@ -87,7 +87,10 @@ public class ClientHandler extends SimpleChannelInboundHandler<Apdu>{
connetOk
=
false
;
}
else
if
(
apdu
.
getApciType
()
==
Apdu
.
ApciType
.
TESTFR_ACT
)
{
ctx
.
channel
().
writeAndFlush
(
"680483000000"
,
promise
);
if
(
startZZ
)
{
startZZ
=
false
;
sendZzCommand
();
}
Logger
.
getLogger
(
this
.
getClass
()).
debug
(
"确认测试消息,U类型"
);
}
else
if
(
apdu
.
getApciType
()
==
Apdu
.
ApciType
.
STARTDT_CON
)
{
Logger
.
getLogger
(
this
.
getClass
()).
debug
(
"启动确认帧回复,U类型"
);
...
...
YeeAmosIec104IntfServer/src/main/java/com/yeejoin/amos/iec104/tcp/client/IEC104NewHandler.java
View file @
b04958e5
...
...
@@ -70,7 +70,11 @@ public class IEC104NewHandler extends SimpleChannelInboundHandler<Apdu>{
close
();
}
else
if
(
apdu
.
getApciType
()
==
Apdu
.
ApciType
.
TESTFR_ACT
)
{
handleBlockingSendQueue
.
add
(
"680483000000"
);
Logger
.
getLogger
(
this
.
getClass
()).
debug
(
"确认测试消息,U类型"
);
if
(
eecruiting_Communication
==
null
)
{
eecruiting_Communication
=
Executors
.
newSingleThreadScheduledExecutor
();
eecruiting_Communication
.
scheduleAtFixedRate
(
Recruiting_runnable
,
Constant
.
Z_Z_INITIALDELAY
,
Constant
.
Z_Z_PREIOD
,
TimeUnit
.
SECONDS
);
}
Logger
.
getLogger
(
this
.
getClass
()).
debug
(
"确认测试消息,U类型"
);
}
else
if
(
apdu
.
getApciType
()
==
Apdu
.
ApciType
.
STARTDT_CON
)
{
Logger
.
getLogger
(
this
.
getClass
()).
debug
(
"启动确认帧回复,U类型"
);
if
(
startService
!=
null
)
{
...
...
YeeAmosIec104IntfServer/src/main/java/com/yeejoin/amos/iec104/tcp/client/invoke/ApduQueue.java
View file @
b04958e5
This diff is collapsed.
Click to expand it.
YeeAmosIec104IntfServer/src/main/java/com/yeejoin/amos/iec104/tcp/entity/IeShort.java
0 → 100644
View file @
b04958e5
package
com
.
yeejoin
.
amos
.
iec104
.
tcp
.
entity
;
import
io.netty.buffer.ByteBuf
;
import
java.io.IOException
;
public
class
IeShort
extends
InformationElement
{
private
final
float
value
;
public
IeShort
(
float
value
)
{
this
.
value
=
value
;
}
public
IeShort
(
ByteBuf
is
)
throws
IOException
{
value
=
Float
.
intBitsToFloat
((
is
.
readByte
()
&
0xff
)
|
((
is
.
readByte
()
&
0xff
)
<<
8
));
}
@Override
public
int
encode
(
byte
[]
buffer
,
int
i
)
{
int
tempVal
=
Float
.
floatToIntBits
(
value
);
buffer
[
i
++]
=
(
byte
)
tempVal
;
buffer
[
i
]
=
(
byte
)
(
tempVal
>>
8
);
return
2
;
}
public
float
getValue
()
{
return
value
;
}
@Override
public
String
toString
()
{
return
"短浮点数值: "
+
value
;
}
}
YeeAmosIec104IntfServer/src/main/java/com/yeejoin/amos/iec104/tcp/entity/InformationObject.java
View file @
b04958e5
...
...
@@ -40,6 +40,16 @@ public class InformationObject {
}
break
;
// 9 测量值, 规一化值
case
9
:
informationElements
=
new
InformationElement
[
numberOfSequenceElements
][
2
];
for
(
int
i
=
0
;
i
<
numberOfSequenceElements
;
i
++)
{
informationElements
[
i
][
0
]
=
new
IeShort
(
is
);
informationElements
[
i
][
1
]
=
new
IeQuality
(
is
);
log
.
debug
(
"9 浮点型遥测1: "
+
i
+
"--->"
+
informationElements
[
i
][
0
].
toString
());
log
.
debug
(
"9 浮点型遥测2: "
+
i
+
"--->"
+
informationElements
[
i
][
1
].
toString
());
}
break
;
// 13 浮点型遥测
case
13
:
informationElements
=
new
InformationElement
[
numberOfSequenceElements
][
2
];
...
...
@@ -54,7 +64,7 @@ public class InformationObject {
case
21
:
informationElements
=
new
InformationElement
[
numberOfSequenceElements
][
1
];
for
(
int
i
=
0
;
i
<
numberOfSequenceElements
;
i
++)
{
informationElements
[
i
][
0
]
=
new
IeShort
Float
(
is
);
informationElements
[
i
][
0
]
=
new
IeShort
(
is
);
log
.
debug
(
"21 浮点型遥测, 不带品质描述词的规一化值: "
+
i
+
"--->"
+
informationElements
[
i
][
0
].
toString
());
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment