최종우치에. 이전노드정보와 다음 시작 노드 정보를 모두 추가함.
최초 실행시 선택하는 위치 다이얼로그 제거 후 바로 자동 로딩하도록 함
This commit is contained in:
@@ -25,13 +25,6 @@ using System.Drawing;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public class LastPositionData
|
||||
{
|
||||
public string NodeId { get; set; }
|
||||
public AgvDirection Direction { get; set; }
|
||||
public AGVTurn Turn { get; set; }
|
||||
public DateTime SaveTime { get; set; }
|
||||
}
|
||||
|
||||
public static class PUB
|
||||
{
|
||||
@@ -121,7 +114,7 @@ namespace Project
|
||||
/// <param name="m"></param>
|
||||
/// <param name="force"></param>
|
||||
/// <param name="addlog">로그에도 출력 합니다</param>
|
||||
public static void Speak(string m, Boolean force = false, bool addlog = true,string logcate="")
|
||||
public static void Speak(string m, Boolean force = false, bool addlog = true, string logcate = "")
|
||||
{
|
||||
if (force == false && PUB.setting.Enable_Speak == false)
|
||||
{
|
||||
@@ -643,7 +636,7 @@ namespace Project
|
||||
if (rfidValue.isEmpty()) return null;
|
||||
return _mapNodes.Where(t => t.RfidId.Equals(rfidValue)).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -666,7 +659,7 @@ namespace Project
|
||||
{
|
||||
|
||||
if (_virtualAGV == null) return;
|
||||
if(_virtualAGV.CurrentDirection != direction)
|
||||
if (_virtualAGV.CurrentDirection != direction)
|
||||
{
|
||||
PUB.log.Add($"[PUB] AGV Direction Change {_virtualAGV.CurrentDirection}->{direction}");
|
||||
_virtualAGV.CurrentDirection = direction;
|
||||
@@ -682,13 +675,13 @@ namespace Project
|
||||
{
|
||||
if (_virtualAGV == null) return;
|
||||
|
||||
if(_virtualAGV.CurrentState != state)
|
||||
if (_virtualAGV.CurrentState != state)
|
||||
{
|
||||
PUB.log.Add($"[PUB] AGV State Change {_virtualAGV.CurrentState}->{state}");
|
||||
_virtualAGV.CurrentState = state;
|
||||
RefreshAGVCanvas();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -714,7 +707,7 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region "Starting Position Persistence"
|
||||
|
||||
private static string LastPosFilePath => Path.Combine(UTIL.CurrentPath, "Data", "last_pos.json");
|
||||
@@ -723,6 +716,7 @@ namespace Project
|
||||
{
|
||||
if (_virtualAGV == null || _virtualAGV.CurrentNode == null) return;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var data = new LastPositionData
|
||||
@@ -730,7 +724,15 @@ namespace Project
|
||||
NodeId = _virtualAGV.CurrentNode.Id,
|
||||
Direction = _virtualAGV.CurrentDirection,
|
||||
Turn = _virtualAGV.Turn,
|
||||
SaveTime = DateTime.Now
|
||||
SaveTime = DateTime.Now,
|
||||
AGV_Motor = PUB.AGV.data.Direction,
|
||||
AGV_Speed = PUB.AGV.data.Speed,
|
||||
AGV_TagString = PUB.AGV.data.TagString,
|
||||
PrevNode = _virtualAGV.PrevNode?.Id ?? string.Empty,
|
||||
PrevDirection = _virtualAGV.PrevDirection,
|
||||
StartNode = _virtualAGV.StartNode?.Id ?? string.Empty,
|
||||
TargetNode = _virtualAGV.TargetNode?.Id ?? string.Empty,
|
||||
AGV_Turn = PUB.AGV.TurnInformation,
|
||||
};
|
||||
|
||||
var fi = new System.IO.FileInfo(LastPosFilePath);
|
||||
|
||||
Reference in New Issue
Block a user