1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! # Data definitions for sysdiagrams
use ms_oforms::properties::types::{Size, Position};
use std::collections::HashMap;

#[derive(Debug)]
pub struct SchGrid {
    pub d1: u32,
    pub d2: u32,
    pub d3: u32,
    pub d4: u32,
    pub d5: [u32; 6],
    pub d6: u32,
    pub d7: [u32;16],
    pub d8: [u32;16],
    pub d9: u32,
    pub d10: [u32;16],
    pub d11: [u32;11],
    pub d12: u32,
    pub d13: [u32;2],
    pub d14: Vec<u32>,
    pub size1: Size,
    pub size2: Size,
    pub name: String,
    pub table: String,
    pub schema: String,
}

#[derive(Debug)]
pub struct Control1 {
    pub positions: Vec<Position>,
    pub pos: Position,
    pub d1: u16,
    pub d2: [u8; 32],
    pub d3: u32,
    pub d4: u32,
    pub d5: u32,
    pub d6: u32,
    pub d7: u32,
    pub d8: [u8; 6],
    pub d9: u32,
}

#[derive(Debug, Clone)]
pub struct DSRefSchemaEntry {
    pub k1: u32,
    pub table: String,
    pub schema: String,
}

#[derive(Debug)]
pub struct DSRefSchemaContents {
    pub name: String,
    pub guid: String,
    pub tables: Vec<DSRefSchemaEntry>,
    pub settings: HashMap<String, String>,
}

#[derive(Debug)]
pub struct Table {
    pub sch_grid: SchGrid,
    pub caption: String,
}

#[derive(Debug)]
pub struct Relationship {
    pub control: Control1,
    pub caption: String,
    pub from: String,
    pub to: String,
    pub name: String,
}

#[derive(Debug)]
pub struct SysDiagram {
    pub tables: Vec<Table>,
    pub relationships: Vec<Relationship>,
    pub dsref_schema_contents: DSRefSchemaContents,
}