- sm_SPS 이벤트 핸들러에서 장치 연결 및 상태 전송을 비동기로 처리
- DeviceConnectionWorker 스레드로 장치 연결 분리
- SPS(1초), Running(2초) 타임아웃 보호 추가
- 상태머신 모니터링 디버그 창 추가 (fStateMachineDebug)
- F11/F12 단축키로 스레드 덤프 및 디버그 브레이크 지원
- RaiseMessage 이벤트 비동기 처리로 로그 블로킹 방지
상태머신에서 장치 연결(AGV, XBee, BMS)이 메인 루프를 블로킹하는 문제 해결
주요 변경사항:
- DeviceConnectionWorker: 별도 쓰레드에서 장치 연결 처리
- StartDeviceConnectionThread: 쓰레드 시작 로직
- StopDeviceConnectionThread: 프로그램 종료 시 안전한 쓰레드 종료
- sm_SPS: 연결 로직 제거, 쓰레드 시작만 담당
- __Closing: 프로그램 종료 시 쓰레드 종료 호출
이점:
- 장치 연결 중 상태머신 블로킹 방지
- 1초 간격으로 비동기 연결 시도
- 프로그램 종료 시 안전한 쓰레드 정리
파일:
- StateMachine/_SPS.cs: 쓰레드 로직 추가
- fMain.cs: 종료 시 쓰레드 정리
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 맵 에디터 메인폼 UI 개선
- AGV 캔버스 컨트롤 수정
- 설정 파일 업데이트
- 상태머신 AGV 로직 조정
- 자동 모드 화면 개선
- 메인폼 디자이너 및 로직 수정
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## 신규 기능
- ACS(중앙제어시스템) 시뮬레이터 프로젝트 생성
- 8가지 AGV 제어 명령어 지원:
* SetCurrent: 현재 위치 설정
* Goto: RFID 이동
* GotoAlias: 별칭 이동 (v1.1.0)
* Stop: 정지
* Reset: 에러 리셋
* Manual: 수동 제어
* MarkStop: 마크센서 정지
* LiftControl: 리프트 제어
## AGV 상태 실시간 표시 (v1.3.0)
- AGV 상태 그룹박스 추가 (8가지 상태 정보)
- Status 메시지(cmd=3) 자동 수신 및 UI 업데이트
- 상태별 색상 표시로 직관적 모니터링
## 설정 관리
- 실행 폴더에 JSON 형식 설정 파일 저장 (v1.4.0)
- COM 포트, 보레이트, RFID, 별칭, AGV 선택 자동 저장
- 설정 파일 직접 편집 가능
## 기술 스택
- .NET Framework 4.8
- ENIGProtocol 프로젝트 참조
- RS232/Xbee 통신
- Newtonsoft.Json
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add motor/magnet/speed enums and AGVCommand class for AGV control
- Implement Predict() method for next action prediction based on path and state
- Add RFID position tracking (requires 2 RFIDs for position confirmation)
- Add SetPath() method to VirtualAGV for path management
- Implement GetCommandFromPath() to extract motor/magnet/speed from DetailedPath
- Add real-time prediction display in SimulatorForm (timer1_Tick)
- Support automatic forward movement at low speed when position unconfirmed
- Support stop command when destination reached or no destination set
Key Features:
- Position unconfirmed (RFID < 2): Forward + Straight + Low speed
- Position confirmed + no destination: Stop (position found)
- Position confirmed + destination reached: Stop (arrived)
- Path execution: Motor/Magnet/Speed from DetailedPath NodeMotorInfo
- Rotation nodes: Automatic low speed
- Junction handling: Magnet direction (Left/Right/Straight)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ghost rendering at original position during node drag
- Implement real-time drag preview with Update() for immediate rendering
- Add visual feedback: shadow effects, cyan borders, pulse animations
- Improve pan movement accuracy with zoom level compensation (PointF precision)
- Add mouse capture for stable drag operations
- Fix coordinate precision loss by changing _panOffset from Point to PointF
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
MapNode.cs:
- Padding 속성 추가 (기본값 8px, 텍스트 주변 여백)
- Clone 메서드에 Padding 복사 추가
NodePropertyWrapper.cs:
- LabelNodePropertyWrapper에 Padding 속성 추가
- PropertyGrid에서 0~50px 범위로 조정 가능
UnifiedAGVCanvas.Events.cs:
- DrawLabelNode: 하드코딩된 패딩을 node.Padding 사용
- GetNodeBrush: RFID 없는 노드를 회색 계통으로 표시
* Normal: Blue → LightGray
* Rotation: Orange → DarkGray
* Docking: Green → Gray
* Charging: Red → Silver
UnifiedAGVCanvas.Mouse.cs:
- HandleLabelNodeDoubleClick: node.Name → node.LabelText 사용
이제 라벨 노드 패딩을 속성창에서 조정 가능하고,
RFID 미할당 노드를 시각적으로 쉽게 구분 가능
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
노드 타입별 더블클릭 액션 구현:
UnifiedAGVCanvas.Mouse.cs:
- MouseDoubleClick 핸들러 수정 - 노드 타입별 분기 처리
- HandleNormalNodeDoubleClick() 추가 - RFID 입력 InputBox 표시
- HandleLabelNodeDoubleClick() 추가 - 라벨 텍스트 입력 InputBox 표시
- HandleImageNodeDoubleClick() 추가 - ImageNodeDoubleClicked 이벤트 발생
UnifiedAGVCanvas.cs:
- ImageNodeDoubleClicked 이벤트 정의 추가
MainForm.cs:
- OnImageNodeDoubleClicked 이벤트 핸들러 추가
- 이미지 편집창(ImageEditorForm) 자동 표시
AGVNavigationCore.csproj:
- Microsoft.VisualBasic 참조 추가 (InputBox 사용)
이제 노드 더블클릭 시:
- 일반노드(Normal/Rotation/Docking/Charging): RFID 입력창 표시
- 라벨노드: 텍스트 입력창 표시
- 이미지노드: 이미지 편집창 자동 표시
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
UnifiedAGVCanvas.Mouse.cs 수정 내용:
- MouseClick switch문에 AddLabel, AddImage case 추가
- HandleAddLabelClick() 메서드 추가 (NodeType.Label 노드 생성)
- HandleAddImageClick() 메서드 추가 (NodeType.Image 노드 생성)
이제 라벨 추가 및 이미지 추가 드롭다운 메뉴를 선택하고 맵을 클릭하면
해당 위치에 라벨/이미지 노드가 정상적으로 생성됩니다.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
btnAddNode가 ToolStripSplitButton으로 변경되면서 이벤트 처리 수정:
- btnAddNode: Click → ButtonClick 이벤트 사용
- btnAddLabel, btnAddImage: 드롭다운 항목으로 Click 이벤트 유지
이제 노드 추가 버튼과 라벨/이미지 추가 드롭다운 메뉴가 정상 작동합니다.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced Panel + Button controls with ToolStrip + ToolStripButton
- Unified toolbar design with toolStrip2 style
- Simplified WireToolbarButtonEvents() method
- Updated UpdateImageEditButton() and DisableImageEditButton() for ToolStripButton
- Image edit button now properly enables/disables based on selected node type
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- Graphics Transform 순서 수정 (Translate → Scale)
- ScreenToWorld/WorldToScreen 공식 통일
- 마우스 휠 줌 계산 수정
- FitToNodes, PanTo 계산 수정
- GetVisibleBounds 공식 수정
- 이제 줌 상태에서 노드 선택이 정확하게 작동
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- 그리드가 화면 전체를 덮도록 수정
- ScreenToWorld를 사용하여 정확한 월드 좌표 계산
- 스케일 표시를 동적으로 계산 (줌에 따라 변경)
- 스케일 정보를 별도 박스로 표시 (좌하단)
- 줌 정보와 스케일 정보 분리 표시
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- ProgressLogForm.Designer.cs 생성
- VS에서 레이아웃 편집 가능하도록 개선
- 고정 컨트롤을 디자이너 파일로 이동
- ProgressLogForm.cs 간소화
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- CleanupOrphanConnections() 함수 추가
- 저장 시 고아 연결 자동 정리
- 로드 시 고아 연결 자동 제거
- 경로 예측에서 삭제된 노드 연결 사용 방지
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- ConnectedMapNodes 속성 추가로 런타임 객체 참조 지원
- 이미지 에디터 UI 개선 (ImageEditorCanvas 추가)
- 연결 생성 버그 수정: 양방향 연결 생성
- 연결 삭제 버그 수정: 양방향 모두 제거
- CleanupDuplicateConnections 비활성화 (단방향 변환 버그)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ProgressLogForm.cs for test result logging with ListView
- Implement real UI workflow simulation in path prediction test
- Test all connected node pairs to all docking targets
- Support CSV export for test results
- Keep List<string> ConnectedNodes structure (reverted List<MapNode> changes)
- Display RFID values in log for better readability
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
방향 유지 시 이전 노드로 되돌아가는 문제 수정
- 방향 유지(prevDirection == direction): 이전 노드 제외
- 방향 전환(prevDirection != direction): 모든 연결 노드 허용 (U-turn 가능)
수정 파일: DirectionalHelper.cs:61-73
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
마그넷 방향(Straight/Left/Right) 가중치 강화:
- Straight 보너스: 0.3 → 0.5
- 올바른 회전 보너스: 0.25 → 1.0
- 잘못된 회전 페널티: 0.2 → 0.8
이를 통해 GetNextNodeByDirection에서 마그넷 방향이 주요 결정 요소로 작동.
실제 경로 예측 정확도 개선 (Left 마그넷 방향 테스트: 100% 일치).
## 발견된 이슈 (다음 세션)
- 기본 내적(dot product) 차이가 큰 경우 (>1.0) 마그넷 보너스(+1.0)로 극복 못함
- 경로 계산 결과는 올바르지만, 검증 단계에서 다르게 평가되는 경우 존재
- 예: N022→N004→N011 경로, 마그넷 Right일 때
- 경로 생성: N011 선택 (내적 -0.1275, 마그넷 Right 일치)
- 검증 예측: N031 선택 (내적 0.9646, 마그넷 Right 일치)
- 원인: 내적 차이(1.0921) > 마그넷 보너스 효과(1.0)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Added detailed debug output to GetNextNodeByDirection() with:
- Initial node information (positions, movement vectors)
- All candidate nodes evaluation with step-by-step scoring
- Score calculations: base score → motor direction → magnet direction
- Final selection with best score
- Added detailed debug output to ValidateDockingDirection() with:
- Path validation stage information
- Expected vs actual next node comparison
- Movement vector analysis for mismatch debugging
- Success/failure status for each path segment
Debug output includes:
- Node IDs, RFIDs, positions, and vectors
- Normalized vectors and dot products
- Score progression through each bonus/penalty application
- Direction consistency analysis
- Final scoring results with selection indicators
This enables detailed tracing of path prediction and validation issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added MagnetDirection parameter to GetNextNodeByDirection() function in DirectionalHelper
- Implemented ApplyMagnetDirectionBonus() helper method using vector cross product for turn direction detection
- Straight magnet direction: +0.3f bonus for consistent forward direction
- Left/Right magnet direction: +0.25f bonus for correct turn, -0.2f penalty for wrong turn direction
- Updated DockingValidator to pass actual magnet direction from DetailedPath
- Updated AGVPathfinder calls to use MagnetDirection.Straight as default during path planning phase
- Includes debug output for scoring decisions with magnet direction analysis
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Summary
- Changed Path property type from List<string> to List<MapNode> for better type safety
- Eliminated O(n) node lookups throughout pathfinding system
- Added DirectionalHelper with motor direction consistency bonus/penalty
- Updated all path processing to work with MapNode objects directly
## Files Modified
- AGVPathResult.cs: Path property and CreateSuccess() method signature
- AStarPathfinder.cs: Path generation and node lookup optimization
- AGVPathfinder.cs: Path processing with MapNode objects
- DirectionChangePlanner.cs: Direction change planning with MapNode paths
- DockingValidator.cs: Docking validation with direct node access
- UnifiedAGVCanvas.Events.cs: Path visualization with MapNode iteration
- UnifiedAGVCanvas.cs: Destination node access
- VirtualAGV.cs: Path conversion to string IDs for storage
- DirectionalHelper.cs: Enhanced with motor direction awareness
- NodeMotorInfo.cs: Updated for new path structure
## Benefits
- Performance: Eliminated O(n) lookup searches
- Type Safety: Compile-time checking for node properties
- Code Quality: Direct property access instead of repeated lookups
- Maintainability: Single source of truth for node data
## Build Status
✅ AGVNavigationCore: Build successful (0 errors, 2 warnings)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>