初始化2
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package plc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bj_power_mes/internal/config"
|
||||
)
|
||||
|
||||
// tcpClient 占位:对接西门子 S7 的实现签名。
|
||||
// 本项目以 mock 为主,真实 S7 对接预留(寄存器写工序码、读完成信号位)。
|
||||
type tcpClient struct {
|
||||
c config.PlcConf
|
||||
}
|
||||
|
||||
func newTcpClient(c config.PlcConf) *tcpClient {
|
||||
return &tcpClient{c: c}
|
||||
}
|
||||
|
||||
func (t *tcpClient) SendProcessCode(_ context.Context, combination string) ([]int, error) {
|
||||
return parseCombination(combination), nil
|
||||
}
|
||||
|
||||
func (t *tcpClient) QueryDone(_ context.Context) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (t *tcpClient) AckDone(_ context.Context, ok bool) {
|
||||
_ = ok
|
||||
}
|
||||
Reference in New Issue
Block a user