T3_8_SorterCalc.vb Detailed Explanation
Location: ../TeraCalc3_LogisticsEquipmentSpaceCalc/
Lines: 163 lines
Purpose: Layout calculation for case sorters
Overview
This file is a Visual Basic form class that performs layout calculations for a case sorter. It provides features to calculate the required space for installing logistics equipment.
Class Structure
Inherits: Form
Core Functional Areas
1. Screen Operations (#Region "Screen Operations")
SorterCalc_Load Event (Lines 6-13)
Process Details:
- Displays copyright information and validity period
- Calls 3 calculation methods sequentially
RecalculateBt_Click Event (Lines 15-27)
Process Details:
- Re-executes all calculation methods
- Toggles GroupBox3 background color (visual indication of calculation status)
- LightYellow ⇔ PowderBlue
Other Screen Operation Events
| Event Name | Process Details | Line No |
|---|---|---|
| CoverPb_Click | Navigate to "Deviation ETB" tab | 30-32 |
| SorterCalcBt_Click | Navigate to "Deviation ETB" tab | 34-36 |
| CloseBt_Click | Close the form | 39-41 |
2. Layout Calculation (#Region "Layout Calculation")
DetailedDimensions2() → DetailedDimensions1() → LayoutArea()
(Base Dimensions) → (Derived Dimensions) → (Final Result)
DetailedDimensions2() Method (Lines 78-138)
Reads base dimensions and performs initial calculations.
Input Parameters
| Variable Name | Description | Input Source |
|---|---|---|
| AWorkWidth | Working space width | AWorkWidthTb |
| InspectionAisleWidth | Maintenance aisle | InspectionAisleWidthTb |
| AuxiliaryAisleWidth | Auxiliary aisle | AuxiliaryAisleWidthTb |
| BCageCartInOutAisle | Cage cart entry/exit aisle width | BCageCartInOutAisleTb |
| CCageCartDepth | Cage cart depth | CCageCartDepthTb |
| Deviation | Calculation adjustment value (margin) | Deviation4Tb |
| ChuteWidth | Width of one chute | ChuteWidthTb |
| InputCvWidth | Input conveyor width | InputCvWidthTb |
| WaitingArea1Width / 2Width | Waiting space | WaitingArea1WidthTb / 2WidthTb |
| HorizontalCvLength / InclinedCvLength | Conveyor length | HorizontalCvLengthTb / InclinedCvLengthTb |
| SorterProtectivePillar | Safety pillar space | SorterProtectivePillarTb |
Calculation Items
1. Input Work Width (Lines 106-108)
2. Work 1 Width (Lines 110-112)
3. Work 2 Width (Lines 114-117)
4. Effective Work Length (Lines 125-127)
5. Main Body Length (Lines 130-132)
Deviation Synchronization Processing (Lines 90-93)
DetailedDimensions1() Method (Lines 54-77)
Calculates the width of each section of the sorter.
Calculation Items
1. Input Line Width (Lines 55-57)
2. Sorter Front Width (Lines 59-61)
3. Sorter Middle Width (Lines 63-65)
4. Sorter Rear Width (Lines 67-69)
Synchronizes and displays each calculation result across multiple text boxes (different locations on the screen). This allows the same dimension to be displayed at different locations on the drawing.
LayoutArea() Method (Lines 140-157)
Calculates the final required area.
Calculation Items
1. Sorter Middle Chute Count (Lines 141-143)
2. Sorter Middle Total Width (Lines 145-146)
3. Required Width (Lines 149-150)
4. Required Length (Lines 152-153)
5. Required Area (Lines 155-156)
Details of Formula:
- Required Width × Required Length = Area in mm²
- ÷ 1000² = Convert to m²
- + 0.5 = Adjustment for rounding
- Int() = Gets the integer part
Distinctive Design Features
| Feature | Details |
|---|---|
| Phased Calculation Approach | Calculates in 3 phases: Base Dimensions → Sectional Dimensions → Final Area. Intermediate results are displayed on-screen at each phase. |
| Real-time Synchronization | Displays the same value in multiple text boxes (for drawing display). Deviation values are displayed in both positive and negative. |
| Visual Feedback | Changes background color upon recalculation to explicitly show calculation execution. |
| Flexible Configuration Calc | Dynamically calculates middle width based on chute count. Separates formulas for one-sided/two-sided work spaces. |
Use Case Scenarios
1. Logistics Center Design Phase
Pre-calculates the space required to install a case sorter and reflects it in the building design.
2. Layout Optimization
Minimizes required area by adjusting chute counts and work widths to reduce costs.
3. Comparing Multiple Plans
Modifies parameters, recalculates, and compares multiple installation options.
Calculation Flowchart
[Form Load] ↓ ┌─────────────────────┐ │ DetailedDimensions2()│ ← Read base dimensions │ - InputWorkWidth │ │ - Work1Width │ │ - Work2Width │ │ - Work3Width │ │ - EffectiveWorkLength│ │ - MainBodyLength │ └────┬────────────────┘ ↓ ┌─────────────────────┐ │ DetailedDimensions1()│ ← Calc sectional widths │ - InputLineWidth │ │ - SorterFrontWidth │ │ - SorterMiddleWidth │ │ - SorterRearWidth │ └────┬────────────────┘ ↓ ┌─────────────────────┐ │ LayoutArea() │ ← Calc final area │ - RequiredWidth │ │ - RequiredLength │ │ - RequiredArea(m²) │ └─────────────────────┘ ↓ [Screen Display]
Summary
This code is considered part of an architectural/facility design support system used in practice as a dedicated space calculation tool for logistics equipment.
Main Advantages:
- Automates complex dimension calculations.
- Reduces human errors.
- Responds quickly to design changes.
- Easily compares multiple plans.
- Improves efficiency in drawing creation.