stb_parser/st_bridge/stb_model/
stb_sections.rs

1use strum_macros::EnumString;
2
3#[derive(Debug)]
4pub struct StbSections {
5    pub children: Vec<Box<dyn StbSectionsChildren>>,
6    pub stb_sec_steel: StbSecSteel,
7}
8
9impl StbSections {
10    pub fn new() -> StbSections {
11        StbSections {
12            children: Vec::new(),
13            stb_sec_steel: StbSecSteel::new(),
14        }
15    }
16}
17
18pub trait StbSectionsChildren {}
19
20impl std::fmt::Debug for dyn StbSectionsChildren {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
22        write!(f, "{}", "section")
23    }
24}
25
26#[derive(Debug)]
27pub struct StbSecColumnS {
28    pub id: i32,
29    pub name: String,
30    pub floor: String,
31    pub kind_column: ColumnKind,
32    pub direction: bool,
33    pub base_type: SteelBaseType,
34    pub stb_sec_steel_column: StbSecSteelColumn,
35}
36
37impl StbSectionsChildren for StbSecColumnS {}
38
39#[derive(Debug, EnumString)]
40pub enum ColumnKind {
41    #[strum(serialize = "COLUMN")]
42    Column,
43    #[strum(serialize = "POST")]
44    Post,
45}
46
47#[derive(Debug, EnumString)]
48pub enum SteelBaseType {
49    #[strum(serialize = "")]
50    Null,
51    #[strum(serialize = "EXPOSE")]
52    Expose,
53    #[strum(serialize = "EMBEDDED")]
54    Embedded,
55    #[strum(serialize = "WRAP")]
56    Wrap,
57}
58
59#[derive(Debug)]
60pub struct StbSecSteelColumn {
61    pub pos: StbSecSteelColumnPosition,
62    pub shape: String,
63    pub strength_main: String,
64    pub strength_web: String,
65}
66
67#[derive(Debug, EnumString)]
68pub enum StbSecSteelColumnPosition {
69    #[strum(serialize = "ALL")]
70    All,
71}
72
73#[derive(Debug)]
74pub struct StbSecBeamRC {
75    pub id: i32,
76    pub name: String,
77    pub floor: String,
78    pub kind_beam: BeamKind,
79    pub is_foundation: bool,
80    pub is_canti: bool,
81    pub d_reinforcement_main: String,
82    pub d_stirrup: String,
83    pub d_reinforcement_web: String,
84    pub d_bar_spacing: String,
85    pub strength_concrete: Option<String>,
86    pub strength_reinforcement_main: String,
87    pub strength_reinforcement_2nd_main: Option<String>,
88    pub strength_stirrup: String,
89    pub strength_reinforcement_web: String,
90    pub strength_bar_spacing: String,
91    pub depth_cover_left: Option<f64>,
92    pub depth_cover_right: Option<f64>,
93    pub depth_cover_top: Option<f64>,
94    pub depth_cover_bottom: Option<f64>,
95    pub stb_sec_figure: StbSecFigureBeam,
96    pub stb_sec_bar_arrangement: StbSecBarArrangementBeam,
97}
98
99impl StbSectionsChildren for StbSecBeamRC {}
100
101#[derive(Debug, EnumString)]
102pub enum BeamKind {
103    #[strum(serialize = "GIRDER")]
104    Girder,
105    #[strum(serialize = "BEAM")]
106    Beam,
107}
108
109#[derive(Debug)]
110pub struct StbSecFigureBeam {
111    pub stb_sec_haunch: Option<StbSecHaunch>,
112    pub stb_sec_straight: Option<StbSecStraightBeam>,
113}
114
115#[derive(Debug)]
116pub struct StbSecHaunch {
117    pub width_start: f64,
118    pub depth_start: f64,
119    pub width_center: f64,
120    pub depth_center: f64,
121    pub width_end: f64,
122    pub depth_end: f64,
123}
124
125#[derive(Debug)]
126pub struct StbSecStraightBeam {
127    pub depth: f64,
128}
129
130#[derive(Debug)]
131pub struct StbSecBarArrangementBeam {
132    pub stb_sec_beam_start_center_end_section_list: Option<Vec<StbSecBeamStartCenterEndSection>>,
133    pub stb_sec_beam_same_section: Option<StbSecBeamSameSection>,
134}
135
136#[derive(Debug)]
137pub struct StbSecBeamStartCenterEndSection {
138    pub pos: StbSecBeamSectionPosition,
139    pub count_main_top_1st: u32,
140    pub count_main_bottom_1st: u32,
141    pub count_stirrup: u32,
142    pub pitch_stirrup: f64,
143    pub count_web: u32,
144    pub count_bar_spacing: u32,
145    pub pitch_bar_spacing: f64,
146}
147
148#[derive(Debug)]
149pub struct StbSecBeamSameSection {
150    pub count_main_top_1st: u32,
151    pub count_main_bottom_1st: u32,
152    pub count_stirrup: u32,
153    pub pitch_stirrup: f64,
154    pub count_web: u32,
155    pub count_bar_spacing: u32,
156    pub pitch_bar_spacing: f64,
157}
158
159#[derive(Debug, EnumString)]
160pub enum StbSecBeamSectionPosition {
161    #[strum(serialize = "START")]
162    Start,
163    #[strum(serialize = "CENTER")]
164    Center,
165    #[strum(serialize = "END")]
166    End,
167}
168
169#[derive(Debug)]
170pub struct StbSecBeamS {
171    pub id: i32,
172    pub name: String,
173    pub floor: String,
174    pub kind_beam: BeamKind,
175    pub is_canti: bool,
176    pub stb_sec_steel_beam: StbSecSteelBeam,
177}
178
179impl StbSectionsChildren for StbSecBeamS {}
180
181#[derive(Debug)]
182pub struct StbSecSteelBeam {
183    pub pos: StbSecSteelBeamPosition,
184    pub shape: String,
185    pub strength_main: String,
186    pub strength_web: String,
187}
188
189#[derive(Debug, EnumString)]
190pub enum StbSecSteelBeamPosition {
191    #[strum(serialize = "ALL")]
192    All,
193}
194
195#[derive(Debug)]
196pub struct StbSecSlabRC {
197    pub id: i32,
198    pub name: String,
199    pub is_foundation: bool,
200    pub is_canti: bool,
201    pub strength_concrete: String,
202    pub stb_sec_figure: StbSecFigureSlab,
203    pub stb_sec_bar_arrangement: StbSecBarArrangementSlab,
204}
205
206impl StbSectionsChildren for StbSecSlabRC {}
207
208#[derive(Debug)]
209pub struct StbSecFigureSlab {
210    pub stb_sec_straight: StbSecStraightSlab,
211}
212
213#[derive(Debug)]
214pub struct StbSecStraightSlab {
215    pub depth: f64,
216}
217
218#[derive(Debug)]
219pub struct StbSecBarArrangementSlab {
220    pub stb_sec_1way_slab_1_list: Vec<StbSec1WaySlab1>,
221}
222
223#[derive(Debug)]
224pub struct StbSec1WaySlab1 {
225    pub pos: StbSec1WaySlab1Position,
226    pub strength: String,
227    pub d: String,
228    pub pitch: f64,
229}
230
231#[derive(Debug, EnumString)]
232pub enum StbSec1WaySlab1Position {
233    #[strum(serialize = "MAIN_TOP")]
234    MainTop,
235    #[strum(serialize = "MAIN_BOTTOM")]
236    MainBottom,
237    #[strum(serialize = "TRANSVERS_TOP")]
238    TransverseTop,
239    #[strum(serialize = "TRANSVERS_BOTTOM")]
240    TransverseBottom,
241}
242
243#[derive(Debug)]
244pub struct StbSecBraceS {
245    pub id: i32,
246    pub name: String,
247    pub floor: String,
248    pub kind_brace: BraceKind,
249    pub stb_sec_steel_brace: StbSecSteelBrace,
250}
251
252impl StbSectionsChildren for StbSecBraceS {}
253
254#[derive(Debug, EnumString)]
255pub enum BraceKind {
256    #[strum(serialize = "VERTICAL")]
257    Vertical,
258    #[strum(serialize = "HORIZONTAL")]
259    Horizontal,
260}
261
262#[derive(Debug)]
263pub struct StbSecSteelBrace {
264    pub pos: StbSecSteelBraceSPosition,
265    pub shape: String,
266    pub strength_main: String,
267    pub strength_web: String,
268}
269
270#[derive(Debug, EnumString)]
271pub enum StbSecSteelBraceSPosition {
272    #[strum(serialize = "ALL")]
273    All,
274}
275
276#[derive(Debug)]
277pub struct StbSecSteel {
278    pub children: Vec<Box<dyn StbSecSteelChildren>>,
279}
280
281impl StbSecSteel {
282    pub fn new() -> StbSecSteel {
283        StbSecSteel {
284            children: Vec::new(),
285        }
286    }
287}
288
289pub trait StbSecSteelChildren {}
290
291impl std::fmt::Debug for dyn StbSecSteelChildren {
292    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
293        write!(f, "{}", "steel section")
294    }
295}
296
297#[derive(Debug)]
298pub struct StbSecRollH {
299    pub name: String,
300    pub sec_type: StbSecRollHType,
301    pub a: f64,
302    pub b: f64,
303    pub t1: f64,
304    pub t2: f64,
305    pub r: f64,
306}
307
308impl StbSecSteelChildren for StbSecRollH {}
309
310#[derive(Debug, EnumString)]
311pub enum StbSecRollHType {
312    #[strum(serialize = "H")]
313    H,
314    #[strum(serialize = "SH")]
315    SH,
316}
317
318#[derive(Debug)]
319pub struct StbSecBuildH {
320    pub name: String,
321    pub a: f64,
322    pub b: f64,
323    pub t1: f64,
324    pub t2: f64,
325}
326
327impl StbSecSteelChildren for StbSecBuildH {}
328
329#[derive(Debug)]
330pub struct StbSecRollBox {
331    pub name: String,
332    pub sec_type: StbSecRollBoxType,
333    pub a: f64,
334    pub b: f64,
335    pub t: f64,
336    pub r: f64,
337}
338
339impl StbSecSteelChildren for StbSecRollBox {}
340
341#[derive(Debug, EnumString)]
342pub enum StbSecRollBoxType {
343    #[strum(serialize = "BCP")]
344    BCP,
345    #[strum(serialize = "BCR")]
346    BCR,
347    #[strum(serialize = "STKR")]
348    STKR,
349    #[strum(serialize = "ELSE")]
350    Else,
351}
352
353#[derive(Debug)]
354pub struct StbSecBuildBox {
355    pub name: String,
356    pub a: f64,
357    pub b: f64,
358    pub t1: f64,
359    pub t2: f64,
360}
361
362impl StbSecSteelChildren for StbSecBuildBox {}
363
364#[derive(Debug)]
365pub struct StbSecPipe {
366    pub name: String,
367    pub d: f64,
368    pub t: f64,
369}
370
371impl StbSecSteelChildren for StbSecPipe {}
372
373#[derive(Debug)]
374pub struct StbSecRollL {
375    pub name: String,
376    pub sec_type: StbSecRollLType,
377    pub a: f64,
378    pub b: f64,
379    pub t1: f64,
380    pub t2: f64,
381    pub r1: f64,
382    pub r2: f64,
383    pub side: bool,
384}
385
386impl StbSecSteelChildren for StbSecRollL {}
387
388#[derive(Debug, EnumString)]
389pub enum StbSecRollLType {
390    #[strum(serialize = "L")]
391    L,
392}