회전중입력된 태그는 무시
This commit is contained in:
@@ -24,6 +24,7 @@ namespace arDev
|
||||
{
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime End { get; set; }
|
||||
public string Message { get; set; }
|
||||
public TimeSpan Runtime
|
||||
{
|
||||
get
|
||||
@@ -41,6 +42,13 @@ namespace arDev
|
||||
End = new DateTime(1982, 11, 23);
|
||||
State = eNarumiTurn.None;
|
||||
}
|
||||
public bool IsTurning
|
||||
{
|
||||
get
|
||||
{
|
||||
return State == eNarumiTurn.LeftIng || State == eNarumiTurn.RightIng;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class NarumiCommandTime
|
||||
{
|
||||
@@ -76,6 +84,7 @@ namespace arDev
|
||||
{
|
||||
public eNarmiPBSSensor PBSSensor = eNarmiPBSSensor.notset;
|
||||
|
||||
|
||||
public NarumiTurnInfo TurnInformation { get; set; } = null;
|
||||
Dictionary<string, NarumiCommandTime> SendCommandFailList { get; set; } = new Dictionary<string, NarumiCommandTime>();
|
||||
|
||||
@@ -297,6 +306,38 @@ namespace arDev
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 턴정보를 설정한다
|
||||
/// </summary>
|
||||
/// <param name="newstate"></param>
|
||||
void TurnInformationSetting(eNarumiTurn newstate)
|
||||
{
|
||||
if (TurnInformation == null) TurnInformation = new NarumiTurnInfo();
|
||||
TurnInformation.Start = DateTime.Now;
|
||||
TurnInformation.End = new DateTime(1982, 11, 23);
|
||||
if (TurnInformation.State != newstate)
|
||||
{
|
||||
TurnInformation.Message = $"Change {TurnInformation.State} -> {newstate}";
|
||||
TurnInformation.State = newstate;
|
||||
RaiseMessage(MessageType.Normal, TurnInformation.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 턴이진행중일경우에는 상태를 해제한다
|
||||
/// </summary>
|
||||
void TurnInformationSettingCancel()
|
||||
{
|
||||
if (TurnInformation == null) return;
|
||||
if (TurnInformation.State == eNarumiTurn.LeftIng || TurnInformation.State == eNarumiTurn.RightIng)
|
||||
{
|
||||
TurnInformation.End = DateTime.Now;
|
||||
TurnInformation.State = eNarumiTurn.None;
|
||||
TurnInformation.Message = "Turningstatus cancled";
|
||||
RaiseMessage(MessageType.Normal, TurnInformation.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected eNarumiCommandResult AddCommand(eAgvCmd command, BunkiData param)
|
||||
{
|
||||
@@ -332,10 +373,14 @@ namespace arDev
|
||||
cmdString = $"CST{param}";
|
||||
system1.agv_run_manual = false;
|
||||
retval = AddCommand(cmdString);
|
||||
if (retval == eNarumiCommandResult.Success)
|
||||
TurnInformationSettingCancel();
|
||||
break;
|
||||
case eAgvCmd.MoveStart:
|
||||
cmdString = $"CRN{param}";
|
||||
retval = AddCommand(cmdString);
|
||||
if (retval == eNarumiCommandResult.Success)
|
||||
TurnInformationSettingCancel();
|
||||
break;
|
||||
|
||||
case eAgvCmd.ChargeOf:
|
||||
@@ -354,10 +399,7 @@ namespace arDev
|
||||
retval = AddCommand(cmdString);
|
||||
if (retval == eNarumiCommandResult.Success)
|
||||
{
|
||||
if (TurnInformation == null) TurnInformation = new NarumiTurnInfo();
|
||||
TurnInformation.Start = DateTime.Now;
|
||||
TurnInformation.End = new DateTime(1982, 11, 23);
|
||||
TurnInformation.State = eNarumiTurn.LeftIng;
|
||||
TurnInformationSetting(eNarumiTurn.LeftIng);
|
||||
}
|
||||
break;
|
||||
case eAgvCmd.TurnRight:
|
||||
@@ -365,10 +407,7 @@ namespace arDev
|
||||
retval = AddCommand(cmdString);
|
||||
if (retval == eNarumiCommandResult.Success)
|
||||
{
|
||||
if (TurnInformation == null) TurnInformation = new NarumiTurnInfo();
|
||||
TurnInformation.Start = DateTime.Now;
|
||||
TurnInformation.End = new DateTime(1982, 11, 23);
|
||||
TurnInformation.State = eNarumiTurn.RightIng;
|
||||
TurnInformationSetting(eNarumiTurn.RightIng);
|
||||
}
|
||||
break;
|
||||
case eAgvCmd.BackAndTurn:
|
||||
@@ -399,6 +438,8 @@ namespace arDev
|
||||
system1.agv_run_manual = true;
|
||||
cmdString = $"CRT{param}";
|
||||
retval = AddCommand(cmdString);
|
||||
if (retval == eNarumiCommandResult.Success)
|
||||
TurnInformationSettingCancel();
|
||||
break;
|
||||
|
||||
case eAgvCmd.LiftControl:
|
||||
|
||||
Reference in New Issue
Block a user