add supertonic
This commit is contained in:
@@ -83,6 +83,75 @@ namespace AGVNavigationCore.Controls
|
||||
// UI 정보 그리기 (변환 없이)
|
||||
if (_showGrid)
|
||||
DrawUIInfo(g);
|
||||
|
||||
// 동기화 화면 그리기 (변환 없이, 최상위)
|
||||
if (_canvasMode == CanvasMode.Sync)
|
||||
{
|
||||
DrawSyncScreen(g);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSyncScreen(Graphics g)
|
||||
{
|
||||
// 반투명 검은색 배경
|
||||
using (var brush = new SolidBrush(Color.FromArgb(200, 0, 0, 0)))
|
||||
{
|
||||
g.FillRectangle(brush, this.ClientRectangle);
|
||||
}
|
||||
|
||||
// 중앙에 메시지 표시
|
||||
var center = new Point(Width / 2, Height / 2);
|
||||
|
||||
// 메시지 폰트
|
||||
using (var fontTitle = new Font("Malgun Gothic", 24, FontStyle.Bold))
|
||||
using (var fontDetail = new Font("Malgun Gothic", 14))
|
||||
using (var brushText = new SolidBrush(Color.White))
|
||||
{
|
||||
// 메인 메시지
|
||||
var sizeTitle = g.MeasureString(_syncMessage, fontTitle);
|
||||
g.DrawString(_syncMessage, fontTitle, brushText,
|
||||
center.X - sizeTitle.Width / 2,
|
||||
center.Y - sizeTitle.Height / 2 - 60);
|
||||
|
||||
// 진행률 바 배경
|
||||
int barWidth = 500;
|
||||
int barHeight = 30;
|
||||
int barX = center.X - barWidth / 2;
|
||||
int barY = center.Y + 10;
|
||||
|
||||
using (var brushBarBg = new SolidBrush(Color.FromArgb(64, 64, 64)))
|
||||
{
|
||||
g.FillRectangle(brushBarBg, barX, barY, barWidth, barHeight);
|
||||
}
|
||||
g.DrawRectangle(Pens.Gray, barX, barY, barWidth, barHeight);
|
||||
|
||||
// 진행률 바 채우기
|
||||
if (_syncProgress > 0)
|
||||
{
|
||||
using (var brushProgress = new SolidBrush(Color.LimeGreen))
|
||||
{
|
||||
int fillWidth = (int)((barWidth - 4) * _syncProgress);
|
||||
if (fillWidth > 0)
|
||||
g.FillRectangle(brushProgress, barX + 2, barY + 2, fillWidth, barHeight - 4);
|
||||
}
|
||||
}
|
||||
|
||||
// 진행률 텍스트
|
||||
string progressText = $"{(_syncProgress * 100):F0}%";
|
||||
var sizeProgress = g.MeasureString(progressText, fontDetail);
|
||||
g.DrawString(progressText, fontDetail, brushText,
|
||||
center.X - sizeProgress.Width / 2,
|
||||
barY + 5);
|
||||
|
||||
// 상세 메시지
|
||||
if (!string.IsNullOrEmpty(_syncDetail))
|
||||
{
|
||||
var sizeDetail = g.MeasureString(_syncDetail, fontDetail);
|
||||
g.DrawString(_syncDetail, fontDetail, brushText,
|
||||
center.X - sizeDetail.Width / 2,
|
||||
barY + barHeight + 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawGrid(Graphics g)
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace AGVNavigationCore.Controls
|
||||
/// </summary>
|
||||
public enum CanvasMode
|
||||
{
|
||||
Edit // 편집 가능 (맵 에디터)
|
||||
Edit, // 편집 가능 (맵 에디터)
|
||||
Sync // 동기화 모드 (장비 설정 동기화)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -116,6 +117,11 @@ namespace AGVNavigationCore.Controls
|
||||
// RFID 중복 검사
|
||||
private HashSet<string> _duplicateRfidNodes = new HashSet<string>();
|
||||
|
||||
// 동기화 모드 관련
|
||||
private string _syncMessage = "동기화 중...";
|
||||
private float _syncProgress = 0.0f;
|
||||
private string _syncDetail = "";
|
||||
|
||||
// 브러쉬 및 펜
|
||||
private Brush _normalNodeBrush;
|
||||
private Brush _rotationNodeBrush;
|
||||
@@ -546,6 +552,40 @@ namespace AGVNavigationCore.Controls
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 동기화 상태 설정
|
||||
/// </summary>
|
||||
/// <param name="message">메인 메시지</param>
|
||||
/// <param name="progress">진행률 (0.0 ~ 1.0)</param>
|
||||
/// <param name="detail">상세 메시지</param>
|
||||
public void SetSyncStatus(string message, float progress, string detail = "")
|
||||
{
|
||||
_syncMessage = message;
|
||||
_syncProgress = Math.Max(0.0f, Math.Min(1.0f, progress));
|
||||
_syncDetail = detail;
|
||||
|
||||
if (_canvasMode != CanvasMode.Sync)
|
||||
{
|
||||
_canvasMode = CanvasMode.Sync;
|
||||
UpdateModeUI();
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 동기화 모드 종료
|
||||
/// </summary>
|
||||
public void ExitSyncMode()
|
||||
{
|
||||
if (_canvasMode == CanvasMode.Sync)
|
||||
{
|
||||
_canvasMode = CanvasMode.Edit; // 기본 모드로 복귀 (또는 이전 모드)
|
||||
UpdateModeUI();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cleanup
|
||||
|
||||
Reference in New Issue
Block a user