Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
RoboPLC
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄新宇
RoboPLC
Commits
1be35882
提交
1be35882
authored
1月 06, 2025
作者:
Serhij S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
codefmt
上级
b411d08f
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
8 行增加
和
4 行删除
+8
-4
modbus-master.rs
examples/modbus-master.rs
+1
-1
modbus-slave.rs
examples/modbus-slave.rs
+1
-0
pipe.rs
examples/pipe.rs
+1
-1
rflow.rs
examples/rflow.rs
+1
-1
snmp-modbus.rs
examples/snmp-modbus.rs
+1
-1
hub_async.rs
src/hub_async.rs
+1
-0
eapi.rs
src/io/eapi.rs
+1
-0
state.rs
src/state.rs
+1
-0
没有找到文件。
examples/modbus-master.rs
浏览文件 @
1be35882
...
@@ -155,7 +155,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
...
@@ -155,7 +155,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
roboplc
::
setup_panic
();
roboplc
::
setup_panic
();
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
// sets the simulated mode for the real-time module, do not set any thread real-time parameters
// sets the simulated mode for the real-time module, do not set any thread real-time parameters
roboplc
::
thread_rt
::
set_simulated
();
roboplc
::
set_simulated
();
// creates a controller instance
// creates a controller instance
let
mut
controller
:
Controller
<
Message
,
Variables
>
=
Controller
::
new
();
let
mut
controller
:
Controller
<
Message
,
Variables
>
=
Controller
::
new
();
// creates a reliable auto-reconnecting shared TCP port connection
// creates a reliable auto-reconnecting shared TCP port connection
...
...
examples/modbus-slave.rs
浏览文件 @
1be35882
...
@@ -47,6 +47,7 @@ struct VariableData {
...
@@ -47,6 +47,7 @@ struct VariableData {
}
}
#[derive(WorkerOpts)]
#[derive(WorkerOpts)]
#[allow(clippy
::
struct_field_names)]
struct
Worker1
{
struct
Worker1
{
// Modbus server context and controller variables/data hub are not synchronized automatically,
// Modbus server context and controller variables/data hub are not synchronized automatically,
// workers must write to the Modbus server context and read from the controller variables/data
// workers must write to the Modbus server context and read from the controller variables/data
...
...
examples/pipe.rs
浏览文件 @
1be35882
...
@@ -43,7 +43,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
...
@@ -43,7 +43,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
roboplc
::
setup_panic
();
roboplc
::
setup_panic
();
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
if
!
roboplc
::
is_production
()
{
if
!
roboplc
::
is_production
()
{
roboplc
::
thread_rt
::
set_simulated
();
roboplc
::
set_simulated
();
}
}
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
let
mut
controller
=
Controller
::
<
Message
,
Variables
>
::
new
();
let
mut
controller
=
Controller
::
<
Message
,
Variables
>
::
new
();
...
...
examples/rflow.rs
浏览文件 @
1be35882
...
@@ -38,7 +38,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
...
@@ -38,7 +38,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
roboplc
::
setup_panic
();
roboplc
::
setup_panic
();
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
if
!
roboplc
::
is_production
()
{
if
!
roboplc
::
is_production
()
{
roboplc
::
thread_rt
::
set_simulated
();
roboplc
::
set_simulated
();
}
}
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
let
mut
controller
=
Controller
::
<
Message
,
Variables
>
::
new
();
let
mut
controller
=
Controller
::
<
Message
,
Variables
>
::
new
();
...
...
examples/snmp-modbus.rs
浏览文件 @
1be35882
...
@@ -176,7 +176,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
...
@@ -176,7 +176,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
roboplc
::
setup_panic
();
roboplc
::
setup_panic
();
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
roboplc
::
configure_logger
(
roboplc
::
LevelFilter
::
Info
);
if
!
roboplc
::
is_production
()
{
if
!
roboplc
::
is_production
()
{
roboplc
::
thread_rt
::
set_simulated
();
roboplc
::
set_simulated
();
}
}
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
roboplc
::
thread_rt
::
prealloc_heap
(
10
_000_000
)
?
;
let
mut
server
=
ModbusServer
::
bind
(
let
mut
server
=
ModbusServer
::
bind
(
...
...
src/hub_async.rs
浏览文件 @
1be35882
...
@@ -314,6 +314,7 @@ mod test {
...
@@ -314,6 +314,7 @@ mod test {
use
super
::
Hub
;
use
super
::
Hub
;
#[derive(Clone,
Debug)]
#[derive(Clone,
Debug)]
#[allow(dead_code)]
enum
Message
{
enum
Message
{
Temperature
(
f64
),
Temperature
(
f64
),
Humidity
(
f64
),
Humidity
(
f64
),
...
...
src/io/eapi.rs
浏览文件 @
1be35882
...
@@ -200,6 +200,7 @@ pub type ActionResult = std::result::Result<(), Box<dyn std::error::Error>>;
...
@@ -200,6 +200,7 @@ pub type ActionResult = std::result::Result<(), Box<dyn std::error::Error>>;
type
ActionHandlers
<
D
,
V
>
=
Arc
<
BTreeMap
<
OID
,
ActionHandlerFn
<
D
,
V
>>>
;
type
ActionHandlers
<
D
,
V
>
=
Arc
<
BTreeMap
<
OID
,
ActionHandlerFn
<
D
,
V
>>>
;
type
BulkActionHandlers
<
D
,
V
>
=
Arc
<
Vec
<
(
OIDMask
,
ActionHandlerFn
<
D
,
V
>
)
>>
;
type
BulkActionHandlers
<
D
,
V
>
=
Arc
<
Vec
<
(
OIDMask
,
ActionHandlerFn
<
D
,
V
>
)
>>
;
#[allow(clippy
::
struct_field_names)]
struct
Handlers
<
D
,
V
>
struct
Handlers
<
D
,
V
>
where
where
D
:
DataDeliveryPolicy
+
Clone
+
Send
+
Sync
+
'static
,
D
:
DataDeliveryPolicy
+
Clone
+
Send
+
Sync
+
'static
,
...
...
src/state.rs
浏览文件 @
1be35882
...
@@ -12,6 +12,7 @@ enum Format {
...
@@ -12,6 +12,7 @@ enum Format {
}
}
impl
Format
{
impl
Format
{
#[allow(clippy
::
unnecessary_wraps)]
fn
from_path
<
P
:
AsRef
<
Path
>>
(
path
:
P
)
->
Result
<
Self
>
{
fn
from_path
<
P
:
AsRef
<
Path
>>
(
path
:
P
)
->
Result
<
Self
>
{
match
path
match
path
.as_ref
()
.as_ref
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论