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
pub fn calc_filename(tag : Option<&str>, control : u32, prev_ctl : Option<u32>, order: &[u32]) -> String{
let mut s = String::new();
if let Some(tag) = tag{
s.push('#');
s.push_str(&tag);
s.push('#');
}
if let Some(prev_ctl) = prev_ctl{
s.push('(');
s.push_str(&prev_ctl.to_string());
s.push(')');
}
s.push('_');
s.push_str(&control.to_string());
for phase in order {
s.push('_');
s.push_str(&*phase.to_string())
}
s.push_str(".his");
s
}