Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sparrowzz
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
sgool
sparrowzz
Commits
546238e9
Commit
546238e9
authored
Jul 17, 2024
by
dongshufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change example
parent
db229b6c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
mems/examples/ds-pf-input/src/lib.rs
+11
-11
没有找到文件。
mems/examples/ds-pf-input/src/lib.rs
查看文件 @
546238e9
...
@@ -5,9 +5,9 @@ use std::path::PathBuf;
...
@@ -5,9 +5,9 @@ use std::path::PathBuf;
use
arrow_schema
::{
DataType
,
Field
,
Schema
};
use
arrow_schema
::{
DataType
,
Field
,
Schema
};
use
ds_common
::{
DEV_TOPO_DF_NAME
,
POINT_DF_NAME
,
SHUNT_MEAS_DF_NAME
,
STATIC_TOPO_DF_NAME
,
TERMINAL_DF_NAME
,
TN_INPUT_DF_NAME
};
use
ds_common
::{
DEV_TOPO_DF_NAME
,
POINT_DF_NAME
,
SHUNT_MEAS_DF_NAME
,
TERMINAL_DF_NAME
,
TN_INPUT_DF_NAME
};
use
ds_common
::
dyn_topo
::
read_dev_topo
;
use
ds_common
::
dyn_topo
::
read_dev_topo
;
use
ds_common
::
static_topo
::{
read_point_terminal
,
read_
static_topo
,
read_
terminal_cn_dev
};
use
ds_common
::
static_topo
::{
read_point_terminal
,
read_terminal_cn_dev
};
use
ds_common
::
tn_input
::
read_shunt_measures
;
use
ds_common
::
tn_input
::
read_shunt_measures
;
use
eig_domain
::{
DataUnit
,
MeasureValue
};
use
eig_domain
::{
DataUnit
,
MeasureValue
};
use
mems
::
model
::{
get_df_from_in_plugin
,
get_meas_from_plugin_input
,
get_wasm_result
,
PluginInput
,
PluginOutput
};
use
mems
::
model
::{
get_df_from_in_plugin
,
get_meas_from_plugin_input
,
get_wasm_result
,
PluginInput
,
PluginOutput
};
...
@@ -48,15 +48,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -48,15 +48,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
let
mut
rdr
=
csv
::
ReaderBuilder
::
new
()
.has_headers
(
true
)
.from_reader
(
&
input
.bytes
[
from
..
end
]);
let
mut
rdr
=
csv
::
ReaderBuilder
::
new
()
.has_headers
(
true
)
.from_reader
(
&
input
.bytes
[
from
..
end
]);
let
mut
records
=
rdr
.records
();
let
mut
records
=
rdr
.records
();
// 对第i个边输入该节点的 dataframe 进行处理
// 对第i个边输入该节点的 dataframe 进行处理
if
input
.dfs
[
i
]
==
DEV_TOPO_DF_NAME
{
if
input
.dfs
[
i
]
==
TERMINAL_DF_NAME
{
match
read_dev_topo
(
&
mut
records
)
{
Ok
(
v
)
=>
dyn_dev_topo
=
v
,
Err
(
s
)
=>
{
error
=
Some
(
s
);
break
;
}
}
}
else
if
input
.dfs
[
i
]
==
TERMINAL_DF_NAME
{
with_static
=
true
;
with_static
=
true
;
match
read_terminal_cn_dev
(
&
mut
records
,
Some
(
&
mut
dev_type
))
{
match
read_terminal_cn_dev
(
&
mut
records
,
Some
(
&
mut
dev_type
))
{
Ok
(
v
)
=>
terminals
=
v
,
Ok
(
v
)
=>
terminals
=
v
,
...
@@ -67,6 +59,14 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -67,6 +59,14 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
Ok
(
v
)
=>
points
=
v
,
Ok
(
v
)
=>
points
=
v
,
Err
(
s
)
=>
error
=
Some
(
s
),
Err
(
s
)
=>
error
=
Some
(
s
),
}
}
}
else
if
input
.dfs
[
i
]
==
DEV_TOPO_DF_NAME
{
match
read_dev_topo
(
&
mut
records
)
{
Ok
(
v
)
=>
dyn_dev_topo
=
v
,
Err
(
s
)
=>
{
error
=
Some
(
s
);
break
;
}
}
}
else
if
input
.dfs
[
i
]
==
SHUNT_MEAS_DF_NAME
{
}
else
if
input
.dfs
[
i
]
==
SHUNT_MEAS_DF_NAME
{
match
read_shunt_measures
(
&
mut
records
)
{
match
read_shunt_measures
(
&
mut
records
)
{
Ok
(
v
)
=>
{
Ok
(
v
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论