1. Overview
🎯 Module Purpose
T3_2_Inbound Space.vb is an advanced module designed to compute the requisite staging and dock area for inbound logistics operations. It leverages scientific calculations factoring in cargo volume, truck models, loading styles, and unloading dwell times.
1.1 Key Characteristics
📊 Diverse Data Inputs
Imports raw inbound volume metrics via Excel files, segmenting data by case-level and piece-level workflows.
🚛 Truck Profiling
Configures multiple truck capacities and accounts for both palletized and floor-loaded cargo profiles.
⏱️ Time-Based Sizing
Determines space requirements based on precise unloading cycle times and daily peak volume concentration ratios.
📐 Footprint Optimization
Calculates comprehensive square footage including truck staging queues and empty pallet return buffers.
1.2 File Information
| Item | Details |
|---|---|
| File Name | T3_2_Inbound Space.vb |
| Line Count | 962 Lines |
| Class Name | T3_2InboundFrom |
| Inheritance | System.Windows.Forms.Form |
| Libraries Used | System.IO, OfficeOpenXml (EPPlus) |
1.3 Associated Files
- Inventory_Inbound_Volume.xlsx: Base volume data split by case/piece output.
- Inbound_Space_Calc.xlsx: Master data for truck specs and default unload times.
- TeraCalcData Directory: System root directory for DB and Excel storage.
2. Architecture & Design
2.1 Class Structure
📦 T3_2InboundFrom Class
Base Class: System.Windows.Forms.Form
Access Modifier: Public
Primary Role: Provides the GUI and mathematical logic for inbound sizing.
2.2 Code Regions
| Region Name | Line Range | Core Function |
|---|---|---|
| Inbound Volume Dgv Display | 23-163 | Reads and displays Excel volume data |
| Inbound Space Calc | 165-578 | Main mathematical sizing engine |
| PL/Case Volume Calc | 580-637 | Reverse-engineers case metrics |
| Unloading Time Update | 639-858 | Reads and refreshes dwell times |
| Unloading Time Save | 860-940 | Commits user customizations to Excel |
2.3 Data Flow
Processing Pipeline
1. Excel Import
├─ Inventory_Inbound_Volume.xlsx (Raw Volumes)
└─ Inbound_Space_Calc.xlsx (Truck & Dwell Specs)
2. Volume Aggregation
├─ Inbound generated from full-case picking
├─ Inbound generated from loose-piece picking
└─ Total combined inbound cubic volume
3. Scenario Configuration (Up to 3 Truck Types)
├─ Assign vehicle specs (Type 1, 2, 3)
├─ Assign loading type (Palletized / Floor-loaded)
└─ Assign workload distribution ratios
4. Bay Count Calculation
├─ Trucks per Day = Total Volume / Truck Capacity
├─ Total Dwell Time = Trucks * Unload Mins/Truck
├─ Apply Peak Hour Ratio
└─ Result = Required Dock Bay Count
5. Final Space Sizing
├─ Staging Area = Bay Count * Truck Area * Clearance
├─ Empty Pallet Buffer Area
└─ Total Required Footprint = (Staging + Buffers) * Safety Margin
3. Core Features
3.1 Data Import
📥 Inventory Inbound XLSX Loader
在庫入荷量XLSX読込(MySheet, Mydgv)
Function: Parses raw Excel data directly into the DataGridView.
Technology: EPPlus (OfficeOpenXml).
Target Sheets:
- Case Shipping Volume
- Piece Shipping Volume
Private Sub 在庫入荷量XLSX読込(MySheet As String, Mydgv As DataGridView) MyExcel = Dat保存Path & "\在庫入荷量.xlsx" Dim fi As IO.FileInfo = New IO.FileInfo(MyExcel) If fi.Exists = False Then MessageBox.Show("File not found") Return End If Using pkg As New ExcelPackage(fi) Dim sheet1 As ExcelWorksheet = pkg.Workbook.Worksheets(MySheet) ' Data import logic... End Using End Sub
3.2 Sizing Calculation
🧮 Inbound Space Calc 1()
Main Sizing Function
Execution Sequence:
- Load Truck Specs into DGV()
- Calculate Bays and Space 1()
📊 Bay & Space Mathematics()
Micro-Steps
Applies mathematical distribution across 3 parallel inbound configurations.
Step 1: Segmented Volume
Step 2: Effective Capacity
Step 3: Daily Truck Arrivals
Step 4: Total Dock Dwell
Step 5: Peak Hour Workload
Step 6: Required Bays
Step 7: Staging Area Footprint
Step 8: Empty Pallet Buffer Area
Step 9: Grand Total Space
3.3 Helper Functions
Palletized Payload Volume()
Calculates effective truck volume when using pallets.
Floor-Loaded Payload Volume()
Fetches theoretical max volume directly from truck master data.
Dwell Time()
Fetches cumulative unloading time based on vehicle type and loading method.
Staging Area()
Calculates immediate buffer footprint behind the dock doors.
Empty PL Buffer()
Calculates holding footprint for retrieved empty pallets.
3.4 PL/Case Reverse Engineering
📦 PL/Case Volume Calculator()
Functional Overview
Advanced heuristics to reverse-engineer average carton dimensions if raw data lacks them.
Logic Flow:
- Derive average case volume from total aggregate metrics.
- Iteratively scale a 4:3:2 W:D:H aspect ratio until the target volume is matched.
- Assign resulting dimensions to pallet configurations.
' Reverse engineer dimensions via 4:3:2 ratio constraint Dim V As Single = AverageCaseVolume * 1000 ^ 3 ' m³ to mm³ For i = 1 To 1000 AvgCaseWidth = 4 * i AvgCaseDepth = 3 * i AvgCaseHeight = 2 * i If (AvgCaseWidth * AvgCaseDepth * AvgCaseHeight) >= V Then Exit For End If Next
4. Data Metrics & Constraints
4.1 Volume Sourcing
| Item | Formula | Description |
|---|---|---|
| Case Volume Base | Aggregated from Case Shipments | Inbound replenishment to support full-case picking. |
| Piece Volume Base | Aggregated from Piece Shipments | Inbound replenishment to support loose-piece picking. |
| Total Inbound Volume | Case Base + Piece Base | Gross daily replenishment demand in cubic meters. |
| Peak Target Volume | Total Inbound Volume × Peak Ratio / 100 | Spike volume used for actual dock design. |
4.2 Truck & Dock Design Parameters
⚠️ Critical Sizing Variables
- 3 Scenarios: Users can distribute freight across up to 3 distinct truck types to mirror reality.
- Volume Ratios: The split percentage must equal exactly 100%.
- Load Factor: Real-world trailer utilization (rarely 100%).
- Peak Hour Ratio: Protects against morning/afternoon arrival clustering.
- Aisle Clearance: 1.5x multiplier ensures MHE maneuvering space behind the trailer.
- Safety Margin: Final multiplier applied to absolute area totals.
4.3 Unload Time Dwell Components
| Task Component | Duration (Mins) | Description |
|---|---|---|
| Docking Approach | Variable | Time required to safely back into the bay. |
| Clerical Processing | Variable | Manifest review and WMS check-in. |
| Physical Unload | Variable | Core labor time executing the physical strip. |
| Audit & Inspection | Variable | Quality/quantity checks on the dock floor. |
| Undocking | Variable | Pull-away and exit time. |
| Total Dwell | Sum | The full cycle time the dock bay is occupied. |
4.4 Sample Equation Flow
📝 Step-by-Step Resolution
Baseline Scenario:
- Total Volume: 100 m³
- Scenario 1 (Palletized): 60% share
- Truck Class: 4-Ton Truck
- Truck Capacity: 30 m³
- Load Factor: 80%
- Total Dwell Time: 60 mins/truck
- Peak Hour Ratio: 30%
Calculation Sequence:
1. Target Volume = 100 m³ × 60% = 60 m³
2. Payload/Truck = 30 m³ × 80% = 24 m³
3. Truck Arrivals = 60 m³ / 24 m³ = 2.5 Trucks
4. Total Dock Dwell = 2.5 Trucks × 60 mins = 150 mins
5. Peak Workload Dwell = 150 mins × 30% = 45 mins
6. Required Bays = 45 mins / 60 mins = 0.75 → Rounds to 1 Bay
7. Staging Area = 15m² (Truck Footprint) × 1 Bay × 1.5 = 22.5 m²
8. Empty PL Area = (1.21 m² × 10 PLs × 1) / 5 Tiers = 2.42 m²
9. Final Inbound Space = (22.5 + 2.42) × 1.2 Margin = 29.9 m²
5. Data Architecture
5.1 External Excel Dependencies
📄 Inventory_Inbound_Volume.xlsx
| Worksheet Name | Contents | Size |
|---|---|---|
| Case Shipping Volume | Replenishment demands for full-case workflows. | 7 cols × 60 rows |
| Piece Shipping Volume | Replenishment demands for loose-piece workflows. | 7 cols × 60 rows |
📄 Inbound_Space_Calc.xlsx
| Worksheet Name | Contents | Size |
|---|---|---|
| Tera Setting Dwell | System default unload cycle times. | 20 cols × 23 rows |
| User Setting Dwell | Customized dwell times modified by user. | 20 cols × 23 rows |
| Truck Specs | Dimension and volume master data by vehicle class. | 15 cols × 12 rows |
5.2 DataGridView Map
| Control Name | Purpose | Data Source |
|---|---|---|
| Case Inbound Volume Dgv | Renders case volumes. | Excel: Case Shipping Volume |
| Piece Inbound Volume Dgv | Renders piece volumes. | Excel: Piece Shipping Volume |
| Aggregated Inbound Dgv | Renders unified view. | Combined via code |
| Truck Specs Dgv | Renders reference specs. | Excel: User Setting Dwell |
| Tera Dwell Setting Dgv | Renders system defaults. | Excel: Tera Setting Dwell |
| User Dwell Setting Dgv | Editable dwell grid. | Excel: User Setting Dwell |
| Calculation Results Dgv | Renders final answers. | Memory outputs |
5.3 Application State Variables
' Inherited Global Variables (from T3_UtilitySoft.vb) Public Dat保存Path As String ' Storage root directory Public MyExcel As String ' Active Excel path Public MySheet As String ' Active Worksheet Public MyDgv As DataGridView ' Active target DGV ' Internal State Variables Private Dgv表示_チェック As Integer ' Initialization semaphore Private 平均ケース幅 As Single ' Avg Case Width Private 平均ケース奥行 As Single ' Avg Case Depth Private 平均ケース高 As Single ' Avg Case Height
6. Methods Reference
6.1 Initialization
スペース計算1入荷From_Load
Event Hook: Form Load
Execution Order:
- Set init semaphore to 0.
- Execute master file/path verification.
- Render copyright and license expiry tags.
- Load Excel volume data for Cases and Pieces.
- Set init semaphore to 1.
- Display aggregated volume grids.
- Load Dwell Time tables.
- Update text field UI.
- Execute Pallet/Case heuristic scaling.
6.2 Display Renders
入荷量Dgv表示()
Function: Refreshes the aggregate volume summary UI.
Toggles:
- Volume Mode Rb = True: Displays in m³ format.
- Volume Mode Rb = False: Displays physical unit counts.
入荷トラック仕様Dgv表示()
Function: Renders read-only reference data for vehicles.
UI Rules:
- Hides row and column headers.
- Enforces ReadOnly state.
- Applies N0, N1, N2 numeric formatting bounds.
- Auto-sizes columns via AutoSizeColumnsMode.
- Freezes critical reference axes.
6.3 Execution & Saving
入荷スペース計算開始Bt_Click
Function: Primary execution trigger.
Logic: Executes the main math module and highlights the results container.
テキスト集計Bt_Click
Function: Sub-totals the 5 micro-dwell parameters into a unified "Total Unloading Time" value before saving.
荷降ろし時間ユーザ設定_修正保存Bt_Click
Function: Commits UI edits back to the underlying Excel master file.
荷降ろし時間Tera設定Rb_CheckedChanged
Function: Factory reset. Overwrites all user-customized dwell times with the Tera System defaults after prompting for confirmation via MessageBox.
7. Usage & Workflow
7.1 Standard User Journey
📋 Step-by-Step Guide
- Launch Screen
- Open Inbound Space from the main utility menu.
- Wait for Excel data to auto-populate the grids.
- Verify Volumes
- Review the aggregate volume grid.
- Toggle between cubic meter volume and raw counts.
- Tune Operational Parameters
- Set the Peak Ratio (e.g., 30% concentration).
- Set desired Pallet Load Factor (e.g., 75%).
- Set the Safety Margin Area Multiplier (e.g., 120%).
- Configure Truck Arrivals (Up to 3 Profiles)
- Select vehicle classifications.
- Select loading style (Palletized vs Floor-loaded).
- Assign distribution percentages (must sum to 100%).
- Define the actual cubic utilization percentage for the trailers.
- Execute
- Click the large calculate button.
- Observe the results grid populate.
- Evaluate Outcomes
- Determine total required receiving docks.
- Determine total required inbound square meterage.
- Use these values for subsequent architectural layouts.
7.2 Modifying Dwell Times
🔧 Customization Process
- Select the "User Setting" radio button to unlock edits.
- Select the target vehicle class.
- Select the target loading style.
- Override the time values for approach, clerical check, physical unload, inspection, and exit.
- Click the Sub-Total button.
- Click Save to commit to the Excel master.
📌 Note: Saved settings persist across application restarts.
7.3 Factory Reset
⚠️ Restoring Tera Defaults
To purge custom dwell times:
- Select the "Tera Setting" radio button.
- A confirmation prompt will appear.
- Clicking "Yes" will permanently overwrite the User sheet with the Tera Master sheet values.
⚠️ Warning: This operation is destructive and cannot be undone.
7.4 Troubleshooting
❌ Common Errors & Fixes
1. "File Not Found" Exception
- Cause: Missing Excel files.
- Fix: Ensure the `Tera計算Data` folder exists on a valid root drive (A: through F:).
2. #DIV/0! Error in Results
- Cause: Attempting to divide by a zero payload capacity.
- Fix: Ensure Truck Volumes and Load Factors are greater than zero.
3. Unreasonably High/Low Dock Requirements
- Cause: Anomalous Peak Factor or Dwell Time inputs.
- Fix: Verify Peak ratios (30-50% is standard) and Load factors (70-85%).
4. Allocation Total Mismatch
- Cause: The 3 arrival profile distributions do not equal exactly 100%.
- Fix: Adjust the percentage sliders/inputs until they balance.
8. Summary & Recommendations
🎓 Value Proposition of T3_2_Inbound Space.vb
- Science-Based Sizing: Eliminates guesswork by deriving footprint directly from logistics physics.
- High Granularity: Models realistic mixed-fleet arrivals across 3 distinct vehicle profiles simultaneously.
- Excel Portability: Interacts seamlessly with Excel for transparent, auditable data persistence via EPPlus.
- Adaptable: Allows seasoned engineers to override default dwell assumptions with real-world time-study data.
8.1 Usage Patterns
Pattern 1: Greenfield Design
Determine exactly how many dock doors and how much staging depth to include in architectural blueprints.
Pattern 2: Facility Audit
Compare theoretical minimum space against a currently congested facility to justify expansion.
Pattern 3: Throughput Stress Test
Scale up the volume inputs to see when existing dock doors will become a hard bottleneck.
Pattern 4: Process Optimization
Simulate shifting from floor-loading to 100% palletized receiving to evaluate the reduction in dock dwell times and required bays.
8.2 Notes for Maintainers
💡 Developer Guidelines
- Hardcoded Excel Maps: Column and row offsets are hardcoded. If the template Excel file structure changes, the loop indices in the code must be updated.
- EPPlus Compatibility: Validate EPPlus library versions. Upgrading beyond version 4.x introduces commercial licensing constraints.
- Semaphore Integrity: Ensure the `Dgv表示_チェック` flag is properly handled to prevent race conditions during UI repaints.
- Input Sanitization: While basic bounds checking exists, ensure user text inputs are safely cast to Doubles before execution.