Commit Graph

10 Commits

Author SHA1 Message Date
backuppc
dbf81bfc60 .. 2025-10-27 12:00:59 +09:00
backuppc
1d65531b11 feat: Add next node direction detection and path visualization improvements
Path Direction Detection (AGVPathfinder.cs):
- Added GetNextNodeByDirection() method to determine next node based on Forward/Backward direction
- Implements vector-based angle calculation for intelligent node selection
- Forward: selects node in continuous direction
- Backward: selects node in opposite direction
- Validates if selected direction matches path requirements

Logic additions at line 150-167:
- Detects next node for Forward and Backward directions
- Checks if backward movement aligns with path's next node
- Returns path with appropriate motor direction (ReverseDirection when applicable)

Improved Path Visualization (UnifiedAGVCanvas.Events.cs):
- Refined equilateral triangle arrows (8 pixels, symmetric)
- 50% transparency for purple path lines with 2x thickness
- Bidirectional path detection (darker color for repeated segments)
- Better visual distinction for calculated paths

Technical Details:
- Added System.Drawing using statement for PointF operations
- Added DirectionalPathfinder initialization
- Vector normalization for angle-based decisions
- Dot product calculation for direction similarity scoring

Result: AGV can now intelligently select next node based on current movement direction and validate path feasibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 17:38:03 +09:00
backuppc
a6c4a967ad feat: Improve path preview visualization in UnifiedAGVCanvas
Enhanced path drawing with better visibility:

1. Arrow improvements:
   - Changed from line-based arrows to filled triangle shapes
   - Increased arrow size by 1.5x for better visibility
   - Added polygon fill with outline for clearer identification

2. Path line improvements:
   - Added 50% transparency to purple path color (Alpha: 128)
   - Increased line thickness by 2x (from 4 to 8 pixels)
   - Improved visual contrast and clarity

3. Bidirectional path detection:
   - Detect routes that traverse the same segment multiple times
   - Display bidirectional paths with higher opacity (darker color, Alpha: 200)
   - Visual distinction helps identify round-trip routes

Changes in UnifiedAGVCanvas.Events.cs:
- Modified DrawDirectionArrow() to use FillPolygon instead of DrawLine
- Enhanced DrawPath() with transparency, thickness, and bidirectional detection
- Added System.Collections.Generic using statement

Result: Much better visual identification of calculated paths in HMI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:56:49 +09:00
backuppc
402f155a99 refactor: Remove unused functions and fields from pathfinding and models
Removed from AGVPathfinder.cs:
- ConvertToDetailedPath() - unused private method
- CalculatePathDistance() - unused private method
- ValidatePath() - unused public method
- ValidatePhysicalConstraints() - only called by ValidatePath (now removed)
- OptimizePath() - unused public method (TODO placeholder only)
- GetPathSummary() - unused public method (debug helper)

Kept essential methods:
- FindNearestJunction() - used by FindPath_test
- FindNearestJunctionOnPath() - used by FindPath_test
- MakeDetailData() - used by FindPath_test
- MakeMagnetDirection() - used by FindPath_test

Removed from VirtualAGV.cs:
- _targetId field - never used
- _currentId field - never used
- _rotationSpeed field - never used (read-only, no references)

Removed from UnifiedAGVCanvas.cs:
- AGVSelected event - unused
- AGVStateChanged event - unused

Result: Cleaner codebase, reduced technical debt, easier maintenance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:49:34 +09:00
backuppc
d932b8d332 fix: Add motor direction parameter to magnet direction calculation in pathfinding
- Fixed critical issue in ConvertToDetailedPath where motor direction was not passed to GetRequiredMagnetDirection
- Motor direction is essential for backward movement as Left/Right directions must be inverted
- Modified AGVPathfinder.cs line 280 to pass currentDirection parameter
- Ensures backward motor direction properly inverts magnet sensor directions

feat: Add waypoint support to pathfinding system

- Added FindPath overload with params string[] waypointNodeIds in AStarPathfinder
- Supports sequential traversal through multiple intermediate nodes
- Validates waypoints and prevents duplicates in sequence
- Returns combined path result with aggregated metrics

feat: Implement path result merging with DetailedPath preservation

- Added CombineResults method in AStarPathfinder for intelligent path merging
- Automatically deduplicates nodes when last of previous path equals first of current
- Preserves DetailedPath information including motor and magnet directions
- Essential for multi-segment path operations

feat: Integrate magnet direction with motor direction awareness

- Modified JunctionAnalyzer.GetRequiredMagnetDirection to accept AgvDirection parameter
- Inverts Left/Right magnet directions when moving Backward
- Properly handles motor direction context throughout pathfinding

feat: Add automatic start node selection in simulator

- Added SetStartNodeToCombo method to SimulatorForm
- Automatically selects start node combo box when AGV position is set via RFID
- Improves UI usability and workflow efficiency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:46:16 +09:00
backuppc
3ddecf63ed fix: Correct background grid rendering at high zoom levels
- Fix grid line coordinate transformation (world to screen)
- Properly align grid with zoom and pan transformations
- Calculate grid start position at GRID_SIZE multiples
- Draw grid lines across entire visible canvas area
- Ensure grid lines render completely regardless of zoom level
- Grid now displays consistently at all zoom magnifications

Fixes: Grid no longer disappears or renders incompletely when zoomed in

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:12:04 +09:00
backuppc
8ecbd3cd74 feat: Add middle mouse button panning support
- Support middle mouse button (wheel) for map panning alongside left button
- Middle button drag always enables panning regardless of edit mode
- Change cursor to hand icon during middle button panning for clarity
- Left button panning remains unchanged (mode-dependent behavior preserved)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:10:51 +09:00
backuppc
fcf5a469c7 fix: Correct mouse-centered wheel zoom functionality
- Fix ScreenToWorld coordinate transformation bug in wheel event
- Implement proper mouse cursor-centered zoom calculation
- Calculate world coordinates before zoom and maintain them after zoom
- Adjust pan offset to keep mouse cursor pointing at same world position
- Remove matrix-based transformation that was causing coordinate issues

Fixes: Wheel zoom now correctly centers on mouse cursor position and no longer causes erratic panning

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:08:59 +09:00
backuppc
acdef44766 feat: Add AGVLogic solution file for unified project management
- Create AGVLogic.sln containing 3 projects:
  * AGVMapEditor (Map editor application)
  * AGVNavigationCore (Pathfinding library)
  * AGVSimulator (AGV simulator application)
- Project dependencies properly configured
- Support for Debug/Release and AnyCPU platform configurations

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:02:09 +09:00
backuppc
dbaf647d4e refactor: Move AGV development projects to separate AGVLogic folder
- Reorganized AGVMapEditor, AGVNavigationCore, AGVSimulator into AGVLogic folder
- Removed deleted project files from root folder tracking
- Updated CLAUDE.md with AGVLogic-specific development guidelines
- Clean separation of independent project development from main codebase
- Projects now ready for independent development and future integration

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:00:40 +09:00