diff --git a/src/main.rs b/src/main.rs index d196560..58b649b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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""""""; diff --git a/src/masterlog.rs b/src/masterlog.rs index 0900cdf..1f90e95 100644 --- a/src/masterlog.rs +++ b/src/masterlog.rs @@ -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); diff --git a/tests/cli.rs b/tests/cli.rs index 7edc011..af3aa72 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -34,7 +34,7 @@ mod integrated_test { line .unwrap() .contains( - "8866,,A-0-0,0,1,1,0,1,8,1,,7,2024-07-20T17:15:46Z,7.log,0.1.0,alice,,,," + "8866,,B-0-1,0,1,1,0,1,8,1,,7,2024-07-20T17:15:46Z,7.log,0.1.0,alice,,,," ) })); } diff --git a/tests/example_logs/valid/7.log b/tests/example_logs/valid/7.log index 5451837..ee2440d 100644 --- a/tests/example_logs/valid/7.log +++ b/tests/example_logs/valid/7.log @@ -5,24 +5,24 @@ QAQC runid: 7 Shifters: alice ---------------------- PBS Assignment: -Position / assigned-ID : A-0-0 / PS008866 -Position / assigned-ID : A-1-0 / PS008867 -Position / assigned-ID : A-0-1 / PS008868 -Position / assigned-ID : A-1-1 / PS008869 -Position / assigned-ID : A-0-2 / PS008870 -Position / assigned-ID : A-1-2 / PS008871 -Position / assigned-ID : A-0-3 / PS008872 -Position / assigned-ID : A-1-3 / PS008873 -Position / assigned-ID : A-0-4 / PS008874 -Position / assigned-ID : A-1-4 / PS008875 -Position / assigned-ID : A-0-5 / PS008876 -Position / assigned-ID : A-1-5 / PS008877 -Position / assigned-ID : A-0-6 / PS008878 -Position / assigned-ID : A-1-6 / PS008879 -Position / assigned-ID : A-0-7 / PS008880 -Position / assigned-ID : A-1-7 / PS008881 -Position / assigned-ID : A-0-8 / PS008882 -Position / assigned-ID : A-1-8 / PS008883 +Position / assigned-ID : B-0-1 / PS008866 +Position / assigned-ID : B-1-1 / PS008867 +Position / assigned-ID : B-0-2 / PS008868 +Position / assigned-ID : B-1-2 / PS008869 +Position / assigned-ID : B-0-3 / PS008870 +Position / assigned-ID : B-1-3 / PS008871 +Position / assigned-ID : B-0-4 / PS008872 +Position / assigned-ID : B-1-4 / PS008873 +Position / assigned-ID : B-0-5 / PS008874 +Position / assigned-ID : B-1-5 / PS008875 +Position / assigned-ID : B-0-6 / PS008876 +Position / assigned-ID : B-1-6 / PS008877 +Position / assigned-ID : B-0-7 / PS008878 +Position / assigned-ID : B-1-7 / PS008879 +Position / assigned-ID : B-0-8 / PS008880 +Position / assigned-ID : B-1-8 / PS008881 +Position / assigned-ID : B-0-9 / PS008882 +Position / assigned-ID : B-1-9 / PS008883 ====================== QAQC status| QSPIp | Recov | Power | Clock | ASDTP | Reset | Result | ---------------------------------------------------------------------- diff --git a/tests/example_logs/valid/84.log b/tests/example_logs/valid/84.log index 3919413..a2e166b 100644 --- a/tests/example_logs/valid/84.log +++ b/tests/example_logs/valid/84.log @@ -5,20 +5,20 @@ QAQC runid: 84 Shifters: alice ---------------------- PBS Assignment: -Position / assigned-ID : A-0-0 / PS008867 -Position / assigned-ID : A-1-0 / PS008868 -Position / assigned-ID : A-0-2 / PS008869 -Position / assigned-ID : A-1-2 / PS008810 -Position / assigned-ID : A-0-3 / PS008811 -Position / assigned-ID : A-1-3 / PS008812 -Position / assigned-ID : A-0-4 / PS008813 -Position / assigned-ID : A-1-4 / PS008814 -Position / assigned-ID : A-1-5 / PS008815 -Position / assigned-ID : A-0-6 / PS008816 -Position / assigned-ID : A-1-6 / PS008817 -Position / assigned-ID : A-0-7 / PS008818 -Position / assigned-ID : A-0-8 / PS008819 -Position / assigned-ID : A-1-8 / PS008820 +Position / assigned-ID : B-0-1 / PS008867 +Position / assigned-ID : B-1-1 / PS008868 +Position / assigned-ID : B-0-3 / PS008869 +Position / assigned-ID : B-1-3 / PS008810 +Position / assigned-ID : B-0-4 / PS008811 +Position / assigned-ID : B-1-4 / PS008812 +Position / assigned-ID : B-0-5 / PS008813 +Position / assigned-ID : B-1-5 / PS008814 +Position / assigned-ID : B-1-6 / PS008815 +Position / assigned-ID : B-0-7 / PS008816 +Position / assigned-ID : B-1-7 / PS008817 +Position / assigned-ID : B-0-8 / PS008818 +Position / assigned-ID : B-0-9 / PS008819 +Position / assigned-ID : B-1-9 / PS008820 ====================== QAQC status| QSPIp | Recov | Power | Clock | ASDTP | Reset | Result | ----------------------------------------------------------------------