1. Overview
🎯 Module Purpose
T3_1_Manual_Calculation_Method is an educational module within TeraCalc3_Utility. It serves as an on-screen reference displaying fundamental calculation theories and layout design concepts to help users understand logistics engineering principles.
1.1 Key Characteristics
📚 Educational Tool
Explains basic logistics concepts and facility design strategies.
🖥️ Simple UI
Utilizes a RichTextBox for clear, static text rendering without requiring complex operations.
🔗 Menu Integration
Triggered as a modal dialog from the main menu, returning gracefully upon closure.
💡 Shared Design Philosophy
Outlines the prerequisite knowledge and core philosophy defining the TeraCalc software series.
1.2 File Structure
| File Name | Type | Size | Description |
|---|---|---|---|
| T3_1_手計算方法.vb | Visual Basic Code | 6 lines | Main code behind featuring event handlers |
| T3_1_手計算方法.Designer.vb | Designer Code | 92 lines | Auto-generated form definitions |
| T3_1_手計算方法.resx | Resource File | 151 lines | Resource bindings including display text |
2. Architecture & Design
2.1 Class Structure
📦 T3_1_手計算方法F Class
Inherits: System.Windows.Forms.Form
Access Modifier: Public
Designer Generated: Yes (Partial Class)
🔧 Member List
| Type | Name | Data Type | Access | Description |
|---|---|---|---|---|
| 🔘 Control | 閉じるBt | Button | Friend | Close screen button |
| 🔘 Control | 使用期限L | Label | Friend | Expiry date label |
| 🔘 Control | 著作権L | Label | Friend | Copyright info label |
| 🔘 Control | RichTextBox1 | RichTextBox | Friend | Text display area |
| 📝 Method | 閉じるBt_Click | Sub | Private | Close button click event handler |
| ⚙️ Method | InitializeComponent | Sub | Private | Designer component initialization |
| ⚙️ Method | Dispose | Sub | Protected | Resource memory release override |
2.2 Dependencies
📚 Referenced Namespaces
System.Windows.Forms- GUI ControlsSystem.Drawing- Render sizes, colors, positionsSystem.ComponentModel- Component resources
2.3 Execution Flow
1. [Main Menu] T3_Uty0メニュー.vb
↓
手計算方法Bt_Click Event Fires
2. [Form Generation] T3_1_手計算方法F
↓
Dim F As New T3_1_手計算方法F
3. [Display] Render as Modal Dialog
↓
F.ShowDialog(Me)
4. [User Operation] User reads the help text
↓
Reads text loaded into RichTextBox1
5. [Exit] User clicks Close Button
↓
閉じるBt_Click → Me.Close()
6. [Resource Release]
↓
F.Dispose()
7. [Return to Menu]
3. UI Component Details
3.1 Control Inventory
3.2 Detailed Properties
🔘 閉じるBt (Button)
| Property | Value | Description |
|---|---|---|
| Name | 閉じるBt | Control identifier |
| Text | "閉じる(メニュー画面に戻る)" | Close & Return button text |
| BackColor | RGB(192, 255, 192) | Light green for visibility |
| Location | X=159, Y=826 | Bottom-left position |
| Size | 173 x 23 | Button dimensions |
| TabIndex | 34 | Tab order sequence |
| Event | Click → 閉じるBt_Click | Closes active form |
🏷️ 使用期限L (Label)
| Property | Value | Description |
|---|---|---|
| Name | 使用期限L | Control identifier |
| Text | " 使用期限: 2019/12/31" | Initial dummy text, dynamically updated at runtime |
| AutoSize | True | Expands to fit text string |
| Location | X=1233, Y=831 | Bottom-right position |
| TabIndex | 33 | Tab order sequence |
🏷️ 著作権L (Label)
| Property | Value | Description |
|---|---|---|
| Name | 著作権L | Control identifier |
| Text | "物流技術研究所" | Initial dummy text, dynamically updated |
| Font | MS UI Gothic, 9pt | Font spec |
| AutoSize | True | Expands to fit text string |
| Location | X=857, Y=831 | Bottom-center position |
| TabIndex | 32 | Tab order sequence |
📄 RichTextBox1 (RichTextBox)
| Property | Value | Description |
|---|---|---|
| Name | RichTextBox1 | Control identifier |
| Font | MS UI Gothic, 12pt, Bold | Large bold font for readability |
| Location | X=66, Y=35 | Top-aligned position |
| Size | 682 x 628 | Primary large reading area |
| TabIndex | 35 | Tab order sequence |
| Text | Loaded from resources | Contains the core educational text |
3.3 Form Properties
| Property | Value | Description |
|---|---|---|
| Name | T3_1_手計算方法F | Form class identifier |
| Text | "Tera計算3_1_手計算方法" | Window Title Bar caption |
| ClientSize | 1484 x 861 | Base client resolution |
| AutoScroll | True | Enables scrollbars if content overflows |
| AutoScaleMode | Font | Scales UI proportionately to system font settings |
| AutoScaleDimensions | 6.0F, 12.0F | Baseline scaling dimension |
| StartPosition | CenterScreen | Spawns dialog precisely in the center of the active monitor |
4. Source Code Analysis
4.1 Main Source Code (T3_1_手計算方法.vb)
Public Class T3_1_手計算方法F Private Sub 閉じるBt_Click(sender As Object, e As EventArgs) Handles 閉じるBt.Click Me.Close() End Sub End Class
📝 Code Review
The code is strictly minimal, focusing only on form closure:
- Class Definition: Inherits the standard WinForms Form base class.
- Event Handler: Bound to the click event of the Close button.
- Action:
Me.Close()gracefully disposes of the active modal instance.
4.2 Event Handler Specs
🔧 閉じるBt_Click Method
| Item | Details |
|---|---|
| Access Modifier | Private - Internal to class only |
| Return Type | Sub - No return value |
| Parameters |
sender As Object - The caller (Button)e As EventArgs - Standard event arguments
|
| Handles Clause | 閉じるBt.Click - Subscribes to the button's click event |
| Logic | Me.Close() - Kills the form window |
4.3 Deep Dive into Execution Flow
[User Action] 1. User clicks the "Close (Return to Menu)" button. ↓ [Event Trigger] 2. Click event of 閉じるBt fires. ↓ [Handler Execution] 3. 閉じるBt_Click method is invoked. - sender: 閉じるBt Object - e: EventArgs Object ↓ [Form Closure] 4. Me.Close() is executed. - Me = Current instance of T3_1_手計算方法F - Close() sequence begins. ↓ [Event Chain] 5. Form closing events fire sequentially. - FormClosing - FormClosed ↓ [Return Control] 6. Modal ShowDialog() unblocks. - Control shifts back to Main Menu (T3_Uty0メニュー.vb). ↓ [Memory Release] 7. F.Dispose() is executed in the menu code. - Releases UI handles and memory. ↓ [End] 8. Main Menu resumes normal interactive state.
4.4 RichTextBox Educational Content
📄 Resource Text Payload
The following Japanese text is loaded from the embedded resource file (Translated contextually below):
Tera計算3は、Tera計算1(各設備の要求保管量)を前提条件として、 物流機器設備の面積を自分の手で計算するツール集です。 レイアウト設計(配送センターの規模)は、単に面積合計だけでは決まりません。 実際に建屋の縦横有効寸法内に収まるか、柱や防火壁に干渉しないかなど検討し、 建築法や消防法などの関係法案に合致しているか、安全が確保されているか、 作業運用から見て移動距離や荷役方法が適切か、設備投資と投資コストがバランスが良いか。 レイアウト設計は、いろいろな設計要素はあるが、 ここでは 1.配送センターの規模規模を小さくまとめる。 2.前工程と後工程を近づける。 この2点に着目してください。 上記2点を行うために、物流機器設備の縦・横・高さの寸法が必要となります。 Tera計算2の計算方法と手順を参考に、Tera計算3で個々の面積計算方法を学習してください。
⚠️ Key Educational Takeaways
- Prerequisites: This tool assumes capacities are pre-calculated using TeraCalc1.
- Holistic Design: Area sums alone do not dictate layout. Designers must consider column grids, fire walls, building codes, travel distance, and ROI balance.
- Two Core Mandates:
- Keep the DC footprint as compact as possible.
- Position upstream and downstream processes as close as possible.
- Cross-Training: Encourages users to leverage knowledge gained from TeraCalc2.
5. UI Design & Layout
5.1 Form Layout Schematic
📐 Geometry (1484 x 861 pixels)
(Objective and Methodology)
5.2 Color Scheme
| Element | Color Render | RGB / Reason |
|---|---|---|
| Close Button | RGB(192, 255, 192) - Light green for safe exit | |
| Form Background | System default | |
| RichTextBox Bg | Pure white for maximum text contrast | |
| Font Color | System black |
5.3 Typography
| Element | Typeface | Size | Style |
|---|---|---|---|
| RichTextBox1 | MS UI Gothic | 12pt | Bold |
| 著作権L (Copyright) | MS UI Gothic | 9pt | Regular |
| 使用期限L (Expiry) | MS UI Gothic | System Default | Regular |
| 閉じるBt (Close) | MS UI Gothic | System Default | Regular |
5.4 Usability & Ergonomics
👁️ Visibility
- Oversized 12pt Bold font prevents eye strain.
- Pastel green exit button draws the eye naturally.
- Centered screen spawn point ensures immediate focus.
🖱️ Operability
- Large hit-box on the exit button (173x23 pixels).
- Clear, unambiguous instructional text.
- Auto-scroll handles diverse monitor heights.
⌨️ Accessibility
- Proper TabIndex flows.
- Keyboard-friendly navigation.
- Modal exclusivity forces user to acknowledge the content.
📱 Responsiveness
- AutoScroll properties.
- Font-based AutoScaleMode prevents clipping on DPI-scaled monitors.
6. Usage & Scenarios
6.1 Baseline User Workflow
📋 Step-by-Step Guide
- Launch from Main Menu
- Open TeraCalc3_Utility main menu.
- Click the "手計算方法" (Manual Calculation Method) button.
- Read the Digest
- Review the principles outlined in the text box.
- Scroll to ensure full comprehension.
- Internalize Principles
- Understand the overarching goal of TeraCalc3.
- Grasp the two core layout optimization rules.
- Close & Proceed
- Click the green Close button to return to the menu.
- Proceed to mathematical modules armed with proper context.
6.2 Target Scenarios
Scenario 1: New Employee Onboarding
Context: A junior logistics engineer opening TeraCalc for the first time.
Objective: Grasp system philosophy before crunching numbers.
Workflow:
- Launch software.
- Open this manual screen first.
- Understand that mere area totals do not equal a functional layout.
- Internalize the goals of compaction and process proximity.
Benefit: Prevents users from blindly trusting calculated math without applying physical engineering constraints.
Scenario 2: Veteran User Refresh
Context: A seasoned planner returning to the tool after an absence.
Objective: Re-align with the "Tera Method" design philosophy.
Workflow:
- Skim the manifesto.
- Remember to optimize for minimal travel distance and tight spatial consolidation.
Benefit: Enforces consistent facility design standards across projects.
6.3 Module Interactions
| Target Module | Relationship | Suggested Flow |
|---|---|---|
| Inbound Space Calc | Applies the compaction principle to receiving docks. | Manual Screen → Inbound Space |
| Outbound Space Calc | Applies the proximity principle to pick-to-pack zones. | Manual Screen → Outbound Space |
| Pallet Loading Calc | Executes the footprint compaction directive. | Manual Screen → Pallet Loading |
| Truck Trajectory | Validates spatial viability against physical constraints. | Manual Screen → Truck Trajectory |
7. Customization & Extension
7.1 Modifying Educational Text
⚙️ Resource File Editing
The text content is stored in the T3_1_手計算方法.resx resource file rather than hardcoded.
Procedure:
- Open the project in Visual Studio.
- Locate
T3_1_手計算方法.resxin Solution Explorer. - Find the
RichTextBox1.Textentry. - Edit the string value and save.
- Rebuild the solution.
Note: While manual XML editing is possible, using the Visual Studio Resource Editor prevents corruption.
7.2 Functional Extension Proposals
Idea 1: Image Injection
' Add a PictureBox to render diagrams Friend WithEvents 図解Pb As PictureBox ' Load image on Form Load Private Sub T3_1_手計算方法F_Load(sender As Object, e As EventArgs) Handles MyBase.Load 図解Pb.ImageLocation = MyPath & "\LayoutConcept.jpg" 図解Pb.SizeMode = PictureBoxSizeMode.Zoom End Sub
Idea 2: Printing Capability
' Add a Print button Friend WithEvents 印刷Bt As Button ' Print sequence Private Sub 印刷Bt_Click(sender As Object, e As EventArgs) Handles 印刷Bt.Click Dim pd As New PrintDocument() AddHandler pd.PrintPage, AddressOf PrintDocument_PrintPage pd.Print() End Sub Private Sub PrintDocument_PrintPage(sender As Object, e As PrintPageEventArgs) ' Spool RichTextBox text to printer graphics e.Graphics.DrawString(RichTextBox1.Text, RichTextBox1.Font, Brushes.Black, 50, 50) End Sub
Idea 3: PDF Export
' Add a PDF export button via iTextSharp or similar Private Sub PDF出力Bt_Click(sender As Object, e As EventArgs) Handles PDF出力Bt.Click Dim saveDialog As New SaveFileDialog() saveDialog.Filter = "PDF Files|*.pdf" If saveDialog.ShowDialog() = DialogResult.OK Then ' Call external PDF library function ExportToPDF(RichTextBox1.Text, saveDialog.FileName) End If End Sub
Idea 4: Active Hyperlinks
' Enable URL clicking in the text box Private Sub T3_1_手計算方法F_Load(sender As Object, e As EventArgs) Handles MyBase.Load RichTextBox1.DetectUrls = True AddHandler RichTextBox1.LinkClicked, AddressOf RichTextBox1_LinkClicked End Sub Private Sub RichTextBox1_LinkClicked(sender As Object, e As LinkClickedEventArgs) Process.Start(e.LinkText) End Sub
7.3 UI Tweaks
| Customization Target | Modifier Method | Recommendation |
|---|---|---|
| Window Resolution | ClientSize Property | Adjust based on target displays (Minimum 1280x720) |
| Typography Size | RichTextBox1.Font | 10pt to 14pt |
| Background Base | BackColor Property | Keep it pastel to reduce glare |
| Button Placement | Location Property | Keep bottom-centered for rapid mouse acquisition |
7.4 Localization (i18n)
🌏 Multilingual Setup
Because text is already bound to .resx, localization is native:
- Create localized resource files (e.g., T3_1_手計算方法.en-US.resx).
- Translate the string definitions.
- Set Thread.CurrentCulture at runtime to swap text dynamically.
8. Best Practices & Maintenance
8.1 Coding Conventions
✅ Recommendations
- Naming: Maintain consistency if mixing English and Japanese identifiers.
- Comments: Document "Why" not just "What".
- Error Trapping: Wrap file I/O and resource calls in Try-Catch blocks.
- Memory: Utilize Using blocks for unmanaged object wrappers.
8.2 Performance Profiling
| Metric | Current Status | Optimization Path |
|---|---|---|
| Text Rendering | Batch loaded from compiled .resx | Optimal as-is (Zero I/O overhead) |
| Form Launch | Modal ShowDialog() | Optimal as-is (Prevents parent mutation) |
| Memory Cleanup | Explicit Dispose() on close | Optimal as-is (Defeats memory leaks) |
8.3 QA Testing Checklist
🧪 Unit Testing Items
- Spawn Test: Does the form render without unhandled exceptions?
- Text Load Test: Does the RichTextBox populate the correct language resource?
- Button Action Test: Does the Close button fire its event?
- GC Test: Does the parent GC collect the disposed form reference?
- Overflow Test: Does the scrollbar appear if DPI forces text wrapping?
8.4 Version Control
' Document versions in class headers ' Version 1.0.0 - 2025/01/XX - Initial Release ' Version 1.0.1 - 2025/XX/XX - Copy update ' Version 1.1.0 - 2025/XX/XX - Added PDF Export Public Class T3_1_手計算方法F Private Const VERSION As String = "1.0.0" ' ... Class Logic ... End Class
8.5 Documentation Maintenance
- Inline XML: Use ''' XML comments for IntelliSense generation.
- External Docs: Keep this HTML manual aligned with codebase changes.
- Changelogs: Maintain a dedicated Markdown or text log.
- End User Guides: Extract the non-technical sections for operator manuals.
9. Summary
🎓 Characteristics of T3_1_手計算方法.vb
- Elegant Simplicity: Relies on a single event handler, creating zero technical debt.
- Didactic Value: Contextualizes raw mathematics within real-world engineering constraints.
- UX Focused: Large, bold typography ensures the message is read and retained.
- Extensible: The barebones structure allows for easy feature bolting (PDF, Print, Images) later.
9.1 Technical Highlights
📌 Class Structure
Direct Form inheritance keeps memory footprint minimal.
📌 Resource Separation
Delegating text to .resx decouples content from logic code.
📌 Event Driven
Strict adherence to the WinForms event loop model.
📌 Ergonomics
Color choices and font scaling respect long-session operator fatigue.
9.2 Advice for Future Maintainers
💡 Maintenance Protocol
- Never hardcode text updates into the VB file. Always use the Resource Editor.
- Do not manually hack the
.Designer.vbfile; let Visual Studio manage it. - Add new controls via the drag-and-drop designer to prevent DPI scaling anomalies.
- Always compile and verify modal blocking behavior after updates.
- Commit changes linearly using Git or SVN.
9.3 References
| Resource | Context |
|---|---|
| Microsoft Docs - Windows Forms | Official .NET framework documentation |
| VB.NET Language Reference | Syntax and keywords |
| TeraCalc3_Utility Master Manual | Software architecture context |
| Logistics Facility Design Standards | Theoretical basis for the text content |