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
9cd16d09
Commit
9cd16d09
authored
Feb 05, 2025
by
dongshufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加注释
parent
a44fe942
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
21 行删除
+30
-21
mems/examples/ds-powerflow/README.md
+25
-8
mems/examples/ds-powerflow/ds-dyn-topo/src/lib.rs
+2
-2
mems/examples/ds-powerflow/ds-static-topo/src/lib.rs
+3
-11
没有找到文件。
mems/examples/ds-powerflow/README.md
查看文件 @
9cd16d09
...
@@ -6,12 +6,13 @@
...
@@ -6,12 +6,13 @@
## 2. 拓扑分析
## 2. 拓扑分析
### 2.1 静态拓扑分析
### 2.1 静态拓扑分析
输入:
#### 输入
1.
电气岛
1.
电气岛
2.
属性定义
2.
属性定义
3.
资源定义
3.
资源定义
输出:
#### 输出
-
默认输出下面六列
-
默认输出下面六列
<table>
<table>
...
@@ -23,7 +24,7 @@
...
@@ -23,7 +24,7 @@
<th>
name
</th>
<th>
name
</th>
</table>
</table>
-
terminal_cn_dev,如果输出的边是该名称,则输出下面
四
列
-
terminal_cn_dev,如果输出的边是该名称,则输出下面
几
列
<table>
<table>
<th>
terminal
</th>
<th>
terminal
</th>
<th>
cn
</th>
<th>
cn
</th>
...
@@ -31,7 +32,7 @@
...
@@ -31,7 +32,7 @@
<th>
type
</th>
<th>
type
</th>
</table>
</table>
-
point_terminal_phase: 如果输出的边是该名称,则输出下面
三
列
-
point_terminal_phase: 如果输出的边是该名称,则输出下面
几
列
<table>
<table>
<th>
point
</th>
<th>
point
</th>
<th>
terminal
</th>
<th>
terminal
</th>
...
@@ -40,11 +41,27 @@
...
@@ -40,11 +41,27 @@
### 2.2 动态拓扑分析
### 2.2 动态拓扑分析
输入:
#### 输入
1.
电气岛
2.
属性定义
-
电气岛
3.
资源定义
-
量测
-
静态拓扑:上述输出的三个表格
#### 输出
-
默认输出下面六列
<table>
<th>
cn
</th>
<th>
tn
</th>
</table>
-
dev_topo: 如果输出的边是该名称,则输出下面几列
<table>
<th>
terminal
</th>
<th>
cn
</th>
<th>
tn
</th>
<th>
dev
</th>
</table>
## 3. 输入参数准备
## 3. 输入参数准备
### 3.1 设备电气参数计算
### 3.1 设备电气参数计算
...
...
mems/examples/ds-powerflow/ds-dyn-topo/src/lib.rs
查看文件 @
9cd16d09
...
@@ -159,6 +159,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -159,6 +159,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
}
}
let
mut
csv_bytes
=
Vec
::
with_capacity
(
2
);
let
mut
csv_bytes
=
Vec
::
with_capacity
(
2
);
let
mut
schema
=
Vec
::
with_capacity
(
2
);
let
mut
schema
=
Vec
::
with_capacity
(
2
);
// 默认或者指定名称
if
outgoing
.is_empty
()
||
outgoing
.contains
(
&
DYN_TOPO_DF_NAME
.to_string
())
||
if
outgoing
.is_empty
()
||
outgoing
.contains
(
&
DYN_TOPO_DF_NAME
.to_string
())
||
(
!
outgoing
.contains
(
&
DYN_TOPO_DF_NAME
.to_string
())
&&
!
outgoing
.contains
(
&
DEV_TOPO_DF_NAME
.to_string
()))
{
(
!
outgoing
.contains
(
&
DYN_TOPO_DF_NAME
.to_string
())
&&
!
outgoing
.contains
(
&
DEV_TOPO_DF_NAME
.to_string
()))
{
// build topology
// build topology
...
@@ -173,8 +174,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -173,8 +174,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
]);
]);
csv_bytes
.push
((
DYN_TOPO_DF_NAME
.to_string
(),
topo_csv
.into_bytes
()));
csv_bytes
.push
((
DYN_TOPO_DF_NAME
.to_string
(),
topo_csv
.into_bytes
()));
schema
.push
(
topo_schema
);
schema
.push
(
topo_schema
);
}
}
else
if
outgoing
.contains
(
&
DEV_TOPO_DF_NAME
.to_string
())
{
if
outgoing
.contains
(
&
DEV_TOPO_DF_NAME
.to_string
())
{
// build dev connection
// build dev connection
let
mut
dev_csv
=
String
::
from
(
"terminal,cn,tn,dev
\n
"
);
let
mut
dev_csv
=
String
::
from
(
"terminal,cn,tn,dev
\n
"
);
for
(
terminal
,
dev
)
in
terminal_dev
{
for
(
terminal
,
dev
)
in
terminal_dev
{
...
...
mems/examples/ds-powerflow/ds-static-topo/src/lib.rs
查看文件 @
9cd16d09
...
@@ -57,14 +57,11 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -57,14 +57,11 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
// .open(&base)
// .open(&base)
// .expect("Could not create file");
// .expect("Could not create file");
// write graph
// write graph
let
mut
is_matched
=
false
;
// 根据输出名称来确定形成不同的data frame
if
outgoing
.is_empty
()
||
outgoing
.contains
(
&
STATIC_TOPO_DF_NAME
.to_string
())
{
if
outgoing
.is_empty
()
||
outgoing
.contains
(
&
STATIC_TOPO_DF_NAME
.to_string
())
{
is_matched
=
true
;
create_static_topo
(
&
island
,
&
prop_defs
,
&
defines
,
&
mut
csv_bytes
,
&
mut
schema
);
create_static_topo
(
&
island
,
&
prop_defs
,
&
defines
,
&
mut
csv_bytes
,
&
mut
schema
);
}
}
// 根据输出名称来确定形成不同的data frame
else
if
outgoing
.contains
(
&
TERMINAL_DF_NAME
.to_string
())
{
if
outgoing
.contains
(
&
TERMINAL_DF_NAME
.to_string
())
{
is_matched
=
true
;
let
mut
terminal_csv_str
=
String
::
from
(
"terminal,cn,dev,type
\n
"
);
let
mut
terminal_csv_str
=
String
::
from
(
"terminal,cn,dev,type
\n
"
);
let
mut
terminal_to_cn
=
HashMap
::
with_capacity
(
2
*
island
.cns
.len
());
let
mut
terminal_to_cn
=
HashMap
::
with_capacity
(
2
*
island
.cns
.len
());
// 先建立CN对应的节点
// 先建立CN对应的节点
...
@@ -100,8 +97,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -100,8 +97,7 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
// let _ = file.sync_all();
// let _ = file.sync_all();
// }
// }
if
outgoing
.contains
(
&
POINT_DF_NAME
.to_string
())
{
else
if
outgoing
.contains
(
&
POINT_DF_NAME
.to_string
())
{
is_matched
=
true
;
let
mut
point_csv_str
=
String
::
from
(
"point,terminal,phase
\n
"
);
let
mut
point_csv_str
=
String
::
from
(
"point,terminal,phase
\n
"
);
for
(
_
,
defines
)
in
&
island
.measures
{
for
(
_
,
defines
)
in
&
island
.measures
{
for
def
in
defines
{
for
def
in
defines
{
...
@@ -118,10 +114,6 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
...
@@ -118,10 +114,6 @@ pub unsafe fn run(ptr: i32, len: u32) -> u64 {
Field
::
new
(
"phase"
,
DataType
::
Utf8
,
false
),
Field
::
new
(
"phase"
,
DataType
::
Utf8
,
false
),
]));
]));
}
}
// if not matched, default is used
if
!
is_matched
{
create_static_topo
(
&
island
,
&
prop_defs
,
&
defines
,
&
mut
csv_bytes
,
&
mut
schema
);
}
PluginOutput
{
PluginOutput
{
error_msg
:
None
,
error_msg
:
None
,
schema
:
Some
(
schema
),
schema
:
Some
(
schema
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论