This commit is contained in:
chi
2025-06-25 17:55:37 +09:00
parent ba18564719
commit f1aeeeba12
14 changed files with 1086 additions and 810 deletions

View File

@@ -39,178 +39,189 @@ namespace Project
bool _charging = false; bool _charging = false;
private void AGV_DataReceive(object sender, arDev.Narumi.DataEventArgs e) private void AGV_DataReceive(object sender, arDev.Narumi.DataEventArgs e)
{ {
if (PUB.mapctl != null) try
PUB.mapctl.PredictNextAction();
switch (e.DataType)
{ {
case arDev.Narumi.DataType.STS:
{
//마크센서 확인
var chg_mark1 = PUB.AGV.signal.GetChanged(arDev.Narumi.Signal.eflag.mark_sensor_1);
var chg_mark2 = PUB.AGV.signal.GetChanged(arDev.Narumi.Signal.eflag.mark_sensor_1);
var chg_run = PUB.AGV.system1.GetChanged(arDev.Narumi.SystemFlag1.eflag.agv_run);
var chg_stop = PUB.AGV.system1.GetChanged(arDev.Narumi.SystemFlag1.eflag.agv_stop);
//if (chg_run && PUB.AGV.system1.agv_run) PUB.Speak("이동을 시작 합니다");
VAR.BOOL[eVarBool.AGVDIR_UP] = PUB.AGV.data.Direction == 'B';
// PUB.AGV.signal.mark_sensor = PUB.AGV.signal.mark_sensor;
VAR.BOOL[eVarBool.AGV_ERROR] = PUB.AGV.error.Value > 0;
VAR.BOOL[eVarBool.EMERGENCY] = PUB.AGV.error.Emergency;
//모터방향 입력
if (PUB.AGV.data.Direction == 'B')
PUB.mapctl.agv.CurrentMOTDirection = AGVControl.Models.Direction.Backward;
else
PUB.mapctl.agv.CurrentMOTDirection = AGVControl.Models.Direction.Forward;
if (PUB.AGV.signal.mark_sensor == false) if (PUB.mapctl != null)
PUB.mapctl.PredictNextAction();
switch (e.DataType)
{
case arDev.Narumi.DataType.STS:
{ {
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == false) //마크센서 확인
var chg_mark1 = PUB.AGV.signal.GetChanged(arDev.Narumi.Signal.eflag.mark_sensor_1);
var chg_mark2 = PUB.AGV.signal.GetChanged(arDev.Narumi.Signal.eflag.mark_sensor_1);
var chg_run = PUB.AGV.system1.GetChanged(arDev.Narumi.SystemFlag1.eflag.agv_run);
var chg_stop = PUB.AGV.system1.GetChanged(arDev.Narumi.SystemFlag1.eflag.agv_stop);
//if (chg_run && PUB.AGV.system1.agv_run) PUB.Speak("이동을 시작 합니다");
VAR.BOOL[eVarBool.AGVDIR_UP] = PUB.AGV.data.Direction == 'B';
// PUB.AGV.signal.mark_sensor = PUB.AGV.signal.mark_sensor;
VAR.BOOL[eVarBool.AGV_ERROR] = PUB.AGV.error.Value > 0;
VAR.BOOL[eVarBool.EMERGENCY] = PUB.AGV.error.Emergency;
//모터방향 입력
if (PUB.AGV.data.Direction == 'B')
PUB.mapctl.agv.CurrentMOTDirection = AGVControl.Models.Direction.Backward;
else
PUB.mapctl.agv.CurrentMOTDirection = AGVControl.Models.Direction.Forward;
PUB.mapctl.agv.IsMoving = PUB.AGV.system1.agv_run;
PUB.mapctl.agv.IsMarkCheck = PUB.AGV.system1.Mark1_check || PUB.AGV.system1.Mark2_check;
if (PUB.AGV.signal.mark_sensor == false)
{ {
VAR.BOOL[eVarBool.MARK_SENSOROFF] = true; if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == false)
VAR.TIME[eVarTime.MarkSensorOff] = DateTime.Now;
PUB.log.Add($"마크센서off를 설정");
}
}
else
{
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == true)
{
VAR.BOOL[eVarBool.MARK_SENSOROFF] = false;
VAR.TIME[eVarTime.MarkSensorOff] = DateTime.Now;
PUB.log.Add($"마크센서off를 해제");
}
}
//차징상태변경
if (_charging != PUB.AGV.system1.Battery_charging)
{
if (PUB.AGV.system1.Battery_charging)
{
VAR.TIME[eVarTime.ChargeStart] = DateTime.Now;
PUB.logagv.Add($"충전시작:{VAR.TIME[eVarTime.ChargeStart]}");
}
_charging = PUB.AGV.system1.Battery_charging;
}
//배터리충전상태
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA] != PUB.AGV.system1.Battery_charging)
{
PUB.log.Add($"충전상태전환 {PUB.AGV.system1.Battery_charging}");
VAR.BOOL[eVarBool.FLAG_CHARGEONA] = PUB.AGV.system1.Battery_charging;
}
//자동충전해제시 곧바로 수동 충전되는 경우가 있어 자동 상태를 BMS에 넣는다 230118
PUB.BMS.AutoCharge = PUB.AGV.system1.Battery_charging;
if (PUB.AGV.error.Charger_pos_error != VAR.BOOL[eVarBool.CHG_POSERR])
{
if (PUB.AGV.error.Charger_pos_error)
{
PUB.Speak(Lang.);
}
VAR.BOOL[eVarBool.CHG_POSERR] = PUB.AGV.error.Charger_pos_error;
}
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == true && PUB.AGV.signal.mark_sensor == false)
{
//현재 활성화된 위치를 꺼준다
if (this.ctlPos1.GetPositionActive(PUB.Result.CurrentPos))
{
var ts = VAR.TIME.RUN(eVarTime.MarkSensorOff);
if (ts.TotalSeconds >= 2)
{ {
ctlPos1.SetPositionDeActive(); VAR.BOOL[eVarBool.MARK_SENSOROFF] = true;
PUB.log.Add($"현재 활성위치를 해제 함"); VAR.TIME[eVarTime.MarkSensorOff] = DateTime.Now;
PUB.log.Add($"마크센서off를 설정");
}
}
else
{
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == true)
{
VAR.BOOL[eVarBool.MARK_SENSOROFF] = false;
VAR.TIME[eVarTime.MarkSensorOff] = DateTime.Now;
PUB.log.Add($"마크센서off를 해제");
} }
} }
}
//나르미가 멈췄다면 다음 마크 이동 기능이 OFF 된다 //차징상태변경
if (PUB.AGV.system1.agv_stop) if (_charging != PUB.AGV.system1.Battery_charging)
VAR.BOOL[eVarBool.NEXTSTOP_MARK] = false;
if (VAR.BOOL[eVarBool.MARK_SENSOR] != PUB.AGV.signal.mark_sensor)
{
if (PUB.AGV.signal.mark_sensor)
{ {
//현재위치를 확정한다 if (PUB.AGV.system1.Battery_charging)
var curact = ctlPos1.GetPositionActive(PUB.Result.CurrentPos);
if (curact == false)
{ {
PUB.log.Add($"마크센서로인해 현재위치 설정완료:{PUB.Result.CurrentPos}"); VAR.TIME[eVarTime.ChargeStart] = DateTime.Now;
ctlPos1.SetPositionActive(PUB.Result.CurrentPos); PUB.logagv.Add($"충전시작:{VAR.TIME[eVarTime.ChargeStart]}");
ctlPos1.SetDirection("");
ctlPos1.Invalidate();
} }
_charging = PUB.AGV.system1.Battery_charging;
} }
VAR.BOOL[eVarBool.MARK_SENSOR] = PUB.AGV.signal.mark_sensor;
}
}
break;
case arDev.Narumi.DataType.TAG:
{
//자동 실행 중이다.
PUB.log.Add($"AGV 태그수신 : {PUB.AGV.data.TagNo}");
PUB.Result.LastTAG = PUB.AGV.data.TagNo.ToString();
//POT/NOT 보면 일단 바로 멈추게한다 //배터리충전상태
if (PUB.Result.CurrentPos == ePosition.POT || PUB.Result.CurrentPos == ePosition.NOT) if (VAR.BOOL[eVarBool.FLAG_CHARGEONA] != PUB.AGV.system1.Battery_charging)
{
PUB.log.Add($"충전상태전환 {PUB.AGV.system1.Battery_charging}");
VAR.BOOL[eVarBool.FLAG_CHARGEONA] = PUB.AGV.system1.Battery_charging;
}
//자동충전해제시 곧바로 수동 충전되는 경우가 있어 자동 상태를 BMS에 넣는다 230118
PUB.BMS.AutoCharge = PUB.AGV.system1.Battery_charging;
if (PUB.AGV.error.Charger_pos_error != VAR.BOOL[eVarBool.CHG_POSERR])
{
if (PUB.AGV.error.Charger_pos_error)
{
PUB.Speak(Lang.);
}
VAR.BOOL[eVarBool.CHG_POSERR] = PUB.AGV.error.Charger_pos_error;
}
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == true && PUB.AGV.signal.mark_sensor == false)
{
//현재 활성화된 위치를 꺼준다
if (this.ctlPos1.GetPositionActive(PUB.Result.CurrentPos))
{
var ts = VAR.TIME.RUN(eVarTime.MarkSensorOff);
if (ts.TotalSeconds >= 2)
{
ctlPos1.SetPositionDeActive();
PUB.log.Add($"현재 활성위치를 해제 함");
}
}
}
//나르미가 멈췄다면 다음 마크 이동 기능이 OFF 된다
if (PUB.AGV.system1.agv_stop)
VAR.BOOL[eVarBool.NEXTSTOP_MARK] = false;
if (VAR.BOOL[eVarBool.MARK_SENSOR] != PUB.AGV.signal.mark_sensor)
{
if (PUB.AGV.signal.mark_sensor)
{
//현재위치를 확정한다
var curact = ctlPos1.GetPositionActive(PUB.Result.CurrentPos);
if (curact == false)
{
PUB.log.Add($"마크센서로인해 현재위치 설정완료:{PUB.Result.CurrentPos}");
ctlPos1.SetPositionActive(PUB.Result.CurrentPos);
ctlPos1.SetDirection("");
ctlPos1.Invalidate();
}
}
VAR.BOOL[eVarBool.MARK_SENSOR] = PUB.AGV.signal.mark_sensor;
}
}
break;
case arDev.Narumi.DataType.TAG:
{ {
var logEMsg = $"Stop by [POT/NOT]"; //자동 실행 중이다.
PUB.AGV.AGVMoveStop(logEMsg); PUB.log.Add($"AGV 태그수신 : {PUB.AGV.data.TagNo}");
PUB.log.AddE(logEMsg); PUB.Result.LastTAG = PUB.AGV.data.TagNo.ToString();
}
//맵데이터에서 현재 위치를 찾는 //POT/NOT 보면 일단 바로 멈추게한
if (PUB.mapctl.SetCurrentPosition(PUB.AGV.data.TagNo) == false) if (PUB.Result.CurrentPos == ePosition.POT || PUB.Result.CurrentPos == ePosition.NOT)
{ {
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] && PUB.AGV.system1.agv_run) var logEMsg = $"Stop by [POT/NOT]";
PUB.AGV.AGVMoveStop("unknown tag no"); PUB.AGV.AGVMoveStop(logEMsg);
PUB.log.AddE(logEMsg);
}
//존재하지 않는 태그가 읽히면 관련 오류를 표시한다. //맵데이터에서 현재 위치를 찾는다
} if (PUB.mapctl.SetCurrentPosition(PUB.AGV.data.TagNo) == false)
else {
{ if (VAR.BOOL[eVarBool.FLAG_AUTORUN] && PUB.AGV.system1.agv_run)
//위치는 찾았다 해당 위치가 내 목적지라면 mark stop기능으로 전환한다 PUB.AGV.AGVMoveStop("unknown tag no");
//존재하지 않는 태그가 읽히면 관련 오류를 표시한다.
}
else
{
//위치는 찾았다 해당 위치가 내 목적지라면 mark stop기능으로 전환한다
}
////자동, 상하차 모드일때 RFID 가 타겟위치에 올때는 - 멈춤을 설정해준다
//if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == true &&
// PUB.Result.CurrentPos == PUB.Result.TargetPos &&
// PUB.Result.TargetPos != ePosition.NONE &&
// (PUB.sm.RunStep == ERunStep.GODOWN ||
// PUB.sm.RunStep == ERunStep.GOUP ||
// PUB.sm.RunStep == ERunStep.GOHOME ||
// PUB.sm.RunStep == ERunStep.GOCHARGE))
//{
// if (PUB.AGV.data.Sts == 'F' && dirForward == "0") //아래로 내려오고있음
// {
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
// PUB.Speak( Lang.다음마크위치에서정지합니다);
// }
// else if (PUB.AGV.data.Sts == 'B' && dirForward == "1")
// {
// //VAR.BOOL[eVarBool.FLAG_NEXTSTOP_MARK] = true;
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
// PUB.Speak(Lang.다음마크위치에서정지합니다);
// }
//}
} }
break;
case arDev.Narumi.DataType.ACK:
PUB.logagv.Add($"AGV_[ACK]Receive : {PUB.AGV.ACKData}");
break;
default:
PUB.logagv.Add($"AGV_DataReceive : {e.DataType}");
break;
}
////자동, 상하차 모드일때 RFID 가 타겟위치에 올때는 - 멈춤을 설정해준다 }
//if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == true && catch (Exception ex)
// PUB.Result.CurrentPos == PUB.Result.TargetPos && {
// PUB.Result.TargetPos != ePosition.NONE && Console.WriteLine($"[AGV_DataReceive] {ex.Message}");
// (PUB.sm.RunStep == ERunStep.GODOWN ||
// PUB.sm.RunStep == ERunStep.GOUP ||
// PUB.sm.RunStep == ERunStep.GOHOME ||
// PUB.sm.RunStep == ERunStep.GOCHARGE))
//{
// if (PUB.AGV.data.Sts == 'F' && dirForward == "0") //아래로 내려오고있음
// {
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
// PUB.Speak( Lang.다음마크위치에서정지합니다);
// }
// else if (PUB.AGV.data.Sts == 'B' && dirForward == "1")
// {
// //VAR.BOOL[eVarBool.FLAG_NEXTSTOP_MARK] = true;
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
// PUB.Speak(Lang.다음마크위치에서정지합니다);
// }
//}
}
break;
case arDev.Narumi.DataType.ACK:
PUB.logagv.Add($"AGV_[ACK]Receive : {PUB.AGV.ACKData}");
break;
default:
PUB.logagv.Add($"AGV_DataReceive : {e.DataType}");
break;
} }
} }
} }

View File

@@ -4,6 +4,7 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Media.Animation;
using AR; using AR;
using arCtl; using arCtl;
using COMM; using COMM;
@@ -113,9 +114,29 @@ namespace Project
var ts = VAR.TIME.RUN(eVarTime.LastConn_BAT); var ts = VAR.TIME.RUN(eVarTime.LastConn_BAT);
if (ts.TotalSeconds > 3) if (ts.TotalSeconds > 3)
{ {
Console.WriteLine($"bms connect to {PUB.setting.Port_BAT}");
PUB.BMS.PortName = PUB.setting.Port_BAT; PUB.BMS.PortName = PUB.setting.Port_BAT;
PUB.BMS.Open(); PUB.BMS.Open();
PUB.BMS.BMSDataReceive += Bms_BMSDataReceive;
PUB.BMS.Message += Bms_Message;
PUB.BMS.ChargeDetect += BMS_ChargeDetect;
VAR.TIME.Update(eVarTime.LastConn_BAT); VAR.TIME.Update(eVarTime.LastConn_BAT);
VAR.TIME.Update(eVarTime.LastConnTry_BAT);
}
}
else if (PUB.BMS.IsValid == false)
{
var ts = VAR.TIME.RUN(eVarTime.LastConnTry_BAT);
if (ts.TotalSeconds > 10)
{
Console.WriteLine("bms auto disconnect");
PUB.BMS.BMSDataReceive -= Bms_BMSDataReceive;
PUB.BMS.Message -= Bms_Message;
PUB.BMS.ChargeDetect -= BMS_ChargeDetect;
PUB.BMS.Close();
VAR.TIME.Set(eVarTime.LastConn_BAT,DateTime.Now.AddSeconds(5));
} }
} }
//ConnectSerialPort(PUB.BMS, PUB.setting.Port_BAT, PUB.setting.Baud_BAT, //ConnectSerialPort(PUB.BMS, PUB.setting.Port_BAT, PUB.setting.Baud_BAT,

View File

@@ -35,7 +35,7 @@ namespace Project
var targID = dataStr.Substring(0, 2); var targID = dataStr.Substring(0, 2);
var targstr = dataStr.Substring(2); var targstr = dataStr.Substring(2);
if(byte.TryParse(targID,out byte tID)) if (byte.TryParse(targID, out byte tID))
{ {
if (PUB.setting.XBE_ID == tID) if (PUB.setting.XBE_ID == tID)
{ {
@@ -61,13 +61,10 @@ namespace Project
if (uint.TryParse(dataStr, out uint tagno2)) if (uint.TryParse(dataStr, out uint tagno2))
{ {
var currPos = PUB.mapctl.agv.CurrentRFID;///.AGVMoveToRFID(; var currPos = PUB.mapctl.agv.CurrentRFID;///.AGVMoveToRFID(;
if (currPos == 0) currPos = 10; if (PUB.mapctl.SetTargetPosition(tagno2))
var pathRlt = PUB.mapctl.CalculatePath(currPos, tagno2); PUB.log.AddI($"New Target {tagno2}");
if (pathRlt.Success == true) else
{ PUB.log.AddE($"Path Error {tagno2}");
PUB.log.AddI($"New Target:{tagno2}");
}
else PUB.log.AddE($"Path Error {pathRlt.Message} : {tagno2}");
} }
else PUB.log.AddE($"Path Param Error :{dataStr}"); else PUB.log.AddE($"Path Param Error :{dataStr}");
break; break;

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@ using System.Drawing;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Permissions; using System.Security.Permissions;
using System.Windows.Forms;
namespace AGVControl.Models namespace AGVControl.Models
{ {
@@ -13,23 +14,23 @@ namespace AGVControl.Models
Stop = 2 Stop = 2
} }
public class CRFIDData //public class CRFIDData
{ //{
public UInt16 rfid { get; set; } // public UInt16 Value { get; set; }
public Point Position { get; set; } // public Point Location { get; set; }
public override string ToString() // public override string ToString()
{ // {
return $"RFID:{rfid},P:{Position.X},{Position.Y}"; // return $"RFID:{Value},P:{Location.X},{Location.Y}";
} // }
} //}
public class movehistorydata : CRFIDData public class movehistorydata : RFIDPoint
{ {
public Direction direction { get; set; } public Direction Direction { get; set; }
public override string ToString() public override string ToString()
{ {
return $"RFID:{rfid},DIR:{direction},P:{Position.X},{Position.Y}"; return $"RFID:{Value},DIR:{Direction},P:{Location.X},{Location.Y}";
} }
} }
@@ -78,24 +79,32 @@ namespace AGVControl.Models
/// </summary> /// </summary>
public Direction TargetDirection { get; set; } = Direction.Stop; public Direction TargetDirection { get; set; } = Direction.Stop;
public bool IsMoving { get; set; } public bool IsMoving { get; set; }
public bool IsMarkCheck { get; set; }
public bool IsTargetDirectionMatch { get; set; }
/// <summary> /// <summary>
/// 메인경로
/// 경로검색으로 입력된 경로 /// 경로검색으로 입력된 경로
/// </summary> /// </summary>
public List<RFIDPoint> CurrentPath { get; set; } = new List<RFIDPoint>(); public List<RFIDPoint> MainPath { get; set; } = new List<RFIDPoint>();
/// <summary>
/// 메인경로외에 거쳐가는 중간 경로
/// </summary>
public List<RFIDPoint> SubPath { get; set; }
public List<Point> PlannedPath { get; set; }
public List<string> PathRFIDs { get; set; } public List<string> PathRFIDs { get; set; }
// 이동 경로 기록을 위한 새로운 속성들 // 이동 경로 기록을 위한 새로운 속성들
public List<movehistorydata> MovementHistory { get; } = new List<movehistorydata>(); public List<movehistorydata> MovementHistory { get; } = new List<movehistorydata>();
public const int HISTORY_SIZE = 4; // 최근 4개 위치 기록 public const int HISTORY_SIZE = 10; // 최근 4개 위치 기록
public AGV() public AGV()
{ {
CurrentPath = new List<RFIDPoint>(); MainPath = new List<RFIDPoint>();
PlannedPath = new List<Point>(); SubPath = new List<RFIDPoint>();
PathRFIDs = new List<string>(); PathRFIDs = new List<string>();
CurrentRFID = new RFIDPoint(); CurrentRFID = new RFIDPoint();
@@ -110,10 +119,10 @@ namespace AGVControl.Models
public void AddToMovementHistory(UInt16 rfidValue, Point position, Direction direction) public void AddToMovementHistory(UInt16 rfidValue, Point position, Direction direction)
{ {
// 중복 RFID가 연속으로 들어오는 경우 무시 // 중복 RFID가 연속으로 들어오는 경우 무시
if (MovementHistory.Count > 0 && MovementHistory.Last().rfid == rfidValue) if (MovementHistory.Count > 0 && MovementHistory.Last().Value == rfidValue)
return; return;
MovementHistory.Add(new movehistorydata { rfid = rfidValue, direction = direction, Position = position }); MovementHistory.Add(new movehistorydata { Value = rfidValue, Direction = direction, Location = position });
// 기록 크기 제한 // 기록 크기 제한
if (MovementHistory.Count > HISTORY_SIZE) if (MovementHistory.Count > HISTORY_SIZE)
@@ -122,7 +131,7 @@ namespace AGVControl.Models
} }
//최초방향과 마지막 방향이 일치하지 않으면 그 이전의 데이터는 삭제한다. //최초방향과 마지막 방향이 일치하지 않으면 그 이전의 데이터는 삭제한다.
if (MovementHistory.Count > 2 && MovementHistory.First().direction != MovementHistory.Last().direction) if (MovementHistory.Count > 2 && MovementHistory.First().Direction != MovementHistory.Last().Direction)
{ {
var lastTwo = MovementHistory.Skip(MovementHistory.Count - 2).Take(2).ToArray(); // [9, 10] var lastTwo = MovementHistory.Skip(MovementHistory.Count - 2).Take(2).ToArray(); // [9, 10]
MovementHistory.Clear(); MovementHistory.Clear();
@@ -138,14 +147,14 @@ namespace AGVControl.Models
// 이전 RFID에서 현재 RFID로의 연결 확인 // 이전 RFID에서 현재 RFID로의 연결 확인
var connection = connections.FirstOrDefault(c => var connection = connections.FirstOrDefault(c =>
(c.StartRFID == previousRFID && c.EndRFID == currentRFID) || (c.P1.Value == previousRFID && c.P2.Value == currentRFID) ||
(c.IsBidirectional && c.StartRFID == currentRFID && c.EndRFID == previousRFID)); (c.P1.Value == currentRFID && c.P2.Value == previousRFID));
if (connection == null) if (connection == null)
return null; // 연결되지 않은 경로 return null; // 연결되지 않은 경로
// 연결 방향에 따라 실제 이동 방향 결정 // 연결 방향에 따라 실제 이동 방향 결정
if (connection.StartRFID == previousRFID && connection.EndRFID == currentRFID) if (connection.P1.Value == previousRFID && connection.P2.Value == currentRFID)
{ {
return Direction.Forward; // Start -> End 방향으로 이동 return Direction.Forward; // Start -> End 방향으로 이동
} }
@@ -169,7 +178,7 @@ namespace AGVControl.Models
var previousRFID = recentRFIDs[0]; var previousRFID = recentRFIDs[0];
var currentRFID = recentRFIDs[1]; var currentRFID = recentRFIDs[1];
var actualDirection = CalculateActualDirectionByConnection(currentRFID.rfid, previousRFID.rfid, connections); var actualDirection = CalculateActualDirectionByConnection(currentRFID.Value, previousRFID.Value, connections);
if (!actualDirection.HasValue) if (!actualDirection.HasValue)
return true; // 연결 정보로 방향 판단 불가 return true; // 연결 정보로 방향 판단 불가
@@ -201,11 +210,11 @@ namespace AGVControl.Models
var currentRFID = recentRFIDs[1]; var currentRFID = recentRFIDs[1];
// RFID 값의 증가/감소로 방향 판단 // RFID 값의 증가/감소로 방향 판단
if (currentRFID.rfid > prevRFID.rfid) if (currentRFID.Value > prevRFID.Value)
{ {
return Direction.Forward; // RFID 값이 증가하면 전진 return Direction.Forward; // RFID 값이 증가하면 전진
} }
else if (currentRFID.rfid < prevRFID.rfid) else if (currentRFID.Value < prevRFID.Value)
{ {
return Direction.Backward; // RFID 값이 감소하면 후진 return Direction.Backward; // RFID 값이 감소하면 후진
} }

View File

@@ -0,0 +1,14 @@
using AGVControl.Models;
namespace AGVControl
{
public class AGVActionPrediction
{
public Direction Direction { get; set; }
public uint? NextRFID { get; set; }
public string Reason { get; set; }
public AGVActionReasonCode ReasonCode { get; set; }
public AGVMoveState MoveState { get; set; } // RUN 또는 STOP
}
}

View File

@@ -0,0 +1,23 @@
using AGVControl.Models;
using System.Collections.Generic;
using System.Linq;
namespace AGVControl
{
public class PathResult
{
public bool Success
{
get
{
return Path != null && Path.Any();
}
}
public string Message { get; set; }
public List<RFIDPoint> Path { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using AGVControl.Models;
namespace AGVControl
{
public class RFIDConnection
{
public RFIDPoint P1 { get; set; }
public RFIDPoint P2 { get; set; }
public bool DisableP1_to_P2 { get; set; }
public bool DisableP2_to_P1 { get; set; }
public float Distance { get; set; }
public override bool Equals(object obj)
{
if (obj is RFIDConnection other)
{
return (P1 == other.P1 && P2 == other.P2);
}
return false;
}
public override int GetHashCode()
{
return P1.GetHashCode() ^ P2.GetHashCode();
}
public override string ToString()
{
//연결정보를 확인
return $"{P1.Value} ↔ {P2.Value},P1-2:{(DisableP1_to_P2 ? "X" : "O")},P2-1:{(DisableP2_to_P1 ? "X" : "O")}";
}
}
}

View File

@@ -13,7 +13,6 @@ namespace AGVControl.Models
public Direction? FixedDirection { get; set; } // 고정 방향(없으면 null) public Direction? FixedDirection { get; set; } // 고정 방향(없으면 null)
public bool IsTerminal { get; set; } // 종단 여부 public bool IsTerminal { get; set; } // 종단 여부
public RectangleF Bounds { get; set; } public RectangleF Bounds { get; set; }
public void Clear() public void Clear()
{ {
this.Location = Point.Empty; this.Location = Point.Empty;
@@ -38,5 +37,10 @@ namespace AGVControl.Models
IsTerminal = false; // 기본값은 종단 아님 IsTerminal = false; // 기본값은 종단 아님
Clear(); Clear();
} }
public override string ToString()
{
return $"[RFIDPoint] {Value},P:{Location.X},{Location.Y}";
}
} }
} }

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AGVControl
{
public enum AGVMoveState
{
Stop = 0,
Run
}
public enum AGVActionReasonCode
{
Unknown = 0,
NoPosition, // 위치 미확정(처음 기동)
NoPath, // 경로 없음 또는 현재 위치 미확정
NotOnPath, // 현재 위치가 경로에 없음
Arrived, // 경로의 마지막 지점(목적지 도달)
Normal, // 정상(다음 RFID 있음)
NeedTurn,
NoTurnPoint,
PathCalcError,
NoDirection,
MoveForTurn,
}
}

View File

@@ -45,6 +45,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Models\AGVActionPrediction.cs" />
<Compile Include="BatteryLevelGauge.cs"> <Compile Include="BatteryLevelGauge.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
@@ -57,16 +58,20 @@
<Compile Include="GuideSensor.Designer.cs"> <Compile Include="GuideSensor.Designer.cs">
<DependentUpon>GuideSensor.cs</DependentUpon> <DependentUpon>GuideSensor.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="MapControl.cs" /> <Compile Include="MapControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MapControl.Designer.cs"> <Compile Include="MapControl.Designer.cs">
<DependentUpon>MapControl.cs</DependentUpon> <DependentUpon>MapControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Models\AGV.cs" /> <Compile Include="Models\AGV.cs" />
<Compile Include="Models\CustomLine.cs" /> <Compile Include="Models\CustomLine.cs" />
<Compile Include="Models\enumStruct.cs" />
<Compile Include="Models\MagnetLine.cs" /> <Compile Include="Models\MagnetLine.cs" />
<Compile Include="Models\MapData.cs" /> <Compile Include="Models\MapData.cs" />
<Compile Include="Models\MapElements.cs" /> <Compile Include="Models\MapElements.cs" />
<Compile Include="Models\MapText.cs" /> <Compile Include="Models\MapText.cs" />
<Compile Include="Models\PathResult.cs" />
<Compile Include="Models\RFIDLine.cs" /> <Compile Include="Models\RFIDLine.cs" />
<Compile Include="Models\RFIDPoint.cs" /> <Compile Include="Models\RFIDPoint.cs" />
<Compile Include="Models\ToolBarItem.cs" /> <Compile Include="Models\ToolBarItem.cs" />
@@ -82,6 +87,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
<Compile Include="Models\RFIDConnection.cs" />
<Compile Include="RoundButton.cs"> <Compile Include="RoundButton.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
@@ -105,6 +111,10 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CommData\CommData.csproj">
<Project>{14e8c9a5-013e-49ba-b435-efefc77dd623}</Project>
<Name>CommData</Name>
</ProjectReference>
<ProjectReference Include="..\CommUtil\arCommUtil.csproj"> <ProjectReference Include="..\CommUtil\arCommUtil.csproj">
<Project>{14e8c9a5-013e-49ba-b435-ffffff7dd623}</Project> <Project>{14e8c9a5-013e-49ba-b435-ffffff7dd623}</Project>
<Name>arCommUtil</Name> <Name>arCommUtil</Name>

View File

@@ -113,6 +113,8 @@ namespace COMM
/// </summary> /// </summary>
WAIT_CHARGEACK, WAIT_CHARGEACK,
MARKSTOP_ON,
//agv area start ( 64 ~ 95) //agv area start ( 64 ~ 95)

View File

@@ -30,38 +30,44 @@ namespace AGVEmulator
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
AGVEmulator.UC.AgvViewer.ptdata ptdata85 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata1 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata86 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata2 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata87 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata3 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata88 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata4 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata89 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata5 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata90 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata6 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata91 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata7 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata92 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata8 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata93 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata9 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata94 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata10 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata95 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata11 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata96 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata12 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata97 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata13 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata98 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata14 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata99 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata15 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata100 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata16 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata101 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata17 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata102 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata18 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata103 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata19 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata104 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata20 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata105 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata21 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata106 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata22 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata107 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata23 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata108 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata24 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata109 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata25 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata110 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata26 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata111 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata27 = new AGVEmulator.UC.AgvViewer.ptdata();
AGVEmulator.UC.AgvViewer.ptdata ptdata112 = new AGVEmulator.UC.AgvViewer.ptdata(); AGVEmulator.UC.AgvViewer.ptdata ptdata28 = new AGVEmulator.UC.AgvViewer.ptdata();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rtBMS = new arCtl.LogTextBox(); this.rtBMS = new arCtl.LogTextBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.trbT2 = new System.Windows.Forms.TrackBar();
this.trbT1 = new System.Windows.Forms.TrackBar();
this.btc8 = new System.Windows.Forms.Label(); this.btc8 = new System.Windows.Forms.Label();
this.btc4 = new System.Windows.Forms.Label(); this.btc4 = new System.Windows.Forms.Label();
this.btc7 = new System.Windows.Forms.Label(); this.btc7 = new System.Windows.Forms.Label();
@@ -154,14 +160,10 @@ namespace AGVEmulator
this.sbBMS = new System.Windows.Forms.ToolStripStatusLabel(); this.sbBMS = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.sbCAL = new System.Windows.Forms.ToolStripStatusLabel(); this.sbCAL = new System.Windows.Forms.ToolStripStatusLabel();
this.trbT1 = new System.Windows.Forms.TrackBar();
this.trbT2 = new System.Windows.Forms.TrackBar();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trbT1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
this.panel4.SuspendLayout(); this.panel4.SuspendLayout();
this.groupBox9.SuspendLayout(); this.groupBox9.SuspendLayout();
@@ -190,8 +192,6 @@ namespace AGVEmulator
((System.ComponentModel.ISupportInitialize)(this.nudTagNo)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudTagNo)).BeginInit();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
@@ -257,6 +257,70 @@ namespace AGVEmulator
this.panel1.Size = new System.Drawing.Size(1134, 103); this.panel1.Size = new System.Drawing.Size(1134, 103);
this.panel1.TabIndex = 4; this.panel1.TabIndex = 4;
// //
// label11
//
this.label11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label11.ForeColor = System.Drawing.Color.White;
this.label11.Location = new System.Drawing.Point(620, 68);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(75, 24);
this.label11.TabIndex = 19;
this.label11.Text = "Curr";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label10
//
this.label10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label10.ForeColor = System.Drawing.Color.White;
this.label10.Location = new System.Drawing.Point(620, 12);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(75, 24);
this.label10.TabIndex = 18;
this.label10.Text = "Curr";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(391, 72);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(44, 12);
this.label9.TabIndex = 17;
this.label9.Text = "Temp2";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(392, 18);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(44, 12);
this.label8.TabIndex = 16;
this.label8.Text = "Temp1";
//
// trbT2
//
this.trbT2.LargeChange = 10;
this.trbT2.Location = new System.Drawing.Point(442, 58);
this.trbT2.Maximum = 990;
this.trbT2.Name = "trbT2";
this.trbT2.Size = new System.Drawing.Size(172, 45);
this.trbT2.SmallChange = 5;
this.trbT2.TabIndex = 15;
this.trbT2.Value = 200;
this.trbT2.Scroll += new System.EventHandler(this.trbT2_Scroll);
//
// trbT1
//
this.trbT1.LargeChange = 10;
this.trbT1.Location = new System.Drawing.Point(442, 7);
this.trbT1.Maximum = 990;
this.trbT1.Name = "trbT1";
this.trbT1.Size = new System.Drawing.Size(172, 45);
this.trbT1.SmallChange = 5;
this.trbT1.TabIndex = 14;
this.trbT1.Value = 200;
this.trbT1.Scroll += new System.EventHandler(this.trbT1_Scroll);
//
// btc8 // btc8
// //
this.btc8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.btc8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
@@ -828,6 +892,7 @@ namespace AGVEmulator
0, 0,
0, 0,
0}); 0});
this.numericUpDown1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.numericUpDown1_KeyDown);
// //
// button18 // button18
// //
@@ -1030,120 +1095,120 @@ namespace AGVEmulator
this.agvViewer1.lastmarkdir = ""; this.agvViewer1.lastmarkdir = "";
this.agvViewer1.lasttag = ""; this.agvViewer1.lasttag = "";
this.agvViewer1.lasttagdir = ""; this.agvViewer1.lasttagdir = "";
ptdata85.active = false; ptdata1.active = false;
ptdata85.data = "NOT"; ptdata1.data = "NOT";
ptdata85.pos = 30F; ptdata1.pos = 30F;
ptdata86.active = false; ptdata2.active = false;
ptdata86.data = "QA"; ptdata2.data = "QA";
ptdata86.pos = 200F; ptdata2.pos = 200F;
ptdata87.active = false; ptdata3.active = false;
ptdata87.data = "CHG"; ptdata3.data = "CHG";
ptdata87.pos = 300F; ptdata3.pos = 300F;
ptdata88.active = false; ptdata4.active = false;
ptdata88.data = "QC"; ptdata4.data = "QC";
ptdata88.pos = 400F; ptdata4.pos = 400F;
ptdata89.active = false; ptdata5.active = false;
ptdata89.data = "#FVI-1"; ptdata5.data = "#FVI-1";
ptdata89.pos = 500F; ptdata5.pos = 500F;
ptdata90.active = false; ptdata6.active = false;
ptdata90.data = "#FVI-2"; ptdata6.data = "#FVI-2";
ptdata90.pos = 600F; ptdata6.pos = 600F;
ptdata91.active = false; ptdata7.active = false;
ptdata91.data = "#FVI-3"; ptdata7.data = "#FVI-3";
ptdata91.pos = 700F; ptdata7.pos = 700F;
ptdata92.active = false; ptdata8.active = false;
ptdata92.data = "#FVI-4"; ptdata8.data = "#FVI-4";
ptdata92.pos = 800F; ptdata8.pos = 800F;
ptdata93.active = false; ptdata9.active = false;
ptdata93.data = "#FVI-5"; ptdata9.data = "#FVI-5";
ptdata93.pos = 900F; ptdata9.pos = 900F;
ptdata94.active = false; ptdata10.active = false;
ptdata94.data = "POT"; ptdata10.data = "POT";
ptdata94.pos = 970F; ptdata10.pos = 970F;
this.agvViewer1.listMRK = new AGVEmulator.UC.AgvViewer.ptdata[] { this.agvViewer1.listMRK = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata85, ptdata1,
ptdata86, ptdata2,
ptdata87, ptdata3,
ptdata88, ptdata4,
ptdata89, ptdata5,
ptdata90, ptdata6,
ptdata91, ptdata7,
ptdata92, ptdata8,
ptdata93, ptdata9,
ptdata94}; ptdata10};
ptdata95.active = false; ptdata11.active = false;
ptdata95.data = "9000"; ptdata11.data = "9000";
ptdata95.pos = 80F; ptdata11.pos = 80F;
ptdata96.active = false; ptdata12.active = false;
ptdata96.data = "9001"; ptdata12.data = "9001";
ptdata96.pos = 120F; ptdata12.pos = 120F;
ptdata97.active = false; ptdata13.active = false;
ptdata97.data = "9010"; ptdata13.data = "9010";
ptdata97.pos = 180F; ptdata13.pos = 180F;
ptdata98.active = false; ptdata14.active = false;
ptdata98.data = "9011"; ptdata14.data = "9011";
ptdata98.pos = 220F; ptdata14.pos = 220F;
ptdata99.active = false; ptdata15.active = false;
ptdata99.data = "9020"; ptdata15.data = "9020";
ptdata99.pos = 280F; ptdata15.pos = 280F;
ptdata100.active = false; ptdata16.active = false;
ptdata100.data = "9021"; ptdata16.data = "9021";
ptdata100.pos = 320F; ptdata16.pos = 320F;
ptdata101.active = false; ptdata17.active = false;
ptdata101.data = "9030"; ptdata17.data = "9030";
ptdata101.pos = 380F; ptdata17.pos = 380F;
ptdata102.active = false; ptdata18.active = false;
ptdata102.data = "9031"; ptdata18.data = "9031";
ptdata102.pos = 420F; ptdata18.pos = 420F;
ptdata103.active = false; ptdata19.active = false;
ptdata103.data = "9040"; ptdata19.data = "9040";
ptdata103.pos = 480F; ptdata19.pos = 480F;
ptdata104.active = false; ptdata20.active = false;
ptdata104.data = "9041"; ptdata20.data = "9041";
ptdata104.pos = 520F; ptdata20.pos = 520F;
ptdata105.active = false; ptdata21.active = false;
ptdata105.data = "9050"; ptdata21.data = "9050";
ptdata105.pos = 580F; ptdata21.pos = 580F;
ptdata106.active = false; ptdata22.active = false;
ptdata106.data = "9051"; ptdata22.data = "9051";
ptdata106.pos = 620F; ptdata22.pos = 620F;
ptdata107.active = false; ptdata23.active = false;
ptdata107.data = "9060"; ptdata23.data = "9060";
ptdata107.pos = 680F; ptdata23.pos = 680F;
ptdata108.active = false; ptdata24.active = false;
ptdata108.data = "9061"; ptdata24.data = "9061";
ptdata108.pos = 720F; ptdata24.pos = 720F;
ptdata109.active = false; ptdata25.active = false;
ptdata109.data = "9070"; ptdata25.data = "9070";
ptdata109.pos = 780F; ptdata25.pos = 780F;
ptdata110.active = false; ptdata26.active = false;
ptdata110.data = "9071"; ptdata26.data = "9071";
ptdata110.pos = 820F; ptdata26.pos = 820F;
ptdata111.active = false; ptdata27.active = false;
ptdata111.data = "9000"; ptdata27.data = "9000";
ptdata111.pos = 10F; ptdata27.pos = 10F;
ptdata112.active = false; ptdata28.active = false;
ptdata112.data = "9001"; ptdata28.data = "9001";
ptdata112.pos = 50F; ptdata28.pos = 50F;
this.agvViewer1.listTAG = new AGVEmulator.UC.AgvViewer.ptdata[] { this.agvViewer1.listTAG = new AGVEmulator.UC.AgvViewer.ptdata[] {
ptdata95, ptdata11,
ptdata96, ptdata12,
ptdata97, ptdata13,
ptdata98, ptdata14,
ptdata99, ptdata15,
ptdata100, ptdata16,
ptdata101, ptdata17,
ptdata102, ptdata18,
ptdata103, ptdata19,
ptdata104, ptdata20,
ptdata105, ptdata21,
ptdata106, ptdata22,
ptdata107, ptdata23,
ptdata108, ptdata24,
ptdata109, ptdata25,
ptdata110, ptdata26,
ptdata111, ptdata27,
ptdata112}; ptdata28};
this.agvViewer1.Location = new System.Drawing.Point(241, 0); this.agvViewer1.Location = new System.Drawing.Point(241, 0);
this.agvViewer1.Name = "agvViewer1"; this.agvViewer1.Name = "agvViewer1";
this.agvViewer1.Size = new System.Drawing.Size(899, 120); this.agvViewer1.Size = new System.Drawing.Size(899, 120);
@@ -1430,70 +1495,6 @@ namespace AGVEmulator
this.sbCAL.Size = new System.Drawing.Size(19, 17); this.sbCAL.Size = new System.Drawing.Size(19, 17);
this.sbCAL.Text = "●"; this.sbCAL.Text = "●";
// //
// trbT1
//
this.trbT1.LargeChange = 10;
this.trbT1.Location = new System.Drawing.Point(442, 7);
this.trbT1.Maximum = 990;
this.trbT1.Name = "trbT1";
this.trbT1.Size = new System.Drawing.Size(172, 45);
this.trbT1.SmallChange = 5;
this.trbT1.TabIndex = 14;
this.trbT1.Value = 200;
this.trbT1.Scroll += new System.EventHandler(this.trbT1_Scroll);
//
// trbT2
//
this.trbT2.LargeChange = 10;
this.trbT2.Location = new System.Drawing.Point(442, 58);
this.trbT2.Maximum = 990;
this.trbT2.Name = "trbT2";
this.trbT2.Size = new System.Drawing.Size(172, 45);
this.trbT2.SmallChange = 5;
this.trbT2.TabIndex = 15;
this.trbT2.Value = 200;
this.trbT2.Scroll += new System.EventHandler(this.trbT2_Scroll);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(392, 18);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(44, 12);
this.label8.TabIndex = 16;
this.label8.Text = "Temp1";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(391, 72);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(44, 12);
this.label9.TabIndex = 17;
this.label9.Text = "Temp2";
//
// label10
//
this.label10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label10.ForeColor = System.Drawing.Color.White;
this.label10.Location = new System.Drawing.Point(620, 12);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(75, 24);
this.label10.TabIndex = 18;
this.label10.Text = "Curr";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label11
//
this.label11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.label11.ForeColor = System.Drawing.Color.White;
this.label11.Location = new System.Drawing.Point(620, 68);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(75, 24);
this.label11.TabIndex = 19;
this.label11.Text = "Curr";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -1509,6 +1510,8 @@ namespace AGVEmulator
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trbT1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
this.panel4.ResumeLayout(false); this.panel4.ResumeLayout(false);
this.groupBox9.ResumeLayout(false); this.groupBox9.ResumeLayout(false);
@@ -1547,8 +1550,6 @@ namespace AGVEmulator
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false); this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout(); this.statusStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trbT1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trbT2)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@@ -590,6 +590,12 @@ namespace AGVEmulator
} }
private void numericUpDown1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
button18.PerformClick();
}
private void trbT2_Scroll(object sender, EventArgs e) private void trbT2_Scroll(object sender, EventArgs e)
{ {
Temp2 = (UInt16)trbT2.Value; Temp2 = (UInt16)trbT2.Value;