From a1a4559a501a1b2e2a44ef4f64600da8407dc097 Mon Sep 17 00:00:00 2001 From: OpenXER Maintainers <207556411+clachance14@users.noreply.github.com> Date: Wed, 25 Nov 2026 21:18:02 -0600 Subject: [PATCH] Release v0.1.1: delete open projects, richer RIVERBEND sample, picker menu - Enable Delete on open projects (including RIVERBEND), add Close Project to the Projects context menu, support empty workspace state, and keep emptied workspaces empty on restart. - Expand RIVERBEND default project to 365 activities across 6 plant areas with a second baseline, risks, documents, issues, thresholds, LOE and WBS summary activities, OBS, project/resource/assignment codes, funding, budget log, spending plan, financial periods with past period actuals, and typed UDFs. - Add right-click context menu (Copy, Columns, Table Font and Row, Filter By, Group and Sort By, Expand All, Collapse All) and keyboard shortcuts to Assign Predecessors and Assign Successors. - Bump workspace version to 0.1.1 and update README download links and CHANGELOG. --- CHANGELOG.md | 12 +- Cargo.lock | 12 +- Cargo.toml | 2 +- README.md | 8 +- assets/sample-project.txt | 932 +++++++++++--- desktop/help/assign-relationships.md | 2 +- desktop/help/getting-started.md | 15 +- desktop/help/view-projects.md | 6 +- desktop/src/baselines/mod.rs | 53 + desktop/src/details/assign_kit.rs | 35 +- desktop/src/details/mod.rs | 100 +- desktop/src/details/schedule_tabs.rs | 329 ++++- desktop/src/first_run.rs | 44 +- desktop/src/frame.rs | 29 +- desktop/src/grid/mod.rs | 70 +- desktop/src/help/tests.rs | 7 +- desktop/src/main.rs | 121 +- desktop/src/open_set/mod.rs | 96 +- desktop/src/project_io.rs | 25 +- desktop/src/qa_workflows/context_menus.rs | 3 +- desktop/src/schedule_dialogs.rs | 4 + desktop/src/startup_tests.rs | 71 +- desktop/src/store.rs | 21 +- desktop/src/views/command_bar_tests.rs | 6 +- desktop/src/views/project_ops.rs | 100 +- desktop/src/views/project_ops/tests.rs | 9 +- desktop/src/views/projects.rs | 59 +- desktop/src/views/view_menus_tests.rs | 109 ++ desktop/src/workspace_sync.rs | 2 +- xer/src/sample_project.rs | 1429 +++++++++++++++++++-- xer/src/sample_project/tests.rs | 136 +- 31 files changed, 3287 insertions(+), 560 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6945d9..db072ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,17 @@ All notable changes to OpenXER are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/). The newest release is at the top. -## [Unreleased] +## [0.1.1] - 2026-11-25 + +### Added +- **Close Project** in the Projects view right-click menu, plus a true empty-workspace state when the last open project is closed or deleted. +- Full right-click context menu in **Assign Predecessors** and **Assign Successors**: Copy (`Ctrl+C`), Columns, Table Font and Row, Filter By, Group and Sort By, Expand All (`Ctrl+Num +`), and Collapse All (`Ctrl+Num -`). +- Expanded the default `RIVERBEND` sample project to 365 activities across six plant areas with a second baseline (Mid-August Rebaseline), Risks, Work Products & Documents, Issues, Thresholds, LOE and WBS Summary activities, WBS Milestones, OBS, Project/Resource/Assignment Codes, Funding, Budget Log, Spending Plan, Financial Periods with past period actuals, and typed UDFs. + +### Fixed +- Enabled **Delete** directly on open projects (including the default `RIVERBEND` sample project) in the Projects view, saving and closing before deletion and keeping the workspace empty on restart instead of re-seeding the sample. + +## [0.1.0] - 2026-11-25 The first public release. diff --git a/Cargo.lock b/Cargo.lock index a2a62ab..3a65677 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2429,7 +2429,7 @@ dependencies = [ [[package]] name = "openxer-automation" -version = "0.1.0" +version = "0.1.1" dependencies = [ "chrono", "encoding_rs", @@ -2449,7 +2449,7 @@ dependencies = [ [[package]] name = "openxer-chat" -version = "0.1.0" +version = "0.1.1" dependencies = [ "native-tls", "openssl", @@ -2461,7 +2461,7 @@ dependencies = [ [[package]] name = "openxer-desktop" -version = "0.1.0" +version = "0.1.1" dependencies = [ "chrono", "eframe", @@ -2482,11 +2482,11 @@ dependencies = [ [[package]] name = "openxer-engine" -version = "0.1.0" +version = "0.1.1" [[package]] name = "openxer-interchange" -version = "0.1.0" +version = "0.1.1" dependencies = [ "calamine", "chrono", @@ -2499,7 +2499,7 @@ dependencies = [ [[package]] name = "openxer-xer" -version = "0.1.0" +version = "0.1.1" dependencies = [ "chrono", "encoding_rs", diff --git a/Cargo.toml b/Cargo.toml index 8aad16e..b491f95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["desktop"] resolver = "2" [workspace.package] -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "MIT OR Apache-2.0" publish = false diff --git a/README.md b/README.md index f8da2ed..40770ce 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@

- + Download for Windows (.exe)   - + Download for Linux (AppImage)

@@ -240,8 +240,8 @@ Download directly from the **[Latest Release](https://github.com/OpenXER/openxer | Platform | Recommended download | Portable download | |---|---|---| -| **Windows 10/11 (64-bit)** | [**OpenXER-0.1.0-setup.exe**](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.0-setup.exe) (installer, no admin needed) | [OpenXER-0.1.0-windows-x64.zip](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.0-windows-x64.zip) | -| **Linux (x86_64, X11/Wayland)** | [**OpenXER-0.1.0-x86_64.AppImage**](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.0-x86_64.AppImage) (single file, `chmod +x` and run) | [OpenXER-0.1.0-linux-x86_64.tar.gz](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.0-linux-x86_64.tar.gz) | +| **Windows 10/11 (64-bit)** | [**OpenXER-0.1.1-setup.exe**](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.1-setup.exe) (installer, no admin needed) | [OpenXER-0.1.1-windows-x64.zip](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.1-windows-x64.zip) | +| **Linux (x86_64, X11/Wayland)** | [**OpenXER-0.1.1-x86_64.AppImage**](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.1-x86_64.AppImage) (single file, `chmod +x` and run) | [OpenXER-0.1.1-linux-x86_64.tar.gz](https://github.com/OpenXER/openxer/releases/latest/download/OpenXER-0.1.1-linux-x86_64.tar.gz) | Verify checksums with [SHA256SUMS.txt](https://github.com/OpenXER/openxer/releases/latest/download/SHA256SUMS.txt). diff --git a/assets/sample-project.txt b/assets/sample-project.txt index aaea63b..5ae2a4d 100644 --- a/assets/sample-project.txt +++ b/assets/sample-project.txt @@ -5,7 +5,8 @@ # Durations are working days of the activity's calendar: 5 is the 5-day # 8-hour office calendar, 6 the 6-day 10-hour construction calendar and 7 the # 7-day 10-hour calendar for concrete curing and the plant outage. -# A duration of "start" or "finish" makes a milestone. +# A duration of "start" or "finish" makes a milestone, "loe" makes a Level of +# Effort activity, and "wbs" makes a WBS Summary activity. # Predecessors: ID (finish to start), "ID SS2" (start to start, 2 days lag on # the predecessor's calendar), "ID FF1", "ID FS1". # Resources: "ID units" where units is the crew size (units per hour) for @@ -24,26 +25,48 @@ CY | Cubic Yard TON | Ton BAG | Bag LF | Linear Foot +SF | Square Foot +EA | Each +# code | parent | name +## obs +RIVCAP | | Riverbend Capital Projects +PMO | RIVCAP | M. Alvarez - Project Director +ENGM | RIVCAP | D. Patel - Engineering Manager +PROCM | RIVCAP | S. Novak - Procurement Manager +CONM | RIVCAP | R. Kowalski - Construction Manager +COMMM | RIVCAP | T. Brooks - Commissioning Manager + +# code | parent | name | rate | limit ## roles -STAFF | Project Staff -SUPV | Field Supervision -CRAFT | Skilled Craft -LABOR | General Labor +R-ALL | | Project Delivery Roles | 100 | 80 +STAFF | R-ALL | Project Staff | 120 | 12 +SUPV | R-ALL | Field Supervision | 100 | 10 +CRAFT | R-ALL | Skilled Craft | 85 | 50 +LABOR | R-ALL | General Labor | 60 | 12 +# code | parent | name ## accounts -1000 | Project Management and Engineering -2000 | Direct Craft Labor -3000 | Construction Equipment -4000 | Permanent Materials -5000 | Subcontracts and Vendor Services -6000 | Permits, Freight and Other Expenses +0000 | | Riverbend Process Water Upgrade Cost Accounts +1000 | 0000 | Project Management and Engineering +1100 | 1000 | Project Management and Controls +1200 | 1000 | Engineering and Automation Design +2000 | 0000 | Direct Craft Labor +2100 | 2000 | Civil, Structural and Site Craft +2200 | 2000 | Mechanical, Piping and Millwright Craft +2300 | 2000 | Electrical and Instrumentation Craft +3000 | 0000 | Construction Equipment +4000 | 0000 | Permanent Materials +5000 | 0000 | Subcontracts and Vendor Services +6000 | 0000 | Permits, Freight and Other Expenses ## expense categories Permits and Fees Freight Vendor Services Testing and Inspection +Subcontract Services +Insurance and Bonds ## topics Scope @@ -53,216 +76,487 @@ Safety Quality and Inspection Field Notes Change Notes +Commissioning Notes -# id | name | type (labor, nonlabor, material) | unit | calendar | rate | limit | role | account +## baseline types +Initial Baseline +Mid-Project Rebaseline +Owner Sign-Off Baseline + +# type | short | name | assign +## project codes +Facility | RIV | Riverbend Manufacturing Plant | yes +Facility | NORTH | Northyard Utilities Complex | no +Capital Program | WATER | Process Water Reliability Program | yes +Capital Program | POWER | Substation Modernization Program | no +Contract Type | EPC-GMP | EPC Guaranteed Maximum Price | yes +Contract Type | T-AND-M | Time and Materials | no +Region | MW | Midwest Operations | yes +Region | GL | Great Lakes Operations | no +Priority Tier | T1 | Tier 1 - Plant Outage Critical | yes +Priority Tier | T2 | Tier 2 - Standard Capital | no + +# name | amount | share | description +## funding +Corporate Capital Budget | 3600000 | 65 | Approved FY2026-2027 capital appropriation for plant reliability +Plant Reliability Reserve | 1400000 | 25 | Operations reserve allocated for cooling and process water upgrades +Environmental Compliance Grant | 550000 | 10 | State industrial water reuse and filtration efficiency grant + +# type | short | name +## resource codes +Trade Group | MGMT | Management and Controls +Trade Group | ENGR | Design and Automation Engineering +Trade Group | CIV | Civil and Structural Craft +Trade Group | MECH | Mechanical and Piping Craft +Trade Group | ELEC | Electrical and Instrumentation Craft +Trade Group | EQUIP | Construction Equipment +Trade Group | MATL | Bulk and Permanent Materials +Resource Source | INT | Internal Staff and Self-Perform +Resource Source | SUB | Specialty Subcontractor +Resource Source | RENT | Rented Equipment Fleet +Resource Source | SUPP | Material Supplier + +# type | short | name +## assignment codes +Shift | OFFICE | 5-Day 8-Hour Office Shift +Shift | DAY | 6-Day 10-Hour Construction Shift +Shift | OUTAGE | 7-Day 10-Hour Outage and Curing Shift +Work Location | HOME | Home Office and Vendor Shop +Work Location | SHOP | Piping Fabrication Shop +Work Location | FIELD | Plant Field Construction +Billing Type | DIRECT | Direct Craft Labor +Billing Type | INDIRECT | Management and Field Indirect +Billing Type | EQUIP | Construction Equipment Rental +Billing Type | MATL | Permanent Bulk Material + +# id | parent | name | type (group_labor, group_nonlabor, group_material, labor, nonlabor, material) | unit | calendar | rate | limit | role | account | trade | source ## resources -PM | Project Manager | labor | | 5 | 135 | 1 | STAFF | 1000 -PE | Project Engineer | labor | | 5 | 110 | 2 | STAFF | 1000 -ENGR | Design Engineer | labor | | 5 | 125 | 4 | STAFF | 1000 -BUYER | Buyer and Expeditor | labor | | 5 | 85 | 1 | STAFF | 1000 -SUPT | Construction Superintendent | labor | | 6 | 115 | 1 | SUPV | 2000 -GF | General Foreman | labor | | 6 | 98 | 3 | SUPV | 2000 -FE | Field Engineer | labor | | 6 | 95 | 2 | SUPV | 2000 -QC | Quality Control Inspector | labor | | 6 | 95 | 2 | SUPV | 2000 -LAB | Laborer | labor | | 6 | 58 | 8 | LABOR | 2000 -CARP | Carpenter | labor | | 6 | 72 | 6 | CRAFT | 2000 -IW | Ironworker | labor | | 6 | 82 | 7 | CRAFT | 2000 -PF | Pipefitter | labor | | 6 | 88 | 14 | CRAFT | 2000 -WLD | Pipe Welder | labor | | 6 | 92 | 6 | CRAFT | 2000 -ELEC | Electrician | labor | | 6 | 86 | 10 | CRAFT | 2000 -INST | Instrument Technician | labor | | 6 | 90 | 4 | CRAFT | 2000 -MW | Millwright | labor | | 6 | 85 | 4 | CRAFT | 2000 -PNT | Painter | labor | | 6 | 66 | 3 | CRAFT | 2000 -INSUL | Insulator | labor | | 6 | 70 | 4 | CRAFT | 2000 -OPR | Equipment Operator | labor | | 6 | 80 | 3 | CRAFT | 2000 -CXE | Commissioning Engineer | labor | | 6 | 120 | 2 | STAFF | 1000 -CR90 | Crane, 90 Ton Hydraulic | nonlabor | | 6 | 310 | 1 | | 3000 -CR250 | Crane, 250 Ton Crawler | nonlabor | | 6 | 650 | 1 | | 3000 -LIFT | Manlift, 60 Foot | nonlabor | | 6 | 45 | 5 | | 3000 -WMACH | Welding Machine | nonlabor | | 6 | 18 | 6 | | 3000 -EXC | Excavator | nonlabor | | 6 | 150 | 1 | | 3000 -HYD | Hydrotest Pump and Gauges | nonlabor | | 6 | 35 | 1 | | 3000 -CONC | Ready-Mix Concrete | material | CY | 6 | 185 | | | 4000 -REBAR | Reinforcing Steel | material | TON | 6 | 1450 | | | 4000 -GROUT | Non-Shrink Grout | material | BAG | 6 | 42 | | | 4000 -CABLE | Power Cable, 600 Volt | material | LF | 6 | 9.5 | | | 4000 +R-STAFF | | Project Staff and Engineering | group_labor | | 5 | 0 | | | 1000 | MGMT | INT +PM | R-STAFF | Project Manager | labor | | 5 | 135 | 1 | STAFF | 1100 | MGMT | INT +PE | R-STAFF | Project Engineer | labor | | 5 | 110 | 3 | STAFF | 1100 | MGMT | INT +SCHED | R-STAFF | Lead Project Scheduler | labor | | 5 | 115 | 1 | STAFF | 1100 | MGMT | INT +DC | R-STAFF | Document Controller | labor | | 5 | 78 | 1 | STAFF | 1100 | MGMT | INT +ENGR | R-STAFF | Design Engineer | labor | | 5 | 125 | 6 | STAFF | 1200 | ENGR | INT +PROC_E | R-STAFF | Process Engineer | labor | | 5 | 130 | 2 | STAFF | 1200 | ENGR | INT +AUTO | R-STAFF | Automation and DCS Engineer | labor | | 5 | 132 | 2 | STAFF | 1200 | ENGR | SUB +BUYER | R-STAFF | Buyer and Expeditor | labor | | 5 | 85 | 2 | STAFF | 1100 | MGMT | INT +CXE | R-STAFF | Commissioning Engineer | labor | | 6 | 120 | 3 | STAFF | 1200 | ENGR | INT +R-SUPV | | Field Supervision and QA/QC | group_labor | | 6 | 0 | | | 2000 | MGMT | INT +SUPT | R-SUPV | Construction Superintendent | labor | | 6 | 115 | 2 | SUPV | 2000 | MGMT | INT +GF | R-SUPV | General Foreman | labor | | 6 | 98 | 4 | SUPV | 2000 | MGMT | INT +FE | R-SUPV | Field Engineer | labor | | 6 | 95 | 3 | SUPV | 2000 | MGMT | INT +QC | R-SUPV | Quality Control Inspector | labor | | 6 | 95 | 3 | SUPV | 2000 | MGMT | INT +HSE | R-SUPV | Safety Coordinator | labor | | 6 | 92 | 2 | SUPV | 2000 | MGMT | INT +R-CRAFT | | Direct Craft Labor | group_labor | | 6 | 0 | | | 2000 | CIV | INT +LAB | R-CRAFT | Laborer | labor | | 6 | 58 | 12 | LABOR | 2100 | CIV | INT +CARP | R-CRAFT | Carpenter | labor | | 6 | 72 | 8 | CRAFT | 2100 | CIV | INT +IW | R-CRAFT | Ironworker | labor | | 6 | 82 | 10 | CRAFT | 2100 | CIV | INT +CFIN | R-CRAFT | Concrete Finisher | labor | | 6 | 76 | 6 | CRAFT | 2100 | CIV | INT +PF | R-CRAFT | Pipefitter | labor | | 6 | 88 | 18 | CRAFT | 2200 | MECH | SUB +WLD | R-CRAFT | Pipe Welder | labor | | 6 | 92 | 8 | CRAFT | 2200 | MECH | SUB +MW | R-CRAFT | Millwright | labor | | 6 | 85 | 6 | CRAFT | 2200 | MECH | SUB +ELEC | R-CRAFT | Electrician | labor | | 6 | 86 | 14 | CRAFT | 2300 | ELEC | SUB +INST | R-CRAFT | Instrument Technician | labor | | 6 | 90 | 6 | CRAFT | 2300 | ELEC | SUB +PNT | R-CRAFT | Painter and Coater | labor | | 6 | 66 | 5 | CRAFT | 2200 | MECH | SUB +INSUL | R-CRAFT | Insulator | labor | | 6 | 70 | 6 | CRAFT | 2200 | MECH | SUB +OPR | R-CRAFT | Equipment Operator | labor | | 6 | 80 | 5 | CRAFT | 2100 | CIV | INT +R-EQUIP | | Construction Equipment Fleet | group_nonlabor | | 6 | 0 | | | 3000 | EQUIP | RENT +CR90 | R-EQUIP | Crane, 90 Ton Hydraulic | nonlabor | | 6 | 310 | 2 | | 3000 | EQUIP | RENT +CR250 | R-EQUIP | Crane, 250 Ton Crawler | nonlabor | | 6 | 650 | 1 | | 3000 | EQUIP | RENT +LIFT | R-EQUIP | Manlift, 60 Foot | nonlabor | | 6 | 45 | 8 | | 3000 | EQUIP | RENT +WMACH | R-EQUIP | Welding Machine | nonlabor | | 6 | 18 | 10 | | 3000 | EQUIP | RENT +EXC | R-EQUIP | Excavator | nonlabor | | 6 | 150 | 2 | | 3000 | EQUIP | RENT +HYD | R-EQUIP | Hydrotest Pump and Gauges | nonlabor | | 6 | 35 | 2 | | 3000 | EQUIP | RENT +FORK | R-EQUIP | Telehandler, 10000 lb | nonlabor | | 6 | 55 | 2 | | 3000 | EQUIP | RENT +COMP | R-EQUIP | Air Compressor, 375 CFM | nonlabor | | 6 | 40 | 2 | | 3000 | EQUIP | RENT +R-MAT | | Bulk and Permanent Materials | group_material | | 6 | 0 | | | 4000 | MATL | SUPP +CONC | R-MAT | Ready-Mix Concrete | material | CY | 6 | 185 | | | 4000 | MATL | SUPP +REBAR | R-MAT | Reinforcing Steel | material | TON | 6 | 1450 | | | 4000 | MATL | SUPP +GROUT | R-MAT | Non-Shrink Grout | material | BAG | 6 | 42 | | | 4000 | MATL | SUPP +CABLE | R-MAT | Power Cable, 600 Volt | material | LF | 6 | 9.5 | | | 4000 | MATL | SUPP +FIBER | R-MAT | Fiber Optic Cable, 12-Strand | material | LF | 6 | 6.25 | | | 4000 | MATL | SUPP +SSPIPE | R-MAT | Stainless Steel Pipe, 4-Inch | material | LF | 6 | 68 | | | 4000 | MATL | SUPP +EPOXY | R-MAT | Chemical Containment Coating | material | SF | 6 | 14 | | | 4000 | MATL | SUPP -# code | parent | name +# code | parent | name | obs | orig_budget ## wbs -PM | | Project Management -ENG | | Engineering Deliverables -CS | ENG | Civil and Structural Drawings -ME | ENG | Piping and Mechanical Drawings -EI | ENG | Electrical and Instrument Drawings -PROC | | Procurement -LL | PROC | Long-Lead Equipment -BM | PROC | Bulk Materials -CONST | | Construction -SITE | CONST | Site Preparation and Temporary Facilities -FAB | CONST | Piping Fabrication Shop -A100 | CONST | Area 100 Pump Station -A100.DEMO | A100 | Demolition -A100.CIVIL | A100 | Civil and Structural -A100.EQUIP | A100 | Equipment -A100.PIPE | A100 | Piping -A100.ELEC | A100 | Electrical -A100.INST | A100 | Instrumentation -A100.PAINT | A100 | Paint and Insulation -A200 | CONST | Area 200 Pipe Rack -A200.CIVIL | A200 | Civil and Structural -A200.PIPE | A200 | Piping -A200.ELEC | A200 | Electrical -A200.PAINT | A200 | Paint and Insulation -A300 | CONST | Area 300 Heat Exchanger and Header Tie-ins -A300.DEMO | A300 | Demolition -A300.CIVIL | A300 | Civil and Structural -A300.EQUIP | A300 | Equipment -A300.PIPE | A300 | Piping -A300.TIE | A300 | Header Tie-ins (Plant Outage) -A300.ELEC | A300 | Electrical -A300.INST | A300 | Instrumentation -A300.PAINT | A300 | Paint and Insulation -A400 | CONST | Area 400 Electrical Room -A400.CIVIL | A400 | Civil and Structural -A400.ELEC | A400 | Power Distribution -COMM | | Commissioning and Turnover -MC | COMM | Mechanical Completion -SU | COMM | Commissioning and Startup -TO | COMM | Turnover and Closeout +PM | | Project Management | PMO | 520000 +PM.CTRL | PM | Project Controls and Reporting | PMO | 180000 +PM.SAFE | PM | Safety, Permits and Environmental | PMO | 140000 +PM.QA | PM | Quality Assurance and Document Control | PMO | 90000 +PM.LOE | PM | Management and Site Support (LOE) | PMO | 110000 +ENG | | Engineering Deliverables | ENGM | 680000 +PROC_ENG | ENG | Process Engineering and P&IDs | ENGM | 145000 +CS | ENG | Civil and Structural Drawings | ENGM | 150000 +ME | ENG | Piping and Mechanical Drawings | ENGM | 165000 +EI | ENG | Electrical, Instrument and DCS Drawings | ENGM | 140000 +ENG.BIM | ENG | 3D Model, Clash Reviews and Work Packages | ENGM | 80000 +PROC | | Procurement and Subcontracts | PROCM | 640000 +LL | PROC | Long-Lead Equipment | PROCM | 260000 +BM | PROC | Bulk Materials | PROCM | 175000 +SUB | PROC | Subcontracts and Specialty Vendors | PROCM | 115000 +EXP | PROC | Expediting, Inspection and Logistics | PROCM | 90000 +CONST | | Construction | CONM | 2950000 +SITE | CONST | Site Preparation and Temporary Facilities | CONM | 195000 +FAB | CONST | Piping Fabrication Shop | CONM | 340000 +A100 | CONST | Area 100 Pump Station | CONM | 490000 +A100.DEMO | A100 | Demolition | CONM | 85000 +A100.CIVIL | A100 | Civil and Structural | CONM | 115000 +A100.EQUIP | A100 | Equipment | CONM | 75000 +A100.PIPE | A100 | Piping | CONM | 110000 +A100.ELEC | A100 | Electrical | CONM | 60000 +A100.INST | A100 | Instrumentation | CONM | 30000 +A100.PAINT | A100 | Paint and Insulation | CONM | 15000 +A200 | CONST | Area 200 Pipe Rack | CONM | 520000 +A200.CIVIL | A200 | Civil and Structural | CONM | 210000 +A200.PIPE | A200 | Piping | CONM | 195000 +A200.ELEC | A200 | Electrical | CONM | 65000 +A200.PAINT | A200 | Paint and Insulation | CONM | 50000 +A300 | CONST | Area 300 Heat Exchanger and Header Tie-ins | CONM | 460000 +A300.DEMO | A300 | Demolition | CONM | 25000 +A300.CIVIL | A300 | Civil and Structural | CONM | 80000 +A300.EQUIP | A300 | Equipment | CONM | 65000 +A300.PIPE | A300 | Piping | CONM | 95000 +A300.TIE | A300 | Header Tie-ins (Plant Outage) | CONM | 85000 +A300.ELEC | A300 | Electrical | CONM | 35000 +A300.INST | A300 | Instrumentation | CONM | 50000 +A300.PAINT | A300 | Paint and Insulation | CONM | 25000 +A400 | CONST | Area 400 Electrical Room | CONM | 240000 +A400.CIVIL | A400 | Civil and Structural | CONM | 55000 +A400.ELEC | A400 | Power Distribution | CONM | 185000 +A500 | CONST | Area 500 Chemical Feed and Filtration Skid | CONM | 440000 +A500.CIVIL | A500 | Civil and Containment Pad | CONM | 95000 +A500.EQUIP | A500 | Filtration Skid and Chemical Tanks | CONM | 105000 +A500.PIPE | A500 | Process and Chemical Feed Piping | CONM | 115000 +A500.ELEC | A500 | Electrical Power and Heat Trace | CONM | 55000 +A500.INST | A500 | Analyzers and Control Instrumentation | CONM | 45000 +A500.PAINT | A500 | Coatings and Insulation | CONM | 25000 +A600 | CONST | Area 600 Control Room, DCS and Plant Utilities | CONM | 265000 +A600.DCS | A600 | Control System Cabinets and Fiber Backbone | CONM | 110000 +A600.UTIL | A600 | Plant Air, Potable Water and Drain Tie-ins | CONM | 85000 +A600.CIVIL | A600 | Underground Ductbank and Paving Restoration | CONM | 70000 +COMM | | Commissioning and Turnover | COMMM | 405000 +PRECOM | COMM | Pre-Commissioning, Flushing and Passivation | COMMM | 105000 +MC | COMM | Mechanical Completion | COMMM | 95000 +SU | COMM | Commissioning and Startup | COMMM | 125000 +TO | COMM | Turnover and Closeout | COMMM | 80000 + +# wbs | step | weight | complete +## wbs steps +ENG | 30% Design and P&ID Freeze | 20 | Y +ENG | 60% 3D Model and HAZOP Sign-Off | 30 | Y +ENG | 90% Owner Review Resolution | 25 | Y +ENG | Issued for Construction (IFC) Release | 25 | Y +PROC | Long-Lead Equipment POs Issued | 30 | Y +PROC | Critical Vendor Drawings Approved | 30 | Y +PROC | Subcontracts Awarded | 20 | Y +PROC | Major Equipment Delivered to Site | 20 | N +A100 | Existing Pumps Demolished | 20 | N +A100 | Pump Foundations Cured | 25 | N +A100 | Pumps Set and Grouted | 25 | N +A100 | Area 100 Mechanical Completion Signed | 30 | N +A200 | Rack Footings Completed | 25 | Y +A200 | Pipe Rack Steel Erected | 25 | N +A200 | 10-Inch Header Hydrotested | 30 | N +A200 | Heat Tracing and Insulation Complete | 20 | N +A300 | Heat Exchanger E-301 Set on Pad | 30 | N +A300 | Plant Outage Tie-Ins TI-01 to TI-03 Complete | 50 | N +A300 | Tie-In Leak Test Accepted | 20 | N +A500 | Chemical Containment Pad Coated | 25 | N +A500 | Filtration Skid FL-501 Installed | 35 | N +A500 | Analyzers Calibrated and Loop Checked | 40 | N +COMM | All Systems Mechanically Complete | 35 | N +COMM | DCS SAT and Wet Commissioning Complete | 35 | N +COMM | 30-Day Reliability Run Accepted | 30 | N + +# wbs (PROJECT or code) | number | date | amount | status | responsible | reason +## budget log +PROJECT | AUTH-000 | 2026-06-01 07:00 | 5195000 | Approved | M. Alvarez | Initial Board Capital Authorization for Riverbend Process Water Upgrade +PROJECT | CO-001 | 2026-08-14 14:00 | 145000 | Approved | M. Alvarez | Add pipe rack freeze protection heat tracing and insulation per winter operations review +PROJECT | CO-002 | 2026-09-18 11:00 | 210000 | Approved | D. Patel | Upgrade Area 500 containment curb and dual-wall chemical dosing lines per state grant terms +PROJECT | CO-003 | 2026-10-02 15:00 | 68500 | Pending | R. Kowalski | Extended 250-ton crawler crane timber matting and soft-soil subgrade stabilization at Area 300 +PROJECT | CO-004 | 2026-09-24 10:00 | 42000 | Rejected | S. Novak | Expedited air-ride freight premium for transformer TX-401 (declined, standard transit holds float) +PROJECT | CO-005 | 2026-10-09 16:00 | 54000 | Pending | T. Brooks | Redundant DCS analog I/O modules and ring-topology fiber backbone for Area 500 analyzers +A200 | CO-001A | 2026-08-14 14:00 | 145000 | Approved | R. Kowalski | Area 200 heat tracing and jacketing allocation under CO-001 +A500 | CO-002A | 2026-09-18 11:00 | 210000 | Approved | R. Kowalski | Area 500 chemical containment epoxy and stainless header upgrade under CO-002 + +# wbs (PROJECT or code) | start | end | spend | benefit +## spending plan +PROJECT | 2026-06-01 00:00 | 2026-06-30 23:59 | 240000 | 0 +PROJECT | 2026-07-01 00:00 | 2026-07-31 23:59 | 380000 | 0 +PROJECT | 2026-08-01 00:00 | 2026-08-31 23:59 | 490000 | 0 +PROJECT | 2026-09-01 00:00 | 2026-09-30 23:59 | 560000 | 0 +PROJECT | 2026-10-01 00:00 | 2026-10-31 23:59 | 640000 | 0 +PROJECT | 2026-11-01 00:00 | 2026-11-30 23:59 | 720000 | 0 +PROJECT | 2026-12-01 00:00 | 2026-12-31 23:59 | 740000 | 0 +PROJECT | 2027-01-01 00:00 | 2027-01-31 23:59 | 680000 | 0 +PROJECT | 2027-02-01 00:00 | 2027-02-28 23:59 | 520000 | 0 +PROJECT | 2027-03-01 00:00 | 2027-03-31 23:59 | 340000 | 180000 +PROJECT | 2027-04-01 00:00 | 2027-04-30 23:59 | 240000 | 320000 +PROJECT | 2027-05-01 00:00 | 2027-05-31 23:59 | 0 | 360000 # id | wbs | calendar | duration | name | predecessors | resources ## activities +# --- Project Management, Controls, Safety, QA & LOE --- MS0000 | PM | 5 | start | Notice to proceed | | -PM0100 | PM | 5 | 2 | Hold project kickoff meeting with owner and plant operations | MS0000 | PM 1, PE 1, SUPT 1 -PM0110 | PM | 5 | 10 | Submit project schedule and cost breakdown for owner approval | PM0100 | PM 0.5, PE 1 -PM0120 | PM | 5 | 12 | Prepare and submit site safety plan and job hazard analyses | PM0100 | PE 0.5, SUPT 1 -PM0130 | PM | 5 | 25 | Obtain county building and excavation permits | PM0100 | PE 0.5 -PM0140 | PM | 5 | 1 | Hold pre-construction safety meeting with plant operations | PM0120 | PM 1, SUPT 1, GF 1 +PM0100 | PM | 5 | 2 | Hold project kickoff meeting with owner and plant operations | MS0000 | PM 1, PE 1, SUPT 1, SCHED 1 +PM0105 | PM.CTRL | 5 | 5 | Establish WBS, cost account structure and project controls plan | PM0100 | PM 0.5, SCHED 1, PE 0.5 +PM0110 | PM.CTRL | 5 | 10 | Submit project schedule and cost breakdown for owner approval | PM0105 | PM 0.5, PE 1, SCHED 1 +PM0115 | PM.CTRL | 5 | 4 | Baseline schedule review and formal owner baseline sign-off | PM0110 | PM 0.5, SCHED 1 +PM0118 | PM.CTRL | 5 | finish | Baseline schedule and cost plan approved | PM0115 | +PM0120 | PM.SAFE | 5 | 12 | Prepare and submit site safety plan and job hazard analyses | PM0100 | PE 0.5, SUPT 1, HSE 1 +PM0125 | PM.SAFE | 5 | 6 | Prepare environmental spill prevention and stormwater plan | PM0100 | HSE 1, PE 0.5 +PM0130 | PM.SAFE | 5 | 25 | Obtain county building and excavation permits | PM0100 | PE 0.5, PM 0.25 +PM0135 | PM.SAFE | 5 | 15 | Obtain state industrial water filtration and discharge permit addendum | PM0125 | PROC_E 0.5, HSE 0.5 +PM0140 | PM.SAFE | 5 | 1 | Hold pre-construction safety meeting with plant operations | PM0120, PM0125 | PM 1, SUPT 1, GF 1, HSE 1 +PM0150 | PM.QA | 5 | 8 | Issue project quality assurance plan and weld inspection matrix | PM0100 | QC 1, PE 0.5 +PM0155 | PM.QA | 5 | 5 | Configure document control register and submittal tracking portal | PM0100 | DC 1, PE 0.25 +PM0160 | PM.QA | 5 | 6 | Establish inspection and test plan (ITP) hold points with owner QA | PM0150, PM0155 | QC 1, PM 0.25 +PM0200 | PM.CTRL | 5 | 5 | Conduct monthly cost forecast and schedule update - Month 2 | PM0118 | SCHED 0.5, PM 0.25 +PM0205 | PM.CTRL | 5 | 4 | Conduct monthly cost forecast and schedule update - Month 3 | PM0200, EN0080 | SCHED 0.5, PM 0.25 +PM0210 | PM.CTRL | 5 | 5 | Conduct monthly cost forecast and schedule update - Month 4 | PM0205, EN0240 | SCHED 0.5, PM 0.25 +PM0212 | PM.CTRL | 5 | 4 | Conduct monthly cost forecast and schedule update - Month 5 | PM0210, CV2040 | SCHED 0.5, PM 0.25 +PM0214 | PM.CTRL | 5 | 4 | Conduct monthly cost forecast and schedule update - Month 6 | PM0212, DM0900 | SCHED 0.5, PM 0.25 +PM0216 | PM.CTRL | 5 | 4 | Conduct monthly cost forecast and schedule update - Month 7 | PM0214, CV1040 | SCHED 0.5, PM 0.25 +PM0218 | PM.QA | 5 | 3 | Perform mid-project quality management and weld traceability audit | PM0160, PP0130 | QC 1, DC 0.5, PE 0.5 +PM0220 | PM.CTRL | 5 | 5 | Prepare February plant outage readiness and execution playbook | EN0220, PR0320, PM0216 | PM 0.5, SUPT 1, SCHED 1, HSE 0.5 +PM0230 | PM.CTRL | 5 | 3 | Conduct plant outage tabletop rehearsal with owner operations | PM0220, PM0218 | PM 1, SUPT 1, GF 1, CXE 1, HSE 1 +LOE010 | PM.LOE | 5 | loe | Level of effort: project management and controls oversight | MS0000 SS0, PM0920 FF0 | PM 0.35, SCHED 0.35 +LOE020 | PM.LOE | 6 | loe | Level of effort: field supervision and site safety management | ST0100 SS0, PM0900 FF0 | SUPT 0.4, HSE 0.5 +LOE030 | PM.LOE | 5 | loe | Level of effort: QA/QC coordination and document control | PM0155 SS0, PM0910 FF0 | DC 0.4, QC 0.25 +LOE040 | PM.LOE | 6 | loe | Level of effort: temporary site utilities, trailers and housekeeping | ST0100 SS0, PM0900 FF0 | LAB 0.5 +LOE050 | PM.LOE | 6 | loe | Level of effort: excavation dewatering and environmental monitoring | CV3000 SS0, CV6030 FF0 | LAB 0.3, HSE 0.2 + +# --- Engineering Deliverables --- +EN0050 | PROC_ENG | 5 | 12 | Perform hydraulic network analysis and pump head calculations | PM0100 | PROC_E 1.5, ENGR 0.5 +EN0060 | PROC_ENG | 5 | 15 | Develop process flow diagrams and P&IDs for all areas | EN0050 | PROC_E 1.5, ENGR 1 +EN0070 | PROC_ENG | 5 | 4 | Conduct HAZOP safety study with plant operations and process team | EN0060 | PROC_E 1, ENGR 1, HSE 1, PM 0.5 +EN0080 | PROC_ENG | 5 | 8 | Resolve HAZOP action items and issue IFC P&IDs | EN0070 | PROC_E 1.5, ENGR 0.5 +EN0085 | PROC_ENG | 5 | finish | Process P&IDs issued for construction | EN0080 | +EN0090 | PROC_ENG | 5 | 10 | Prepare chemical feed dosing and filtration process specifications | EN0060 | PROC_E 1, ENGR 0.5 +EN0092 | PROC_ENG | 5 | 6 | Prepare process water valve, strainer and specialty item datasheets | EN0060 | PROC_E 1, ENGR 0.5 +EN0095 | PROC_ENG | 5 | 5 | Prepare chemical compatibility and material selection report | EN0090 | PROC_E 1 EN0100 | CS | 5 | 25 | Design pump foundations, rack footings and equipment pads | PM0100 | ENGR 2, PE 0.5 +EN0105 | CS | 5 | 14 | Design Area 500 chemical containment slab, sump and curbing | EN0090, EN0095, EN0110 | ENGR 1.5 EN0110 | CS | 5 | 5 | Review soil report for pump foundation bearing pressure | EN0100 SS5 | ENGR 1 -EN0120 | CS | 5 | 10 | Resolve owner comments on civil and structural drawings | EN0100, EN0110 | ENGR 1 -EN0130 | CS | 5 | finish | Civil and structural drawings issued for construction | EN0120 | +EN0112 | CS | 5 | 6 | Perform wind and seismic lateral load check on 6-bent pipe rack | EN0110 | ENGR 1 +EN0115 | CS | 5 | 12 | Design pipe rack structural steel framing and anchor bolt details | EN0112 | ENGR 1.5 +EN0118 | CS | 5 | 8 | Design underground electrical and fiber ductbank routing | EN0110 | ENGR 1 +EN0120 | CS | 5 | 10 | Resolve owner comments on civil and structural drawings | EN0100, EN0110, EN0112, EN0115 | ENGR 1 +EN0125 | CS | 5 | 6 | Resolve owner comments on Area 500 containment and ductbank drawings | EN0105, EN0118 | ENGR 1 +EN0130 | CS | 5 | finish | Civil and structural drawings issued for construction | EN0120, EN0125 | EN0200 | ME | 5 | 35 | Design pump station, pipe rack and heat exchanger piping | PM0100 | ENGR 2, PE 0.5 -EN0210 | ME | 5 | 10 | Resolve owner comments on piping drawings | EN0200 | ENGR 1 +EN0205 | ME | 5 | 18 | Design Area 500 filtration skid and chemical feed piping layout | EN0080, EN0090, EN0092 | ENGR 1.5, PROC_E 0.5 +EN0208 | ME | 5 | 10 | Perform pipe stress and thermal expansion analysis on 10-inch header | EN0050 | ENGR 1 +EN0209 | ME | 5 | 8 | Design pipe hanger, shoe and spring support schedule | EN0208 | ENGR 1 +EN0210 | ME | 5 | 10 | Resolve owner comments on piping drawings | EN0200, EN0208, EN0209 | ENGR 1 +EN0215 | ME | 5 | 6 | Resolve owner comments on Area 500 chemical and filtration piping | EN0205 | ENGR 1 EN0220 | ME | 5 | 8 | Prepare piping isometrics and tie-in package for the outage | EN0210 | ENGR 1.5 -EN0230 | ME | 5 | 5 | Prepare hydrotest packages with test limits and test pressures | EN0220 | ENGR 1, QC 0.5 -EN0240 | ME | 5 | finish | Piping drawings issued for construction | EN0220 | +EN0225 | ME | 5 | 6 | Prepare Area 500 stainless and chemical piping isometrics | EN0215 | ENGR 1 +EN0230 | ME | 5 | 5 | Prepare hydrotest packages with test limits and test pressures | EN0220, EN0225 | ENGR 1, QC 0.5 +EN0240 | ME | 5 | finish | Piping drawings issued for construction | EN0220, EN0225 | EN0300 | EI | 5 | 30 | Design one-line diagram, motor control center schedule and cable schedule | PM0100 | ENGR 1.5 +EN0302 | EI | 5 | 8 | Perform cable tray fill and voltage drop sizing calculations | EN0050 | ENGR 1 +EN0305 | EI | 5 | 12 | Perform short-circuit, coordination and arc flash engineering study | EN0050 | ENGR 1 +EN0308 | EI | 5 | 8 | Design motor starter control schematics and VFD interlock wiring | EN0305 | ENGR 1, AUTO 0.5 EN0310 | EI | 5 | 25 | Design instrument loop drawings, instrument index and hookups | EN0200 SS15 | ENGR 1 -EN0320 | EI | 5 | 10 | Resolve owner comments on electrical and instrument drawings | EN0300, EN0310 | ENGR 1 -EN0330 | EI | 5 | 5 | Prepare cable pull cards and termination schedules | EN0320 | ENGR 1 -EN0340 | EI | 5 | finish | Electrical and instrument drawings issued for construction | EN0320 | -EN0400 | ENG | 5 | 3 | Issue construction work packages for Area 100 pump station | EN0130, EN0240 | PE 1, FE 1 -EN0410 | ENG | 5 | 3 | Issue construction work packages for Area 200 pipe rack | EN0130, EN0240 | PE 1, FE 1 -EN0420 | ENG | 5 | 3 | Issue construction work packages for Area 300 heat exchanger and tie-ins | EN0240, EN0340 | PE 1, FE 1 +EN0315 | EI | 5 | 16 | Develop DCS control narrative, I/O list and cause-and-effect matrix | EN0080 | AUTO 1.5, PROC_E 0.5 +EN0318 | EI | 5 | 12 | Design Area 500 analyzer panels, VFD wiring and fiber network topology | EN0315 | AUTO 1, ENGR 1 +EN0320 | EI | 5 | 10 | Resolve owner comments on electrical and instrument drawings | EN0300, EN0302, EN0305, EN0308, EN0310 | ENGR 1 +EN0325 | EI | 5 | 8 | Resolve owner comments on DCS I/O list and Area 500 E&I package | EN0315, EN0318 | AUTO 1, ENGR 0.5 +EN0330 | EI | 5 | 5 | Prepare cable pull cards and termination schedules | EN0320, EN0325 | ENGR 1 +EN0335 | EI | 5 | 15 | Program DCS graphics, alarms and pump lead-lag control logic | EN0325 | AUTO 1.5 +EN0340 | EI | 5 | finish | Electrical and instrument drawings issued for construction | EN0320, EN0325 | +EN0350 | ENG.BIM | 5 | 5 | Conduct 30 percent 3D model design review with owner | EN0050, EN0110 | ENGR 1, PE 1, PROC_E 0.5 +EN0360 | ENG.BIM | 5 | 5 | Conduct 60 percent 3D model clash detection and constructability review | EN0350, EN0060 | ENGR 1, PE 1, SUPT 0.5 +EN0370 | ENG.BIM | 5 | 5 | Conduct 90 percent 3D model review and lock pipe rack elevations | EN0360, EN0210 | ENGR 1, PE 1, SUPT 0.5 +EN0400 | ENG.BIM | 5 | 3 | Issue construction work packages for Area 100 pump station | EN0130, EN0240, EN0370 | PE 1, FE 1, DC 0.5 +EN0410 | ENG.BIM | 5 | 3 | Issue construction work packages for Area 200 pipe rack | EN0130, EN0240, EN0370 | PE 1, FE 1, DC 0.5 +EN0420 | ENG.BIM | 5 | 3 | Issue construction work packages for Area 300 heat exchanger and tie-ins | EN0240, EN0340 | PE 1, FE 1, DC 0.5 +EN0430 | ENG.BIM | 5 | 3 | Issue construction work packages for Area 500 filtration skid and Area 600 DCS | EN0085, EN0130, EN0240, EN0340 | PE 1, FE 1, DC 0.5 + +# --- Procurement and Subcontracts --- PR0100 | LL | 5 | 8 | Issue purchase order for process water pumps P-101A and P-101B | EN0200 SS5 | BUYER 0.5, ENGR 0.25 -PR0110 | LL | 5 | 20 | Review and approve pump vendor drawings | PR0100 | ENGR 0.5, BUYER 0.25 +PR0110 | LL | 5 | 20 | Review and approve pump vendor drawings | PR0100 | ENGR 0.5, BUYER 0.25, DC 0.25 PR0120 | LL | 5 | 44 | Pump vendor pours and machines the pump casings | PR0110 | BUYER 0.25 PR0125 | LL | 5 | 44 | Pump vendor assembles and shop tests pumps P-101A and P-101B | PR0120 | BUYER 0.25, ENGR 0.1 PR0130 | LL | 5 | 10 | Ship pumps P-101A and P-101B to site | PR0125 | BUYER 0.25 +PR0150 | LL | 5 | 8 | Issue purchase order for variable frequency drives VFD-101A and VFD-101B | EN0330, EN0370 | BUYER 0.5, ENGR 0.25 +PR0155 | LL | 5 | 15 | Review and approve VFD vendor submittals and harmonic study | PR0150 | ENGR 0.5, BUYER 0.25 +PR0160 | LL | 5 | 42 | Vendor builds and factory tests VFDs VFD-101A and VFD-101B | PR0155 | BUYER 0.25 +PR0165 | LL | 5 | 8 | Ship VFD cabinets VFD-101A and VFD-101B to site | PR0160 | BUYER 0.25 PR0200 | LL | 5 | 6 | Issue purchase order for transformer TX-401 and motor control center MCC-401 | EN0300 SS10 | BUYER 0.5, ENGR 0.25 -PR0210 | LL | 5 | 25 | Review and approve transformer and motor control center vendor drawings | PR0200 | ENGR 0.5, BUYER 0.25 +PR0210 | LL | 5 | 25 | Review and approve transformer and motor control center vendor drawings | PR0200 | ENGR 0.5, BUYER 0.25, DC 0.25 PR0220 | LL | 5 | 44 | Vendor winds the core and coil of transformer TX-401 | PR0210 | BUYER 0.25 PR0225 | LL | 5 | 44 | Vendor assembles transformer TX-401 and builds MCC-401 | PR0220 | BUYER 0.25 -PR0227 | LL | 5 | 15 | Vendor factory tests TX-401 and MCC-401 with the owner witnessing | PR0225 | ENGR 0.25 +PR0227 | LL | 5 | 15 | Vendor factory tests TX-401 and MCC-401 with the owner witnessing | PR0225 | ENGR 0.25, QC 0.25 PR0230 | LL | 5 | 12 | Ship transformer TX-401 and motor control center MCC-401 to site | PR0227 | BUYER 0.25 PR0300 | LL | 5 | 6 | Issue purchase order for control valve FV-301 and field instruments | EN0310 SS10 | BUYER 0.5, ENGR 0.25 PR0310 | LL | 5 | 40 | Vendor builds and ships control valve FV-301 and field instruments | PR0300 | BUYER 0.25 PR0320 | LL | 5 | finish | Owner delivers heat exchanger E-301 to site (owner furnished) | MS0000 | +PR0350 | LL | 5 | 8 | Issue purchase order for multimedia filtration skid FL-501 and tanks | EN0215 | BUYER 0.5, PROC_E 0.25 +PR0355 | LL | 5 | 15 | Review and approve filtration skid FL-501 vendor drawings | PR0350 | PROC_E 0.5, ENGR 0.25, DC 0.25 +PR0360 | LL | 5 | 42 | Vendor fabricates and hydrotests filtration skid FL-501 and day tanks | PR0355 | BUYER 0.25 +PR0365 | LL | 5 | 10 | Ship filtration skid FL-501 and chemical tanks TK-501/502 to site | PR0360 | BUYER 0.25 +PR0370 | LL | 5 | 6 | Issue purchase order for DCS marshalling cabinet CP-601 and analyzers | EN0335, EN0430 | BUYER 0.5, AUTO 0.25 +PR0375 | LL | 5 | 38 | Vendor integrates, wires and factory tests cabinet CP-601 and analyzers | PR0370 | AUTO 0.25, BUYER 0.25 +PR0380 | LL | 5 | 8 | Ship DCS marshalling cabinet CP-601 and analyzers to site | PR0375 | BUYER 0.25 PR0400 | BM | 5 | 5 | Issue purchase order for pipe, fittings and valves | EN0220 | BUYER 1 PR0410 | BM | 5 | 40 | Receive pipe, fittings and valves at the laydown yard | PR0400 | BUYER 0.25 +PR0420 | BM | 5 | 5 | Issue purchase order for Area 500 stainless pipe, chemical tubing and valves | EN0240 | BUYER 0.75 +PR0425 | BM | 5 | 25 | Receive Area 500 stainless pipe, valves and safety shower package | PR0420 | BUYER 0.25 PR0500 | BM | 5 | 5 | Issue purchase order for pipe rack structural steel | EN0120 | BUYER 1 -PR0505 | BM | 5 | 25 | Steel fabricator prepares pipe rack shop drawings for approval | PR0500 | ENGR 0.25 +PR0505 | BM | 5 | 25 | Steel fabricator prepares pipe rack shop drawings for approval | PR0500 | ENGR 0.25, DC 0.25 PR0510 | BM | 5 | 40 | Steel fabricator builds pipe rack steel | PR0505 | BUYER 0.25 PR0515 | BM | 5 | 15 | Steel fabricator galvanizes and ships pipe rack steel | PR0510 | BUYER 0.25 PR0600 | BM | 5 | 18 | Purchase and receive cable, cable tray and conduit | EN0320 | BUYER 0.5 +PR0605 | BM | 5 | 16 | Purchase and receive fiber optic cable, ductbank conduit and pull boxes | EN0125, EN0325 | BUYER 0.5 PR0610 | BM | 5 | 35 | Purchase and receive anchor bolts, embeds and reinforcing steel | EN0120 | BUYER 0.5 PR0620 | BM | 5 | 15 | Purchase and receive instrument tubing, fittings and supports | EN0320 | BUYER 0.25 PR0630 | BM | 5 | 20 | Purchase and receive insulation, jacketing and heat tracing | EN0220 | BUYER 0.25 +PR0640 | BM | 5 | 12 | Purchase and receive chemical containment epoxy coating system | EN0125 | BUYER 0.25 +PR0700 | SUB | 5 | 10 | Issue bid packages and evaluate mechanical and piping subcontractor bids | EN0080 | BUYER 1, PM 0.5 +PR0710 | SUB | 5 | 6 | Award mechanical and piping installation subcontract | PR0700 | PM 0.5, BUYER 1 +PR0720 | SUB | 5 | 10 | Issue bid packages and evaluate electrical and I&C subcontractor bids | EN0305 | BUYER 1, PM 0.5 +PR0730 | SUB | 5 | 6 | Award electrical and instrumentation subcontract | PR0720 | PM 0.5, BUYER 1 +PR0740 | SUB | 5 | 8 | Award NDT radiography, scaffolding and insulation specialty subcontracts | PM0150, PR0710 | BUYER 0.75, QC 0.25 +PR0750 | SUB | 5 | 6 | Award 250-ton heavy lift crane and rigging subcontract | EN0120 | BUYER 0.5, SUPT 0.25 +PR0760 | SUB | 5 | 6 | Issue PO for commissioning spare parts, seals, gaskets and filter media | PR0130, PR0365 | BUYER 0.75, PE 0.25 +PR0765 | SUB | 5 | 32 | Receive and catalog commissioned spare parts in warehouse | PR0760 | BUYER 0.25, DC 0.25 +PR0800 | EXP | 5 | 3 | Perform mid-fabrication source inspection at pump vendor facility | PR0120 | QC 0.5, BUYER 0.5 +PR0805 | EXP | 5 | 3 | Witness VFD load-bank and harmonic filter factory test | PR0160 | ENGR 0.5, QC 0.5 +PR0810 | EXP | 5 | 3 | Perform source inspection at structural steel fabricator shop | PR0510 | QC 0.5, BUYER 0.5 +PR0815 | EXP | 5 | 3 | Review valve MTRs and hydrotest certificates prior to shipment | PR0410 | QC 0.5, DC 0.5 +PR0820 | EXP | 5 | 3 | Perform source inspection and FAT witness on filtration skid FL-501 | PR0360 | QC 0.5, PROC_E 0.5 +PR0825 | EXP | 5 | 2 | Witness chemical day tank TK-501/502 hydrostatic leak test at vendor | PR0360 | QC 0.5, BUYER 0.25 +PR0830 | EXP | 5 | 3 | Conduct DCS cabinet CP-601 factory acceptance test (FAT) | PR0375, EN0335 | AUTO 1, CXE 0.5, QC 0.5 +PR0835 | EXP | 5 | 2 | Perform receiving megger check on power cable reels and fiber spools | PR0600, PR0605, EL2000 | ELEC 1, QC 0.5 +PR0840 | EXP | 5 | 3 | Bench-verify pressure, flow and temperature transmitters on receipt | PR0310 | INST 1, QC 0.5 + +# --- Construction: Site Prep & Fabrication --- ST0100 | SITE | 6 | 5 | Mobilize site trailers, laydown yard and temporary power | PM0140, PM0130, PM0110 | SUPT 1, GF 1, LAB 4, OPR 1, ELEC 1 +ST0105 | SITE | 6 | 4 | Grade and gravel laydown yard, crane pads and material storage bays | ST0100 | OPR 2, LAB 3, FORK 1 +ST0108 | SITE | 6 | 2 | Hook up temporary construction water, air and trailer sanitary utilities | ST0100 | PF 2, LAB 2 ST0110 | SITE | 6 | 3 | Install temporary fencing and traffic barricades | ST0100 SS2 | LAB 3 +ST0115 | SITE | 6 | 3 | Install silt fencing, washout pit and stormwater sediment controls | ST0105 | LAB 3, HSE 0.5 ST0120 | SITE | 6 | 3 | Locate and mark existing underground utilities in the work areas | ST0100 | FE 1, LAB 2, OPR 1, EXC 1 -ST0130 | SITE | 6 | 4 | Survey and stake new foundations and rack column lines | ST0120, EN0130 | FE 2, LAB 1 -ST0140 | SITE | 6 | finish | Construction mobilization complete | ST0110, ST0130 | -PP0100 | FAB | 6 | 15 | Fabricate pump station piping spools at the fab shop | PR0410, EN0400 | GF 1, PF 3, WLD 2, WMACH 2 +ST0125 | SITE | 6 | 3 | Hydro-excavate pothole verification at critical underground crossings | ST0120 | LAB 3, OPR 1, FE 0.5 +ST0130 | SITE | 6 | 4 | Survey and stake new foundations and rack column lines | ST0120, ST0125, EN0130 | FE 2, LAB 1 +ST0135 | SITE | 6 | 2 | Conduct site safety orientation for mechanical and electrical crews | ST0110, PR0710, PR0730 | HSE 1, SUPT 1 +ST0140 | SITE | 6 | finish | Construction mobilization complete | ST0108, ST0110, ST0115, ST0130, ST0135 | +PP0100 | FAB | 6 | 15 | Fabricate pump station piping spools at the fab shop | PR0410, EN0400, PR0710 | GF 1, PF 3, WLD 2, WMACH 2 +PP0105 | FAB | 6 | 2 | Perform positive material identification (PMI) on alloy spools and fittings | PR0425, PP0100 | QC 1, LAB 1 PP0110 | FAB | 6 | 20 | Fabricate pipe rack header spools at the fab shop | PP0100 SS5, EN0410 | PF 3, WLD 2, WMACH 2 -PP0120 | FAB | 6 | 15 | Fabricate heat exchanger and tie-in spools at the fab shop | PP0110, EN0420 | PF 3, WLD 2, WMACH 2 -PP0130 | FAB | 6 | 4 | Radiograph shop spool welds (random 10 percent) | PP0120 | QC 1 +PP0120 | FAB | 6 | 15 | Fabricate heat exchanger and tie-in spools at the fab shop | PP0110, PR0815, EN0420 | PF 3, WLD 2, WMACH 2 +PP0125 | FAB | 6 | 12 | Fabricate Area 500 stainless filtration and chemical feed spools | PP0110, PR0425, PP0105, EN0430 | PF 2, WLD 2, WMACH 2 +PP0128 | FAB | 6 | 3 | Compile shop weld maps, welder qualification logs and NDE packages | PP0120, PR0815 | QC 1, DC 0.5 +PP0130 | FAB | 6 | 4 | Radiograph shop spool welds (random 10 percent) | PP0120, PP0128, PR0740 | QC 1 +PP0135 | FAB | 6 | 3 | Passivate, tag and stage stainless spools for Area 500 delivery | PP0125 | QC 1, LAB 2, FORK 1 +PP0140 | FAB | 6 | 3 | Deliver and stage carbon steel spool bundles to laydown yard | PP0130 | LAB 2, OPR 1, FORK 1 + +# --- Area 100: Pump Station --- +WS1000 | A100 | 6 | wbs | Area 100 Pump Station Summary | | DM0900 | A100.DEMO | 6 | start | Plant operations releases existing pumps P-1 and P-2 for demolition | ST0140 | -DM1000 | A100.DEMO | 6 | 2 | Lock out, drain and isolate existing pumps P-1 and P-2 | DM0900, EN0400 | GF 1, PF 2, ELEC 1 +DM1000 | A100.DEMO | 6 | 2 | Lock out, drain and isolate existing pumps P-1 and P-2 | DM0900, EN0400 | GF 1, PF 2, ELEC 1, HSE 0.5 DM1010 | A100.DEMO | 6 | 3 | Disconnect and remove existing pump motor cables and conduit | DM1000 | ELEC 3 DM1020 | A100.DEMO | 6 | 4 | Cut out and remove existing pump suction and discharge piping | DM1000 | PF 3, WLD 1, WMACH 1, LIFT 1 DM1030 | A100.DEMO | 6 | 3 | Rig out existing pumps P-1 and P-2 and their motors | DM1010, DM1020 | MW 2, LAB 2, OPR 1, CR90 1 -DM1040 | A100.DEMO | 6 | 4 | Break out and haul away the old pump bases | DM1030 | LAB 4, OPR 1, EXC 1 -CV1000 | A100.CIVIL | 6 | 4 | Excavate for new pump foundations | DM1040, ST0130 | OPR 1, LAB 3, EXC 1 -CV1010 | A100.CIVIL | 6 | 8 | Form, set anchor bolts and tie reinforcing steel for pump foundations | CV1000, PR0610 | CARP 4, IW 2, LAB 2, REBAR 6 -CV1020 | A100.CIVIL | 6 | 1 | Place concrete for pump foundations | CV1010 | GF 1, LAB 4, CARP 2, OPR 1, CONC 48 +DM1040 | A100.DEMO | 6 | 3 | Break out and haul away the old pump bases | DM1030 | LAB 4, OPR 1, EXC 1, COMP 1 +DM1050 | A100.DEMO | 6 | 1 | Clean, inspect and proof-roll exposed pump station subgrade | DM1040 | LAB 2, FE 0.5, QC 0.5 +CV1000 | A100.CIVIL | 6 | 3 | Excavate for new pump foundations | DM1040, DM1050, ST0130 | OPR 1, LAB 3, EXC 1 +CV1005 | A100.CIVIL | 6 | 1 | Place compacted crushed stone base and 3-inch mud mat | CV1000 | LAB 3, CFIN 2, CONC 10 +CV1010 | A100.CIVIL | 6 | 7 | Form, set anchor bolts and tie reinforcing steel for pump foundations | CV1005, PR0610 | CARP 4, IW 2, LAB 2, REBAR 6 +CV1015 | A100.CIVIL | 6 | 1 | Survey verify anchor bolt templates and pre-pour QA sign-off | CV1010 | FE 1, QC 1 +CV1020 | A100.CIVIL | 6 | 1 | Place concrete for pump foundations | CV1010, CV1015 | GF 1, LAB 4, CARP 2, CFIN 2, OPR 1, CONC 48 CV1030 | A100.CIVIL | 7 | 7 | Cure concrete at pump foundations | CV1020 | LAB 1 -CV1040 | A100.CIVIL | 6 | 3 | Strip forms and backfill around pump foundations | CV1030 | CARP 2, LAB 3, OPR 1 +CV1040 | A100.CIVIL | 6 | 2 | Strip forms and backfill around pump foundations | CV1030 | CARP 2, LAB 3, OPR 1 +CV1045 | A100.CIVIL | 6 | 1 | Bush-hammer and prepare concrete top surface for pump grouting | CV1040 | LAB 2, CFIN 2, COMP 1 CV1050 | A100.CIVIL | 6 | 5 | Install pump station access platform, stairs and handrail | EQ1011 | IW 3, LIFT 1 -EQ1000 | A100.EQUIP | 6 | 2 | Receive and inspect pumps P-101A and P-101B | PR0130 | MW 2, OPR 1 -EQ1010 | A100.EQUIP | 6 | 1 | Set pump P-101A on its foundation | EQ1000, CV1040 | MW 3, IW 1, OPR 1, CR90 1 +EQ1000 | A100.EQUIP | 6 | 2 | Receive and inspect pumps P-101A and P-101B | PR0130, PR0800 | MW 2, OPR 1, QC 0.5, FORK 1 +EQ1010 | A100.EQUIP | 6 | 1 | Set pump P-101A on its foundation | EQ1000, CV1040, CV1045 | MW 3, IW 1, OPR 1, CR90 1 EQ1011 | A100.EQUIP | 6 | 1 | Set pump P-101B on its foundation | EQ1010 | MW 3, IW 1, OPR 1, CR90 1 EQ1020 | A100.EQUIP | 6 | 2 | Level and rough align pump P-101A | EQ1010 | MW 2 EQ1021 | A100.EQUIP | 6 | 2 | Level and rough align pump P-101B | EQ1011, EQ1020 | MW 2 -EQ1030 | A100.EQUIP | 6 | 1 | Grout baseplates of pumps P-101A and P-101B | EQ1021 | LAB 2, MW 1, GROUT 40 +EQ1030 | A100.EQUIP | 6 | 1 | Grout baseplates of pumps P-101A and P-101B | EQ1021 | LAB 2, MW 1, CFIN 1, GROUT 40 EQ1040 | A100.EQUIP | 7 | 3 | Cure baseplate grout at pumps P-101A and P-101B | EQ1030 | LAB 0.5 -EQ1050 | A100.EQUIP | 6 | 2 | Final align pump P-101A to its motor after piping is connected | PP1040 | MW 2 -EQ1051 | A100.EQUIP | 6 | 2 | Final align pump P-101B to its motor after piping is connected | EQ1050 | MW 2 -PP1000 | A100.PIPE | 6 | 8 | Erect suction and discharge piping at pump P-101A | EQ1040, PP0100, DM1020 | PF 4, WLD 2, WMACH 2, LIFT 1 -PP1001 | A100.PIPE | 6 | 8 | Erect suction and discharge piping at pump P-101B | PP1000 SS2 | PF 4, WLD 2, WMACH 2, LIFT 1 +EQ1045 | A100.EQUIP | 6 | 1 | Torque pump anchor bolts and verify soft-foot tolerances | EQ1040 | MW 2, QC 0.5 +EQ1050 | A100.EQUIP | 6 | 2 | Final align pump P-101A to its motor after piping is connected | PP1040 | MW 2, QC 0.5 +EQ1051 | A100.EQUIP | 6 | 2 | Final align pump P-101B to its motor after piping is connected | EQ1050 | MW 2, QC 0.5 +PP1000 | A100.PIPE | 6 | 7 | Erect suction and discharge piping at pump P-101A | EQ1040, EQ1045, PP0100, DM1020 | PF 4, WLD 2, WMACH 2, LIFT 1 +PP1001 | A100.PIPE | 6 | 7 | Erect suction and discharge piping at pump P-101B | PP1000 SS2 | PF 4, WLD 2, WMACH 2, LIFT 1 +PP1005 | A100.PIPE | 6 | 3 | Install check valves, isolation butterfly valves and discharge relief valves | PP1000 | PF 3, FORK 1 PP1010 | A100.PIPE | 6 | 4 | Install pipe supports and guides at the pump station | PP1000 SS2 | PF 2 -PP1020 | A100.PIPE | 6 | 2 | Radiograph pump station field welds | PP1001 | QC 1 +PP1020 | A100.PIPE | 6 | 2 | Radiograph pump station field welds | PP1001, PP1005 | QC 1 PP1030 | A100.PIPE | 6 | 2 | Hydrotest pump station piping | PP1020, PP1010, EN0230 | PF 3, QC 1, HYD 1 PP1040 | A100.PIPE | 6 | 2 | Bolt up suction and discharge flanges to pumps P-101A and P-101B | PP1030 | PF 2, MW 1 PP1050 | A100.PIPE | 6 | 1 | Install temporary flushing screens in pump suction strainers | PP1040 | PF 2 EL1000 | A100.ELEC | 6 | 5 | Install conduit and cable supports at the pump station | DM1010, EQ1011, EN0340 | ELEC 3, LIFT 1 -EL1010 | A100.ELEC | 6 | 6 | Pull 480-volt power cables from MCC-401 to pump motors | EL1000, EL4020, PR0600 | ELEC 4, CABLE 1800 -EL1020 | A100.ELEC | 6 | 3 | Terminate and megger pump motor power cables at the motors and MCC-401 | EL1010, EQ1011 | ELEC 2 +EL1005 | A100.ELEC | 6 | 2 | Receive and mount VFD cabinets VFD-101A and VFD-101B in pump house | PR0165, PR0805, CV1050 | ELEC 3, FORK 1 +EL1010 | A100.ELEC | 6 | 6 | Pull 480-volt power cables from MCC-401 to VFDs and pump motors | EL1000, EL1005, EL4020, PR0600, PR0835 | ELEC 4, CABLE 1800 +EL1020 | A100.ELEC | 6 | 3 | Terminate and megger pump motor power cables at the motors, VFDs and MCC-401 | EL1010, EQ1011 | ELEC 2, QC 0.5 EL1030 | A100.ELEC | 6 | 2 | Install local control stations and motor grounding at pumps P-101A and P-101B | EL1000, EQ1011 | ELEC 2 EL1040 | A100.ELEC | 6 | 3 | Install pump station lighting and receptacles | CV1050 | ELEC 2, LIFT 1 -IN1000 | A100.INST | 6 | 2 | Install pressure transmitters PT-101A and PT-101B and pressure gauges | PP1001, PR0310 | INST 2 +IN1000 | A100.INST | 6 | 2 | Install pressure transmitters PT-101A and PT-101B and pressure gauges | PP1001, PR0310, PR0840 | INST 2 +IN1005 | A100.INST | 6 | 2 | Install pump bearing vibration and temperature sensors on P-101A/B | EQ1045, PR0310 | INST 2 IN1010 | A100.INST | 6 | 3 | Run instrument cable from the pump station transmitters to junction box JB-101 | IN1000, EL1000 | INST 2, ELEC 1 -IN1020 | A100.INST | 6 | 2 | Terminate instrument cables at the transmitters and junction box JB-101 | IN1010 | INST 2 +IN1020 | A100.INST | 6 | 2 | Terminate instrument cables at the transmitters and junction box JB-101 | IN1010, IN1005 | INST 2 PI1000 | A100.PAINT | 6 | 3 | Field paint pump station piping welds and supports | PP1040 | PNT 2, LIFT 1 -CV2000 | A200.CIVIL | 6 | 5 | Excavate for pipe rack spread footings, bents 1 to 6 | ST0130, EN0410, CV3020 | OPR 1, LAB 3, EXC 1 +PI1010 | A100.PAINT | 6 | 2 | Apply pipe flow-direction arrows and equipment tag plaques in Area 100 | PI1000 | PNT 1, LAB 1 + +# --- Area 200: Pipe Rack --- +WS2000 | A200 | 6 | wbs | Area 200 Pipe Rack Summary | | +CV2000 | A200.CIVIL | 6 | 5 | Excavate for pipe rack spread footings, bents 1 to 6 | ST0130, EN0410, CV3040 | OPR 1, LAB 3, EXC 1 CV2010 | A200.CIVIL | 6 | 10 | Form, set anchor bolts and tie reinforcing steel for rack footings | CV2000, PR0610 | CARP 4, IW 2, LAB 2, REBAR 9 -CV2020 | A200.CIVIL | 6 | 2 | Place concrete for rack footings | CV2010 | GF 1, LAB 4, CARP 2, OPR 1, CONC 72 +CV2015 | A200.CIVIL | 6 | 1 | Inspect rebar cages and verify column anchor bolt elevations | CV2010 | FE 1, QC 1 +CV2020 | A200.CIVIL | 6 | 2 | Place concrete for rack footings | CV2010, CV2015 | GF 1, LAB 4, CARP 2, CFIN 2, OPR 1, CONC 72 CV2030 | A200.CIVIL | 7 | 7 | Cure concrete at rack footings | CV2020 | LAB 1 CV2040 | A200.CIVIL | 6 | 4 | Strip forms and backfill rack footings | CV2030 | CARP 2, LAB 3, OPR 1 -CV2100 | A200.CIVIL | 6 | 3 | Receive and shake out pipe rack steel at the laydown yard | PR0515 | IW 2, LAB 2, OPR 1 -CV2110 | A200.CIVIL | 6 | 10 | Erect pipe rack columns and beams, bents 1 to 6 | CV2040, CV2100 | GF 1, IW 5, LAB 1, OPR 1, CR90 1 -CV2120 | A200.CIVIL | 6 | 4 | Plumb, bolt up and torque pipe rack steel | CV2110 | IW 3, LIFT 1 -CV2130 | A200.CIVIL | 6 | 2 | Grout pipe rack column base plates | CV2120 | LAB 2, IW 1, GROUT 30 +CV2045 | A200.CIVIL | 6 | 2 | Compact backfill in lifts and perform nuclear density compaction tests | CV2040 | LAB 2, QC 1 +CV2100 | A200.CIVIL | 6 | 3 | Receive and shake out pipe rack steel at the laydown yard | PR0515, PR0810 | IW 2, LAB 2, OPR 1, FORK 1 +CV2110 | A200.CIVIL | 6 | 10 | Erect pipe rack columns and beams, bents 1 to 6 | CV2040, CV2045, CV2100 | GF 1, IW 5, LAB 1, OPR 1, CR90 1 +CV2120 | A200.CIVIL | 6 | 4 | Plumb, bolt up and torque pipe rack steel | CV2110 | IW 3, LIFT 1, QC 0.5 +CV2130 | A200.CIVIL | 6 | 2 | Grout pipe rack column base plates | CV2120 | LAB 2, IW 1, CFIN 1, GROUT 30 CV2140 | A200.CIVIL | 6 | 4 | Install pipe rack ladders, platforms and handrail | PP2000 | IW 3, LIFT 1 -ST0200 | A200.CIVIL | 6 | 3 | Erect scaffolding at pipe rack bents 1 to 6 | CV2120 | LAB 4, GF 1 +ST0200 | A200.CIVIL | 6 | 3 | Erect scaffolding at pipe rack bents 1 to 6 | CV2120, PR0740 | LAB 4, GF 1 PP2000 | A200.PIPE | 6 | 20 | Erect 10-inch process water header on the pipe rack | ST0200, PP0110, CV2130 | GF 1, PF 6, WLD 3, WMACH 3, LIFT 2, CR90 1 +PP2005 | A200.PIPE | 6 | 6 | Erect 4-inch chemical and filtration return branch line on pipe rack | PP2000 SS10, PP0135 | PF 3, WLD 2, WMACH 2, LIFT 1, SSPIPE 420 PP2010 | A200.PIPE | 6 | 6 | Install pipe shoes, guides and anchors on the pipe rack | PP2000 SS4 | PF 2, IW 1 PP2020 | A200.PIPE | 6 | 3 | Install high point vents, low point drains and expansion loop | PP2000 | PF 2, WLD 1, WMACH 1 -PP2030 | A200.PIPE | 6 | 3 | Radiograph pipe rack field welds | PP2000, PP2020 | QC 1 +PP2030 | A200.PIPE | 6 | 3 | Radiograph pipe rack field welds | PP2000, PP2005, PP2020 | QC 1 PP2040 | A200.PIPE | 6 | 3 | Hydrotest pipe rack header | PP2030, PP2010, EN0230 | PF 3, QC 1, HYD 1 +PP2045 | A200.PIPE | 6 | 2 | Drain, dry and reinstate pipe rack test blinds and flange torque tags | PP2040 | PF 2, QC 0.5 ST0210 | A200.PIPE | 6 | 2 | Dismantle scaffolding at pipe rack bents 1 to 6 | EL2020 | LAB 4 EL2000 | A200.ELEC | 6 | 10 | Install cable tray on the pipe rack | PP2000 SS5, PR0600 | ELEC 4, LIFT 2 -EL2010 | A200.ELEC | 6 | 5 | Install heat tracing cable on the pipe rack header | PP2040, PR0630 | ELEC 2, LIFT 1 +EL2005 | A200.ELEC | 6 | 4 | Bond and ground pipe rack structural steel and cable tray sections | EL2000 | ELEC 2, LIFT 1 +EL2010 | A200.ELEC | 6 | 5 | Install heat tracing cable on the pipe rack header | PP2045, PR0630 | ELEC 2, LIFT 1 +EL2015 | A200.ELEC | 6 | 2 | Megger heat tracing circuits prior to pipe insulation jacketing | EL2010 | ELEC 1, QC 0.5 EL2020 | A200.ELEC | 6 | 2 | Terminate heat tracing and test it after insulation | PI2010, EL4070 | ELEC 2 -EL2030 | A200.ELEC | 6 | 4 | Install pipe rack lighting | EL2000, CV2140 | ELEC 2, LIFT 1 -PI2000 | A200.PAINT | 6 | 4 | Field paint pipe rack field welds and touch up damaged primer | PP2040 | PNT 2, LIFT 1 -PI2010 | A200.PAINT | 6 | 10 | Insulate and jacket the pipe rack header for freeze protection | EL2010, PI2000 | INSUL 4, LIFT 2 +EL2030 | A200.ELEC | 6 | 4 | Install pipe rack lighting | EL2000, EL2005, CV2140 | ELEC 2, LIFT 1 +PI2000 | A200.PAINT | 6 | 4 | Field paint pipe rack field welds and touch up damaged primer | PP2045 | PNT 2, LIFT 1 +PI2010 | A200.PAINT | 6 | 10 | Insulate and jacket the pipe rack header for freeze protection | EL2015, PI2000 | INSUL 4, LIFT 2 +PI2020 | A200.PAINT | 6 | 2 | Install weatherproof heat-trace indicator lights and pipe rack ID markers | PI2010 | ELEC 1, LAB 1 + +# --- Area 300: Heat Exchanger and Header Tie-ins --- +WS3000 | A300 | 6 | wbs | Area 300 Heat Exchanger and Tie-Ins Summary | | DM3000 | A300.DEMO | 6 | 3 | Remove abandoned strainer and piping at the heat exchanger pad area | ST0120, EN0420 | PF 2, LAB 2, WMACH 1 CV3000 | A300.CIVIL | 6 | 3 | Excavate for the heat exchanger pad | DM3000, ST0130, CV4010 | OPR 1, LAB 2, EXC 1 -CV3010 | A300.CIVIL | 6 | 5 | Form, set anchor bolts and tie reinforcing steel for the heat exchanger pad | CV3000, PR0610 | CARP 3, IW 2, LAB 2, REBAR 4 -CV3020 | A300.CIVIL | 6 | 1 | Place concrete for the heat exchanger pad | CV3010 | GF 1, LAB 4, CARP 2, OPR 1, CONC 36 +CV3005 | A300.CIVIL | 6 | 2 | Place engineered gravel pad and crane matting for heavy lift | CV3000 | OPR 1, LAB 3, FORK 1 +CV3010 | A300.CIVIL | 6 | 5 | Form, set anchor bolts and tie reinforcing steel for the heat exchanger pad | CV3005, PR0610 | CARP 3, IW 2, LAB 2, REBAR 4 +CV3020 | A300.CIVIL | 6 | 1 | Place concrete for the heat exchanger pad | CV3010 | GF 1, LAB 4, CARP 2, CFIN 2, OPR 1, CONC 36 CV3030 | A300.CIVIL | 7 | 7 | Cure concrete at the heat exchanger pad | CV3020 | LAB 1 CV3040 | A300.CIVIL | 6 | 2 | Strip forms and backfill the heat exchanger pad | CV3030 | CARP 2, LAB 2, OPR 1 EQ3000 | A300.EQUIP | 6 | 2 | Receive and inspect owner furnished heat exchanger E-301 | PR0320 | MW 2, OPR 1, QC 0.5 -EQ3010 | A300.EQUIP | 6 | 1 | Set heat exchanger E-301 on its pad with the 250-ton crane | EQ3000, CV3040 | GF 1, IW 3, MW 2, OPR 2, CR250 1 -EQ3020 | A300.EQUIP | 6 | 2 | Level, anchor and grout the heat exchanger E-301 frame | EQ3010 | MW 2, LAB 1, GROUT 12 -PP3000 | A300.PIPE | 6 | 10 | Erect heat exchanger inlet and outlet piping to the pipe rack | EQ3020, PP2000, PP0130 | PF 4, WLD 2, WMACH 2, LIFT 1 +EQ3005 | A300.EQUIP | 6 | 2 | Mobilize, assemble and inspect 250-ton crawler crane for critical lift | EQ3000, CV3040, PR0750 | OPR 2, IW 2, HSE 0.5, CR250 1 +EQ3010 | A300.EQUIP | 6 | 1 | Set heat exchanger E-301 on its pad with the 250-ton crane | EQ3005 | GF 1, IW 3, MW 2, OPR 2, CR250 1 +EQ3015 | A300.EQUIP | 6 | 1 | Disassemble and demobilize 250-ton crawler crane from Area 300 | EQ3010 | OPR 2, IW 2, CR250 1 +EQ3020 | A300.EQUIP | 6 | 2 | Level, anchor and grout the heat exchanger E-301 frame | EQ3010 | MW 2, LAB 1, CFIN 1, GROUT 12 +PP3000 | A300.PIPE | 6 | 10 | Erect heat exchanger inlet and outlet piping to the pipe rack | EQ3020, PP2000, PP0140 | PF 4, WLD 2, WMACH 2, LIFT 1 PP3010 | A300.PIPE | 6 | 3 | Install control valve FV-301 and its block and bypass valves | PP3000, PR0310 | PF 3 PP3020 | A300.PIPE | 6 | 3 | Install pipe supports for the heat exchanger piping | PP3000 SS2 | PF 2 PP3030 | A300.PIPE | 6 | 2 | Radiograph heat exchanger piping field welds | PP3000 | QC 1 PP3040 | A300.PIPE | 6 | 2 | Hydrotest heat exchanger piping | PP3030, PP3010, PP3020, EN0230 | PF 3, QC 1, HYD 1 -PP3100 | A300.TIE | 7 | start | Plant outage starts: existing cooling water headers drained and isolated by owner | PP3040, PP2040 | +PP3050 | A300.PIPE | 6 | 2 | Stage pre-beveled tie-in tees, blinds, gaskets and backup welders at Area 300 | PP3040, PM0230 | GF 1, PF 2, FORK 1 +PP3100 | A300.TIE | 7 | start | Plant outage starts: existing cooling water headers drained and isolated by owner | PP3040, PP3050, PP2040 | PP3110 | A300.TIE | 7 | 1 | Tie-in TI-01: cut out existing 10-inch supply header spool | PP3100 | GF 1, PF 3, WLD 1, WMACH 1 PP3120 | A300.TIE | 7 | 2 | Tie-in TI-01: fit up and weld new 10-inch tee on the supply header | PP3110 | PF 3, WLD 2, WMACH 2 PP3130 | A300.TIE | 7 | 1 | Tie-in TI-01: radiograph new supply header welds | PP3120 | QC 1 @@ -271,7 +565,7 @@ PP3220 | A300.TIE | 7 | 2 | Tie-in TI-02: fit up and weld new 10-inch tee on the PP3230 | A300.TIE | 7 | 1 | Tie-in TI-02: radiograph new return header welds | PP3220 | QC 1 PP3310 | A300.TIE | 7 | 1 | Tie-in TI-03: remove blind flange on existing 4-inch header drain | PP3100 | PF 2 PP3320 | A300.TIE | 7 | 1 | Tie-in TI-03: bolt up new 4-inch drain connection with new gaskets | PP3310 | PF 2 -PP3400 | A300.TIE | 7 | 1 | Leak test tie-ins TI-01, TI-02 and TI-03 at operating pressure with owner operations | PP3130, PP3230, PP3320 | PF 2, QC 1 +PP3400 | A300.TIE | 7 | 1 | Leak test tie-ins TI-01, TI-02 and TI-03 at operating pressure with owner operations | PP3130, PP3230, PP3320 | PF 2, QC 1, HSE 0.5 PP3410 | A300.TIE | 7 | finish | Plant outage ends: existing headers returned to service | PP3400 | EL3000 | A300.ELEC | 6 | 5 | Install conduit and cable tray for Area 300 instruments | EL2000, EQ3020 | ELEC 3, LIFT 1 IN3000 | A300.INST | 6 | 3 | Install flow transmitter FT-301 and temperature transmitters TT-301 and TT-302 | PP3040, PR0310 | INST 2 @@ -279,45 +573,115 @@ IN3010 | A300.INST | 6 | 3 | Run instrument air tubing to control valve FV-301 f IN3020 | A300.INST | 6 | 2 | Install pressure gauges at the heat exchanger inlet and outlet | PP3040 | INST 1 IN3030 | A300.INST | 6 | 4 | Pull instrument cables from Area 300 instruments to junction box JB-301 | IN3000, EL3000 | INST 2, ELEC 1 IN3040 | A300.INST | 6 | 2 | Terminate instrument cables at the instruments and junction box JB-301 | IN3030 | INST 2 -IN3050 | A300.INST | 6 | 4 | Pull home-run cables from JB-101 and JB-301 to the control room marshalling cabinet | IN1020, IN3040 | ELEC 2, INST 1 -IN3060 | A300.INST | 6 | 2 | Terminate home-run cables at the control room marshalling cabinet | IN3050 | INST 2 +IN3050 | A300.INST | 6 | 4 | Pull home-run cables from JB-101 and JB-301 to the control room marshalling cabinet | IN1020, IN3040, EL6020 | ELEC 2, INST 1 +IN3060 | A300.INST | 6 | 2 | Terminate home-run cables at the control room marshalling cabinet | IN3050, DC6010 | INST 2 PI3000 | A300.PAINT | 6 | 3 | Field paint heat exchanger piping welds and supports | PP3040 | PNT 2 PI3010 | A300.PAINT | 6 | 2 | Field paint tie-in welds at TI-01 and TI-02 | PP3410 | PNT 2 + +# --- Area 400: Electrical Room --- CV4000 | A400.CIVIL | 6 | 3 | Form and tie reinforcing steel for the transformer pad and oil containment curb | ST0130, PR0610 | CARP 3, IW 1, LAB 2, REBAR 2 -CV4010 | A400.CIVIL | 6 | 1 | Place concrete for the transformer pad and oil containment curb | CV4000, EL4000 | LAB 3, CARP 2, CONC 18 +CV4010 | A400.CIVIL | 6 | 1 | Place concrete for the transformer pad and oil containment curb | CV4000, EL4000 | LAB 3, CARP 2, CFIN 1, CONC 18 CV4020 | A400.CIVIL | 7 | 7 | Cure concrete at the transformer pad | CV4010 | LAB 0.5 CV4030 | A400.CIVIL | 6 | 2 | Install transformer bollards and gravel surfacing | CV4020 | LAB 2, OPR 1 EL4000 | A400.ELEC | 6 | 3 | Install ground grid and ground rods at the transformer pad | ST0130 | ELEC 2, LAB 1 -EL4010 | A400.ELEC | 6 | 2 | Set transformer TX-401 on its pad | PR0230, CV4020 | ELEC 2, IW 1, OPR 1, CR90 1 -EL4020 | A400.ELEC | 6 | 2 | Set motor control center MCC-401 in the electrical room | PR0230 | ELEC 3, OPR 1 -EL4030 | A400.ELEC | 6 | 6 | Pull and terminate the 4160-volt feeder from existing switchgear to TX-401 | EL4010, PR0600, EN0330 | ELEC 4 +EL4005 | A400.ELEC | 6 | 2 | Perform ground grid continuity and soil resistivity fall-of-potential test | EL4000 | ELEC 1, QC 0.5 +EL4010 | A400.ELEC | 6 | 2 | Set transformer TX-401 on its pad | PR0230, CV4020, EL4005 | ELEC 2, IW 1, OPR 1, CR90 1 +EL4020 | A400.ELEC | 6 | 2 | Set motor control center MCC-401 in the electrical room | PR0230 | ELEC 3, OPR 1, FORK 1 +EL4030 | A400.ELEC | 6 | 6 | Pull and terminate the 4160-volt feeder from existing switchgear to TX-401 | EL4010, PR0600, PR0835, EN0330 | ELEC 4 EL4040 | A400.ELEC | 6 | 3 | Install and terminate the 480-volt feeder from TX-401 to MCC-401 | EL4010, EL4020 | ELEC 3 -EL4050 | A400.ELEC | 6 | 2 | Test transformer TX-401: insulation resistance, turns ratio and oil sample | EL4030, EL4040 | ELEC 2 -EL4060 | A400.ELEC | 6 | 2 | Megger and test motor control center MCC-401 starters and breakers | EL4040 | ELEC 2 -EL4070 | A400.ELEC | 6 | 1 | Energize transformer TX-401 and MCC-401 with owner switching | EL4050, EL4060 | ELEC 2, SUPT 1 +EL4050 | A400.ELEC | 6 | 2 | Test transformer TX-401: insulation resistance, turns ratio and oil sample | EL4030, EL4040 | ELEC 2, QC 0.5 +EL4055 | A400.ELEC | 6 | 2 | Calibrate protective relays and verify 4160V breaker trip curves | EL4030 | ELEC 2, QC 0.5 +EL4060 | A400.ELEC | 6 | 2 | Megger and test motor control center MCC-401 starters and breakers | EL4040 | ELEC 2, QC 0.5 +EL4065 | A400.ELEC | 6 | 1 | Perform pre-energization safety inspection and owner readiness walkdown | EL4050, EL4055, EL4060 | ELEC 1, SUPT 1, HSE 0.5, QC 0.5 +EL4070 | A400.ELEC | 6 | 1 | Energize transformer TX-401 and MCC-401 with owner switching | EL4065 | ELEC 2, SUPT 1, HSE 0.5 EL4080 | A400.ELEC | 6 | 3 | Install electrical room lighting and receptacles | EL4020 | ELEC 2 -EL4090 | A400.ELEC | 6 | 1 | Install arc flash and equipment labels at TX-401 and MCC-401 | EL4070 | ELEC 1 -CM9000 | MC | 6 | 2 | Walk down Area 100 pump station for mechanical completion | PP1050, EL1020, EL1030, EL1040, IN1020, PI1000, EQ1051, CV1050 | GF 1, FE 1, QC 1 -CM9010 | MC | 6 | 2 | Walk down Area 200 pipe rack for mechanical completion | ST0210, EL2020, EL2030, CV2140 | GF 1, FE 1, QC 1 +EL4085 | A400.ELEC | 6 | 2 | Install electrical room HVAC exhaust louver, smoke detector and fire extinguishers | EL4080 | ELEC 1, LAB 1, HSE 0.5 +EL4090 | A400.ELEC | 6 | 1 | Install arc flash and equipment labels at TX-401 and MCC-401 | EL4070, EL4085 | ELEC 1 + +# --- Area 500: Chemical Feed and Filtration Skid --- +WS5000 | A500 | 6 | wbs | Area 500 Chemical Feed and Filtration Skid Summary | | +CV5000 | A500.CIVIL | 6 | 4 | Excavate and grade for Area 500 filtration and chemical containment pad | CV2045, PM0135, EN0430 | OPR 1, LAB 3, EXC 1 +CV5010 | A500.CIVIL | 6 | 3 | Install containment sump pit, under-slab drain piping and vapor barrier | CV5000 | PF 2, LAB 2, CARP 2 +CV5020 | A500.CIVIL | 6 | 7 | Form, tie rebar and set anchor embeds for Area 500 containment slab | CV5010, PR0610 | CARP 4, IW 2, LAB 2, REBAR 5 +CV5030 | A500.CIVIL | 6 | 1 | Place concrete for Area 500 filtration pad and chemical containment curb | CV5020 | GF 1, LAB 4, CARP 2, CFIN 2, OPR 1, CONC 42 +CV5040 | A500.CIVIL | 7 | 7 | Cure concrete at Area 500 containment slab | CV5030 | LAB 1 +CV5050 | A500.CIVIL | 6 | 3 | Strip forms, backfill perimeter and install pipe trench grating | CV5040 | CARP 2, LAB 2, IW 1 +CV5060 | A500.CIVIL | 6 | 4 | Abrasive blast slab and apply chemical-resistant epoxy containment coating | CV5050, PR0640 | PNT 3, LAB 1, QC 0.5, EPOXY 1250 +CV5065 | A500.CIVIL | 6 | 2 | Perform holiday spark test and 24-hour hydrostatic flood test on containment curb | CV5060 | QC 1, LAB 2 +EQ5000 | A500.EQUIP | 6 | 2 | Receive and inspect filtration skid FL-501 and chemical tanks TK-501/502 | PR0365, PR0820, PR0825 | MW 2, OPR 1, QC 0.5, FORK 1 +EQ5010 | A500.EQUIP | 6 | 2 | Rig and set multimedia filtration skid FL-501 onto Area 500 pad | EQ5000, CV5065 | GF 1, MW 3, IW 2, OPR 1, CR90 1 +EQ5020 | A500.EQUIP | 6 | 2 | Set chemical day tanks TK-501 and TK-502 and metering pump skid | EQ5010 | MW 2, IW 1, OPR 1, CR90 1 +EQ5030 | A500.EQUIP | 6 | 2 | Level, anchor and grout filtration skid FL-501 and load filter media | EQ5010 | MW 2, LAB 2, GROUT 20 +EQ5040 | A500.EQUIP | 6 | 3 | Install Area 500 chemical containment canopy steel and maintenance platform | EQ5020 | IW 3, LIFT 1 +PP5000 | A500.PIPE | 6 | 8 | Erect 4-inch stainless steel inlet, backwash and filtrate piping at Area 500 | EQ5030, PP0135 | PF 3, WLD 2, WMACH 2, SSPIPE 260 +PP5010 | A500.PIPE | 6 | 5 | Install dual-wall chemical dosing lines from TK-501/502 to injection quills | EQ5020, PR0425 | PF 3 +PP5020 | A500.PIPE | 6 | 3 | Install emergency safety shower, eyewash station and tempered water valve | CV5060, PR0425, UT6020 | PF 2 +PP5030 | A500.PIPE | 6 | 2 | Radiograph and borescope inspect Area 500 stainless process welds | PP5000 | QC 1 +PP5040 | A500.PIPE | 6 | 2 | Hydrotest Area 500 filtration and chemical feed piping | PP5030, PP5010, PP5020, EN0230 | PF 3, QC 1, HYD 1 +EL5000 | A500.ELEC | 6 | 4 | Install conduit, cable tray and local disconnect switches at Area 500 | EQ5040, EN0340, PR0600 | ELEC 3, LIFT 1 +EL5010 | A500.ELEC | 6 | 4 | Pull and terminate 480-volt feeders from MCC-401 to FL-501 and dosing pumps | EL5000, EL4020 | ELEC 3, CABLE 950 +EL5020 | A500.ELEC | 6 | 3 | Install freeze-protection heat tracing on Area 500 backwash and shower lines | PP5040, PR0630 | ELEC 2 +EL5030 | A500.ELEC | 6 | 2 | Install Area 500 canopy LED lighting, grounding and GFCI receptacles | EL5010 | ELEC 2, LIFT 1 +IN5000 | A500.INST | 6 | 3 | Install pH, conductivity and turbidity analyzer rack AN-501 and sample lines | PP5040, PR0380 | INST 2, PF 1 +IN5010 | A500.INST | 6 | 3 | Install ultrasonic tank level transmitters LT-501/502 and differential pressure gauges | EQ5020, PR0380 | INST 2 +IN5020 | A500.INST | 6 | 4 | Pull and terminate Area 500 instrument cables to junction box JB-501 | IN5000, IN5010, EL5000 | INST 2, ELEC 1 +PI5000 | A500.PAINT | 6 | 3 | Field paint Area 500 carbon steel supports, canopy touch-ups and pipe labels | PP5040, EQ5040 | PNT 2, LIFT 1 +PI5010 | A500.PAINT | 6 | 4 | Insulate and jacket Area 500 heat-traced piping and safety shower line | EL5020, PI5000 | INSUL 3 + +# --- Area 600: Control Room, DCS and Plant Utilities --- +CV6000 | A600.CIVIL | 6 | 4 | Sawcut paving and trench underground electrical and fiber ductbank | CV5050, EN0430 | OPR 1, LAB 3, EXC 1 +CV6010 | A600.CIVIL | 6 | 5 | Install PVC ductbank conduits, spacers, pull boxes and warning tape | CV6000, PR0605 | ELEC 3, LAB 2 +CV6020 | A600.CIVIL | 6 | 2 | Place red-dyed concrete encasement over underground ductbank | CV6010 | LAB 3, CFIN 1, CONC 24 +CV6030 | A600.CIVIL | 6 | 3 | Backfill ductbank trenches and compact subgrade to 95 percent Proctor | CV6020 | OPR 1, LAB 3, QC 0.5 +EL6020 | A600.DCS | 6 | 5 | Pull 12-strand fiber optic backbone and control cables through ductbank | CV6030, PR0605, PR0835 | ELEC 3, INST 1, FIBER 1600 +EL6025 | A600.DCS | 6 | 2 | Fusion-splice fiber patch panels and run OTDR loss certification test | EL6020 | INST 2, QC 0.5 +DC6000 | A600.DCS | 6 | 2 | Receive, unpack and set DCS marshalling cabinet CP-601 in control room | PR0380, PR0830, CV6020 | INST 2, ELEC 1, FORK 1 +DC6005 | A600.DCS | 6 | 2 | Install and load-test redundant 24VDC UPS power supply for cabinet CP-601 | DC6000 | ELEC 2, INST 1 +DC6010 | A600.DCS | 6 | 4 | Terminate fiber patch panels, power feeds and JB-501 home-runs in CP-601 | DC6005, EL6025, IN5020 | INST 2, AUTO 1 +DC6020 | A600.DCS | 6 | 4 | Download DCS application software and configure HMI operator screens | DC6010, EN0335 | AUTO 2 +DC6030 | A600.DCS | 6 | 3 | Execute control room network redundancy and fiber failover test | DC6020 | AUTO 1, INST 1, QC 0.5 +UT6000 | A600.UTIL | 6 | 4 | Extend 2-inch plant instrument air branch header to Area 300 and Area 500 | EQ5040, PR0620 | PF 3, LIFT 1 +UT6010 | A600.UTIL | 6 | 2 | Pressure test and blow down new instrument air branch header | UT6000 | PF 2, QC 0.5, COMP 1 +UT6020 | A600.UTIL | 6 | 3 | Install potable water branch supply for Area 500 safety shower and eyewash | CV5050, EN0430 | PF 2, LAB 1 +UT6030 | A600.UTIL | 6 | 4 | Install gravity backwash and process drain tie-in to plant neutralization sump | CV6030, EN0430 | PF 2, OPR 1, LAB 2, EXC 1 +CV6040 | A600.CIVIL | 6 | 4 | Restore plant roadway asphalt, curbs and concrete sidewalks | CV6030, UT6030, EQ3015 | OPR 2, LAB 4, CFIN 2 + +# --- Pre-Commissioning, Mechanical Completion, Startup & Turnover --- +PC9000 | PRECOM | 6 | 3 | Conduct pipe cleanliness verification and air-blow of Area 500 lines | PP5040, UT6010 | PF 2, CXE 1, COMP 1 +PC9010 | PRECOM | 6 | 3 | Perform chemical passivation and rinse of Area 500 stainless headers | PC9000 | PF 2, CXE 1, HSE 0.5 +PC9020 | PRECOM | 6 | 2 | Parameterize and bench-test VFDs VFD-101A and VFD-101B | EL1020, EL4070 | ELEC 2, AUTO 1, CXE 0.5 +PC9030 | PRECOM | 6 | 3 | Verify Area 500 analyzer wet calibration and chemical metering pump stroke | IN5020, EL5010, EL4070 | INST 2, CXE 1 +CM9000 | MC | 6 | 2 | Walk down Area 100 pump station for mechanical completion | PP1050, EL1020, EL1030, EL1040, IN1020, PI1010, EQ1051, CV1050, PC9020 | GF 1, FE 1, QC 1 +CM9010 | MC | 6 | 2 | Walk down Area 200 pipe rack for mechanical completion | ST0210, EL2020, EL2030, CV2140, PI2020 | GF 1, FE 1, QC 1 CM9020 | MC | 6 | 2 | Walk down Area 300 heat exchanger and tie-ins for mechanical completion | PI3000, PI3010, IN3040, IN3020, IN3010 | GF 1, FE 1, QC 1 CM9030 | MC | 6 | 1 | Walk down Area 400 electrical room for mechanical completion | EL4090, EL4080, CV4030 | GF 1, FE 1, QC 1 -CM9040 | MC | 6 | 6 | Clear punch list items from the mechanical completion walkdowns | CM9000, CM9010, CM9020, CM9030 | GF 1, PF 2, ELEC 2, LAB 2 +CM9032 | MC | 6 | 2 | Walk down Area 500 filtration skid and chemical feed for mechanical completion | PI5010, EL5030, PC9010, PC9030 | GF 1, FE 1, QC 1 +CM9035 | MC | 6 | 1 | Walk down Area 600 DCS cabinet, utilities and paving for mechanical completion | DC6030, CV6040, UT6010 | FE 1, QC 1, AUTO 1 +CM9040 | MC | 6 | 6 | Clear punch list items from the mechanical completion walkdowns | CM9000, CM9010, CM9020, CM9030, CM9032, CM9035 | GF 1, PF 2, ELEC 2, LAB 2, INST 1 CM9050 | MC | 6 | finish | Mechanical completion: contract milestone | CM9040, IN3060 | CM9100 | SU | 6 | 3 | Flush new process water piping to clean water | CM9050 | PF 3, LAB 2, CXE 0.5 CM9110 | SU | 6 | 1 | Remove temporary flushing screens and reinstate piping | CM9100 | PF 2 CM9120 | SU | 6 | 4 | Calibrate transmitters and stroke control valve FV-301 | IN1020, IN3040, IN3010 | INST 2 -CM9130 | SU | 6 | 4 | Loop check instruments from the field to the control room | CM9120, IN3060, EL4070 | INST 2, CXE 1 -CM9140 | SU | 6 | 2 | Bump motors and check rotation of pumps P-101A and P-101B | EL4070, EL1020, EQ1051 | ELEC 2, MW 1, CXE 1 -CM9150 | SU | 6 | 3 | Run pumps P-101A and P-101B on water and check vibration | CM9140, CM9110 | MW 2, PF 1, CXE 1 -CM9160 | SU | 6 | 3 | Performance test heat exchanger E-301 with owner operations | CM9150, CM9130 | CXE 1, INST 1 -CM9170 | SU | 6 | 2 | Train owner operators on the new pumps, heat exchanger and controls | CM9160 SS1 | CXE 1, SUPT 0.5 +CM9130 | SU | 6 | 4 | Loop check instruments from the field to the control room | CM9120, IN3060, EL4070, DC6020 | INST 2, CXE 1, AUTO 1 +CM9135 | SU | 6 | 3 | Execute DCS site acceptance test (SAT) and safety interlock trip checks | CM9130, PC9020, PC9030 | AUTO 1.5, CXE 1, INST 1 +CM9140 | SU | 6 | 2 | Bump motors and check rotation of pumps P-101A and P-101B | EL4070, EL1020, EQ1051, PC9020 | ELEC 2, MW 1, CXE 1 +CM9142 | SU | 6 | 1 | Perform uncoupled 4-hour motor solo run and baseline vibration check | CM9140 | MW 2, ELEC 1, CXE 0.5 +CM9145 | SU | 6 | 2 | Wet-commission filtration skid FL-501 and verify backwash sequence | CM9110, CM9135 | CXE 1, PF 2, AUTO 1 +CM9150 | SU | 6 | 3 | Run pumps P-101A and P-101B on water and check vibration | CM9142, CM9110 | MW 2, PF 1, CXE 1 +CM9155 | SU | 6 | 2 | Tune control valve FV-301 PID loop and pump VFD pressure setpoint control | CM9150, CM9135 | AUTO 1, INST 1, CXE 1 +CM9160 | SU | 6 | 3 | Performance test heat exchanger E-301 and integrated loop with owner operations | CM9155, CM9145, CM9130 | CXE 1, INST 1, PROC_E 0.5 +CM9170 | SU | 6 | 2 | Train owner operators on the new pumps, filtration skid, heat exchanger and DCS | CM9160 SS1 | CXE 1, SUPT 0.5, AUTO 0.5 CM9180 | SU | 6 | finish | Startup complete: system in operation | CM9160, CM9170 | -CM9190 | SU | 7 | 30 | Run the new system through the 30-day reliability period with owner operations | CM9180 | CXE 0.2 -CM9200 | TO | 6 | 5 | Assemble turnover packages: test records, radiograph reports and loop sheets | CM9050 | QC 1, FE 1 -CM9210 | TO | 6 | 5 | Submit operating and maintenance manuals and spare parts lists | CM9050 | PE 1 -CM9220 | TO | 6 | 2 | Owner acceptance walkdown and signed turnover certificates | CM9200, CM9190, CM9210 | PM 1, SUPT 1, QC 1 +CM9190 | SU | 7 | 30 | Run the new system through the 30-day reliability period with owner operations | CM9180 | CXE 0.2, AUTO 0.1 +CM9200 | TO | 6 | 5 | Assemble turnover packages: test records, radiograph reports and loop sheets | CM9050 | QC 1, FE 1, DC 1 +CM9205 | TO | 6 | 3 | Deliver commissioned spare parts inventory and special maintenance tools | CM9050, PR0765 | BUYER 0.5, PE 0.5, LAB 1 +CM9210 | TO | 6 | 5 | Submit operating and maintenance manuals and spare parts lists | CM9050 | PE 1, DC 0.5 +CM9215 | TO | 6 | 3 | Complete field redline verification walkdown for as-built drawings | CM9180 | FE 1, ENGR 0.5, DC 0.5 +CM9220 | TO | 6 | 2 | Owner acceptance walkdown and signed turnover certificates | CM9200, CM9205, CM9190, CM9210, CM9215 | PM 1, SUPT 1, QC 1, CXE 0.5 PM0900 | PM | 6 | 5 | Demobilize site trailers, equipment and temporary power | CM9180 | SUPT 0.5, LAB 4, OPR 1, ELEC 1 -PM0910 | PM | 6 | 8 | Submit as-built drawings and closeout documents | CM9220 | PE 1, ENGR 0.5 +PM0902 | PM.QA | 6 | 2 | Conduct project closeout lessons-learned review with owner and trade leads | CM9220 | PM 1, SUPT 0.5, PE 0.5, SCHED 0.5 +PM0905 | PM.CTRL | 6 | 4 | Reconcile final subcontractor change orders and closeout lien waivers | CM9220 FF2 | PM 0.5, BUYER 1, SCHED 0.5 +PM0910 | PM | 6 | 8 | Submit as-built drawings and closeout documents | CM9220, PM0902, PM0905 | PE 1, ENGR 0.5, DC 1 PM0920 | PM | 6 | finish | Project complete | PM0900, PM0910 | # Constraints: "plan" puts the date where the unconstrained plan finishes. @@ -326,12 +690,16 @@ PR0320 | finish on or after | 2027-01-08 15:30 DM0900 | start on or after | 2026-11-23 06:00 PP3100 | start on or after | 2027-02-13 06:00 CM9050 | finish on or before | plan +PM0118 | finish on or before | 2026-07-10 15:30 +PR0365 | finish on or before | 2026-12-18 15:30 ## codes Area | 100 | Area 100 Pump Station Area | 200 | Area 200 Pipe Rack Area | 300 | Area 300 Heat Exchanger and Tie-ins Area | 400 | Area 400 Electrical Room +Area | 500 | Area 500 Chemical Feed and Filtration Skid +Area | 600 | Area 600 Control Room, DCS and Utilities Area | GEN | General, all areas Discipline | PM | Project Management Discipline | ENG | Engineering @@ -342,6 +710,7 @@ Discipline | EQP | Equipment Discipline | PIP | Piping Discipline | ELE | Electrical Discipline | INS | Instrumentation +Discipline | AUT | Automation and DCS Discipline | PNT | Paint and Insulation Discipline | COM | Commissioning Phase | 1-ENG | Engineering @@ -351,39 +720,64 @@ Phase | 4-COMM | Commissioning and Turnover Responsibility | GC | General Contractor Responsibility | MECH | Mechanical Subcontractor Responsibility | ELEC | Electrical Subcontractor +Responsibility | AUTO | Automation Integrator Responsibility | VEND | Vendor Responsibility | OWN | Owner -# label | data type +# table (TASK or PROJECT) | label | data type (text, number, cost, start_date, finish_date) ## udfs -Work Package | text -Drawing Number | text -Permit Required | text -Crew Size | number +TASK | Work Package | text +TASK | Drawing Number | text +TASK | Permit Required | text +TASK | Crew Size | number +TASK | Subcontract Value | cost +TASK | Target Submittal Date | finish_date +PROJECT | Contract Number | text +PROJECT | Plant Manager | text -# activity | label | value +# target (PROJECT or activity ID) | label | value ## udf values +PROJECT | Contract Number | RB-EPC-2026-014 +PROJECT | Plant Manager | K. Hendrickson DM1000 | Permit Required | Hot work and lockout permit DM1020 | Permit Required | Hot work permit DM1040 | Permit Required | Excavation permit CV1000 | Permit Required | Excavation permit CV2000 | Permit Required | Excavation permit CV3000 | Permit Required | Excavation permit +CV5000 | Permit Required | Excavation permit +CV6000 | Permit Required | Excavation and road crossing permit PP3110 | Permit Required | Hot work and line break permit PP3210 | Permit Required | Hot work and line break permit PP3310 | Permit Required | Line break permit EL4070 | Permit Required | Energized work permit +PC9010 | Permit Required | Chemical handling permit CV1010 | Drawing Number | RB-S-101 CV2010 | Drawing Number | RB-S-201 CV3010 | Drawing Number | RB-S-301 +CV5020 | Drawing Number | RB-S-501 +CV6010 | Drawing Number | RB-E-601 PP1000 | Drawing Number | RB-P-110 PP1001 | Drawing Number | RB-P-111 PP2000 | Drawing Number | RB-P-201 +PP2005 | Drawing Number | RB-P-205 PP3000 | Drawing Number | RB-P-301 PP3120 | Drawing Number | RB-P-351 PP3220 | Drawing Number | RB-P-352 +PP5000 | Drawing Number | RB-P-501 EL1010 | Drawing Number | RB-E-110 EL4030 | Drawing Number | RB-E-401 +EL5010 | Drawing Number | RB-E-501 +DC6010 | Drawing Number | RB-I-601 +PR0110 | Target Submittal Date | 2026-07-17 15:30 +PR0210 | Target Submittal Date | 2026-08-07 15:30 +PR0355 | Target Submittal Date | 2026-08-21 15:30 +PR0505 | Target Submittal Date | 2026-09-11 15:30 +PP0100 | Subcontract Value | 142000 +PP2000 | Subcontract Value | 265000 +EL4030 | Subcontract Value | 98500 +EQ5010 | Subcontract Value | 185000 +DC6020 | Subcontract Value | 76000 # activity | step | weight ## steps @@ -402,65 +796,223 @@ CV2110 | Set beams and struts | 50 PP3040 | Fill and vent the piping | 20 PP3040 | Hold test pressure and inspect joints | 60 PP3040 | Drain and record the test | 20 +EN0060 | Draft process flow diagrams | 25 +EN0060 | Issue 60 percent P&IDs for squad check | 35 +EN0060 | Incorporate operations markup | 25 +EN0060 | Release P&IDs for HAZOP | 15 +CV5060 | Perform moisture vapor emission test | 20 +CV5060 | Abrasive blast slab to CSP-3 profile | 30 +CV5060 | Apply epoxy primer and base coat | 30 +CV5060 | Apply chemical-resistant topcoat and spark test | 20 +EQ5010 | Verify crane pick radius and pad clearances | 20 +EQ5010 | Lift filtration skid FL-501 onto pad | 45 +EQ5010 | Align skid anchor slots and shim level | 35 +PP3120 | Verify lockout, drain and cold-cut bevel | 20 +PP3120 | Fit up 10-inch tee with owner QA witness | 35 +PP3120 | Complete root, hot pass and cap welds | 45 +EL4070 | Verify switching order and grounding removal | 25 +EL4070 | Close primary 4160V breaker to TX-401 | 35 +EL4070 | Verify secondary phase rotation and voltage | 20 +EL4070 | Energize MCC-401 main bus | 20 +DC6010 | Mount fiber patch panels and fusion splice pigtails | 35 +DC6010 | Land field multi-pair home-runs on marshalling blocks | 45 +DC6010 | Run OTDR fiber attenuation test and label cables | 20 +CM9135 | Verify analog scaling for PT, FT, TT and analyzer points | 35 +CM9135 | Test pump lead-lag auto-failover logic | 35 +CM9135 | Test high-pressure and low-suction safety trips | 30 # activity | category | account | name | vendor | cost ## expenses +PM0100 | Insurance and Bonds | 6000 | Builders risk insurance and performance bond | Midwest Surety Underwriters | 48500 PM0130 | Permits and Fees | 6000 | County building and excavation permits | County Building Department | 18500 +PM0135 | Permits and Fees | 6000 | State industrial water filtration permit fee | State Environmental Agency | 9200 +EN0110 | Testing and Inspection | 5000 | Geotechnical soil borings and lab report | Heartland GeoTesting | 11400 PR0130 | Freight | 6000 | Freight for pumps P-101A and P-101B | Valley Freight Lines | 6800 +PR0165 | Freight | 6000 | Climate-controlled freight for VFDs VFD-101A/B | Valley Freight Lines | 4100 PR0230 | Freight | 6000 | Heavy haul for transformer TX-401 and MCC-401 | Valley Freight Lines | 14200 -EQ3010 | Vendor Services | 5000 | 250-ton crane mobilization and demobilization | Northgate Crane Rental | 12000 +PR0365 | Freight | 6000 | Oversize flatbed freight for filtration skid FL-501 | Valley Freight Lines | 9800 +PR0830 | Vendor Services | 5000 | DCS FAT test bench rental and witness travel | Northstar Controls Inc. | 6400 +ST0125 | Subcontract Services | 5000 | Vacuum hydro-excavation truck and utility locating | ClearLine Vac Services | 8600 +CV2045 | Testing and Inspection | 5000 | Soil compaction and concrete cylinder lab testing | Heartland GeoTesting | 7500 +CV5060 | Subcontract Services | 5000 | Chemical containment epoxy lining applicator fee | Apex Industrial Coatings | 16800 +EQ3005 | Vendor Services | 5000 | 250-ton crane mobilization, mats and demobilization | Northgate Crane Rental | 28500 PP0130 | Testing and Inspection | 5000 | Radiography of shop spool welds | Summit Inspection Services | 4200 PP1020 | Testing and Inspection | 5000 | Radiography of pump station field welds | Summit Inspection Services | 3100 PP2030 | Testing and Inspection | 5000 | Radiography of pipe rack field welds | Summit Inspection Services | 4600 PP3030 | Testing and Inspection | 5000 | Radiography of heat exchanger piping welds | Summit Inspection Services | 2900 PP3130 | Testing and Inspection | 5000 | Radiography of tie-in TI-01 welds (outage call-out) | Summit Inspection Services | 2400 PP3230 | Testing and Inspection | 5000 | Radiography of tie-in TI-02 welds (outage call-out) | Summit Inspection Services | 2400 -EL4050 | Testing and Inspection | 5000 | Transformer oil sample and electrical testing | Keystone Electrical Testing | 4800 +PP5030 | Testing and Inspection | 5000 | Radiography and borescope QA of stainless welds | Summit Inspection Services | 3800 +EL4050 | Testing and Inspection | 5000 | Transformer oil sample and NETA electrical testing | Keystone Electrical Testing | 8200 +PC9010 | Subcontract Services | 5000 | Citric acid passivation chemicals and waste disposal | AquaClean Industrial | 11200 +CM9145 | Vendor Services | 5000 | Filtration skid vendor commissioning technician | ClearStream Process Systems | 8400 CM9150 | Vendor Services | 5000 | Pump vendor startup technician, 3 days | Pump vendor field service | 7200 +CV6040 | Subcontract Services | 5000 | Hot-mix asphalt paving and striping subcontract | River Valley Paving | 22400 # activity | resource | curve ## curves +EN0100 | ENGR | Early Weighted +EN0200 | ENGR | Early Weighted +EN0300 | ENGR | Bell, Early Peak PR0120 | BUYER | Bell, Centered PR0220 | BUYER | Bell, Centered +PR0360 | BUYER | Bell, Late Peak +PP0110 | PF | Steady with Ramps PP2000 | PF | Steady with Ramps -EN0200 | ENGR | Early Weighted +PP2000 | WLD | Bell, Centered +PP3000 | PF | Steady with Ramps +PP5000 | PF | Bell, Early Peak +PI2010 | INSUL | Ramp Up CM9040 | PF | Ramp Down +CM9040 | ELEC | Ramp Down + +## doc categories +Engineering Drawing +Specification +Vendor Submittal +Permit and Regulatory +Quality and Test Plan +Safety Plan +Contract and Change Order + +## doc statuses +Draft +In Review +Approved +Issued for Construction +Superseded + +# id | parent | ref | title | category | status | version | author | date | deliv | targets (WBS or Activity IDs) | description +## documents +DOC01 | | RB-PKG-01 | 01 - Project Execution, Safety and Permits | Contract and Change Order | Approved | Rev 1 | M. Alvarez | 2026-06-15 15:30 | N | PM | Master folder for execution plans, permits and approved change orders. +DOC02 | DOC01 | RB-PLN-001 | Project Execution and Controls Plan | Contract and Change Order | Approved | Rev 1 | M. Alvarez | 2026-06-22 15:30 | Y | PM0105, PM0110 | Defines WBS, baseline control rules, monthly update cadence and change management. +DOC03 | DOC01 | RB-HSE-001 | Site-Specific Safety Plan and LOTO Procedure | Safety Plan | Approved | Rev 2 | R. Kowalski | 2026-06-25 15:30 | Y | PM0120, PM0140, DM1000 | Mandatory safety procedures, confined space rules and plant lockout coordination. +DOC04 | DOC01 | RB-PRM-101 | County Building and Excavation Permit #2026-8841 | Permit and Regulatory | Approved | Rev 0 | D. Patel | 2026-07-10 15:30 | Y | PM0130, ST0100 | Approved structural foundation and underground utility trenching permit. +DOC05 | DOC01 | RB-PRM-102 | State Water Reuse and Filtration Permit Addendum | Permit and Regulatory | Approved | Rev 0 | D. Patel | 2026-07-22 15:30 | Y | PM0135, A500 | Environmental authorization supporting the state grant and backwash discharge. +DOC06 | DOC01 | RB-CO-001 | Change Order 001 - Pipe Rack Freeze Protection | Contract and Change Order | Approved | Rev 0 | M. Alvarez | 2026-08-14 14:00 | N | A200, EL2010, PI2010 | Adds electric heat tracing and aluminum-jacketed fiberglass insulation on 10-inch header. +DOC07 | | RB-PKG-02 | 02 - Engineering IFC Drawing Packages | Engineering Drawing | Issued for Construction | Rev 2 | D. Patel | 2026-09-01 15:30 | N | ENG | Issued for construction drawings across process, civil, mechanical and E&I disciplines. +DOC08 | DOC07 | RB-PID-001 | Process Water System P&IDs (Sheets 1-14) | Engineering Drawing | Issued for Construction | Rev 2 | D. Patel | 2026-07-24 15:30 | Y | EN0060, EN0080, EN0085 | Complete P&ID set incorporating all HAZOP safety action items. +DOC09 | DOC07 | RB-CS-100 | Civil Foundation and Pipe Rack Structural IFC Set | Engineering Drawing | Issued for Construction | Rev 1 | D. Patel | 2026-08-18 15:30 | Y | EN0120, EN0130, CV1010, CV2010, CV5020 | Foundations, anchor bolt plans, containment curbing and 6-bent galvanized rack framing. +DOC10 | DOC07 | RB-ME-200 | Piping Isometrics and Outage Tie-In Package | Engineering Drawing | Issued for Construction | Rev 1 | D. Patel | 2026-08-28 15:30 | Y | EN0220, EN0240, PP2000, PP3120, PP3220 | Isometric spool sheets, weld maps and tie-in details for TI-01, TI-02 and TI-03. +DOC11 | DOC07 | RB-EI-300 | Electrical One-Line, Arc Flash Study and Loop Diagrams | Engineering Drawing | Issued for Construction | Rev 1 | D. Patel | 2026-09-04 15:30 | Y | EN0305, EN0320, EN0340, EL4030 | 4160V/480V distribution, VFD schematics, grounding grid and analyzer loop wiring. +DOC12 | DOC07 | RB-DCS-400 | DCS Control Narrative and Cause-and-Effect Matrix | Specification | Approved | Rev 1 | D. Patel | 2026-09-02 15:30 | Y | EN0315, EN0335, DC6020 | Lead-lag pump control, filtration backwash automation and interlock shutdown table. +DOC13 | | RB-PKG-03 | 03 - Major Equipment Vendor Submittals | Vendor Submittal | Approved | Rev 1 | S. Novak | 2026-08-25 15:30 | N | PROC | Certified vendor drawings, datasheets and shop test reports. +DOC14 | DOC13 | RB-VND-101 | Pumps P-101A/B Certified Outline and Performance Curves | Vendor Submittal | Approved | Rev 2 | S. Novak | 2026-07-20 15:30 | Y | PR0110, PR0125, EQ1010 | Certified baseplate anchor layout, NPSH curves and hydro/witness test requirements. +DOC15 | DOC13 | RB-VND-201 | Transformer TX-401 and MCC-401 Certified Drawings | Vendor Submittal | Approved | Rev 1 | S. Novak | 2026-08-12 15:30 | Y | PR0210, PR0227, EL4010 | 1500 kVA oil-filled transformer outline, containment volume and MCC bucket layout. +DOC16 | DOC13 | RB-VND-501 | Filtration Skid FL-501 and Chemical Tanks Submittal | Vendor Submittal | Approved | Rev 1 | S. Novak | 2026-08-24 15:30 | Y | PR0355, PR0360, EQ5010 | Dual-vessel multimedia filtration skid piping, media specs and PLC interface points. +DOC17 | DOC13 | RB-VND-601 | Marshalling Cabinet CP-601 Wiring and FAT Procedure | Vendor Submittal | In Review | Rev 0 | S. Novak | 2026-10-05 15:30 | Y | PR0375, PR0830, DC6010 | Terminal block layout, redundant power supply schematic and FAT checklist. +DOC18 | | RB-PKG-04 | 04 - Quality, Hydrotest and Commissioning Packages | Quality and Test Plan | In Review | Rev 1 | T. Brooks | 2026-10-08 15:30 | N | COMM | Inspection and test plans, weld radiography logs, hydrotest packs and SAT scripts. +DOC19 | DOC18 | RB-QA-001 | Project Quality Assurance Plan and Weld ITP | Quality and Test Plan | Approved | Rev 1 | R. Kowalski | 2026-06-24 15:30 | Y | PM0150, PM0160, PP0130 | ASME B31.3 weld qualification, 10 percent random NDE and 100 percent tie-in NDE criteria. +DOC20 | DOC18 | RB-QA-010 | Master Hydrotest and Passivation Test Packages | Quality and Test Plan | Approved | Rev 0 | T. Brooks | 2026-09-10 15:30 | Y | EN0230, PP1030, PP2040, PP3040, PP5040 | Test pressures, isolation blind lists, gauge calibration sheets and citric passivation spec. +DOC21 | DOC18 | RB-OUT-001 | February Plant Outage Execution Playbook | Safety Plan | Draft | Rev 0 | R. Kowalski | 2026-10-09 15:30 | Y | PM0220, PM0230, PP3100 | Shift-by-shift tie-in sequence, contingency welder plan and operations handback protocol. +DOC22 | DOC18 | RB-COM-001 | DCS SAT and 30-Day Reliability Test Protocol | Quality and Test Plan | Draft | Rev 0 | T. Brooks | 2026-10-10 15:30 | Y | CM9135, CM9160, CM9190 | Acceptance criteria for heat transfer, filtration turbidity, vibration and continuous uptime. + +## risk categories +Schedule +Procurement +Technical +Safety and Outage +Geotechnical and Site +Weather +Regulatory + +# code | name | category | kind (Threat, Opportunity) | status (Proposed, Open, Active, Rejected, Impacted, Managed) | owner | identified_by | date | response (Accept, Avoid, Transfer, Reduce, Exploit, Facilitate, Enhance, Reject) | pre_p | pre_s | pre_c | post_p | post_s | post_c | activities | desc | cause | effect | response_text | notes +## risks +RSK-001 | Pump P-101A/B vendor assembly and test delay | Procurement | Threat | Active | BUYER | PM | 2026-07-15 09:00 | Reduce | High | High | Medium | Medium | Low | Low | PR0125, PR0130, EQ1010 | Pump vendor shop test bay congestion threatens late delivery of pumps P-101A and P-101B. | Impeller dynamic balancing machine outage at vendor foundry added 3 days to assembly. | Late pump setting compresses Area 100 piping and pushes Mechanical Completion float. | Deployed weekly expediter shop visits and locked witness test slot in advance. | Currently tracking 3-day slip in October update; recovery plan under review. +RSK-002 | Plant outage window overrun on header tie-ins | Safety and Outage | Threat | Active | SUPT | PM | 2026-06-20 10:00 | Avoid | Medium | Very High | High | Low | Medium | Low | PP3100, PP3120, PP3220, PP3400 | Welded tie-ins TI-01 and TI-02 could exceed the fixed February plant outage window. | Residual water in isolated headers or weld NDE rejection requiring cut-out and re-weld. | Every day past the outage finish costs plant lost production and triggers liquidated damages. | Pre-bevel all tie-in tees, stage backup certified welders and book dedicated outage radiography crew. | Tabletop rehearsal scheduled in PM0230 two weeks before outage. +RSK-003 | Owner-furnished heat exchanger E-301 late delivery | Procurement | Threat | Open | PM | ENGR | 2026-07-02 14:00 | Transfer | Medium | High | Medium | Low | Medium | Low | PR0320, EQ3000, EQ3010 | Owner-supplied plate heat exchanger E-301 arrives after January 8 target date. | Direct owner vendor shipping congestion during year-end holiday window. | Delays 250-ton crawler crane lift and pushes Area 300 piping into the February outage window. | Owner retains delivery liability under contract; weekly owner-vendor status check established. | Current vendor report shows January 5 ship date, holding 3 days buffer. +RSK-004 | Uncharted underground utilities in Area 500 and ductbank | Geotechnical and Site | Threat | Managed | FE | SUPT | 2026-06-28 08:00 | Reduce | High | Medium | Medium | Low | Low | Low | ST0125, CV5000, CV6000 | Legacy plant drawings may miss abandoned cooling lines or live electrical conduits. | Plant built in 1978 with incomplete as-built records in the south utility corridor. | Trenching stop-work, rerouting redesign and potential safety strike hazard. | Performed GPR scanning and vacuum hydro-excavation potholing in ST0125 prior to mechanical digging. | Potholing found two abandoned 3-inch lines; routed ductbank 4 feet north without delay. +RSK-005 | Soft clay subgrade under Area 300 crane mat and pad | Geotechnical and Site | Threat | Active | SUPT | FE | 2026-09-12 11:00 | Reduce | High | Medium | High | Medium | Low | Medium | CV3005, EQ3005, EQ3010 | High autumn groundwater softens clay soils along the 250-ton crawler crane travel path. | Seasonal rainfall combined with low bearing capacity noted in Heartland GeoTesting borings. | Unsafe crane ground bearing pressure requiring additional timber mats and gravel stabilization. | Submitted CO-003 for engineered crane matting and sump dewatering prior to heavy lift. | Dewatering pump mobilized; CO-003 pending owner commercial approval. +RSK-006 | Winter freeze conditions delaying concrete and epoxy curing | Weather | Threat | Open | GF | SUPT | 2026-08-20 13:00 | Reduce | Medium | Medium | Medium | Low | Low | Low | CV1020, CV5030, CV5060 | Ambient temperatures below 40 degrees F halt concrete placement and epoxy lining cure. | Late autumn cold snaps in Midwest region during November concrete and coating windows. | Coating delamination or low 7-day concrete break strength requiring rework. | Reserve heated enclosure tents, insulating concrete blankets and indirect-fired heaters on standby. | Included in winter weather contingency checklist. +RSK-007 | Transformer TX-401 factory witness test failure | Technical | Threat | Open | ENGR | QC | 2026-08-10 15:00 | Reduce | Low | High | Medium | Very Low | Medium | Low | PR0225, PR0227, EL4010 | Insulation resistance or impulse test non-conformance during witnessed factory test. | Core-to-coil winding moisture or tap-changer assembly defect. | 3-to-4 week factory rework delaying Area 400 energization and motor bump testing. | Require vendor pre-test report 5 days before witness trip and mid-build QA hold point. | Winding phase progressing cleanly on schedule. +RSK-008 | Pipefitter and certified welder craft labor shortage | Schedule | Threat | Active | GF | SUPT | 2026-09-05 09:00 | Reduce | Medium | High | High | Low | Medium | Medium | PP1000, PP2000, PP3000, PP5000 | Peak simultaneous piping across Areas 100, 200, 300 and 500 stretches regional craft supply. | Competing refinery and industrial turnarounds in the region during Q4 2026. | Reduced daily weld productivity and craft overtime cost overrun. | Pre-fabricate 70 percent of spools in off-site fab shop and stagger Area 500 stainless crew start. | Monitoring weekly weld-inch burn rate against plan. +RSK-009 | DCS interface mismatch with existing plant control network | Technical | Threat | Open | AUTO | CXE | 2026-08-28 16:00 | Reduce | Medium | Medium | Medium | Low | Low | Low | EN0335, PR0830, DC6020, CM9135 | Existing plant DCS firmware version may require custom Modbus/OPC mapping for new VFDs and analyzers. | Legacy plant control room runs an older controller revision not fully documented in RFP. | Extended loop-check and SAT duration threatening startup milestone CM9180. | Conduct full cabinet CP-601 FAT with owner controls engineer and test VFD communication early. | Spare I/O module request logged under CO-005. +RSK-010 | Filtration skid FL-501 stainless weld borescope rework | Technical | Threat | Open | QC | BUYER | 2026-09-18 10:00 | Reduce | Medium | Low | Medium | Low | Very Low | Low | PR0360, PR0820, PP5030 | Inadequate argon back-purging on stainless chemical lines causes sugar welds failing QA. | Strict internal corrosion resistance requirements for chemical feed piping. | Re-welding and re-passivation delaying Area 500 pre-commissioning. | Enforce purge oxygen analyzer checks (<50 ppm) and perform vendor shop inspection PR0820. | QC witness checklist issued to fab shop and vendor. +RSK-011 | Early delivery of pipe rack steel enables pre-assembly | Schedule | Opportunity | Proposed | SUPT | GF | 2026-09-22 14:00 | Enhance | Medium | Medium | Low | High | Medium | Medium | CV2100, CV2110, PP2000 | Galvanized pipe rack bents may arrive 5 days ahead of schedule from steel fabricator. | Fabricator completed prior commercial order early and moved Riverbend ahead in galvanizing queue. | Ground-assembling bent frames saves 4 days of crane time and improves Area 200 header float. | Prepare extra laydown bolting skids in ST0105 to pre-assemble bents 1 through 4 on the ground. | Expediter confirming final shipping schedule in PR0810. +RSK-012 | Parallel commissioning of Area 500 filtration skid | Schedule | Opportunity | Open | CXE | PM | 2026-10-01 11:00 | Exploit | High | Medium | Low | High | Medium | Low | PC9010, CM9032, CM9145 | Area 500 filtration skid can be wet-commissioned on temporary water before header tie-in outage. | Independent potable/utility feed allows backwash and analyzer verification ahead of tie-ins. | De-risks integrated startup and removes 3 days from post-outage commissioning pressure. | Add temporary hose bypass in PC9010 test pack and schedule early vendor tech mobilization. | Operations team supportive; final safety review underway. + +# wbs (PROJECT or code) | param_id | detail (Activities, WBS) | priority (Top, High, Normal, Low, Lowest) | status (Enabled, Disabled) | obs | low | high | win_start | win_end +## thresholds +CONST | 17 | Activities | High | Enabled | CONM | 5 | | 2026-06-01 00:00 | 2027-06-01 00:00 +PROC | 16 | Activities | Top | Enabled | PROCM | -2 | | 2026-06-01 00:00 | 2027-06-01 00:00 +PROJECT | 6 | WBS | High | Enabled | PMO | 0.95 | | 2026-06-01 00:00 | 2027-06-01 00:00 +CONST | 9 | WBS | Normal | Enabled | CONM | 0.95 | | 2026-06-01 00:00 | 2027-06-01 00:00 +PROJECT | 5 | Activities | Normal | Enabled | PMO | | 105 | 2026-06-01 00:00 | 2027-06-01 00:00 +A300.TIE | 18 | Activities | Top | Enabled | CONM | 0 | | 2027-01-01 00:00 | 2027-04-01 00:00 + +# name | priority (Top, High, Normal, Low, Lowest) | status (Open, On Hold, Closed) | obs | identified_by | add_date | resolv_date | target (WBS or Activity ID) | param_id (or blank) | value | low | high | notes | history +## issues +Pump vendor assembly slip exceeding 2-day finish variance | Top | Open | PROCM | S. Novak | 2026-10-08 09:00 | | PR0125 | 16 | -3 | -2 | | Pump vendor reported 3-day assembly slip due to impeller balancing fixture maintenance. Expediter reviewing overtime shift to recover 2 days before shipment. | 2026-10-08: Issue raised during October schedule update; vendor recovery schedule requested by Oct 16. +Area 200 rack footing rebar labor overrun above 105% budget | High | Open | CONM | R. Kowalski | 2026-10-05 15:00 | | CV2010 | 5 | 110 | | 105 | Tight anchor bolt congestion at bents 3 and 4 required extra carpenter and ironworker hours. Reviewing bent 5-6 forming method to hold remaining civil budget. | 2026-10-05: Flagged by Cost % of Budget threshold during weekly labor review. +Piping design engineering hours 8% over budget | Normal | Closed | ENGM | D. Patel | 2026-08-26 14:00 | 2026-09-18 16:00 | EN0200 | 5 | 108 | | 105 | Extra iterations on 10-inch thermal expansion loop and winter freeze protection tie-ins increased piping engineering hours. | 2026-08-26: Logged after 90% model review. 2026-09-18: Closed after IFC piping release; hours covered by CO-001 engineering allowance. +Soft soil stabilization and crane mat scope pending CO-003 | High | Open | CONM | R. Kowalski | 2026-10-02 16:00 | | CV3005 | | | | | Subgrade proof-roll along Area 300 crane access lane showed soft wet clay. Additional timber matting priced in CO-003 and awaiting owner sign-off. | 2026-10-02: CO-003 submitted to owner PM ($68,500). +Control room DCS spare I/O and fiber ring request (CO-005) | Normal | On Hold | COMMM | T. Brooks | 2026-10-09 11:00 | | DC6010 | | | | | Plant operations requested 20% spare analog channels and redundant ring fiber path for Area 500 analyzers. Held pending owner operations budget review. | 2026-10-09: Technical scope defined; commercial approval deferred to next steering meeting. +Bent 4 west column anchor bolt out-of-tolerance field sketch SK-07 | Normal | Closed | ENGM | D. Patel | 2026-09-29 10:00 | 2026-10-04 15:00 | CV2110 | | | | | Anchor bolt template shifted 3/8 inch on bent 4 west pedestal. Engineer issued repair sketch SK-07 with oversized baseplate washer plate; accepted by owner QA. | 2026-09-29: NCR-004 opened. 2026-10-04: SK-07 approved and closed prior to steel erection. +Abandonment demolition crew overrun at Area 300 strainer | Low | Closed | CONM | R. Kowalski | 2026-09-15 16:00 | 2026-09-22 15:00 | DM3000 | 5 | 120 | | 105 | Corroded flange bolts on abandoned strainer required hot-work torch cutting and extra fire watch hours. | 2026-09-15: Logged on completion of DM3000. 2026-09-22: Closed; total impact under $4,500 absorbed in Area 300 contingency. +Owner witness date confirmation for TX-401 factory test | Normal | Open | PROCM | S. Novak | 2026-10-10 13:00 | | PR0227 | | | | | Need owner electrical engineer travel confirmation for mid-November transformer TX-401 factory witness testing to avoid ship hold. | 2026-10-10: Sent calendar invite and draft test protocol to owner plant electrical lead. # target (PROJECT, a WBS code or an activity) | topic | text ## notes -PROJECT | Scope | Replace the two worn process water pumps in the existing pump house with new pumps P-101A and P-101B, run a new 10-inch header across a new six-bent pipe rack to the owner furnished plate heat exchanger E-301, and tie the new system into the existing cooling water supply and return headers during the February plant outage. A new 1500 kVA transformer and motor control center feed the pumps. -PROJECT | Basis and Assumptions | Crews work a 6-day, 10-hour week. Office, engineering and procurement work a 5-day, 8-hour week. Concrete cures and the outage tie-ins run 7 days a week. Rates include burden and small tools. The pumps are lump sum from the pump vendor; installation is ours. -PROJECT | Constraints and Access | The plant outage window is fixed by operations: headers are drained and isolated on Saturday 13 February. All header work must finish inside the outage. Mechanical completion is a contract date. -PROJECT | Safety | Lockout and line break permits from plant operations are required before any work on the existing pumps and headers. Daily job hazard analysis at the 6 AM toolbox talk. -PROJECT | Quality and Inspection | Field welds are radiographed by a third party. Tie-in welds are radiographed 100 percent. Hydrotests are witnessed by the owner inspector. -PROJECT | Change Notes | Change 001 (approved): add freeze protection heat tracing and insulation on the pipe rack header, added after the owner's winter review. -A100 | Scope | Demolish the old pumps P-1 and P-2, their bases, piping and power cables, then build new foundations and install pumps P-101A and P-101B with their piping, power, controls and instruments. +PROJECT | Scope | Replace the two worn process water pumps in the existing pump house with new VFD-driven pumps P-101A and P-101B, run a new 10-inch header across a new six-bent pipe rack to the owner furnished plate heat exchanger E-301, install a new Area 500 multimedia filtration and chemical feed skid (FL-501), integrate a new control room DCS marshalling cabinet (CP-601) with fiber backbone, and tie into the existing cooling water supply and return headers during the February plant outage. A new 1500 kVA transformer and motor control center feed the upgraded system. +PROJECT | Basis and Assumptions | Crews work a 6-day, 10-hour week. Office, engineering and procurement work a 5-day, 8-hour week. Concrete cures and the outage tie-ins run 7 days a week. Rates include burden and small tools. The pumps and filtration skid are lump sum from equipment vendors; installation is self-performed and subcontracted under EPC-GMP. +PROJECT | Constraints and Access | The plant outage window is fixed by operations: headers are drained and isolated on Saturday 13 February 2027. All header work must finish inside the outage. Mechanical completion is a contract date. +PROJECT | Safety | Lockout and line break permits from plant operations are required before any work on the existing pumps and headers. Daily job hazard analysis at the 6 AM toolbox talk. Chemical handling permits apply during Area 500 passivation and dosing checkout. +PROJECT | Quality and Inspection | Field welds are radiographed by a third party (10 percent random on carbon steel, 100 percent on outage tie-ins and borescope on Area 500 stainless). Hydrotests and DCS SAT are witnessed by the owner inspector. +PROJECT | Change Notes | Change 001 (approved, +$145,000): add freeze protection heat tracing and insulation on the pipe rack header. Change 002 (approved, +$210,000): upgrade Area 500 containment curb and dual-wall chemical lines per state grant terms. Changes 003 and 005 pending commercial review. +A100 | Scope | Demolish the old pumps P-1 and P-2, their bases, piping and power cables, then build new foundations and install VFD-driven pumps P-101A and P-101B with their piping, power, controls and vibration monitoring instruments. A100.DEMO | Safety | Old pump bases contain asbestos-free grout per the owner's survey dated 12 May. Old motors go to the owner's scrap yard, not off site. A200 | Constraints and Access | Bents 3 and 4 sit beside the plant road. Crane picks over the road need a flagger and the road closed for the lift. A300.TIE | Constraints and Access | Tie-ins TI-01 and TI-02 are welded tees on live headers after isolation; TI-03 is a flanged drain connection. Each welded tie-in is radiographed before the leak test. A300.TIE | Quality and Inspection | Prefabricate the tie-in tees and pre-bevel the spools before the outage. Keep spare gaskets and a second welding machine on hand. A400 | Safety | Energizing TX-401 is done only under owner switching orders. Arc flash labels go up before the room is turned over. -COMM | Basis and Assumptions | Owner operations runs the control system. Our scope ends at the marshalling cabinet terminals; the owner configures the control system. -MS0000 | Field Notes | Notice to proceed received by email from the owner's project manager. +A500 | Scope | New multimedia filtration skid FL-501, chemical day tanks TK-501 and TK-502, epoxy-coated containment pad, stainless headers, online water quality analyzer rack AN-501 and emergency safety shower. +A500 | Safety | Acid/caustic chemical dosing lines require dual-wall containment and a tested emergency eyewash and safety shower before chemical delivery. +A600 | Scope | Underground concrete-encased fiber/control ductbank, control room DCS marshalling cabinet CP-601, plant instrument air extension, backwash drain tie-in and final roadway paving restoration. +COMM | Basis and Assumptions | Owner operations runs the main plant DCS servers. Our automation integrator configures the new Riverbend HMI screens, lead-lag pump logic and filtration backwash sequence up through SAT and 30-day reliability run. +MS0000 | Field Notes | Notice to proceed received by email from the owner's project manager on June 1, 2026. +EN0070 | Safety | HAZOP completed with 6 action items: added high-pressure discharge relief valve, low-suction pump trip and dual-wall chemical line leak detector. PR0120 | Field Notes | Pump vendor reports castings poured on schedule. Shop test witness trip booked. -PR0220 | Change Notes | Vendor offered an earlier ship date for a premium; declined, the standard date holds the plan. +PR0125 | Change Notes | Impeller balancing fixture repair added 3 days to assembly; expediter working overtime recovery option with vendor shop manager. +PR0220 | Change Notes | Vendor offered an earlier ship date for a $42,000 premium (CO-004); declined because standard transit preserves float. PR0320 | Constraints and Access | The owner purchased E-301 directly. Delivery is the owner's; we receive, set and connect it. +PR0360 | Quality and Inspection | Filtration skid vendor to provide certified ASME vessel U-1A forms and hydrostatic test charts prior to release. DM1020 | Safety | Pipe may hold residual water and scale. Drain at low points before cutting. Hot work permit each shift. CV1020 | Quality and Inspection | Slump and cylinders taken by the testing lab. Pour only above 40 degrees F with blankets on hand. CV2110 | Field Notes | Bents 1 and 2 set on the first day; anchor bolt at bent 4 west column was out of tolerance and was corrected by the engineer's sketch SK-07. -EQ3010 | Safety | Critical lift plan required for the 250-ton crane. Lift plan reviewed by the rigging engineer. +CV5060 | Quality and Inspection | Concrete moisture vapor test must pass below 3 lbs/1000 SF/24 hr before applying chemical-resistant epoxy primer. +EQ3010 | Safety | Critical lift plan required for the 250-ton crane. Lift plan reviewed by the rigging engineer and approved by plant safety. +EQ5010 | Field Notes | Filtration skid FL-501 weighs 18,400 lbs dry; verify pad curing reaches 4000 psi break strength before setting. PP2000 | Field Notes | Header spools arriving from the fab shop in rack order. Two welders on the rack, one at the fab shop. PP2000 | Quality and Inspection | Weld map kept in the field office; welder stencil on every weld. PP3120 | Quality and Inspection | Hold point: owner inspector to witness fit up before welding. PP3400 | Constraints and Access | Owner operations opens the header block valves slowly; we stand by with two fitters until the leak test is accepted. +PP5000 | Quality and Inspection | Maintain argon back-purge below 50 ppm O2 on all 316L stainless steel butt welds; borescope sample 20 percent. EL4070 | Safety | Energized work permit and switching order required. Only qualified electricians in the room. -CM9050 | Change Notes | Contract date unchanged after change 001; the heat tracing work fits inside the plan. +DC6020 | Commissioning Notes | Coordinate DCS download during Tuesday plant maintenance window so existing plant HMI consoles experience zero interruption. +CM9050 | Change Notes | Contract date unchanged after changes 001 and 002; heat tracing and Area 500 filtration work fit inside the plan. +CM9135 | Commissioning Notes | Test all 48 new analog and discrete I/O points, VFD Modbus telemetry and emergency shutdown interlocks with owner controls engineer. CM9150 | Field Notes | Pump vendor startup technician booked for three days. +# calendar | name | start | end +## financial periods +Riverbend Monthly Periods | 2026-06 Jun | 2026-06-01 00:00 | 2026-06-30 23:59 +Riverbend Monthly Periods | 2026-07 Jul | 2026-07-01 00:00 | 2026-07-31 23:59 +Riverbend Monthly Periods | 2026-08 Aug | 2026-08-01 00:00 | 2026-08-31 23:59 +Riverbend Monthly Periods | 2026-09 Sep | 2026-09-01 00:00 | 2026-09-30 23:59 +Riverbend Monthly Periods | 2026-10 Oct | 2026-10-01 00:00 | 2026-10-31 23:59 +Riverbend Monthly Periods | 2026-11 Nov | 2026-11-01 00:00 | 2026-11-30 23:59 +Riverbend Monthly Periods | 2026-12 Dec | 2026-12-01 00:00 | 2026-12-31 23:59 +Riverbend Monthly Periods | 2027-01 Jan | 2027-01-01 00:00 | 2027-01-31 23:59 +Riverbend Monthly Periods | 2027-02 Feb | 2027-02-01 00:00 | 2027-02-28 23:59 +Riverbend Monthly Periods | 2027-03 Mar | 2027-03-01 00:00 | 2027-03-31 23:59 +Riverbend Monthly Periods | 2027-04 Apr | 2027-04-01 00:00 | 2027-04-30 23:59 +Riverbend Monthly Periods | 2027-05 May | 2027-05-01 00:00 | 2027-05-31 23:59 + # Progress at the data date. A slip adds working days to an activity's # remaining duration; an overrun scales its actual units. ## progress data date | 2026-10-12 00:00 +revision date | 2026-08-17 00:00 slip | PR0125 | 3 overrun | EN0200 | 1.08 overrun | PR0110 | 1.10 @@ -468,3 +1020,5 @@ overrun | ST0100 | 1.15 overrun | DM3000 | 1.20 overrun | CV3010 | 1.12 overrun | CV2010 | 1.10 +overrun | EN0060 | 1.06 +overrun | PR0360 | 1.05 diff --git a/desktop/help/assign-relationships.md b/desktop/help/assign-relationships.md index 63a0cd7..e79e0d7 100644 --- a/desktop/help/assign-relationships.md +++ b/desktop/help/assign-relationships.md @@ -4,7 +4,7 @@ Picks activities to link to the selected activity. A predecessor is an activity ## What is on it - **Find**: type part of an activity ID or name to shorten the list. -- **The activity list**: **Activity ID** and **Activity Name** of every other activity. With several projects open it also shows **Project ID** and lists the activities of every open project. +- **The activity list**: **Activity ID** and **Activity Name** of every other activity, grouped under WBS bands. With several projects open it also shows **Project ID** and lists the activities of every open project. Right-click the list for **Copy** (`Ctrl+C`), **Columns**, **Table Font and Row...**, **Filter By**, **Group and Sort By**, **Expand All** (`Ctrl+Num +`) and **Collapse All** (`Ctrl+Num -`). - **Relationship Type**: **FS** (finish to start, the usual type), **SS** (start to start), **FF** (finish to finish) or **SF** (start to finish). New links start as FS. - **Lag**: a wait added to the link, typed like a duration. It starts at 0. - **Assign**: adds a relationship to each activity selected in the list. Click one activity, `Ctrl`+click to add or drop more, or `Shift`+click to select a run of them. diff --git a/desktop/help/getting-started.md b/desktop/help/getting-started.md index a2d09f8..c27f9e6 100644 --- a/desktop/help/getting-started.md +++ b/desktop/help/getting-started.md @@ -5,11 +5,16 @@ make a change, schedule, and send the file back out. ## The sample project A new workspace opens on **RIVERBEND**, a made-up process water upgrade in -progress: about 190 activities with logic, three calendars, crews and -equipment with rates, costs, expenses, codes, notebook topics and an -as-planned baseline. Use it to try the views. To remove it, and the -calendars, resources, codes and notebook topics only it uses, delete it in -the Projects view once another project is open. See [Projects](view-projects). +progress: about 365 activities across six plant areas with logic, Level of +Effort and WBS summary activities, three calendars, hierarchical crews and +equipment with rates and curves, costs, expenses, activity/project/resource/assignment +codes, risks, documents, issues, thresholds, WBS milestones, funding, budget log, +spending plan, financial periods, notebook topics and two baselines (as-planned +and mid-August rebaseline). Use it to try every view. To remove it - along with +the calendars, resources, codes, topics and other shared rows only it uses - +right-click **RIVERBEND** in the Projects view and choose **Delete**. Deleting +the last project leaves an empty workspace ready for your own schedule. See +[Projects](view-projects). ## Bring a project in 1. To start from an XER file, use `File > Import...`. The wizard reads the file diff --git a/desktop/help/view-projects.md b/desktop/help/view-projects.md index 95b0c4b..7846cd0 100644 --- a/desktop/help/view-projects.md +++ b/desktop/help/view-projects.md @@ -7,7 +7,7 @@ The Projects view lists every project in your workspace, filed under the folders - **Project table**: EPS folders with their projects under them. A project not yet placed sits under the first top-level folder. Each folder row shows the rollup of every project under it, child folders included. - **Columns**: **Project ID**, **Project Name**, **Total Activities** and **Strategic Priority** at first, leaving most of the width to the chart. **Customize Columns...** lists the others by group: **Status**, **Responsible Manager** and **Project Leveling Priority**; **Start**, **Finish**, **Planned Start**, **Actual Start**, **Actual Finish**, **Anticipated Start** and **Finish**, **Data Date**, **Must Finish By**, **Late Start**, **Late Finish** and **Baseline Finish**; **Finish Variance** and **Total Float**; **Schedule % Complete (duration)**; **Budgeted**, **Actual** and **Remaining Labor Units** and **Total Cost**; **Original**, **Current** and **Proposed Budget** with the spending and benefit plan totals; the **Not Started**, **In Progress** and **Completed** activity counts; a column for each project code (the value assigned on the **Codes** tab, read here); and the user defined fields. - **Project Gantt**: beside the table, one bar per project from its start to its finish, the part already worked (actual start to the data date, or to the actual finish) in a darker shade, a thin baseline bar under it when the project has a baseline, and a blue line at the project's data date. Folder rows get a summary bar over their projects. Drag the splitter between the table and the chart to share the width. The chart scrolls and zooms like the Activities Gantt: drag the top timescale band to pan, the lower band to zoom, or use the scroll bar, the wheel and `Ctrl`+wheel. -- **Command bar**: the buttons on the right edge: **Open Project**, **Close Project**, **Add**, **Delete**, **Cut**, **Copy** and **Paste**. **Close Project** is available only while more than one project is open. +- **Command bar**: the buttons on the right edge: **Open Project**, **Close Project**, **Add**, **Delete**, **Cut**, **Copy** and **Paste**. **Close Project** closes the selected open project (closing the last open project leaves no project open). - **Project Details**: tabs for the selected project: **General**, **Notebook**, **Budget Log**, **Spending Plan**, **Budget Summary**, **Dates**, **Funding**, **Codes**, **Defaults**, **Resources**, **Settings** and **Calculations**. Select an EPS folder instead and the tabs show its totals. The project **Status** (Planned, Active, Inactive, What-If, Requested) is set on the **General** tab. ## How the rollups are worked out @@ -27,7 +27,7 @@ The Projects view lists every project in your workspace, filed under the folders 5. Click a column title to sort the projects inside each folder by it; click again for the reverse order, a third time to go back to Project ID order. 6. To see all jobs of one status together, choose **Group by Status** on the **Layout** menu; to leave out, say, inactive projects, clear **Inactive** under **Show Status**. -Right-click a row or a column title for the same commands except **Close Project**, plus **Project Details** (shows or hides the details), **Edit Project Details** (opens the **General** tab), **Columns**, **Table Font and Row...**, **Filter By**, **Group and Sort By**, **Expand All**, **Collapse All** and **Collapse To...**. Right-click the chart or its date header for **Project Details**. +Right-click a row or a column title for the same commands (including **Open Project**, **Close Project** and **Delete**), plus **Project Details** (shows or hides the details), **Edit Project Details** (opens the **General** tab), **Columns**, **Table Font and Row...**, **Filter By**, **Group and Sort By**, **Expand All**, **Collapse All** and **Collapse To...**. Right-click the chart or its date header for **Project Details**. - **Filter By**: **All**, **Currently Open** (the projects open now), or under **Status** one status at a time, or **Non What-if** (every project but the what-if ones). - **Group and Sort By**: **EPS** (the folder tree), **List** (no bands), **Responsible Manager**, **Status** or **Project Leveling Priority**. - **Table Font and Row...** sets this table's own font, cell colour and row height, with the same window as the Activities table. `View > Expand All`, `Collapse All` and `Collapse To...` work here too. @@ -41,7 +41,7 @@ In the open project's row, click a selected cell or press `F2` to type **Project > On the **Funding** tab of the open project, **Add** and **Delete** list which funding sources pay for it, with an **Amount** and **Fund Share** for each; click a cell to edit it. Each change is one undo step. If no funding sources exist yet, **Add** opens Funding Sources first. > Only the details of the project you are working on can be edited. Other projects' tabs are shown read-only, and their **Funding** tab is empty. > Fill Down (`Ctrl+E`, `Edit > Fill Down` or the right-click menu) works on the **Project Name** column: select two or more projects with `Shift` or `Ctrl`, and the name of the row you clicked first goes to the others as one undo step. Only the project you are working on takes a new name; the others are skipped and the status bar says so. On the other columns Fill Down is greyed. -> A project must be closed before it can be deleted. **Delete** on a folder row deletes the folder with the folders and projects under it, after one question ([Project Folders (EPS)](project-folders)). +> **Delete** works on both open and closed projects: an open project is saved and closed after confirmation before removal. Deleting the last project in the workspace leaves an empty workspace (no project open) without re-creating the sample on restart. **Delete** on a folder row deletes the folder with the folders and projects under it, after one question ([Project Folders (EPS)](project-folders)). > Deleting the sample project RIVERBEND that a new workspace starts on also removes the calendars, resources, codes, notebook topics and other shared rows only the sample uses. A row another project uses stays, and a row of yours that was named `_1` because the sample held `` gets its own name back. Undo puts all of it back. > The **Data Date** on the **Dates** tab can be typed or picked here, as in the Schedule dialog (`F9`). Any date is accepted, earlier than the current one included; nothing asks or refuses. The change is one undo step and moves no activity: schedule afterwards to recalculate the dates from it. > On the **Settings** tab, **Define Critical Activities** decides which activities count as critical: those with total float at or below the value you type, or those on the longest path. It is the same setting as in Schedule Options; the activity table, the bars, the critical filters and reports all follow it. Each change is one undo step. diff --git a/desktop/src/baselines/mod.rs b/desktop/src/baselines/mod.rs index 489219c..3f165a7 100644 --- a/desktop/src/baselines/mod.rs +++ b/desktop/src/baselines/mod.rs @@ -215,6 +215,53 @@ pub(crate) fn add_plan_baseline( Ok(row.id) } +/// Store a second baseline (e.g. a mid-project rebaseline of the first-run +/// sample) and assign it as the Secondary user baseline alongside `primary`. +#[allow(clippy::too_many_arguments)] +pub(crate) fn add_secondary_baseline( + c: &rusqlite::Connection, + parent: i64, + project: &ProjectData, + primary: i64, + revision: &Document, + name: &str, + baseline_type: &str, + stamp: &str, +) -> Result { + store::ensure(c)?; + let pid = project.model.project.proj_id; + let rows = store::list(c, parent)?; + let key = next_key(&project.updated_document(), pid, &rows); + let short = format!("{} - B2", project.model.project.name); + let copy = xb::copy_as_baseline(revision, pid, key, &short, name, stamp); + let info = xb::baseline_info(©, key); + let mut row = BaselineRow { + id: 0, + parent, + project_key: key, + short_name: short, + name: name.into(), + baseline_type: baseline_type.into(), + data_date: info.data_date, + added: stamp.into(), + updated: stamp.into(), + xer: copy.text(), + windows_encoding: project.document.windows_encoding, + import_batch: None, + }; + row.id = store::put(c, &row)?; + store::set_user_baselines( + c, + parent, + UserBaselines([ + Choice::Baseline(primary), + Choice::Baseline(row.id), + Choice::None, + ]), + )?; + Ok(row.id) +} + /// Store the baselines that a file carries for project `pid` (PROJECT rows /// whose `orig_proj_id` is `pid`) under workspace project `parent`. Baselines /// already stored with the same project id are kept as they are. Returns how @@ -344,6 +391,9 @@ impl App { /// The open project's workspace row, if it has been saved. pub(crate) fn workspace_row(&self) -> Option { + if self.open_set.empty { + return None; + } let key = ( self.project.source_name.clone(), self.project.model.project.proj_id, @@ -360,6 +410,9 @@ impl App { } fn ensure_workspace_row(&mut self) -> Result { + if self.open_set.empty { + return Err("No project is open.".into()); + } if let Some(id) = self.workspace_row() { return Ok(id); } diff --git a/desktop/src/details/assign_kit.rs b/desktop/src/details/assign_kit.rs index 2a61247..7fe764d 100644 --- a/desktop/src/details/assign_kit.rs +++ b/desktop/src/details/assign_kit.rs @@ -121,6 +121,34 @@ impl App { selected: &mut Option, size: Vec2, paint: &mut dyn FnMut(&mut egui::Ui, usize, usize, bool), + ) -> ListOut { + self.assign_list_with_menu( + ui, + dialog, + grid_id, + cols, + keys, + selected, + size, + paint, + &mut |_, _| {}, + ) + } + + /// [`Self::assign_list`] with a right-click context menu handler (`row` is + /// the clicked line, or `None` for the empty area). + #[allow(clippy::too_many_arguments)] + pub(super) fn assign_list_with_menu( + &mut self, + ui: &mut egui::Ui, + dialog: &'static str, + grid_id: &str, + cols: &[(&str, f32)], + keys: &[Option], + selected: &mut Option, + size: Vec2, + paint: &mut dyn FnMut(&mut egui::Ui, usize, usize, bool), + menu: &mut dyn FnMut(&mut egui::Ui, Option), ) -> ListOut { let rows = self.detail.assign_rows.entry(dialog).or_default(); let shown = rows.shown(selected, keys); @@ -132,10 +160,9 @@ impl App { shown.current, &shown.rows, size, - &mut |ui, ev, sel| { - if let Ev::Cell(r, c) = ev { - paint(ui, r, c, sel); - } + &mut |ui, ev, sel| match ev { + Ev::Cell(r, c) => paint(ui, r, c, sel), + Ev::Menu(row) => menu(ui, row), }, ); if let Some(Some(key)) = out.clicked.and_then(|r| keys.get(r)) { diff --git a/desktop/src/details/mod.rs b/desktop/src/details/mod.rs index 8ceb833..7745ffb 100644 --- a/desktop/src/details/mod.rs +++ b/desktop/src/details/mod.rs @@ -269,14 +269,91 @@ pub struct Customize { /// Step fields copied with the Steps context menu. pub use openxer_xer::edit::steps::StepCopy; +/// Filter applied inside Assign Predecessors / Successors. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum PickerFilter { + #[default] + All, + CurrentProject, + NotStarted, + InProgress, + Completed, + Critical, +} + +/// Grouping mode inside Assign Predecessors / Successors. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum PickerGroup { + /// Follow the activity table's WBS/band layout (default). + #[default] + Wbs, + /// Flat activity list with no grouping bands. + List, + /// Grouped by Activity Status. + Status, +} + +/// Optional extra columns toggled from the Assign Predecessors / Successors +/// right-click Columns submenu. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub enum PickerColumn { + Status, + OriginalDuration, + Start, + Finish, + TotalFloat, +} + +impl PickerColumn { + pub const ALL: [Self; 5] = [ + Self::Status, + Self::OriginalDuration, + Self::Start, + Self::Finish, + Self::TotalFloat, + ]; + + pub fn key(self) -> &'static str { + match self { + Self::Status => "col_status", + Self::OriginalDuration => "col_orig_dur", + Self::Start => "col_start", + Self::Finish => "col_finish", + Self::TotalFloat => "col_total_float", + } + } + + pub fn label(self) -> &'static str { + match self { + Self::Status => "Activity Status", + Self::OriginalDuration => "Original Duration", + Self::Start => "Start", + Self::Finish => "Finish", + Self::TotalFloat => "Total Float", + } + } + + pub fn width(self) -> f32 { + match self { + Self::Status => 85., + Self::OriginalDuration => 78., + Self::Start => 84., + Self::Finish => 84., + Self::TotalFloat => 72., + } + } +} + /// What the relationship picker's lines depend on: the search text, the -/// project's undo snapshot, the table's Group and Sort, and the activities -/// that take the relationship. +/// project's undo snapshot, the table's Group and Sort, the picker's own +/// filter/grouping, and the activities that take the relationship. #[derive(Clone, Debug, PartialEq)] pub struct PickerLinesKey { pub query: String, pub serial: u64, pub group_sort: crate::grid::layout::GroupSort, + pub filter: PickerFilter, + pub group: PickerGroup, pub targets: Vec, pub collapsed: BTreeSet, } @@ -289,11 +366,21 @@ pub struct DetailState { pub rows: [Option; 2], context: Option<(i64, DetailTab)>, pub picker: Option, - /// Assign Predecessors / Successors: the lines of the last build and - /// what they were built for (see `relationship_picker`). - pub picker_lines: Option<(PickerLinesKey, std::rc::Rc>)>, + /// Assign Predecessors / Successors: the lines of the last build, all + /// band keys (for Collapse All), and what they were built for. + pub picker_lines: Option<( + PickerLinesKey, + std::rc::Rc>, + Vec, + )>, /// Bands folded shut in Assign Predecessors / Successors (band keys). pub picker_collapsed: BTreeSet, + /// Filter By choice in Assign Predecessors / Successors. + pub picker_filter: PickerFilter, + /// Group and Sort By choice in Assign Predecessors / Successors. + pub picker_group: PickerGroup, + /// Optional extra columns shown in Assign Predecessors / Successors. + pub picker_columns: BTreeSet, /// The Activity Codes dictionary was opened from Assign: when it closes /// with code values to assign, the code picker opens. pub assign_codes_after: bool, @@ -356,6 +443,9 @@ impl Default for DetailState { picker: None, picker_lines: None, picker_collapsed: BTreeSet::new(), + picker_filter: PickerFilter::All, + picker_group: PickerGroup::Wbs, + picker_columns: BTreeSet::new(), assign_codes_after: false, assign: None, assign_for: None, diff --git a/desktop/src/details/schedule_tabs.rs b/desktop/src/details/schedule_tabs.rs index 34d323e..cbe802b 100644 --- a/desktop/src/details/schedule_tabs.rs +++ b/desktop/src/details/schedule_tabs.rs @@ -1455,55 +1455,130 @@ impl App { // the search text, the project, Group and Sort and the selection stay // as they are; with several projects open they are built each frame. let multi = self.open_set.multi(); + let active_rows = self.active_rows(); + let filter = self.detail.picker_filter; + let group_mode = self.detail.picker_group; + let extra_cols: Vec = self.detail.picker_columns.iter().copied().collect(); // Find looks inside folded bands too. - let folded = if query.trim().is_empty() { - self.detail.picker_collapsed.clone() - } else { + let searching = !query.trim().is_empty(); + let folded = if searching { BTreeSet::new() + } else { + self.detail.picker_collapsed.clone() + }; + let group_override = match group_mode { + PickerGroup::Wbs => None, + PickerGroup::List => { + let mut g = self.grid.layout.group_sort.clone(); + g.levels.clear(); + Some(g) + } + PickerGroup::Status => { + let mut g = self.grid.layout.group_sort.clone(); + g.levels = vec![crate::grid::layout::GroupLevel { + column: "status".into(), + to_level: None, + indent: true, + interval: String::new(), + }]; + Some(g) + } }; let key = self.shown_serial().map(|serial| PickerLinesKey { query: query.clone(), collapsed: folded.clone(), serial, group_sort: self.grid.layout.group_sort.clone(), + filter, + group: group_mode, targets: std::iter::once(activity) .chain(targets.iter().copied()) .collect(), }); let kept = match (&key, &self.detail.picker_lines) { - (Some(key), Some((built_for, lines))) if key == built_for => Some(lines.clone()), + (Some(key), Some((built_for, lines, bands))) if key == built_for => { + Some((lines.clone(), bands.clone())) + } _ => None, }; - let lines = kept.unwrap_or_else(|| { - let lines = std::rc::Rc::new( - self.picker_lines(query, &folded, &|k| k == activity || targets.contains(&k)), - ); - self.detail.picker_lines = key.map(|key| (key, lines.clone())); - lines + let (lines, all_band_keys) = kept.unwrap_or_else(|| { + let shown_data = self.shown(); + let crit_def = self.critical_definition(); + let (built_lines, bands) = + self.picker_lines_with(query, &folded, group_override.clone(), &|k| { + if k == activity || targets.contains(&k) { + return true; + } + let a = &shown_data.model.activities[k]; + match filter { + PickerFilter::All => false, + PickerFilter::CurrentProject => active_rows.is_some_and(|n| k >= n), + PickerFilter::NotStarted => a.status != StatusType::NotStarted, + PickerFilter::InProgress => a.status != StatusType::InProgress, + PickerFilter::Completed => a.status != StatusType::Completed, + PickerFilter::Critical => !crate::grid::columns::is_critical(a, crit_def), + } + }); + let lines = std::rc::Rc::new(built_lines); + self.detail.picker_lines = key.map(|key| (key, lines.clone(), bands.clone())); + (lines, bands) }); let all = self.shown(); + let origin = all.model.origin_serial; + let leveled = all.model.options.do_level; let projects: Vec = self .open_projects() .iter() .map(|p| p.model.project.name.clone()) .collect(); - let texts: Vec<[String; 3]> = lines + let texts: Vec> = lines .iter() .map(|line| match line { - PickLine::Band { label, .. } => [String::new(), label.clone(), String::new()], + PickLine::Band { label, .. } => vec![label.clone()], PickLine::Activity(k) => { - let project = self - .open_set - .composite - .as_ref() - .and_then(|c| c.origin.get(*k)) - .and_then(|&(slot, _)| projects.get(slot).cloned()) - .unwrap_or_default(); - [ - project, - all.model.activities[*k].task_code.clone(), - all.name(*k).to_string(), - ] + let a = &all.model.activities[*k]; + let mut row = Vec::with_capacity(3 + extra_cols.len()); + if multi { + let project = self + .open_set + .composite + .as_ref() + .and_then(|c| c.origin.get(*k)) + .and_then(|&(slot, _)| projects.get(slot).cloned()) + .unwrap_or_default(); + row.push(project); + } + row.push(a.task_code.clone()); + row.push(all.name(*k).to_string()); + let periods = format::activity_periods(all, *k); + for col in &extra_cols { + let value = match col { + PickerColumn::Status => match a.status { + StatusType::NotStarted => "Not Started".into(), + StatusType::InProgress => "In Progress".into(), + StatusType::Completed => "Completed".into(), + }, + PickerColumn::OriginalDuration => { + let orig = all + .details + .get(&a.task_id) + .map_or(a.rem, |d| d.original_duration); + format::duration(orig, periods) + } + PickerColumn::Start => { + format::date(origin, displayed_start(a, leveled)) + } + PickerColumn::Finish => { + format::date(origin, displayed_finish(a, leveled)) + } + PickerColumn::TotalFloat => a + .total_float + .map(|f| format::duration(f, periods)) + .unwrap_or_default(), + }; + row.push(value); + } + row } }) .collect(); @@ -1525,6 +1600,23 @@ impl App { let boxes = std::cell::RefCell::new(Vec::<(usize, Rect)>::new()); let mut fold = None; let mut double = None; + let mut expand_all = false; + let mut collapse_all = false; + let mut copy_rows = false; + let mut open_table_font = false; + let mut next_filter = None; + let mut next_group = None; + let mut toggle_col = None; + let mut search_focused = false; + let has_bands = !all_band_keys.is_empty() && !searching; + let can_expand = has_bands + && all_band_keys + .iter() + .any(|k| self.detail.picker_collapsed.contains(k)); + let can_collapse = has_bands + && all_band_keys + .iter() + .any(|k| !self.detail.picker_collapsed.contains(k)); const DIALOG: &str = "assign_relationship"; let title = if *predecessor { "Assign Predecessors" @@ -1550,11 +1642,26 @@ impl App { PickLine::Band { .. } => None, }) .collect(); + let mut columns: Vec<(&str, f32)> = if multi { + vec![ + ("Project ID", 90.), + ("Activity ID", 90.), + ("Activity Name", 240.), + ] + } else { + vec![("Activity ID", 90.), ("Activity Name", 240.)] + }; + for col in &extra_cols { + columns.push((col.label(), col.width())); + } + let extra_width: f32 = extra_cols.iter().map(|c| c.width()).sum(); + let list_width = (if multi { 530. } else { 440. } + extra_width).min(780.); let mut choice = selected.map(|k| k as i64); let (open, clicked) = self.assign_window(ctx, &window, |app, ui| { ui.horizontal(|ui| { ui.label("Find"); let response = ui.add(egui::TextEdit::singleline(query).desired_width(220.)); + search_focused = response.has_focus(); app.action("picker_search", &response); if targets.len() > 1 { ui.label(format!( @@ -1563,26 +1670,20 @@ impl App { )); } }); - let columns: &[(&str, f32)] = if multi { - &[ - ("Project ID", 90.), - ("Activity ID", 90.), - ("Activity Name", 240.), - ] - } else { - &[("Activity ID", 90.), ("Activity Name", 240.)] - }; - let out = app.assign_list( + let current_choice = choice; + let out = app.assign_list_with_menu( ui, DIALOG, "relationship_picker", - columns, + &columns, &keys, &mut choice, - Vec2::new(if multi { 530. } else { 440. }, 210.), + Vec2::new(list_width, 210.), &mut |ui, r, c, _| { let Some((fill, ink)) = band_colors[r] else { - cell(ui, &texts[r][c + usize::from(!multi)]); + if let Some(t) = texts[r].get(c) { + cell(ui, t); + } return; }; // A band: its color across the row and its caption @@ -1618,12 +1719,106 @@ impl App { .text( Pos2::new(band_left.get() + 16. + indent, rect.center().y), Align2::LEFT_CENTER, - &texts[r][1], + &texts[r][0], form::font(), ink, ); } }, + &mut |ui, row| { + use crate::chrome::{Icon, Item}; + let mut m = crate::context_menu::Menu::on(ui, "picker_menu"); + let row_is_activity = + row.and_then(|r| keys.get(r)).is_some_and(Option::is_some); + let can_copy = current_choice.is_some() || row_is_activity; + if m.item_if( + "copy", + Item::new("Copy").key("Ctrl+C").icon(Icon::Copy), + can_copy, + ) { + copy_rows = true; + } + m.submenu("columns", Item::new("Columns").icon(Icon::Columns), |m| { + for col in PickerColumn::ALL { + if m.check(col.key(), col.label(), extra_cols.contains(&col)) { + toggle_col = Some(col); + } + } + }); + if m.item( + "table_font", + Item::new("Table Font and Row...").icon(Icon::TableFont), + ) { + open_table_font = true; + } + m.separator(); + m.submenu( + "filter_by", + Item::new("Filter By").icon(Icon::Filter), + |m| { + let choices = [ + ("filter_all", "All Activities", PickerFilter::All), + ( + "filter_current_project", + "Current Project's Activities", + PickerFilter::CurrentProject, + ), + ( + "filter_not_started", + "Not Started", + PickerFilter::NotStarted, + ), + ( + "filter_in_progress", + "In Progress", + PickerFilter::InProgress, + ), + ("filter_completed", "Completed", PickerFilter::Completed), + ("filter_critical", "Critical", PickerFilter::Critical), + ]; + for (k, label, f) in choices { + if m.check(k, label, filter == f) { + next_filter = Some(f); + } + } + }, + ); + m.submenu( + "group_by", + Item::new("Group and Sort By").icon(Icon::GroupSort), + |m| { + let choices = [ + ("group_wbs", "WBS", PickerGroup::Wbs), + ("group_list", "List", PickerGroup::List), + ("group_status", "Activity Status", PickerGroup::Status), + ]; + for (k, label, g) in choices { + if m.check(k, label, group_mode == g) { + next_group = Some(g); + } + } + }, + ); + m.separator(); + if m.item_if( + "expand_all", + Item::new("Expand All") + .key("Ctrl+Num +") + .icon(Icon::ExpandAll), + can_expand, + ) { + expand_all = true; + } + if m.item_if( + "collapse_all", + Item::new("Collapse All") + .key("Ctrl+Num -") + .icon(Icon::CollapseAll), + can_collapse, + ) { + collapse_all = true; + } + }, ); double = out.double; // A click on a band's box, or a double click on the band, folds @@ -1664,12 +1859,68 @@ impl App { } }); }); + // Keyboard shortcuts for Expand All, Collapse All and Copy while open. + if open && !search_focused { + let (k_expand, k_collapse, k_copy) = ctx.input(|i| { + let cmd = i.modifiers.command && !i.modifiers.alt; + ( + cmd && (i.key_pressed(Key::Plus) || i.key_pressed(Key::Equals)), + cmd && i.key_pressed(Key::Minus), + cmd && i.key_pressed(Key::C), + ) + }); + if k_expand && can_expand { + expand_all = true; + } + if k_collapse && can_collapse { + collapse_all = true; + } + if k_copy && choice.is_some() { + copy_rows = true; + } + } *selected = choice.map(|k| k as usize); - if let Some(key) = fold { + if expand_all { + self.detail.picker_collapsed.clear(); + } else if collapse_all { + self.detail.picker_collapsed = all_band_keys.into_iter().collect(); + } else if let Some(key) = fold { if !self.detail.picker_collapsed.remove(&key) { self.detail.picker_collapsed.insert(key); } } + if let Some(f) = next_filter { + self.detail.picker_filter = f; + } + if let Some(g) = next_group { + if self.detail.picker_group != g { + self.detail.picker_group = g; + self.detail.picker_collapsed.clear(); + } + } + if let Some(col) = toggle_col { + if !self.detail.picker_columns.remove(&col) { + self.detail.picker_columns.insert(col); + } + } + if copy_rows { + let picked = self.assign_picked(DIALOG, choice); + let mut out_lines = Vec::with_capacity(picked.len()); + for k in picked { + if let Some(row_idx) = keys.iter().position(|x| *x == Some(k)) { + if let Some(cells) = texts.get(row_idx) { + out_lines.push(cells.join("\t")); + } + } + } + if !out_lines.is_empty() { + ctx.copy_text(out_lines.join("\n")); + self.status = "Copied to clipboard".into(); + } + } + if open_table_font { + self.open_table_font_for(crate::layout_opts::TableTarget::Activities); + } // Assign takes every selected activity; a double click the one. let mut picks: Vec = match clicked { Some("picker_assign") => self diff --git a/desktop/src/first_run.rs b/desktop/src/first_run.rs index f6ad784..713cf4d 100644 --- a/desktop/src/first_run.rs +++ b/desktop/src/first_run.rs @@ -11,6 +11,23 @@ use super::*; const NOTED_KEY: &str = "first_run_noted"; +/// Set once the workspace has been initialized (seeded with the sample or had +/// a project deleted), so emptying the workspace does not re-seed the sample +/// on the next start. +pub(crate) const WORKSPACE_SEEDED_KEY: &str = "workspace_seeded"; + +pub(crate) fn mark_seeded(store: &Store) { + let _ = store.set_preference(WORKSPACE_SEEDED_KEY, "1"); +} + +pub(crate) fn was_seeded(store: &Store) -> bool { + store + .preference(WORKSPACE_SEEDED_KEY) + .ok() + .flatten() + .is_some() + || store.preference(NOTED_KEY).ok().flatten().is_some() +} /// The status message of the first start. It stays short enough to fit in /// the status bar's message panel beside the AI agents hint on a 1366 px /// wide window (`ai_agents::tests::hint_fits_beside_the_first_run_note`): @@ -21,20 +38,22 @@ const NOTED_KEY: &str = "first_run_noted"; pub(crate) const SAMPLE_NOTE: &str = "RIVERBEND is a sample project. Use File > Import... or drop an XER file."; -/// Store the first-run sample's as-planned copy `plan` as its baseline and -/// note which dictionary rows are the sample's: those the workspace -/// dictionary has now and had not `before` the sample was stored. +/// Store the first-run sample's as-planned copy `plan` (Project and Primary +/// baseline) and mid-project copy `revision` (Secondary baseline), and note +/// which dictionary rows are the sample's: those the workspace dictionary has +/// now and had not `before` the sample was stored. pub(crate) fn install_sample( store: &mut Store, project: &mut ProjectData, plan: &ProjectData, + revision: &ProjectData, before: &openxer_xer::Document, ) -> Result<(), String> { let row = store .id_of(&project.source_name, project.model.project.proj_id) .ok_or("the sample is not in the workspace")?; let start = openxer_xer::date_string(plan.model.origin_serial, plan.model.project.plan_start); - crate::baselines::add_plan_baseline( + let primary = crate::baselines::add_plan_baseline( store.connection(), row, project, @@ -42,6 +61,20 @@ pub(crate) fn install_sample( "As planned at notice to proceed", &start, )?; + let rev_date = openxer_xer::date_string( + revision.model.origin_serial, + revision.model.project.data_date, + ); + crate::baselines::add_secondary_baseline( + store.connection(), + row, + project, + primary, + &revision.updated_document(), + "Mid-August Rebaseline (Aug 2026)", + "2", + &rev_date, + )?; if store.shared()? { openxer_automation::workspace_db::record_sample(store.connection(), row, before)?; } @@ -73,6 +106,9 @@ impl App { /// The sample is the only project in a workspace that has not shown the /// note yet: say what it is, once. fn note_first_run(&mut self) { + if !self.has_open_project() { + return; + } if self.store.preference(NOTED_KEY).ok().flatten().is_some() { return; } diff --git a/desktop/src/frame.rs b/desktop/src/frame.rs index 8aef652..c56dcfc 100644 --- a/desktop/src/frame.rs +++ b/desktop/src/frame.rs @@ -67,11 +67,15 @@ impl App { } /// `OpenXER : ()`, sent only when it changes. fn window_title(&mut self, ctx: &egui::Context) { - let title = format!( - "OpenXER : {} ({})", - self.project.model.project.name, - views::project_title(&self.project) - ); + let title = if self.open_set.empty { + "OpenXER".to_string() + } else { + format!( + "OpenXER : {} ({})", + self.project.model.project.name, + views::project_title(&self.project) + ) + }; let key = egui::Id::new("openxer_window_title"); if ctx.data(|d| d.get_temp::(key)).as_ref() != Some(&title) { ctx.send_viewport_cmd(egui::ViewportCommand::Title(title.clone())); @@ -368,10 +372,6 @@ impl App { /// Texts of the fixed status panels, in order. pub(super) fn status_panels(&self) -> Vec { - let data_date = format::date( - self.project.model.origin_serial, - self.project.model.project.data_date, - ); let user = std::env::var("USERNAME") .or_else(|_| std::env::var("USER")) .unwrap_or_else(|_| "local".into()); @@ -381,6 +381,17 @@ impl App { .file_name() .map(|name| name.to_string_lossy().into_owned()) .unwrap_or_else(|| "workspace".into()); + if self.open_set.empty { + return vec![ + "No project open".into(), + format!("User: {user}"), + format!("Workspace: {db}"), + ]; + } + let data_date = format::date( + self.project.model.origin_serial, + self.project.model.project.data_date, + ); let mut panels = vec![ format!("Data Date: {data_date}"), format!("Baseline: {}", self.baseline_label()), diff --git a/desktop/src/grid/mod.rs b/desktop/src/grid/mod.rs index 5a9be1c..4dc3e2f 100644 --- a/desktop/src/grid/mod.rs +++ b/desktop/src/grid/mod.rs @@ -335,23 +335,37 @@ impl App { ) } - /// The lines of an activity picker: every activity whose ID or name - /// contains `query`, under the bands and in the order the table's Group - /// and Sort put them now. A picker offers every activity, so the - /// layout's filter, the WBS filter and the table's collapsed bands do - /// not apply; `collapsed` holds the bands folded in the picker itself. - /// Activities `skip` names are left out, and so is a band left empty. + #[cfg(test)] pub(crate) fn picker_lines( &self, query: &str, collapsed: &BTreeSet, skip: &dyn Fn(usize) -> bool, ) -> Vec { + self.picker_lines_with(query, collapsed, None, skip).0 + } + + /// The lines of an activity picker: every activity whose ID or name + /// contains `query`, under the bands and in the order of `group_override` + /// (or the table's Group and Sort when `None`). A picker offers every + /// activity, so the layout's filter, the WBS filter and the table's + /// collapsed bands do not apply; `collapsed` holds the bands folded in + /// the picker itself. Activities `skip` names are left out, and so is a + /// band left empty. Also returns every band key in the uncollapsed tree + /// (for Collapse All). + pub(crate) fn picker_lines_with( + &self, + query: &str, + collapsed: &BTreeSet, + group_override: Option, + skip: &dyn Fn(usize) -> bool, + ) -> (Vec, Vec) { let shown = self.shown(); let catalog = columns::catalog(shown); let ix = self.shared_index_at(self.shown_serial()); let layout = layout::Layout { filter: filters::FilterSelection::default(), + group_sort: group_override.unwrap_or_else(|| self.grid.layout.group_sort.clone()), ..self.grid.layout.clone() }; let built = group::build( @@ -366,7 +380,7 @@ impl App { users: &self.grid.user_filters, }, ); - built + let lines: Vec = built .rows .iter() .filter_map(|row| match *row { @@ -384,7 +398,47 @@ impl App { }) } }) - .collect() + .collect(); + // Every non-empty band key (including nested bands inside folded + // parents), so Collapse All collapses every level cleanly. + let all_bands: Vec = if collapsed.is_empty() { + lines + .iter() + .filter_map(|l| match l { + PickLine::Band { key, .. } => Some(key.clone()), + PickLine::Activity(_) => None, + }) + .collect() + } else { + let empty = BTreeSet::new(); + let uncollapsed = group::build( + shown, + &ix, + &catalog, + &layout, + &Scope { + query, + wbs_filter: None, + collapsed: &empty, + users: &self.grid.user_filters, + }, + ); + uncollapsed + .rows + .iter() + .filter_map(|row| match *row { + Row::Group(b) => { + let band = &uncollapsed.bands[b]; + band.members + .iter() + .any(|&m| !skip(m)) + .then(|| band.key.clone()) + } + Row::Activity(_) => None, + }) + .collect() + }; + (lines, all_bands) } /// Table rows of the active project in display order (rows of other open diff --git a/desktop/src/help/tests.rs b/desktop/src/help/tests.rs index 87d6557..a3a4112 100644 --- a/desktop/src/help/tests.rs +++ b/desktop/src/help/tests.rs @@ -476,7 +476,12 @@ fn whats_new_shows_the_changelog_newest_release_first() { _ => None, }) .collect(); - assert_eq!(headings.first(), Some(&"Unreleased"), "{headings:?}"); + assert!( + headings + .first() + .is_some_and(|h| *h == "Unreleased" || h.starts_with(env!("CARGO_PKG_VERSION"))), + "{headings:?}" + ); let bullets = t .blocks .iter() diff --git a/desktop/src/main.rs b/desktop/src/main.rs index 9d8634c..17b2406 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -485,6 +485,7 @@ fn main() -> eframe::Result<()> { lock, store, project, + empty, pending, replace_prompt, error: initial_error, @@ -493,11 +494,15 @@ fn main() -> eframe::Result<()> { std::process::exit(1) }; chrome::preload_fonts(); - let initial_title = format!( - "OpenXER : {} ({})", - project.model.project.name, - views::project_title(&project) - ); + let initial_title = if empty { + "OpenXER".to_string() + } else { + format!( + "OpenXER : {} ({})", + project.model.project.name, + views::project_title(&project) + ) + }; let saved_place = window_place::load(&store); window_place::seed(saved_place); // On Windows, winit 0.30 calls ShowWindow(SW_MAXIMIZE) -> ShowWindow(SW_HIDE) @@ -521,8 +526,15 @@ fn main() -> eframe::Result<()> { let cloak = window_place::StartupCloak::engage(defer_maximize); let mut app = App::new(&cc.egui_ctx, store, project); app.startup_cloak = cloak; - app.adopt_file_baselines(); - app.restore_open_set(); + if empty { + app.enter_empty_workspace(); + app.status = + "No project open. Use File > New... or File > Import... to add a project." + .into(); + } else { + app.adopt_file_baselines(); + app.restore_open_set(); + } #[cfg(debug_assertions)] { app.capture_dir = args @@ -566,6 +578,9 @@ struct Startup { lock: store::WorkspaceLock, store: Store, project: ProjectData, + /// The workspace has no project to open (its projects were deleted); start + /// in the empty-workspace state on the Projects view. + empty: bool, pending: Option<(Document, String)>, /// A project read from a file the workspace already has a copy of (the /// copy's workspace id), waiting for the user to choose. @@ -622,22 +637,28 @@ fn launch(args: &[std::ffi::OsString], fatal: impl FnOnce(&str)) -> Option saved, + Ok(None) if file.is_none() && first_run::was_seeded(&store) => { + empty = true; + open_set::empty_placeholder() + } Ok(None) => { - let (current, plan) = fallback_sample(&store); - fresh_sample = Some(plan); + first_run::mark_seeded(&store); + let (current, plan, revision) = fallback_sample(&store); + fresh_sample = Some((plan, revision)); current } Err(error) => { initial_error = Some(format!( "The project open when OpenXER last closed could not be opened, so the sample project is shown instead. That project is still in the workspace: {error}" )); - let (current, plan) = fallback_sample(&store); - fresh_sample = Some(plan); + let (current, plan, revision) = fallback_sample(&store); + fresh_sample = Some((plan, revision)); current } }; @@ -665,6 +686,7 @@ fn launch(args: &[std::ffi::OsString], fatal: impl FnOnce(&str)) -> Option initial_error = Some(error), @@ -678,47 +700,52 @@ fn launch(args: &[std::ffi::OsString], fatal: impl FnOnce(&str)) -> Option initial_error = Some(error), } } - if project - .model - .activities - .iter() - .all(|a| a.early_start.is_none()) - { - if let Err(error) = schedule_model(&mut project.model, &project.resources) { - initial_error = Some(error); - } - } - // The dictionary before the sample joins it: what the sample adds is - // the sample's own, and goes when the sample is removed. - let dictionary_before = fresh_sample - .as_ref() - .and_then(|_| store.dictionary().ok().map(|(d, _)| d)); - // The project starts as the workspace stores it; a failed save is shown - // when the window opens rather than lost. - match store.save_stored(&project) { - Ok((_, Some(doc))) => { - if let Err(error) = store::adopt_document(&mut project, doc) { - note(&mut initial_error, error); + if !empty { + if project + .model + .activities + .iter() + .all(|a| a.early_start.is_none()) + { + if let Err(error) = schedule_model(&mut project.model, &project.resources) { + initial_error = Some(error); } } - Ok(_) => {} - Err(error) => note( - &mut initial_error, - format!("The project could not be saved to the workspace: {error}"), - ), - } - if let (Some(plan), Some(before)) = (fresh_sample, dictionary_before) { - if let Err(error) = first_run::install_sample(&mut store, &mut project, &plan, &before) { - note( + // The dictionary before the sample joins it: what the sample adds is + // the sample's own, and goes when the sample is removed. + let dictionary_before = fresh_sample + .as_ref() + .and_then(|_| store.dictionary().ok().map(|(d, _)| d)); + // The project starts as the workspace stores it; a failed save is shown + // when the window opens rather than lost. + match store.save_stored(&project) { + Ok((_, Some(doc))) => { + if let Err(error) = store::adopt_document(&mut project, doc) { + note(&mut initial_error, error); + } + } + Ok(_) => {} + Err(error) => note( &mut initial_error, - format!("The sample project's baseline could not be stored: {error}"), - ); + format!("The project could not be saved to the workspace: {error}"), + ), + } + if let (Some((plan, revision)), Some(before)) = (fresh_sample, dictionary_before) { + if let Err(error) = + first_run::install_sample(&mut store, &mut project, &plan, &revision, &before) + { + note( + &mut initial_error, + format!("The sample project's baselines could not be stored: {error}"), + ); + } } } Some(Startup { lock, store, project, + empty, pending, replace_prompt, error: initial_error, @@ -730,7 +757,7 @@ fn launch(args: &[std::ffi::OsString], fatal: impl FnOnce(&str)) -> Option (ProjectData, ProjectData) { +fn fallback_sample(store: &Store) -> (ProjectData, ProjectData, ProjectData) { let sample = openxer_xer::sample_project::sample_project(); let mut p = sample.current; let key = p.model.project.proj_id; @@ -748,7 +775,7 @@ fn fallback_sample(store: &Store) -> (ProjectData, ProjectData) { } p.source_name = name; } - (p, sample.plan) + (p, sample.plan, sample.revision) } #[cfg(test)] diff --git a/desktop/src/open_set/mod.rs b/desktop/src/open_set/mod.rs index 688dd06..7388076 100644 --- a/desktop/src/open_set/mod.rs +++ b/desktop/src/open_set/mod.rs @@ -56,6 +56,11 @@ pub struct Composite { #[derive(Default)] pub struct OpenSet { + /// No project is currently open (the user closed or deleted the last open + /// project, or restarted an emptied workspace). `App.project` holds an + /// unsaved empty placeholder until a project is opened, created or + /// imported. + pub empty: bool, /// Workspace id of the active project (`App.project`). pub active: Option, /// Workspace id of the Default Project. @@ -93,11 +98,70 @@ pub struct OpenSet { impl OpenSet { /// More than one project is open. pub fn multi(&self) -> bool { - !self.parked.is_empty() + !self.empty && !self.parked.is_empty() } } +/// An unsaved empty `ProjectData` kept in `App.project` while no project is +/// open (`OpenSet::empty`). It has no activities and is never written to the +/// workspace database. +pub(crate) fn empty_placeholder() -> ProjectData { + let mut cal = openxer_xer::calendar_data::CalendarData::default(); + for day in 1..=5 { + cal.week[day] = vec![(8 * 60, 12 * 60), (13 * 60, 17 * 60)]; + } + let cal_text = cal.serialize(); + let text = format!( + "ERMHDR\t25.12\t2026-01-01\tProject\tOpenXER\tOpenXER\tdbxDatabaseNoName\tProject Management\tUSD\n\ +%T\tCALENDAR\n\ +%F\tclndr_id\tdefault_flag\tclndr_name\tclndr_type\tday_hr_cnt\tweek_hr_cnt\tmonth_hr_cnt\tyear_hr_cnt\trsrc_private\tclndr_data\n\ +%R\t1\tY\tStandard\tCA_Base\t8\t40\t172\t2000\tN\t{cal_text}\n\ +%T\tPROJECT\n\ +%F\tproj_id\tproj_short_name\tclndr_id\tplan_start_date\tlast_recalc_date\n\ +%R\t1\t\t1\t2026-01-01 08:00\t2026-01-01 08:00\n\ +%E\n" + ); + let doc = openxer_xer::Document::parse(&text).expect("empty placeholder XER"); + ProjectData::from_document(doc, 1, String::new()).expect("empty placeholder loads") +} + impl App { + /// True when at least one project is open. + pub(crate) fn has_open_project(&self) -> bool { + !self.open_set.empty + } + + /// Leave the active project open state and enter an empty workspace + /// (Projects view, no project open). The caller saves or discards the + /// closing project first. + pub(crate) fn enter_empty_workspace(&mut self) { + self.project = empty_placeholder(); + self.open_set.empty = true; + self.open_set.active = None; + self.open_set.default = None; + self.open_set.parked.clear(); + self.open_set.composite = None; + self.open_set.undo.clear(); + self.open_set.redo.clear(); + self.open_set.steps_seen = 0; + self.open_set.version += 1; + self.history = history::History::new(&self.project); + self.records_revision = 0; + self.dirty = false; + self.reset_project_ui(); + self.selected = None; + self.query.clear(); + self.wbs_filter = None; + self.collapsed.clear(); + self.date_edits.clear(); + self.data_date.clear(); + self.must_finish.clear(); + self.saved_projects = self.store.list().unwrap_or_default(); + self.views.projects.invalidate(); + self.show_view(views::MainView::Projects); + self.store.clear_last(); + self.save_open_set(); + } /// What the activity table and the Gantt show: every open project. pub(crate) fn shown(&self) -> &ProjectData { self.open_set @@ -130,6 +194,9 @@ impl App { /// The open projects, the active one first (slot order). pub(crate) fn open_projects(&self) -> Vec<&ProjectData> { + if self.open_set.empty { + return vec![]; + } std::iter::once(&self.project) .chain(self.open_set.parked.iter().map(|p| &p.project)) .collect() @@ -180,6 +247,9 @@ impl App { /// The workspace id of the active project, saving it first if needed. fn ensure_active_id(&mut self) -> Option { + if self.open_set.empty { + return None; + } if self.open_set.active.is_none() { self.open_set.active = self.store.id_of( &self.project.source_name, @@ -483,6 +553,9 @@ impl App { /// Reopen the projects that were open with the active one last time. pub(crate) fn restore_open_set(&mut self) { + if self.open_set.empty { + return; + } let Some(active) = self.ensure_active_id() else { return; }; @@ -501,6 +574,11 @@ impl App { .as_array() .map(|a| a.iter().filter_map(|v| v.as_i64()).collect()) .unwrap_or_default(); + if ids.is_empty() && value["active"].is_null() { + self.enter_empty_workspace(); + self.status = "No project open. Open a project from the Projects view.".into(); + return; + } let mut notes = vec![]; if ids.contains(&active) { notes = self.clear_number_clashes(&ids, &[active]); @@ -606,11 +684,11 @@ impl App { } } - /// File > Close Project: close the active project; another open project - /// (the default one first) becomes active. + /// Close the active project: another open project (the default one first) + /// becomes active, or the workspace enters the empty (no open project) + /// state on the Projects view. pub(crate) fn close_active_project(&mut self) { - if self.open_set.parked.is_empty() { - self.status = "The last open project stays open".into(); + if self.open_set.empty { return; } if self.dirty { @@ -619,6 +697,13 @@ impl App { return; } } + let name = self.project.model.project.name.clone(); + if self.open_set.parked.is_empty() { + self.keep_closing_history(); + self.enter_empty_workspace(); + self.status = format!("{name} closed"); + return; + } let closing = self.open_set.active; let next = self .open_set @@ -626,7 +711,6 @@ impl App { .iter() .position(|p| Some(p.id) == self.open_set.default) .unwrap_or(0); - let name = self.project.model.project.name.clone(); self.activate_parked(next); self.open_set.parked.retain(|p| Some(p.id) != closing); if self.open_set.default == closing || self.open_set.default.is_none() { diff --git a/desktop/src/project_io.rs b/desktop/src/project_io.rs index 5e6b69e..a88347d 100644 --- a/desktop/src/project_io.rs +++ b/desktop/src/project_io.rs @@ -18,6 +18,10 @@ impl App { /// [`App::save`], returning the failure instead of showing it. pub(crate) fn try_save(&mut self) -> Result<(), String> { self.save_view(); + if self.open_set.empty { + self.dirty = false; + return Ok(()); + } // Other open projects first, so the active one is the workspace's last project. self.save_parked()?; match self.store.save_stored(&self.project) { @@ -58,15 +62,18 @@ impl App { self.load_from(p, true); } fn load_from(&mut self, p: ProjectData, file: bool) { - if self.any_dirty() { - self.save(); + if !self.open_set.empty { if self.any_dirty() { - return; + self.save(); + if self.any_dirty() { + return; + } } + self.keep_closing_history(); + // Loading one project replaces the open set. + self.close_parked(); } - self.keep_closing_history(); - // Loading one project replaces the open set. - self.close_parked(); + self.open_set.empty = false; if file { // Only now: the projects saved and closed above still needed it. self.store @@ -291,6 +298,10 @@ impl App { /// Add without the wizard: the row goes in at once and its name cell /// opens for typing. pub(crate) fn new_activity(&mut self) { + if self.open_set.empty { + self.status = "Open or create a project first.".into(); + return; + } let place = self.new_activity_place(); let i = self.insert_new_activity(&place); // The name cell opens with the new name selected: typing replaces @@ -349,7 +360,7 @@ impl App { } if changed { self.records_revision = self.history.revision(); - self.dirty = true; + self.dirty = !self.open_set.empty; self.status = if redo { "Redo" } else { "Undo" }.into(); self.date_edits.clear(); self.edit_cell = None; diff --git a/desktop/src/qa_workflows/context_menus.rs b/desktop/src/qa_workflows/context_menus.rs index a32aac6..1baabdf 100644 --- a/desktop/src/qa_workflows/context_menus.rs +++ b/desktop/src/qa_workflows/context_menus.rs @@ -99,8 +99,9 @@ const WBS_TABLE: [&str; 23] = [ const WBS_CHART: [&str; 1] = ["WBS Details"]; /// The Projects table menu of a project row. -const PROJECTS_TABLE: [&str; 21] = [ +const PROJECTS_TABLE: [&str; 22] = [ "Open Project", + "Close Project", "Project Details", "Edit Project Details", SEP, diff --git a/desktop/src/schedule_dialogs.rs b/desktop/src/schedule_dialogs.rs index 4540a4f..020f68f 100644 --- a/desktop/src/schedule_dialogs.rs +++ b/desktop/src/schedule_dialogs.rs @@ -303,6 +303,10 @@ impl App { /// F9 and Tools > Schedule: open the Schedule dialog. pub(crate) fn open_schedule_dialog(&mut self) { + if self.open_set.empty { + self.status = "Open or create a project before scheduling.".into(); + return; + } if let Some((activity, field)) = self.edit_cell.take() { if !self.apply_cell(activity, field, &self.edit_text.clone()) { return; diff --git a/desktop/src/startup_tests.rs b/desktop/src/startup_tests.rs index 1bd9c28..1086ecd 100644 --- a/desktop/src/startup_tests.rs +++ b/desktop/src/startup_tests.rs @@ -100,7 +100,7 @@ fn a_new_workspace_starts_on_the_sample() { let row = started.store.list().unwrap()[0].0; let c = started.store.connection(); let baselines = crate::baselines::store::list(c, row).unwrap(); - assert_eq!(baselines.len(), 1); + assert_eq!(baselines.len(), 2); assert_eq!( openxer_interchange::baseline::project_value( &started.project.document, @@ -109,11 +109,16 @@ fn a_new_workspace_starts_on_the_sample() { ), baselines[0].project_key.to_string() ); + let ub = crate::baselines::store::user_baselines(c, row).0; assert_eq!( - crate::baselines::store::user_baselines(c, row).0[0], + ub[0], crate::baselines::store::Choice::Baseline(baselines[0].id) ); - // Reopened, it is the same sample with its baseline (no second copy). + assert_eq!( + ub[1], + crate::baselines::store::Choice::Baseline(baselines[1].id) + ); + // Reopened, it is the same sample with its two baselines (no second copy). drop(started); let (again, _) = start(&args(&db)); let again = again.unwrap(); @@ -122,10 +127,39 @@ fn a_new_workspace_starts_on_the_sample() { crate::baselines::store::list(again.store.connection(), row) .unwrap() .len(), - 1 + 2 ); } +/// Deleting the default sample project while it is open and the only project +/// in the workspace leaves an empty workspace, cleans up its dictionary rows, +/// and restarting does not re-create the sample. +#[test] +fn deleting_the_only_sample_project_stays_empty_on_restart() { + let db = temp_db("delete-only-sample"); + let (started, _) = start(&args(&db)); + let started = started.unwrap(); + let sample_row = started.store.list().unwrap()[0].0; + let ctx = egui::Context::default(); + let mut app = App::new(&ctx, started.store, started.project); + app.request_project_delete(sample_row); + let confirm = app.views.projects.delete.as_ref().unwrap(); + assert!(confirm.sample); + assert!(confirm.open); + app.views.projects.delete = None; + app.delete_workspace_project(sample_row, 1.).unwrap(); + assert!(app.open_set.empty); + assert!(app.store.list().unwrap().is_empty()); + drop(app); + drop(started.lock); + // Restarting an emptied workspace opens empty, without re-seeding RIVERBEND. + let (again, told) = start(&args(&db)); + assert_eq!(told, None); + let again = again.unwrap(); + assert!(again.empty); + assert!(again.store.list().unwrap().is_empty()); +} + /// A workspace made by the first start holds the sample project, the /// starter reports and nothing else: no other project, no dictionary row /// the sample did not bring, no imported notebook topic. @@ -161,9 +195,12 @@ fn a_new_workspace_holds_only_the_sample_and_the_starter_reports() { let baselines: i64 = c .query_row("SELECT COUNT(*) FROM baselines", [], |r| r.get(0)) .unwrap(); - assert_eq!(baselines, 1, "the sample's as-planned copy only"); + assert_eq!( + baselines, 2, + "the sample's as-planned and rebaseline copies" + ); // The dictionary is the sample's: every row is noted as the sample's, - // and its notebook topics are the sample's own seven. + // and its notebook topics are the sample's own eight. let (dict, _) = workspace_db::read_dictionary(c).unwrap(); let record = workspace_db::read_sample(c).unwrap().unwrap(); assert_eq!(record.row, started.store.list().unwrap()[0].0); @@ -179,7 +216,8 @@ fn a_new_workspace_holds_only_the_sample_and_the_starter_reports() { "Safety", "Quality and Inspection", "Field Notes", - "Change Notes" + "Change Notes", + "Commissioning Notes" ] ); } @@ -549,7 +587,24 @@ fn the_sample_passes_check_schedule() { let failed: Vec = results .iter() .filter(|r| r.passed == Some(false)) - .map(|r| format!("{} {:?}", r.check.name(), r.value)) + .map(|r| { + let codes: Vec = r + .items + .iter() + .filter_map(|item| match item { + crate::schedule_check::Item::Activity(i) => { + let a = ¤t.model.activities[*i]; + Some(format!( + "{}(tf={}d)", + a.task_code, + a.total_float.unwrap_or(0) / 480 + )) + } + _ => None, + }) + .collect(); + format!("{} {:?} {:?}", r.check.name(), r.value, codes) + }) .collect(); assert!(failed.is_empty(), "{failed:?}"); assert!(results.iter().filter(|r| r.passed == Some(true)).count() >= 13); diff --git a/desktop/src/store.rs b/desktop/src/store.rs index 303a601..72bd909 100644 --- a/desktop/src/store.rs +++ b/desktop/src/store.rs @@ -784,6 +784,11 @@ impl Store { project.model.options.do_level = level; Ok(project) } + pub fn clear_last(&self) { + let _ = self + .connection + .execute("DELETE FROM preferences WHERE key='last_project'", []); + } pub fn last(&self) -> Result, String> { let id: Option = self .connection @@ -794,8 +799,20 @@ impl Store { ) .optional() .map_err(|e| e.to_string())?; - id.map(|s| self.load(s.parse().map_err(|_| "Invalid saved project ID")?)) - .transpose() + let Some(s) = id else { + return Ok(None); + }; + let row_id: i64 = s.parse().map_err(|_| "Invalid saved project ID")?; + let exists: Option = self + .connection + .query_row("SELECT 1 FROM projects WHERE id=?1", [row_id], |r| r.get(0)) + .optional() + .map_err(|e| e.to_string())?; + if exists.is_none() { + self.clear_last(); + return Ok(None); + } + self.load(row_id).map(Some) } } /// One running app's hold on a workspace, so a second app on the same diff --git a/desktop/src/views/command_bar_tests.rs b/desktop/src/views/command_bar_tests.rs index 3372740..7dd58d9 100644 --- a/desktop/src/views/command_bar_tests.rs +++ b/desktop/src/views/command_bar_tests.rs @@ -69,8 +69,8 @@ fn projects_and_wbs_show_each_edit_command_once() { } // The WBS shift buttons stay with the Move bar, still shown. assert!(!d.has("wbs_cmd_Shift up") && d.has("dock_move_up")); - // The dock's Projects commands follow the view's own rules: the open - // project cannot be deleted. + // The dock's Projects commands follow the view's own rules: an open + // project can be copied or deleted (saving and closing first). d.app.views.hidden_toolbars.remove("Edit"); d.app.show_view(MainView::Projects); let row = d @@ -82,7 +82,7 @@ fn projects_and_wbs_show_each_edit_command_once() { + 1; d.click(&format!("projects_row_{row}")); d.frames(2); - assert_eq!(d.app.view_edit_enabled(ViewEdit::Delete), Some(false)); + assert_eq!(d.app.view_edit_enabled(ViewEdit::Delete), Some(true)); assert_eq!(d.app.view_edit_enabled(ViewEdit::Copy), Some(true)); assert!(d.app.error.is_none(), "{:?}", d.app.error); } diff --git a/desktop/src/views/project_ops.rs b/desktop/src/views/project_ops.rs index a371595..ef2e1c1 100644 --- a/desktop/src/views/project_ops.rs +++ b/desktop/src/views/project_ops.rs @@ -78,6 +78,8 @@ pub struct DeleteConfirm { pub title: String, pub activities: usize, pub baselines: usize, + /// The project is currently open and will be closed first. + pub open: bool, /// The project is the first-run sample: its own dictionary rows go too. pub sample: bool, } @@ -357,26 +359,29 @@ impl App { Ok(id) } - /// Projects view Delete: ask first. Open projects are refused. + /// Projects view Delete: ask first. Open projects are closed before removal. pub(crate) fn request_project_delete(&mut self, id: i64) { - if self.is_open(id) || self.workspace_row() == Some(id) { - self.error("An open project cannot be deleted. Close it first.".into()); - return; - } + let open = self.is_open(id) || self.workspace_row() == Some(id); let Ok(Some(row)) = bstore::project_row(self.store.connection(), id) else { return; }; - let activities = Document::parse(&row.xer) - .ok() - .and_then(|d| { - d.table("TASK").map(|t| { - t.rows - .iter() - .filter(|r| t.value(r, "proj_id").trim() == row.project_key.to_string()) - .count() + let activities = if self.open_set.active == Some(id) || self.workspace_row() == Some(id) { + self.project.model.activities.len() + } else if let Some(p) = self.open_set.parked.iter().find(|p| p.id == id) { + p.project.model.activities.len() + } else { + Document::parse(&row.xer) + .ok() + .and_then(|d| { + d.table("TASK").map(|t| { + t.rows + .iter() + .filter(|r| t.value(r, "proj_id").trim() == row.project_key.to_string()) + .count() + }) }) - }) - .unwrap_or(0); + .unwrap_or(0) + }; let sample = openxer_automation::workspace_db::read_sample(self.store.connection()) .ok() .flatten() @@ -386,14 +391,35 @@ impl App { title: row.title, activities, baselines: bstore::count(self.store.connection(), id), + open, sample, }); } /// Remove workspace project `id` with its baselines, as one undo step. + /// If the project is open, it is saved and closed first; closing the last + /// open project leaves the workspace in the empty state on Projects view. pub(crate) fn delete_workspace_project(&mut self, id: i64, time: f64) -> Result<(), String> { + crate::first_run::mark_seeded(&self.store); + if self.open_set.parked.iter().any(|p| p.id == id) { + self.close_project_id(id); + } + if !self.open_set.empty + && (self.open_set.active == Some(id) || self.workspace_row() == Some(id)) + { + if self.dirty { + self.try_save()?; + } + if !self.open_set.parked.is_empty() { + self.close_active_project(); + } else { + self.enter_empty_workspace(); + } + } if self.is_open(id) || self.workspace_row() == Some(id) { - return Err("An open project cannot be deleted. Close it first.".into()); + return Err( + "The project could not be saved and closed, so nothing was deleted.".into(), + ); } let c = self.store.connection(); let row = bstore::project_row(c, id)?.ok_or("The project no longer exists")?; @@ -444,8 +470,7 @@ impl App { /// What deleting EPS node `eps` takes: the node and the nodes under it, /// the workspace projects filed in them and their baselines. Refused - /// for the last top-level node, and when every workspace project is in - /// the node while one of them is open (one project always stays open). + /// for the last top-level node. fn folder_delete_plan(&mut self, eps: i64) -> Result { let ws = self.workspace().clone(); if !ws.eps().iter().any(|n| n.id == eps) { @@ -456,15 +481,6 @@ impl App { } let ids = self.workspace_ids(); let (nodes, projects) = ws.folder_contents(eps, &ids); - let open_inside = projects - .iter() - .any(|p| self.is_open(*p) || self.workspace_row() == Some(*p)); - if open_inside && ids.iter().all(|p| projects.contains(p)) { - return Err(format!( - "Every project of the workspace is filed under {}, and one project always stays open. Add or move a project to another EPS node first.", - ws.eps_value(eps, "eps_name") - )); - } let c = self.store.connection(); let baselines = projects.iter().map(|p| bstore::count(c, *p)).sum(); Ok(FolderPlan { @@ -519,13 +535,19 @@ impl App { || self.workspace_row().is_some_and(|a| going.contains(&a)); if active_inside { if self.open_set.parked.is_empty() { - let other = self + if self.dirty { + self.try_save()?; + } + if let Some(other) = self .workspace_ids() .into_iter() .find(|id| !going.contains(id)) - .ok_or("No project outside this EPS node can stay open.")?; - let p = self.store.load(other)?; - self.load(p); + { + let p = self.store.load(other)?; + self.load(p); + } else { + self.enter_empty_workspace(); + } } else { self.close_active_project(); } @@ -549,6 +571,7 @@ impl App { /// current afterwards brings back the nodes, the projects (closed), their /// baselines and baseline choices. pub(crate) fn delete_folder(&mut self, eps: i64, time: f64) -> Result<(), String> { + crate::first_run::mark_seeded(&self.store); let plan = self.folder_delete_plan(eps)?; let name = self.workspace().eps_value(eps, "eps_name"); self.close_for_folder_delete(&plan.projects)?; @@ -615,8 +638,10 @@ impl App { let Some(record) = workspace_db::read_sample(c)?.filter(|s| s.row == id) else { return Ok(None); }; - let mut open: Vec<(Option, &Document)> = - vec![(self.open_set.active, &self.project.document)]; + let mut open: Vec<(Option, &Document)> = vec![]; + if !self.open_set.empty { + open.push((self.open_set.active, &self.project.document)); + } open.extend( self.open_set .parked @@ -750,6 +775,11 @@ impl App { } if let Some(d) = self.views.projects.delete.take() { let mut rects = vec![]; + let open_note = if d.open { + "It is currently open and will be closed first. " + } else { + "" + }; let clicked = crate::kit_window::message_box( ctx, "delete_project", @@ -757,12 +787,12 @@ impl App { crate::kit_window::MessageIcon::Question, &if d.sample { format!( - "Remove the sample project {}?\nIts {} activities and {} baseline(s) are removed from the workspace, with the calendars, resources, codes and notebook topics only the sample uses.", + "Remove the sample project {}?\n{open_note}Its {} activities and {} baseline(s) are removed from the workspace, with the calendars, resources, codes and notebook topics only the sample uses.", d.title, d.activities, d.baselines ) } else { format!( - "Delete project {}?\n{} activities and {} baseline(s) are removed from the workspace.", + "Delete project {}?\n{open_note}{} activities and {} baseline(s) are removed from the workspace.", d.title, d.activities, d.baselines ) }, diff --git a/desktop/src/views/project_ops/tests.rs b/desktop/src/views/project_ops/tests.rs index 66300c4..54c03b1 100644 --- a/desktop/src/views/project_ops/tests.rs +++ b/desktop/src/views/project_ops/tests.rs @@ -207,9 +207,14 @@ fn projects_view_copy_paste_add_and_delete_undo_and_redo() { d.app.history_move(&ctx, false); assert_eq!(rows(&d).len(), start + 2); assert_eq!(d.app.store.load(copy).unwrap().model.project.name, title); - // The open project is refused. + // Deleting the open project closes it first and enters the empty workspace; + // Undo brings it back. let open = d.app.workspace_row().unwrap(); - assert!(d.app.delete_workspace_project(open, 9.).is_err()); + d.app.delete_workspace_project(open, 9.).unwrap(); + assert!(d.app.open_set.empty); + assert_eq!(rows(&d).len(), start + 1); + d.app.history_move(&ctx, false); + assert_eq!(rows(&d).len(), start + 2); } #[test] diff --git a/desktop/src/views/projects.rs b/desktop/src/views/projects.rs index dc1f129..7bc12eb 100644 --- a/desktop/src/views/projects.rs +++ b/desktop/src/views/projects.rs @@ -92,11 +92,13 @@ const MONTHS: [(&str, &str); 12] = [ pub struct ProjectsMenu { /// The row is a project, not an EPS node. pub on_project: bool, + /// The project row is currently open (Close Project applies). + pub is_open: bool, /// Add and Paste have an EPS node to go under. pub can_add: bool, /// The project is kept in the workspace (Cut and Copy apply). pub stored: bool, - /// The project is closed and kept in the workspace. + /// The project is kept in the workspace, or the row is an EPS node. pub deletable: bool, /// A project was cut or copied. pub clipboard: bool, @@ -153,6 +155,13 @@ pub fn projects_menu(m: &ProjectsMenu) -> Vec { Icon::ProjectOpen, m.on_project, ), + item( + "close_project", + "Close Project", + "", + Icon::ProjectClosed, + m.is_open, + ), details_item(m.details), Entry::Item(Spec::new("edit_details", "Edit Project Details").enabled(m.on_project)), Entry::Separator, @@ -741,8 +750,12 @@ impl App { let stamps = self.store.stamps().unwrap_or_default(); self.drop_stale_rollups(); let shared = self.dictionary_shared(); - let live = summarize_live(&self.project); - let is_live = |c: &Cached| c.source == live.source && c.key == live.key; + let has_open = !self.open_set.empty; + let live = has_open.then(|| summarize_live(&self.project)); + let is_live = |c: &Cached| { + live.as_ref() + .is_some_and(|l| c.source == l.source && c.key == l.key) + }; let mut out = vec![]; let mut found_current = false; let cache = &mut self.views.projects.cache; @@ -783,10 +796,12 @@ impl App { let entry = &cache[&id]; if is_live(entry) { found_current = true; - out.push(ProjectSummary { - store_id: Some(id), - ..live.clone() - }); + if let Some(live) = live.as_ref() { + out.push(ProjectSummary { + store_id: Some(id), + ..live.clone() + }); + } } else if let Some(s) = &entry.summary { out.push(ProjectSummary { store_id: Some(id), @@ -795,7 +810,9 @@ impl App { } } if !found_current { - out.push(live); + if let Some(live) = live { + out.push(live); + } } out.sort_by(|a, b| a.id.cmp(&b.id).then(a.source.cmp(&b.source))); for s in &mut out { @@ -914,10 +931,14 @@ impl App { }; match self.store.load(id) { Ok(p) => { + let was_empty = self.open_set.empty; let before = self.project.source_name.clone(); let key = self.project.model.project.proj_id; self.load(p); - if self.project.source_name != before || self.project.model.project.proj_id != key { + if was_empty + || self.project.source_name != before + || self.project.model.project.proj_id != key + { self.saved_projects = self.store.list().unwrap_or_default(); self.show_view(MainView::Activities); } @@ -1089,10 +1110,7 @@ impl App { let has_store = selected.as_ref().is_some_and(|s| s.store_id.is_some()); self.views.projects.edit_enabled = Some([ target.is_some(), - folder.is_some() - || selected - .as_ref() - .is_some_and(|s| s.store_id.is_some() && !is_open(s)), + folder.is_some() || has_store, has_store, has_store, (pending.is_some() || copied.is_some()) && target.is_some(), @@ -1118,7 +1136,7 @@ impl App { if response.clicked() { open = selected.clone(); } - let closable = open_ids.len() > 1 && selected.as_ref().is_some_and(is_open); + let closable = selected.as_ref().is_some_and(is_open); let response = sheet::side_button(ui, chrome::Icon::ProjectClosed, "Close Project", closable); self.action("projects_cmd_close", &response); @@ -1141,14 +1159,11 @@ impl App { if response.clicked() { add = target; } - let deletable = folder.is_some() - || selected - .as_ref() - .is_some_and(|s| s.store_id.is_some() && !is_open(s)); + let deletable = folder.is_some() || has_store; let response = sheet::side_button( ui, chrome::Icon::Delete, - "Delete (a closed project, or an EPS node with everything under it)", + "Delete (a project, or an EPS node with everything under it)", deletable, ); self.action("projects_cmd_delete", &response); @@ -1389,12 +1404,13 @@ impl App { let collapsed = &self.views.projects.collapsed; let any_collapsed = groups.iter().any(|g| collapsed.contains(&g.0)); let any_open = groups.iter().any(|g| !collapsed.contains(&g.0)); - let deletable_row = |s: &ProjectSummary| s.store_id.is_some() && !is_open(s); + let deletable_row = |s: &ProjectSummary| s.store_id.is_some(); let fill_ready = self.view_fill_ready(); let menu = |row: usize| { let project = lines.get(row).and_then(project_line); projects_menu(&ProjectsMenu { on_project: project.is_some(), + is_open: project.is_some_and(is_open), can_add: match lines.get(row) { Some(EpsLine::Eps(id, _)) => *id > 0, Some(_) => project.is_some_and(|p| p.store_id.is_some()), @@ -1578,6 +1594,7 @@ impl App { if let Some((i, key)) = response.menu { match key { "open_project" => open = project_at(i), + "close_project" => close = project_at(i).and_then(|p| p.store_id), "add" | "cut" | "copy" | "paste" | "delete" => { self.views.projects.command = Some(key); } @@ -1666,7 +1683,7 @@ impl App { self.view_fill_down(time); } - let deletable = |s: &ProjectSummary| s.store_id.is_some() && !is_open(s); + let deletable = |s: &ProjectSummary| s.store_id.is_some(); match self.views.projects.command.take() { Some("add") => add = target, Some("delete") => { diff --git a/desktop/src/views/view_menus_tests.rs b/desktop/src/views/view_menus_tests.rs index 868edc1..3ce5eeb 100644 --- a/desktop/src/views/view_menus_tests.rs +++ b/desktop/src/views/view_menus_tests.rs @@ -104,6 +104,7 @@ fn the_projects_menu_lists_its_items_in_order_and_selects_the_row() { ); let order = [ "projects_menu_open_project", + "projects_menu_close_project", "projects_menu_details", "projects_menu_edit_details", "projects_menu_cut", @@ -225,6 +226,7 @@ fn the_projects_menu_opens_a_project_and_serves_the_empty_area() { assert!(d.has("projects_menu_add"), "the empty area has a menu"); for key in [ "projects_menu_open_project", + "projects_menu_close_project", "projects_menu_cut", "projects_menu_copy", "projects_menu_delete", @@ -236,6 +238,113 @@ fn the_projects_menu_opens_a_project_and_serves_the_empty_area() { } } +#[test] +fn projects_menu_closes_and_deletes_an_open_project_into_empty_workspace() { + let mut d = Driver::new("vm-projects-close-del", starter()); + open_projects(&mut d); + // Close Project from right-click menu closes the last open project. + right_click_project_row(&mut d); + assert!(closes_on_click( + &mut d, + "projects_menu_add", + "projects_menu_close_project" + )); + d.frames(2); + assert!( + d.app.open_set.empty, + "closing the last project enters empty workspace" + ); + assert!(d.app.open_ids().is_empty()); + // Reopen it, then right-click Delete directly while open. + right_click_project_row(&mut d); + assert!(closes_on_click( + &mut d, + "projects_menu_add", + "projects_menu_open_project" + )); + d.frames(2); + assert!(!d.app.open_set.empty); + open_projects(&mut d); + right_click_project_row(&mut d); + assert!(closes_on_click( + &mut d, + "projects_menu_add", + "projects_menu_delete" + )); + d.frames(2); + assert!( + d.app.views.projects.delete.as_ref().is_some_and(|c| c.open), + "Delete opens confirmation noting the project is open" + ); + d.click("delete_project_yes"); + d.frames(2); + assert!( + d.app.open_set.empty, + "deleting the last project enters empty workspace" + ); + assert!(d.app.store.list().unwrap().is_empty()); +} + +#[test] +fn assign_predecessors_right_click_menu_expands_and_collapses_wbs() { + let mut d = Driver::new("vm-picker-menu", starter()); + d.frames(2); + d.app.selected = Some(0); + d.app.detail.picker = Some(crate::details::Picker::Relationship { + predecessor: true, + query: String::new(), + selected: None, + kind: openxer_engine::model::LinkType::FS, + lag: 0., + }); + d.frames(2); + assert!(d.app.detail.picker.is_some()); + let search = d.rect("picker_search"); + let list_pos = Pos2::new(search.left() + 40., search.bottom() + 45.); + right_click(&mut d, list_pos); + let order = [ + "picker_menu_copy", + "picker_menu_columns", + "picker_menu_table_font", + "picker_menu_filter_by", + "picker_menu_group_by", + "picker_menu_expand_all", + "picker_menu_collapse_all", + ]; + for key in order { + assert!(d.has(key), "{key} is listed"); + } + assert_order(&d, &order); + // Nothing is collapsed yet: Expand All is disabled, Collapse All is enabled. + assert!(!closes_on_click( + &mut d, + "picker_menu_collapse_all", + "picker_menu_expand_all" + )); + assert!(closes_on_click( + &mut d, + "picker_menu_table_font", + "picker_menu_collapse_all" + )); + d.frames(2); + assert!( + !d.app.detail.picker_collapsed.is_empty(), + "Collapse All folds every WBS band" + ); + // Now Expand All is enabled and clears the collapsed set. + right_click(&mut d, list_pos); + assert!(closes_on_click( + &mut d, + "picker_menu_table_font", + "picker_menu_expand_all" + )); + d.frames(2); + assert!( + d.app.detail.picker_collapsed.is_empty(), + "Expand All unfolds every WBS band" + ); +} + // ------------------------------------------------------------- resources fn with_resources() -> Driver { diff --git a/desktop/src/workspace_sync.rs b/desktop/src/workspace_sync.rs index 526f71c..ff9e1d2 100644 --- a/desktop/src/workspace_sync.rs +++ b/desktop/src/workspace_sync.rs @@ -80,7 +80,7 @@ impl App { /// them, and bring the other open projects up to the dictionary when it /// changed. pub(crate) fn sync_dictionary(&mut self, time: f64) { - if !self.dictionary_shared() { + if self.open_set.empty || !self.dictionary_shared() { return; } let key = key_of(&self.project); diff --git a/xer/src/sample_project.rs b/xer/src/sample_project.rs index b571712..99b0d33 100644 --- a/xer/src/sample_project.rs +++ b/xer/src/sample_project.rs @@ -3,10 +3,11 @@ //! `assets/sample-project.txt` (see the notes at its top). //! //! [`sample_project`] reads the table into an XER document, schedules it to -//! get the as-planned copy (the baseline), then records progress up to the -//! data date the way Update Progress does, adds the slips and overruns the -//! table lists, and schedules again. The result is the same every time: no -//! clock, no random numbers, no hash ordering. +//! get the as-planned copy (the project baseline), progresses a mid-project +//! copy for the secondary baseline, then records progress up to the data date +//! the way Update Progress does, adds the slips, overruns and stored past +//! period performance, and schedules again. The result is the same every time: +//! no clock, no random numbers, no hash ordering. //! //! Every name, rate, quantity and date in it is made up. [`starter`] //! (`crate::starter`) stays the small sample the tests are written against. @@ -14,7 +15,7 @@ use crate::calendar_data::{CalendarData, Shift}; use crate::edit::progress::{apply_progress, ProgressScope, RemainingRule}; use crate::edit::records::{self, add_row}; use crate::{parse_absolute, Document, ProjectData}; -use openxer_engine::model::StatusType; +use openxer_engine::model::{LinkType, StatusType, TaskType}; use std::collections::BTreeMap; /// Project ID of the sample. @@ -24,11 +25,12 @@ pub const SAMPLE_SOURCE: &str = "Sample project"; const DATA: &str = include_str!("../../assets/sample-project.txt"); -/// The sample as planned (scheduled at its start, no progress: the -/// baseline) and as of its data date. +/// The sample as planned (Baseline 1: scheduled at its start, no progress), +/// at its mid-project rebaseline (Baseline 2), and as of its data date. #[derive(Clone, Debug)] pub struct Sample { pub plan: ProjectData, + pub revision: ProjectData, pub current: ProjectData, } @@ -36,7 +38,7 @@ pub struct Sample { /// tests catch. pub fn sample_project() -> Sample { let data = Data::parse(DATA); - let first = load(build(&data, &BTreeMap::new())); + let first = load(build(&data, &BTreeMap::new(), &BTreeMap::new())); // Constraints dated "plan" take the date the plan finishes them on. let mut dates = BTreeMap::new(); for c in &data.constraints { @@ -51,10 +53,60 @@ pub fn sample_project() -> Sample { dates.insert(c.activity.clone(), date); } } - let mut plan = load(build(&data, &dates)); + // LOE activities take their planned hours from their scheduled span so + // their resource assignments are sized to their full planned duration. + let mut loe_hours = BTreeMap::new(); + for a in &first.model.activities { + if a.task_type == TaskType::Loe { + let hours = loe_duration_hours(&first, a); + if hours > 0. { + loe_hours.insert(a.task_code.clone(), hours); + } + } + } + let mut plan = load(build(&data, &dates, &loe_hours)); sync_rollups(&mut plan); - let current = progress(&data, &plan); - Sample { plan, current } + + // Mid-project rebaseline (Baseline 2): progressed to revision date with + // early engineering/submittal overruns only, no October slips. + let rev_date = data.progress_value("revision date")[0][0].clone(); + let rev_overruns: Vec<(String, f64)> = vec![ + ("EN0200".into(), 1.04), + ("PR0110".into(), 1.05), + ("EN0060".into(), 1.03), + ]; + let revision = progress(&data, &plan, &rev_date, &[], &rev_overruns, false); + + // Current schedule as of the data date, with slips, overruns and stored + // past period performance. + let dd = data.progress_value("data date")[0][0].clone(); + let slips: Vec<(String, f64)> = data + .progress_value("slip") + .into_iter() + .map(|s| (s[0].clone(), number(&s[1]))) + .collect(); + let overruns: Vec<(String, f64)> = data + .progress_value("overrun") + .into_iter() + .map(|o| (o[0].clone(), number(&o[1]))) + .collect(); + let current = progress(&data, &plan, &dd, &slips, &overruns, true); + Sample { + plan, + revision, + current, + } +} + +fn loe_duration_hours(p: &ProjectData, a: &openxer_engine::model::Activity) -> f64 { + let (Some(s), Some(f)) = (a.early_start, a.early_finish) else { + return 0.; + }; + if f <= s { + return 0.; + } + let cal = &p.model.calendars[a.cal]; + cal.cal.duration(s, f) as f64 / 60. } fn load(doc: Document) -> ProjectData { @@ -80,6 +132,7 @@ fn sync_rollups(p: &mut ProjectData) { struct Resource { id: String, + parent: String, name: String, kind: String, unit: String, @@ -88,15 +141,31 @@ struct Resource { limit: Option, role: String, account: String, + trade: String, + source: String, +} + +impl Resource { + fn is_group(&self) -> bool { + self.kind.starts_with("group_") + } + + fn xer_type(&self) -> &'static str { + match self.kind.as_str() { + "labor" | "group_labor" => "RT_Labor", + "nonlabor" | "group_nonlabor" => "RT_Equip", + _ => "RT_Mat", + } + } } struct Activity { id: String, wbs: String, calendar: i64, - /// Working days; `None` for a milestone. + /// Working days; `None` for milestones, LOE and WBS summary. days: Option, - milestone: &'static str, + task_type: &'static str, name: String, preds: Vec<(String, &'static str, f64)>, resources: Vec<(String, f64)>, @@ -113,12 +182,21 @@ struct Data { project: Vec, holidays: Vec, units: Vec>, + obs: Vec>, roles: Vec>, accounts: Vec>, expense_categories: Vec, topics: Vec, + baseline_types: Vec, + project_codes: Vec>, + funding: Vec>, + resource_codes: Vec>, + assignment_codes: Vec>, resources: Vec, wbs: Vec>, + wbs_steps: Vec>, + budget_log: Vec>, + spending_plan: Vec>, activities: Vec, constraints: Vec, codes: Vec>, @@ -127,7 +205,15 @@ struct Data { steps: Vec>, expenses: Vec>, curves: Vec>, + doc_categories: Vec, + doc_statuses: Vec, + documents: Vec>, + risk_categories: Vec, + risks: Vec>, + thresholds: Vec>, + issues: Vec>, notes: Vec>, + financial_periods: Vec>, progress: Vec>, } @@ -159,22 +245,34 @@ impl Data { "project" => d.project = f, "holidays" => d.holidays.extend(f), "units" => d.units.push(f), + "obs" => d.obs.push(f), "roles" => d.roles.push(f), "accounts" => d.accounts.push(f), "expense categories" => d.expense_categories.push(f[0].clone()), "topics" => d.topics.push(f[0].clone()), + "baseline types" => d.baseline_types.push(f[0].clone()), + "project codes" => d.project_codes.push(f), + "funding" => d.funding.push(f), + "resource codes" => d.resource_codes.push(f), + "assignment codes" => d.assignment_codes.push(f), "resources" => d.resources.push(Resource { id: f[0].clone(), - name: f[1].clone(), - kind: f[2].clone(), - unit: f[3].clone(), - calendar: number(&f[4]) as i64, - rate: number(&f[5]), - limit: (!f[6].is_empty()).then(|| number(&f[6])), - role: f[7].clone(), - account: f[8].clone(), + parent: f[1].clone(), + name: f[2].clone(), + kind: f[3].clone(), + unit: f[4].clone(), + calendar: number(&f[5]) as i64, + rate: number(&f[6]), + limit: (!f[7].is_empty()).then(|| number(&f[7])), + role: f[8].clone(), + account: f[9].clone(), + trade: f.get(10).cloned().unwrap_or_default(), + source: f.get(11).cloned().unwrap_or_default(), }), "wbs" => d.wbs.push(f), + "wbs steps" => d.wbs_steps.push(f), + "budget log" => d.budget_log.push(f), + "spending plan" => d.spending_plan.push(f), "activities" => d.activities.push(activity(&f)), "constraints" => d.constraints.push(Constraint { activity: f[0].clone(), @@ -192,7 +290,15 @@ impl Data { "steps" => d.steps.push(f), "expenses" => d.expenses.push(f), "curves" => d.curves.push(f), + "doc categories" => d.doc_categories.push(f[0].clone()), + "doc statuses" => d.doc_statuses.push(f[0].clone()), + "documents" => d.documents.push(f), + "risk categories" => d.risk_categories.push(f[0].clone()), + "risks" => d.risks.push(f), + "thresholds" => d.thresholds.push(f), + "issues" => d.issues.push(f), "notes" => d.notes.push(f), + "financial periods" => d.financial_periods.push(f), "progress" => d.progress.push(f), other => panic!("sample table: unknown section {other:?}"), } @@ -208,6 +314,14 @@ impl Data { .unwrap_or_else(|| panic!("sample table: no resource {id}")) } + fn obs_id(&self, code: &str) -> i64 { + 1 + self + .obs + .iter() + .position(|o| o[0] == code) + .unwrap_or_else(|| panic!("sample table: no OBS {code}")) as i64 + } + fn task_id(&self, code: &str) -> i64 { 1000 + self .activities @@ -216,7 +330,14 @@ impl Data { .unwrap_or_else(|| panic!("sample table: no activity {code}")) as i64 } + fn has_activity(&self, code: &str) -> bool { + self.activities.iter().any(|a| a.id == code) + } + fn wbs_id(&self, code: &str) -> i64 { + if code == "PROJECT" { + return 100; + } 101 + self .wbs .iter() @@ -234,9 +355,11 @@ impl Data { } fn activity(f: &[String]) -> Activity { - let (days, milestone) = match f[3].as_str() { + let (days, task_type) = match f[3].as_str() { "start" => (None, "TT_Mile"), "finish" => (None, "TT_FinMile"), + "loe" => (None, "TT_LOE"), + "wbs" => (None, "TT_WBS"), d => (Some(number(d)), "TT_Task"), }; let preds = f[5] @@ -279,7 +402,7 @@ fn activity(f: &[String]) -> Activity { wbs: f[1].clone(), calendar: number(&f[2]) as i64, days, - milestone, + task_type, name: f[4].clone(), preds, resources, @@ -366,9 +489,51 @@ fn cost(v: f64) -> String { crate::assignments::cost_text((v * 100.).round() / 100.) } +fn priority_code(label: &str) -> &'static str { + match label { + "Top" => "PT_Top", + "High" => "PT_High", + "Normal" => "PT_Normal", + "Low" => "PT_Low", + "Lowest" => "PT_Lowest", + other => panic!("sample table: priority {other:?}"), + } +} + +fn risk_status_code(label: &str) -> &'static str { + match label { + "Proposed" => "RS_Propose", + "Open" => "RS_Open", + "Active" => "RS_Active", + "Rejected" => "RS_Reject", + "Impacted" => "RS_Impact", + "Managed" => "RS_Manage", + other => panic!("sample table: risk status {other:?}"), + } +} + +fn risk_response_code(label: &str) -> &'static str { + match label { + "Accept" => "RP_Accept", + "Avoid" => "RP_Avoid", + "Transfer" => "RP_Trans", + "Reduce" => "RP_Reduce", + "Exploit" => "RP_Exploit", + "Facilitate" => "RP_Facil", + "Enhance" => "RP_Enhance", + "Reject" => "RP_Reject", + other => panic!("sample table: risk response {other:?}"), + } +} + /// The XER document of the plan: no progress, the data date at the start. -/// `dates` gives the "plan" constraints their dates. -fn build(d: &Data, dates: &BTreeMap) -> Document { +/// `dates` gives the "plan" constraints their dates, and `loe_hours` gives +/// each Level of Effort activity its planned working hours. +fn build( + d: &Data, + dates: &BTreeMap, + loe_hours: &BTreeMap, +) -> Document { let mut doc = Document { header: "ERMHDR\t25.12\t2026-06-01\tProject\tOpenXER\tOpenXER\tdbxDatabaseNoName\tProject Management\tUSD".into(), tables: vec![], @@ -379,6 +544,8 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { }; let doc = &mut doc; let (short, name, start) = (&d.project[0], &d.project[1], &d.project[2]); + + // Units of measure. for (i, u) in d.units.iter().enumerate() { add_row( doc, @@ -391,20 +558,27 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } - for (i, r) in d.roles.iter().enumerate() { + + // OBS (Responsible Managers). + for (i, o) in d.obs.iter().enumerate() { + let parent = if o[1].is_empty() { + String::new() + } else { + d.obs_id(&o[1]).to_string() + }; add_row( doc, - "ROLES", + "OBS", &[ - ("role_id", (i + 1).to_string()), - ("seq_num", (i + 1).to_string()), - ("role_name", r[1].clone()), - ("role_short_name", r[0].clone()), - ("def_cost_qty_link_flag", "Y".into()), - ("cost_qty_type", "QT_Hour".into()), + ("obs_id", (i + 1).to_string()), + ("parent_obs_id", parent), + ("seq_num", ((i + 1) * 10).to_string()), + ("obs_name", o[2].clone()), ], ); } + + // Roles and role rates (hierarchical). let role_id = |code: &str| { d.roles .iter() @@ -412,18 +586,43 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { .map(|i| (i + 1).to_string()) .unwrap_or_default() }; - for (i, a) in d.accounts.iter().enumerate() { + for (i, r) in d.roles.iter().enumerate() { + let id = (i + 1).to_string(); + let parent = if r[1].is_empty() { + String::new() + } else { + role_id(&r[1]) + }; add_row( doc, - "ACCOUNT", + "ROLES", &[ - ("acct_id", (i + 1).to_string()), - ("acct_seq_num", (i + 1).to_string()), - ("acct_name", a[1].clone()), - ("acct_short_name", a[0].clone()), + ("role_id", id.clone()), + ("parent_role_id", parent), + ("seq_num", ((i + 1) * 10).to_string()), + ("role_name", r[2].clone()), + ("role_short_name", r[0].clone()), + ("def_cost_qty_link_flag", "Y".into()), + ("cost_qty_type", "QT_Hour".into()), ], ); + if let Some(rate) = r.get(3).filter(|s| !s.is_empty()) { + let limit = r.get(4).cloned().unwrap_or_default(); + add_row( + doc, + "ROLERATE", + &[ + ("role_rate_id", id.clone()), + ("role_id", id), + ("cost_per_qty", cost(number(rate))), + ("start_date", "2026-01-01 00:00".into()), + ("max_qty_per_hr", limit), + ], + ); + } } + + // Cost accounts (hierarchical). let account_id = |code: &str| { d.accounts .iter() @@ -431,6 +630,25 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { .map(|i| (i + 1).to_string()) .unwrap_or_else(|| panic!("sample table: no account {code}")) }; + for (i, a) in d.accounts.iter().enumerate() { + let parent = if a[1].is_empty() { + String::new() + } else { + account_id(&a[1]) + }; + add_row( + doc, + "ACCOUNT", + &[ + ("acct_id", (i + 1).to_string()), + ("parent_acct_id", parent), + ("acct_seq_num", ((i + 1) * 10).to_string()), + ("acct_name", a[2].clone()), + ("acct_short_name", a[0].clone()), + ], + ); + } + for (i, c) in d.expense_categories.iter().enumerate() { add_row( doc, @@ -442,6 +660,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + for (i, t) in d.topics.iter().enumerate() { add_row( doc, @@ -457,32 +676,408 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + + for (i, b) in d.baseline_types.iter().enumerate() { + add_row( + doc, + "BASETYPE", + &[ + ("base_type_id", (i + 1).to_string()), + ("base_type_seq_num", ((i + 1) * 10).to_string()), + ("base_type", b.clone()), + ], + ); + } + + // Funding sources and project funding. + for (i, f) in d.funding.iter().enumerate() { + let id = (i + 1).to_string(); + add_row( + doc, + "FUNDSRC", + &[ + ("fund_id", id.clone()), + ("seq_num", ((i + 1) * 10).to_string()), + ("fund_name", f[0].clone()), + ("fund_descr", f.get(3).cloned().unwrap_or_default()), + ], + ); + add_row( + doc, + "PROJFUND", + &[ + ("proj_fund_id", id.clone()), + ("proj_id", "1".into()), + ("fund_id", id), + ("fund_cost", cost(number(&f[1]))), + ("fund_wt", text(number(&f[2]))), + ], + ); + } + + // Project codes. + let mut pcat_types: Vec = vec![]; + for c in &d.project_codes { + if !pcat_types.contains(&c[0]) { + pcat_types.push(c[0].clone()); + let n = pcat_types.len(); + add_row( + doc, + "PCATTYPE", + &[ + ("proj_catg_type_id", n.to_string()), + ("seq_num", (n * 10).to_string()), + ("proj_catg_short_len", "10".into()), + ("proj_catg_type", c[0].clone()), + ("export_flag", "Y".into()), + ], + ); + } + } + for (i, c) in d.project_codes.iter().enumerate() { + let ty = pcat_types.iter().position(|t| *t == c[0]).unwrap() + 1; + let val = i + 1; + add_row( + doc, + "PCATVAL", + &[ + ("proj_catg_id", val.to_string()), + ("proj_catg_type_id", ty.to_string()), + ("seq_num", (val * 10).to_string()), + ("proj_catg_short_name", c[1].clone()), + ("proj_catg_name", c[2].clone()), + ], + ); + if c.get(3).is_some_and(|v| v.eq_ignore_ascii_case("yes")) { + add_row( + doc, + "PROJPCAT", + &[ + ("proj_id", "1".into()), + ("proj_catg_type_id", ty.to_string()), + ("proj_catg_id", val.to_string()), + ], + ); + } + } + + // Resource codes. + let mut rcat_types: Vec = vec![]; + for c in &d.resource_codes { + if !rcat_types.contains(&c[0]) { + rcat_types.push(c[0].clone()); + let n = rcat_types.len(); + add_row( + doc, + "RCATTYPE", + &[ + ("rsrc_catg_type_id", n.to_string()), + ("seq_num", (n * 10).to_string()), + ("rsrc_catg_short_len", "10".into()), + ("rsrc_catg_type", c[0].clone()), + ("export_flag", "Y".into()), + ], + ); + } + } + for (i, c) in d.resource_codes.iter().enumerate() { + let ty = rcat_types.iter().position(|t| *t == c[0]).unwrap() + 1; + add_row( + doc, + "RCATVAL", + &[ + ("rsrc_catg_id", (i + 1).to_string()), + ("rsrc_catg_type_id", ty.to_string()), + ("seq_num", ((i + 1) * 10).to_string()), + ("rsrc_catg_short_name", c[1].clone()), + ("rsrc_catg_name", c[2].clone()), + ], + ); + } + let rcat_id = |ty: &str, short: &str| -> Option<(usize, usize)> { + let t = rcat_types.iter().position(|t| t == ty)? + 1; + let v = d + .resource_codes + .iter() + .position(|c| c[0] == ty && c[1] == short)? + + 1; + Some((t, v)) + }; + + // Assignment codes. + let mut acat_types: Vec = vec![]; + for c in &d.assignment_codes { + if !acat_types.contains(&c[0]) { + acat_types.push(c[0].clone()); + let n = acat_types.len(); + add_row( + doc, + "ASGNMNTCATTYPE", + &[ + ("asgnmnt_catg_type_id", n.to_string()), + ("seq_num", (n * 10).to_string()), + ("asgnmnt_catg_short_len", "10".into()), + ("asgnmnt_catg_type", c[0].clone()), + ("export_flag", "Y".into()), + ], + ); + } + } + for (i, c) in d.assignment_codes.iter().enumerate() { + let ty = acat_types.iter().position(|t| *t == c[0]).unwrap() + 1; + add_row( + doc, + "ASGNMNTCATVAL", + &[ + ("asgnmnt_catg_id", (i + 1).to_string()), + ("asgnmnt_catg_type_id", ty.to_string()), + ("seq_num", ((i + 1) * 10).to_string()), + ("asgnmnt_catg_short_name", c[1].clone()), + ("asgnmnt_catg_name", c[2].clone()), + ], + ); + } + let acat_id = |ty: &str, short: &str| -> (usize, usize) { + let t = acat_types.iter().position(|t| t == ty).unwrap() + 1; + let v = d + .assignment_codes + .iter() + .position(|c| c[0] == ty && c[1] == short) + .unwrap_or_else(|| panic!("sample table: no assignment code {ty}/{short}")) + + 1; + (t, v) + }; + + // Document categories & statuses. + for (i, c) in d.doc_categories.iter().enumerate() { + add_row( + doc, + "DOCCATG", + &[ + ("doc_catg_id", (i + 1).to_string()), + ("seq_num", ((i + 1) * 10).to_string()), + ("doc_catg_name", c.clone()), + ], + ); + } + for (i, s) in d.doc_statuses.iter().enumerate() { + add_row( + doc, + "DOCSTAT", + &[ + ("doc_status_id", (i + 1).to_string()), + ("seq_num", ((i + 1) * 10).to_string()), + ("doc_status_code", s.clone()), + ], + ); + } + + // Risk categories. + for (i, r) in d.risk_categories.iter().enumerate() { + add_row( + doc, + "RISKTYPE", + &[ + ("risk_type_id", (i + 1).to_string()), + ("seq_num", ((i + 1) * 10).to_string()), + ("risk_type", r.clone()), + ], + ); + } + + // Financial period calendar and periods. + if let Some(first_fp) = d.financial_periods.first() { + add_row( + doc, + "FINTMPL", + &[ + ("fintmpl_id", "1".into()), + ("fintmpl_name", first_fp[0].clone()), + ("default_flag", "Y".into()), + ], + ); + for (i, fp) in d.financial_periods.iter().enumerate() { + add_row( + doc, + "FINDATES", + &[ + ("fin_dates_id", (i + 1).to_string()), + ("fin_dates_name", fp[1].clone()), + ("start_date", fp[2].clone()), + ("end_date", fp[3].clone()), + ("fintmpl_id", "1".into()), + ], + ); + } + } + + // Standard threshold parameters (matching xer::edit::thresholds::BUILT_IN). + for (id, seq, wbs_f, task_f, kind, pname, field) in [ + ( + 15, + 1, + "Y", + "Y", + "TH_Drtn", + "Start Date Variance (days)", + "var_start_date_drtn_hr_cnt", + ), + ( + 16, + 2, + "Y", + "Y", + "TH_Drtn", + "Finish Date Variance (days)", + "var_end_date_drtn_hr_cnt", + ), + ( + 17, + 3, + "Y", + "Y", + "TH_Drtn", + "Total Float (days)", + "total_float_hr_cnt", + ), + ( + 18, + 4, + "N", + "Y", + "TH_Drtn", + "Free Float (days)", + "free_float_hr_cnt", + ), + ( + 11, + 5, + "Y", + "Y", + "TH_Percent", + "Duration % of Original (%)", + "drtn_pct_spent", + ), + ( + 5, + 6, + "Y", + "Y", + "TH_Percent", + "Cost % of Budget (%)", + "act_pct_spent", + ), + ( + 1, + 7, + "Y", + "Y", + "TH_Money", + "AV - Accounting Variance ($)", + "AV", + ), + (2, 8, "Y", "Y", "TH_Money", "CV - Cost Variance ($)", "CV"), + ( + 3, + 9, + "Y", + "Y", + "TH_Money", + "SV - Schedule Variance ($)", + "SV", + ), + ( + 4, + 10, + "Y", + "Y", + "TH_Money", + "VAC - Variance at Completion ($)", + "VAC", + ), + ( + 6, + 11, + "Y", + "Y", + "TH_Ratio", + "CPI - Cost Performance Index (ratio)", + "CPI", + ), + ( + 7, + 12, + "Y", + "Y", + "TH_Ratio", + "CVI - Cost Variance Index (ratio)", + "CVI", + ), + ( + 9, + 13, + "Y", + "Y", + "TH_Ratio", + "SPI - Schedule Performance Index (ratio)", + "SPI", + ), + ( + 10, + 14, + "Y", + "Y", + "TH_Ratio", + "SVI - Schedule Variance Index (ratio)", + "SVI", + ), + ] { + add_row( + doc, + "THRSPARM", + &[ + ("thresh_parm_id", id.to_string()), + ("seq_num", seq.to_string()), + ("wbs_flag", wbs_f.into()), + ("task_flag", task_f.into()), + ("rsrc_flag", "N".into()), + ("thresh_parm_type", kind.into()), + ("thresh_parm_name", pname.into()), + ("thresh_field_name", field.into()), + ("thresh_short_name", field.into()), + ], + ); + } + + // UDF types (TASK and PROJECT). for (i, u) in d.udfs.iter().enumerate() { + let data_type = match u[2].as_str() { + "number" => "FT_INT", + "cost" => "FT_MONEY", + "start_date" => "FT_START_DATE", + "finish_date" => "FT_END_DATE", + _ => "FT_TEXT", + }; add_row( doc, "UDFTYPE", &[ ("udf_type_id", (i + 1).to_string()), - ("table_name", "TASK".into()), + ("table_name", u[0].clone()), ("udf_type_name", format!("user_field_{}", i + 1)), - ("udf_type_label", u[0].clone()), - ( - "logical_data_type", - if u[1] == "number" { - "FT_INT" - } else { - "FT_TEXT" - } - .into(), - ), + ("udf_type_label", u[1].clone()), + ("logical_data_type", data_type.into()), ("super_flag", "N".into()), + ("export_flag", "Y".into()), ], ); } + doc.table_mut("PROJECT").add(&[ ("proj_id", "1".into()), ("proj_short_name", short.clone()), ("clndr_id", "5".into()), + ("fintmpl_id", "1".into()), ("plan_start_date", start.clone()), ("last_recalc_date", start.clone()), ("rem_target_link_flag", "Y".into()), @@ -493,7 +1088,11 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ("step_complete_flag", "N".into()), ("task_code_base", "1000".into()), ("task_code_step", "10".into()), + ("priority_num", "10".into()), + ("rsrc_self_add_flag", "Y".into()), + ("allow_complete_flag", "Y".into()), ]); + let holidays: Vec = d .holidays .iter() @@ -521,18 +1120,26 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + // WBS: the project node, then the table's elements in order. + let root_obs = d + .obs + .first() + .map(|o| d.obs_id(&o[0]).to_string()) + .unwrap_or_default(); add_row( doc, "PROJWBS", &[ ("wbs_id", "100".into()), ("proj_id", "1".into()), + ("obs_id", root_obs), ("seq_num", "0".into()), ("proj_node_flag", "Y".into()), ("status_code", "WS_Open".into()), ("wbs_short_name", short.clone()), ("wbs_name", name.clone()), + ("orig_cost", "5195000".into()), ], ); let mut sequence: BTreeMap = BTreeMap::new(); @@ -544,30 +1151,97 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { }; let seq = sequence.entry(w[1].clone()).or_default(); *seq += 1; - // The code is the last segment; the WBS path joins them. let segment = w[0].rsplit('.').next().unwrap().to_string(); + let obs = w + .get(3) + .filter(|s| !s.is_empty()) + .map(|c| d.obs_id(c).to_string()) + .unwrap_or_default(); + let orig_cost = w.get(4).cloned().unwrap_or_default(); add_row( doc, "PROJWBS", &[ ("wbs_id", d.wbs_id(&w[0]).to_string()), ("proj_id", "1".into()), + ("obs_id", obs), ("seq_num", (*seq * 10).to_string()), ("proj_node_flag", "N".into()), ("status_code", "WS_Open".into()), ("wbs_short_name", segment), ("wbs_name", w[2].clone()), ("parent_wbs_id", parent.to_string()), + ("orig_cost", orig_cost), ], ); } + + // WBS Milestones (WBSSTEP). + let mut wbs_step_seq: BTreeMap = BTreeMap::new(); + for (i, s) in d.wbs_steps.iter().enumerate() { + let wbs_id = d.wbs_id(&s[0]); + let seq = wbs_step_seq.entry(wbs_id).or_default(); + *seq += 1; + add_row( + doc, + "WBSSTEP", + &[ + ("wbs_step_id", (i + 1).to_string()), + ("proj_id", "1".into()), + ("wbs_id", wbs_id.to_string()), + ("seq_num", (*seq * 10).to_string()), + ("step_name", s[1].clone()), + ("step_wt", s[2].clone()), + ("complete_flag", s[3].clone()), + ], + ); + } + + // Budget Log (BUDGCHNG). + for (i, b) in d.budget_log.iter().enumerate() { + add_row( + doc, + "BUDGCHNG", + &[ + ("budg_chng_id", (i + 1).to_string()), + ("proj_id", "1".into()), + ("wbs_id", d.wbs_id(&b[0]).to_string()), + ("chng_num", b[1].clone()), + ("chng_date", b[2].clone()), + ("chng_cost", cost(number(&b[3]))), + ("status_code", b[4].clone()), + ("chng_by_name", b[5].clone()), + ("chng_descr", b[6].clone()), + ], + ); + } + + // Spending Plan (WBSBUDG). + for (i, s) in d.spending_plan.iter().enumerate() { + add_row( + doc, + "WBSBUDG", + &[ + ("wbs_budg_id", (i + 1).to_string()), + ("proj_id", "1".into()), + ("wbs_id", d.wbs_id(&s[0]).to_string()), + ("start_date", s[1].clone()), + ("end_date", s[2].clone()), + ("spend_cost", cost(number(&s[3]))), + ("benefit_cost", cost(number(&s[4]))), + ], + ); + } + + // Resources (2-level hierarchy), rates, roles and resource codes. for (i, r) in d.resources.iter().enumerate() { let id = (i + 1).to_string(); - let kind = match r.kind.as_str() { - "labor" => "RT_Labor", - "nonlabor" => "RT_Equip", - _ => "RT_Mat", + let parent = if r.parent.is_empty() { + String::new() + } else { + (d.resource(&r.parent).0 + 1).to_string() }; + let kind = r.xer_type(); let unit = d .units .iter() @@ -579,9 +1253,10 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { "RSRC", &[ ("rsrc_id", id.clone()), + ("parent_rsrc_id", parent), ("clndr_id", r.calendar.to_string()), ("role_id", role_id(&r.role)), - ("rsrc_seq_num", (i + 1).to_string()), + ("rsrc_seq_num", ((i + 1) * 10).to_string()), ("rsrc_name", r.name.clone()), ("rsrc_short_name", r.id.clone()), ("def_qty_per_hr", "1".into()), @@ -598,29 +1273,58 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ("rsrc_type", kind.into()), ], ); - add_row( - doc, - "RSRCRATE", - &[ - ("rsrc_rate_id", id.clone()), - ("rsrc_id", id.clone()), - ("max_qty_per_hr", r.limit.map(text).unwrap_or_default()), - ("cost_per_qty", cost(r.rate)), - ("start_date", "2026-01-01 00:00".into()), - ], - ); - if !r.role.is_empty() { + if !r.is_group() { add_row( doc, - "RSRCROLE", + "RSRCRATE", &[ - ("rsrc_id", id), - ("role_id", role_id(&r.role)), - ("skill_level", "3".into()), + ("rsrc_rate_id", id.clone()), + ("rsrc_id", id.clone()), + ("max_qty_per_hr", r.limit.map(text).unwrap_or_default()), + ("cost_per_qty", cost(r.rate)), + ("start_date", "2026-01-01 00:00".into()), ], ); + if !r.role.is_empty() { + add_row( + doc, + "RSRCROLE", + &[ + ("rsrc_id", id.clone()), + ("role_id", role_id(&r.role)), + ("skill_level", "3".into()), + ], + ); + } + } + if !r.trade.is_empty() { + if let Some((ty, val)) = rcat_id("Trade Group", &r.trade) { + add_row( + doc, + "RSRCRCAT", + &[ + ("rsrc_id", id.clone()), + ("rsrc_catg_type_id", ty.to_string()), + ("rsrc_catg_id", val.to_string()), + ], + ); + } + } + if !r.source.is_empty() { + if let Some((ty, val)) = rcat_id("Resource Source", &r.source) { + add_row( + doc, + "RSRCRCAT", + &[ + ("rsrc_id", id), + ("rsrc_catg_type_id", ty.to_string()), + ("rsrc_catg_id", val.to_string()), + ], + ); + } } } + // Project activity codes. let mut code_types: Vec = vec![]; for c in &d.codes { @@ -637,6 +1341,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ("actv_code_type", c[0].clone()), ("proj_id", "1".into()), ("actv_code_type_scope", "AS_Project".into()), + ("export_flag", "Y".into()), ], ); } @@ -665,13 +1370,18 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { + 1; (t, v) }; + let constraint = |code: &str| d.constraints.iter().find(|c| c.activity == code); let mut assignment = 0; let mut link = 0; for a in &d.activities { let task_id = d.task_id(&a.id); let hours = calendar_hours(a.calendar); - let duration = a.days.map_or(0., |days| days * hours); + let duration = if a.task_type == "TT_LOE" { + loe_hours.get(&a.id).copied().unwrap_or(0.) + } else { + a.days.map_or(0., |days| days * hours) + }; let mut row = vec![ ("task_id", task_id.to_string()), ("proj_id", "1".into()), @@ -683,7 +1393,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ("lock_plan_flag", "N".into()), ("auto_compute_act_flag", "N".into()), ("complete_pct_type", "CP_Phys".into()), - ("task_type", a.milestone.into()), + ("task_type", a.task_type.into()), ("duration_type", "DT_FixedDUR2".into()), ("status_code", "TK_NotStart".into()), ("task_code", a.id.clone()), @@ -721,6 +1431,18 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + let shift_code = match a.calendar { + 5 => "OFFICE", + 7 => "OUTAGE", + _ => "DAY", + }; + let location_code = if a.wbs == "FAB" { + "SHOP" + } else if a.calendar == 5 { + "HOME" + } else { + "FIELD" + }; for (rsrc, units) in &a.resources { assignment += 1; let (i, r) = d.resource(rsrc); @@ -729,11 +1451,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { } else { (units * duration, *units) }; - let kind = match r.kind.as_str() { - "labor" => "RT_Labor", - "nonlabor" => "RT_Equip", - _ => "RT_Mat", - }; + let kind = r.xer_type(); add_row( doc, "TASKRSRC", @@ -769,6 +1487,29 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ("cost_per_qty_source_type", "ST_Rsrc".into()), ], ); + let billing_code = match r.kind.as_str() { + "material" => "MATL", + "nonlabor" => "EQUIP", + _ if r.role == "STAFF" || r.role == "SUPV" => "INDIRECT", + _ => "DIRECT", + }; + for (ty, val_short) in [ + ("Shift", shift_code), + ("Work Location", location_code), + ("Billing Type", billing_code), + ] { + let (t, v) = acat_id(ty, val_short); + add_row( + doc, + "ASGNMNTACAT", + &[ + ("taskrsrc_id", assignment.to_string()), + ("asgnmnt_catg_type_id", t.to_string()), + ("asgnmnt_catg_id", v.to_string()), + ("proj_id", "1".into()), + ], + ); + } } // Codes: area from the WBS, discipline from the activity ID, // phase from the top of the WBS, responsibility from the crew. @@ -777,45 +1518,31 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { "A200" => "200", "A300" => "300", "A400" => "400", + "A500" => "500", + "A600" => "600", _ => "GEN", }; let discipline = match &a.id[..2] { - "MS" | "PM" => "PM", + "MS" | "PM" | "LO" | "WS" => "PM", "EN" => "ENG", "PR" => "PRC", "DM" => "DEM", "CV" | "ST" => "CIV", "EQ" => "EQP", - "PP" => "PIP", + "PP" | "UT" => "PIP", "EL" => "ELE", "IN" => "INS", + "DC" => "AUT", "PI" => "PNT", _ => "COM", }; - let top = d - .wbs - .iter() - .find(|w| w[0] == a.wbs) - .map(|w| { - if w[1].is_empty() { - w[0].clone() - } else { - w[1].clone() - } - }) - .unwrap_or_default(); - let top = d - .wbs - .iter() - .find(|w| w[0] == top) - .map(|w| { - if w[1].is_empty() { - w[0].clone() - } else { - w[1].clone() - } - }) - .unwrap_or(top); + let mut top = a.wbs.clone(); + while let Some(w) = d.wbs.iter().find(|w| w[0] == top) { + if w[1].is_empty() { + break; + } + top = w[1].clone(); + } let phase = match top.as_str() { "ENG" => "1-ENG", "PROC" => "2-PROC", @@ -839,9 +1566,12 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { { "VEND" } else { + let automation = craft(&["AUTO"]); let electrical = craft(&["ELEC", "INST"]); let mechanical = craft(&["PF", "WLD", "MW"]); - if electrical > mechanical && electrical > 0. { + if automation > 0. && automation >= electrical && automation >= mechanical { + "AUTO" + } else if electrical > mechanical && electrical > 0. { "ELEC" } else if mechanical > 0. { "MECH" @@ -871,15 +1601,24 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { if phase == "3-CONST" && a.days.is_some() { let wp = format!("WP-{area}-{discipline}"); let crew = craft(&[ - "GF", "LAB", "CARP", "IW", "PF", "WLD", "ELEC", "INST", "MW", "PNT", "INSUL", "OPR", + "GF", "LAB", "CARP", "IW", "CFIN", "PF", "WLD", "ELEC", "INST", "MW", "PNT", + "INSUL", "OPR", ]); - udf(doc, d, task_id, "Work Package", &wp); - udf(doc, d, task_id, "Crew Size", &text(crew.ceil())); + udf(doc, d, "TASK", task_id, "Work Package", &wp); + udf(doc, d, "TASK", task_id, "Crew Size", &text(crew.ceil())); } } + + // Explicit UDF values (PROJECT or TASK). for v in &d.udf_values { - udf(doc, d, d.task_id(&v[0]), &v[1], &v[2]); + if v[0] == "PROJECT" { + udf(doc, d, "PROJECT", 1, &v[1], &v[2]); + } else { + udf(doc, d, "TASK", d.task_id(&v[0]), &v[1], &v[2]); + } } + + // Activity steps. for (i, s) in d.steps.iter().enumerate() { let task_id = d.task_id(&s[0]); let seq = d.steps[..i].iter().filter(|o| o[0] == s[0]).count() + 1; @@ -898,6 +1637,8 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + + // Expenses. for (i, e) in d.expenses.iter().enumerate() { let category = d .expense_categories @@ -929,6 +1670,8 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } + + // Resource curves. for c in &d.curves { let id = crate::edit::curves::ensure(doc, &c[2]).expect("preset curve"); let task_id = d.task_id(&c[0]).to_string(); @@ -941,6 +1684,219 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { .unwrap_or_else(|| panic!("sample table: no {} on {}", c[1], c[0])); t.set(row, "curv_id", id.to_string()); } + + // Work Products and Documents (DOCUMENT, TASKDOC). + let doc_id = |code: &str| -> i64 { + 1 + d + .documents + .iter() + .position(|x| x[0] == code) + .unwrap_or_else(|| panic!("sample table: no document {code}")) as i64 + }; + let mut taskdoc_id = 0i64; + for (i, item) in d.documents.iter().enumerate() { + let id = (i + 1) as i64; + let parent = if item[1].is_empty() { + String::new() + } else { + doc_id(&item[1]).to_string() + }; + let cat = d + .doc_categories + .iter() + .position(|c| *c == item[4]) + .unwrap_or_else(|| panic!("sample table: no doc category {}", item[4])) + + 1; + let stat = d + .doc_statuses + .iter() + .position(|s| *s == item[5]) + .unwrap_or_else(|| panic!("sample table: no doc status {}", item[5])) + + 1; + add_row( + doc, + "DOCUMENT", + &[ + ("doc_id", id.to_string()), + ("doc_seq_num", ((i + 1) * 10).to_string()), + ("deliv_flag", item[9].clone()), + ("doc_name", item[3].clone()), + ("parent_doc_id", parent), + ("proj_id", "1".into()), + ("doc_status_id", stat.to_string()), + ("doc_catg_id", cat.to_string()), + ("doc_date", item[8].clone()), + ("version_name", item[6].clone()), + ("doc_short_name", item[2].clone()), + ("author_name", item[7].clone()), + ("doc_content", records::text_to_memo(&item[11])), + ], + ); + for target in item[10].split(',').map(str::trim).filter(|t| !t.is_empty()) { + taskdoc_id += 1; + let (tid, wid) = if d.has_activity(target) { + let tid = d.task_id(target); + let act = &d.activities[(tid - 1000) as usize]; + (tid.to_string(), d.wbs_id(&act.wbs).to_string()) + } else { + (String::new(), d.wbs_id(target).to_string()) + }; + add_row( + doc, + "TASKDOC", + &[ + ("taskdoc_id", taskdoc_id.to_string()), + ("doc_id", id.to_string()), + ("proj_id", "1".into()), + ("wbs_id", wid), + ("wp_flag", item[9].clone()), + ("task_id", tid), + ], + ); + } + } + + // Risks (PROJRISK, TASKRISK). + for (i, r) in d.risks.iter().enumerate() { + let id = (i + 1) as i64; + let cat = d + .risk_categories + .iter() + .position(|c| *c == r[2]) + .unwrap_or_else(|| panic!("sample table: no risk category {}", r[2])) + + 1; + let kind = match r[3].as_str() { + "Threat" => "RT_Threat", + "Opportunity" => "RT_Opport", + other => panic!("sample table: risk kind {other:?}"), + }; + let owner = (d.resource(&r[5]).0 + 1).to_string(); + let by = (d.resource(&r[6]).0 + 1).to_string(); + add_row( + doc, + "PROJRISK", + &[ + ("risk_id", id.to_string()), + ("risk_code", r[0].clone()), + ("proj_id", "1".into()), + ("add_date", r[7].clone()), + ("status_code", risk_status_code(&r[4]).into()), + ("risk_name", r[1].clone()), + ("risk_type_id", cat.to_string()), + ("rsrc_id", owner), + ("risk_desc", r[16].clone()), + ("risk_to_type", kind.into()), + ("identified_by_id", by), + ("response_type", risk_response_code(&r[8]).into()), + ("response_text", r[19].clone()), + ("pre_rsp_prblty", r[9].clone()), + ("pre_rsp_schd_prblty", r[10].clone()), + ("pre_rsp_cost_prblty", r[11].clone()), + ("post_rsp_prblty", r[12].clone()), + ("post_rsp_schd_prblty", r[13].clone()), + ("post_rsp_cost_prblty", r[14].clone()), + ("risk_cause", r[17].clone()), + ("risk_effect", r[18].clone()), + ("notes", r[20].clone()), + ], + ); + for code in r[15].split(',').map(str::trim).filter(|c| !c.is_empty()) { + add_row( + doc, + "TASKRISK", + &[ + ("task_id", d.task_id(code).to_string()), + ("risk_id", id.to_string()), + ("proj_id", "1".into()), + ], + ); + } + } + + // Thresholds (PROJTHRS). + for (i, th) in d.thresholds.iter().enumerate() { + let detail = match th[2].as_str() { + "Activities" => "TM_Task", + "WBS" => "TM_WBS", + other => panic!("sample table: threshold detail {other:?}"), + }; + let status = match th[4].as_str() { + "Enabled" => "TS_Enable", + "Disabled" => "TS_Disable", + other => panic!("sample table: threshold status {other:?}"), + }; + add_row( + doc, + "PROJTHRS", + &[ + ("thresh_id", (i + 1).to_string()), + ("proj_id", "1".into()), + ("obs_id", d.obs_id(&th[5]).to_string()), + ("thresh_parm_id", th[1].clone()), + ("status_code", status.into()), + ("priority_type", priority_code(&th[3]).into()), + ("thresh_type", detail.into()), + ("wbs_id", d.wbs_id(&th[0]).to_string()), + ("lo_parm_value", th[6].clone()), + ("hi_parm_value", th[7].clone()), + ("window_start", th[8].clone()), + ("window_end", th[9].clone()), + ], + ); + } + + // Issues (PROJISSU, ISSUHIST). + for (i, iss) in d.issues.iter().enumerate() { + let id = (i + 1) as i64; + let status = match iss[2].as_str() { + "Open" => "IS_Open", + "On Hold" => "IS_On_Hold", + "Closed" => "IS_Closed", + other => panic!("sample table: issue status {other:?}"), + }; + let (tid, wid) = if d.has_activity(&iss[7]) { + let tid = d.task_id(&iss[7]); + let act = &d.activities[(tid - 1000) as usize]; + (tid.to_string(), d.wbs_id(&act.wbs).to_string()) + } else { + (String::new(), d.wbs_id(&iss[7]).to_string()) + }; + add_row( + doc, + "PROJISSU", + &[ + ("issue_id", id.to_string()), + ("obs_id", d.obs_id(&iss[3]).to_string()), + ("proj_id", "1".into()), + ("task_id", tid), + ("thresh_parm_id", iss[8].clone()), + ("wbs_id", wid), + ("add_by_name", iss[4].clone()), + ("issue_name", iss[0].clone()), + ("add_date", iss[5].clone()), + ("resolv_date", iss[6].clone()), + ("priority_type", priority_code(&iss[1]).into()), + ("status_code", status.into()), + ("issue_value", iss[9].clone()), + ("lo_parm_value", iss[10].clone()), + ("hi_parm_value", iss[11].clone()), + ("issue_notes", records::text_to_memo(&iss[12])), + ], + ); + if let Some(hist) = iss.get(13).filter(|s| !s.is_empty()) { + add_row( + doc, + "ISSUHIST", + &[ + ("issue_id", id.to_string()), + ("proj_id", "1".into()), + ("issue_history", hist.clone()), + ], + ); + } + } + + // Notebook notes (TASKMEMO, WBSMEMO). for (i, n) in d.notes.iter().enumerate() { let topic = d .topics @@ -949,7 +1905,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { .unwrap_or_else(|| panic!("sample table: no topic {}", n[1])) + 1; let memo = records::text_to_memo(&n[2]); - if d.activities.iter().any(|a| a.id == n[0]) { + if d.has_activity(&n[0]) { add_row( doc, "TASKMEMO", @@ -962,11 +1918,7 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { ], ); } else { - let wbs = if n[0] == "PROJECT" { - 100 - } else { - d.wbs_id(&n[0]) - }; + let wbs = d.wbs_id(&n[0]); add_row( doc, "WBSMEMO", @@ -983,23 +1935,23 @@ fn build(d: &Data, dates: &BTreeMap) -> Document { doc.clone() } -fn udf(doc: &mut Document, d: &Data, task_id: i64, label: &str, value: &str) { +fn udf(doc: &mut Document, d: &Data, table: &str, fk_id: i64, label: &str, value: &str) { let i = d .udfs .iter() - .position(|u| u[0] == label) - .unwrap_or_else(|| panic!("sample table: no user field {label}")); - let column = if d.udfs[i][1] == "number" { - "udf_number" - } else { - "udf_text" + .position(|u| u[0] == table && u[1] == label) + .unwrap_or_else(|| panic!("sample table: no {table} user field {label}")); + let column = match d.udfs[i][2].as_str() { + "number" | "cost" => "udf_number", + "start_date" | "finish_date" => "udf_date", + _ => "udf_text", }; add_row( doc, "UDFVALUE", &[ ("udf_type_id", (i + 1).to_string()), - ("fk_id", task_id.to_string()), + ("fk_id", fk_id.to_string()), ("proj_id", "1".into()), (column, value.to_string()), ], @@ -1012,15 +1964,68 @@ fn udf(doc: &mut Document, d: &Data, task_id: i64, label: &str, value: &str) { /// the share left (of the original duration), actual start and finish. type State = (StatusType, f64, f64, String, String); -/// The plan progressed to the table's data date: what the plan had done by -/// then is done, what straddles it is in progress, with the table's slips -/// added to the remaining work and its overruns to the actual units. -fn progress(d: &Data, plan: &ProjectData) -> ProjectData { +/// The plan progressed to `date`: what the plan had done by then is done, what +/// straddles it is in progress, with `slips` added to the remaining work and +/// `overruns` to the actual units. When `store_past_periods` is true, completed +/// financial periods prior to `date` receive stored period performance +/// (`TASKFIN` and `TRSRCFIN`). +fn progress( + d: &Data, + plan: &ProjectData, + date: &str, + slips: &[(String, f64)], + overruns: &[(String, f64)], + store_past_periods: bool, +) -> ProjectData { let mut p = plan.clone(); - let date = &d.progress_value("data date")[0][0]; let origin = p.model.origin_serial; let dd = parse_absolute(date).expect("data date") - origin * 1440; apply_progress(&mut p, dd, ProgressScope::All, RemainingRule::Always).expect("progress"); + + // Progress LOE activities whose start anchor (SS predecessor) has started + // or completed by the data date, so the engine tracks them as In Progress. + let loe_updates: Vec<(usize, i64, i64, f64)> = p + .model + .activities + .iter() + .enumerate() + .filter(|(_, a)| a.task_type == TaskType::Loe) + .filter_map(|(idx, a)| { + let ss_pred = a + .preds + .iter() + .map(|&l| &p.model.links[l]) + .find(|l| l.link_type == LinkType::SS) + .map(|l| &p.model.activities[l.pred])?; + let act_start = ss_pred.act_start?; + if act_start >= dd { + return None; + } + let cal = &p.model.calendars[a.cal]; + let orig = p + .details + .get(&a.task_id) + .map_or(0, |dt| dt.original_duration); + let elapsed = cal.cal.duration(act_start, dd); + let rem = (orig - elapsed).max(60); + let pct = if orig > 0 { + ((elapsed as f64 / orig as f64) * 100.).clamp(1., 99.) + } else { + 10. + }; + Some((idx, act_start, rem, pct)) + }) + .collect(); + for (idx, act_start, rem, pct) in loe_updates { + let a = &mut p.model.activities[idx]; + a.status = StatusType::InProgress; + a.act_start = Some(act_start); + a.rem = rem; + if let Some(dt) = p.details.get_mut(&a.task_id) { + dt.percent = pct; + } + } + // Planned remaining before the slips, by task id. let planned: BTreeMap = p .model @@ -1028,22 +2033,21 @@ fn progress(d: &Data, plan: &ProjectData) -> ProjectData { .iter() .map(|a| (a.task_id, a.rem)) .collect(); - for s in d.progress_value("slip") { - let task_id = d.task_id(&s[0]); + for (code, days) in slips { + let task_id = d.task_id(code); let a = p .model .activities .iter_mut() .find(|a| a.task_id == task_id) .unwrap(); - assert_eq!(a.status, StatusType::InProgress, "slip on {}", s[0]); + assert_eq!(a.status, StatusType::InProgress, "slip on {code}"); let hours = calendar_hours(d.activities[(task_id - 1000) as usize].calendar); - a.rem += (number(&s[1]) * hours * 60.) as i64; + a.rem += (*days * hours * 60.) as i64; } - let overrun: BTreeMap = d - .progress_value("overrun") + let overrun: BTreeMap = overruns .iter() - .map(|o| (d.task_id(&o[0]), number(&o[1]))) + .map(|(code, factor)| (d.task_id(code), *factor)) .collect(); let mut doc = p.updated_document(); let state: BTreeMap = p @@ -1053,12 +2057,12 @@ fn progress(d: &Data, plan: &ProjectData) -> ProjectData { .map(|a| { let original = p.details[&a.task_id].original_duration as f64; let done = if original > 0. { - (original - planned[&a.task_id] as f64) / original + ((original - planned[&a.task_id] as f64) / original).clamp(0., 1.) } else { 1. }; let left = if original > 0. { - a.rem as f64 / original + (a.rem as f64 / original).max(0.) } else { 0. }; @@ -1135,10 +2139,159 @@ fn progress(d: &Data, plan: &ProjectData) -> ProjectData { t.set(i, "complete_pct", "100".into()); } } + if store_past_periods { + populate_past_period_actuals(&mut doc, d, &p, dd); + } let mut current = load(doc); sync_rollups(&mut current); current } +/// Populate `TASKFIN` and `TRSRCFIN` rows for completed financial periods +/// ending before the data date, distributing each started/completed activity's +/// actuals across the months in which the work occurred. +fn populate_past_period_actuals(doc: &mut Document, d: &Data, p: &ProjectData, dd: i64) { + let origin = p.model.origin_serial; + let abs_dd = origin * 1440 + dd; + let periods: Vec<(i64, i64, i64)> = d + .financial_periods + .iter() + .enumerate() + .filter_map(|(i, fp)| { + let s = parse_absolute(&fp[2])?; + let e = parse_absolute(&fp[3])?; + (e < abs_dd).then_some(((i + 1) as i64, s, e + 1)) + }) + .collect(); + if periods.is_empty() { + return; + } + if let Some((last_id, _, _)) = periods.last() { + let proj = doc.table_mut("PROJECT"); + if !proj.rows.is_empty() { + proj.set(0, "last_fin_dates_id", last_id.to_string()); + } + } + // Per activity: (act_start_abs, act_end_or_dd_abs). + let spans: BTreeMap = p + .model + .activities + .iter() + .filter_map(|a| { + let s = a.act_start? + origin * 1440; + let e = a + .act_finish + .map_or(abs_dd, |f| f + origin * 1440) + .max(s + 1); + Some((a.task_id, (s, e))) + }) + .collect(); + let share_in = |task_id: i64, ps: i64, pe: i64| -> f64 { + let Some(&(s, e)) = spans.get(&task_id) else { + return 0.; + }; + let lo = s.max(ps); + let hi = e.min(pe); + if hi <= lo { + return 0.; + } + (hi - lo) as f64 / (e - s) as f64 + }; + + // Snapshot assignment actuals before adding TRSRCFIN/TASKFIN rows. + let mut assign_rows: Vec<(i64, i64, String, f64, f64)> = vec![]; + if let Some(t) = doc.table("TASKRSRC") { + for r in &t.rows { + let act_qty = records::float(t.value(r, "act_reg_qty")); + let act_cost = records::float(t.value(r, "act_reg_cost")); + if act_qty <= 0. && act_cost <= 0. { + continue; + } + assign_rows.push(( + records::num(t.value(r, "taskrsrc_id")), + records::num(t.value(r, "task_id")), + t.value(r, "rsrc_type").to_string(), + act_qty, + act_cost, + )); + } + } + let mut expense_rows: Vec<(i64, f64)> = vec![]; + if let Some(t) = doc.table("PROJCOST") { + for r in &t.rows { + let act_cost = records::float(t.value(r, "act_cost")); + if act_cost > 0. { + expense_rows.push((records::num(t.value(r, "task_id")), act_cost)); + } + } + } + + // Aggregate per (fin_dates_id, task_id): + // [labor_qty, labor_cost, equip_qty, equip_cost, mat_cost, expense_cost] + let mut task_fin: BTreeMap<(i64, i64), [f64; 6]> = BTreeMap::new(); + for &(fid, ps, pe) in &periods { + for &(tr_id, tid, ref kind, qty, amt) in &assign_rows { + let f = share_in(tid, ps, pe); + if f <= 0. { + continue; + } + let pq = qty * f; + let pc = amt * f; + add_row( + doc, + "TRSRCFIN", + &[ + ("fin_dates_id", fid.to_string()), + ("taskrsrc_id", tr_id.to_string()), + ("task_id", tid.to_string()), + ("proj_id", "1".into()), + ("act_qty", text(pq)), + ("act_cost", cost(pc)), + ], + ); + let slot = task_fin.entry((fid, tid)).or_insert([0.; 6]); + match kind.as_str() { + "RT_Labor" => { + slot[0] += pq; + slot[1] += pc; + } + "RT_Equip" => { + slot[2] += pq; + slot[3] += pc; + } + _ => slot[4] += pc, + } + } + for &(tid, amt) in &expense_rows { + let f = share_in(tid, ps, pe); + if f > 0. { + task_fin.entry((fid, tid)).or_insert([0.; 6])[5] += amt * f; + } + } + } + for ((fid, tid), v) in task_fin { + let total = v[1] + v[3] + v[4] + v[5]; + add_row( + doc, + "TASKFIN", + &[ + ("fin_dates_id", fid.to_string()), + ("task_id", tid.to_string()), + ("proj_id", "1".into()), + ("act_work_qty", text(v[0])), + ("act_work_cost", cost(v[1])), + ("act_equip_qty", text(v[2])), + ("act_equip_cost", cost(v[3])), + ("act_mat_cost", cost(v[4])), + ("act_expense_cost", cost(v[5])), + ("bcwp", cost(total)), + ("perfm_work_qty", text(v[0])), + ("bcws", cost(total)), + ("sched_work_qty", text(v[0])), + ], + ); + } +} + #[cfg(test)] mod tests; diff --git a/xer/src/sample_project/tests.rs b/xer/src/sample_project/tests.rs index 1450ad3..1ab39c3 100644 --- a/xer/src/sample_project/tests.rs +++ b/xer/src/sample_project/tests.rs @@ -231,7 +231,7 @@ fn the_sample_is_a_mid_size_job() { let s = sample(); let m = &s.current.model; assert!( - (150..=250).contains(&m.activities.len()), + (350..=450).contains(&m.activities.len()), "{}", m.activities.len() ); @@ -265,8 +265,11 @@ fn every_task_is_labor_and_cost_loaded() { .iter() .filter(|r| num(t.value(r, "task_id")) == a.task_id) .collect(); - if a.task_type != TaskType::Task { - assert!(mine.is_empty(), "{} is a milestone", a.task_code); + if matches!( + a.task_type, + TaskType::Mile | TaskType::FinMile | TaskType::Wbs + ) { + assert!(mine.is_empty(), "{} has no assignments", a.task_code); continue; } assert!( @@ -284,18 +287,26 @@ fn every_task_is_labor_and_cost_loaded() { #[test] fn only_the_start_and_finish_are_open_ends() { - for p in [&sample().plan, &sample().current] { + for p in [&sample().plan, &sample().revision, &sample().current] { let m = &p.model; let starts: Vec<&str> = m .activities .iter() - .filter(|a| a.preds.is_empty()) + .filter(|a| !matches!(a.task_type, TaskType::Loe | TaskType::Wbs) && a.preds.is_empty()) .map(|a| a.task_code.as_str()) .collect(); let finishes: Vec<&str> = m .activities .iter() - .filter(|a| a.succs.is_empty()) + .filter(|a| { + !matches!(a.task_type, TaskType::Loe | TaskType::Wbs) + && a.succs.iter().all(|&l| { + matches!( + m.activities[m.links[l].succ].task_type, + TaskType::Loe | TaskType::Wbs + ) + }) + }) .map(|a| a.task_code.as_str()) .collect(); assert_eq!((starts, finishes), (vec!["MS0000"], vec!["PM0920"])); @@ -389,7 +400,7 @@ fn budgets_add_up() { } } let budget: f64 = rows.iter().map(|r| float(t.value(r, "target_cost"))).sum(); - assert!((2_000_000. ..3_000_000.).contains(&budget), "{budget}"); + assert!((4_000_000. ..6_000_000.).contains(&budget), "{budget}"); } // The plan carries no actuals; the budget is the same in both. let total = |p: &ProjectData, column: &str| -> f64 { @@ -540,8 +551,58 @@ fn the_sample_has_codes_fields_steps_expenses_curves_and_notes() { ] { assert!(topics.contains(&topic), "{topics:?}"); } - assert!(count("TASKMEMO") >= 12); - assert!(count("WBSMEMO") >= 6); + assert!(count("TASKMEMO") >= 20); + assert!(count("WBSMEMO") >= 12); + // Rich enterprise and project registers are all populated. + assert!(count("OBS") >= 5); + assert!(count("ROLERATE") >= 4); + assert!(count("BASETYPE") >= 3); + assert!(count("PCATTYPE") >= 4); + assert!(count("PROJPCAT") >= 4); + assert!(count("FUNDSRC") >= 3); + assert!(count("PROJFUND") >= 3); + assert!(count("RCATTYPE") >= 2); + assert!(count("RSRCRCAT") >= 20); + assert!(count("ASGNMNTCATTYPE") >= 3); + assert!(count("ASGNMNTACAT") >= 100); + assert!(count("WBSSTEP") >= 15); + assert!(count("BUDGCHNG") >= 6); + assert!(count("WBSBUDG") >= 10); + assert!(count("DOCCATG") >= 5); + assert!(count("DOCSTAT") >= 4); + assert!(count("DOCUMENT") >= 18); + assert!(count("TASKDOC") >= 25); + assert!(count("RISKTYPE") >= 5); + assert!(count("PROJRISK") >= 10); + assert!(count("TASKRISK") >= 20); + assert!(count("THRSPARM") >= 14); + assert!(count("PROJTHRS") >= 5); + assert!(count("PROJISSU") >= 6); + assert!(count("ISSUHIST") >= 6); + assert!(count("FINTMPL") >= 1); + assert!(count("FINDATES") >= 12); + assert!(count("TASKFIN") >= 40); + assert!(count("TRSRCFIN") >= 80); + assert!(p + .model + .activities + .iter() + .any(|a| a.task_type == TaskType::Loe)); + assert!(p + .model + .activities + .iter() + .any(|a| a.task_type == TaskType::Wbs)); + // Hierarchical resources: parent folders exist and children point to them. + let (rt, rrows) = table_rows(p, "RSRC"); + assert!(rrows + .iter() + .any(|r| !rt.value(r, "parent_rsrc_id").is_empty())); + // Second baseline (mid-project rebaseline) sits between plan and current. + let rev_dd = sample().revision.model.project.data_date.unwrap(); + let plan_dd = sample().plan.model.project.data_date.unwrap(); + let cur_dd = p.model.project.data_date.unwrap(); + assert!(plan_dd < rev_dd && rev_dd < cur_dd); // Codes are the project's own, calendars and resources are named for it. let (t, rows) = table_rows(p, "ACTVTYPE"); assert!(rows @@ -695,3 +756,60 @@ fn the_s_curve_and_earned_hours_reports_run_on_the_sample() { assert!(hours.rows.iter().any(|r| r.key == "ENGR" && r.earned > 0.)); assert!(hours.rows.iter().all(|r| r.budgeted > 0.)); } + +#[test] +fn the_sample_passes_schedule_check() { + use crate::schedule_check::{run_checks_with, CheckParams, Item}; + let s = sample(); + let (plan, current) = (&s.plan, &s.current); + let shift = (plan.model.origin_serial - current.model.origin_serial) * 1440; + let baseline: Vec> = current + .model + .activities + .iter() + .map(|a| { + plan.model + .activities + .iter() + .find(|b| b.task_id == a.task_id) + .and_then(|b| b.early_finish) + .map(|f| f + shift) + }) + .collect(); + let t = current.document.table("PROJCOST").unwrap(); + let with_expenses = t + .rows + .iter() + .map(|r| t.value(r, "task_id").parse().unwrap()) + .collect(); + let results = run_checks_with( + ¤t.model, + &CheckParams::default(), + &with_expenses, + Some(&baseline), + ); + let failed: Vec = results + .iter() + .filter(|r| r.passed == Some(false)) + .map(|r| { + let codes: Vec = r + .items + .iter() + .filter_map(|item| match item { + Item::Activity(i) => { + let a = ¤t.model.activities[*i]; + Some(format!( + "{}(tf={}d)", + a.task_code, + a.total_float.unwrap_or(0) / 480 + )) + } + _ => None, + }) + .collect(); + format!("{} {:?} {:?}", r.check.name(), r.value, codes) + }) + .collect(); + assert!(failed.is_empty(), "{failed:?}"); + assert!(results.iter().filter(|r| r.passed == Some(true)).count() >= 13); +}