update: master log (position fixed)

- A -> B
- 0-origin -> 1-origin
This commit is contained in:
Wataru Otsubo 2024-07-23 17:07:35 +09:00
parent 84d321ec30
commit e20c029684
5 changed files with 59 additions and 36 deletions

View file

@ -364,6 +364,30 @@ mod test {
patch: 2
}
);
assert_eq!(
Position::from_str("B-1-4").unwrap(),
Position {
major: PositionLayer::B,
minor: 1,
patch: 4
}
);
assert_eq!(
Position::from_str("B-0-9").unwrap(),
Position {
major: PositionLayer::B,
minor: 0,
patch: 9
}
);
assert_ne!(
Position::from_str("B-1-4").unwrap(),
Position {
major: PositionLayer::B,
minor: 0,
patch: 2
}
);
}
#[test]
@ -372,7 +396,6 @@ mod test {
assert!(DateTime::parse_from_str("Date: 2024-06-20T08:42:01+0000", "Date: %+").is_ok());
}
// #[test]
// fn parse_file() {
// let logfile = r"""""";

View file

@ -198,9 +198,9 @@ impl MasterLogResult {
// Origin is different (-1)
let pos = Position {
major: PositionLayer::A,
major: PositionLayer::B,
minor: station_minor,
patch: station_id - 1,
patch: station_id,
};
debug!("pos from table {}", pos);