Compare commits

...

2 Commits

Author SHA1 Message Date
703e1387bf .. 2025-12-12 20:57:55 +09:00
f507a6487e 소스정리 2025-12-12 20:00:33 +09:00
13 changed files with 1461 additions and 72 deletions

View File

@@ -36,16 +36,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="arControl.Net4">
<HintPath>..\arControl.Net4.dll</HintPath>
</Reference>
<Reference Include="arFrameControl">
<HintPath>..\arFrameControl.dll</HintPath>
<HintPath>..\Cs_HMI\DLL\arControl.Net4.dll</HintPath>
</Reference>
<Reference Include="ArLog.Net4">
<HintPath>..\ArLog.Net4.dll</HintPath>
<HintPath>..\Cs_HMI\DLL\ArLog.Net4.dll</HintPath>
</Reference>
<Reference Include="ArSetting.Net4">
<HintPath>..\ArSetting.Net4.dll</HintPath>
<HintPath>..\Cs_HMI\DLL\ArSetting.Net4.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -130,6 +127,10 @@
<Project>{c5f7a8b2-8d3e-4a1b-9c6e-7f4d5e2a9b1c}</Project>
<Name>AGVNavigationCore</Name>
</ProjectReference>
<ProjectReference Include="..\Cs_HMI\SubProject\CommUtil\arCommUtil.csproj">
<Project>{14e8c9a5-013e-49ba-b435-ffffff7dd623}</Project>
<Name>arCommUtil</Name>
</ProjectReference>
<ProjectReference Include="..\Cs_HMI\SubProject\EnigProtocol\enigprotocol\ENIGProtocol.csproj">
<Project>{9365803b-933d-4237-93c7-b502c855a71c}</Project>
<Name>ENIGProtocol</Name>

View File

@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36804.6 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AGVEmulator", "AGVEmulator.csproj", "{9312AB43-72F6-4365-A266-E767215FA7F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AGVNavigationCore", "..\Cs_HMI\AGVLogic\AGVNavigationCore\AGVNavigationCore.csproj", "{C5F7A8B2-8D3E-4A1B-9C6E-7F4D5E2A9B1C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ENIGProtocol", "..\Cs_HMI\SubProject\ENIGProtocol\enigprotocol\ENIGProtocol.csproj", "{9365803B-933D-4237-93C7-B502C855A71C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "arCommUtil", "..\Cs_HMI\SubProject\CommUtil\arCommUtil.csproj", "{14E8C9A5-013E-49BA-B435-FFFFFF7DD623}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9312AB43-72F6-4365-A266-E767215FA7F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9312AB43-72F6-4365-A266-E767215FA7F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9312AB43-72F6-4365-A266-E767215FA7F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9312AB43-72F6-4365-A266-E767215FA7F5}.Release|Any CPU.Build.0 = Release|Any CPU
{C5F7A8B2-8D3E-4A1B-9C6E-7F4D5E2A9B1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5F7A8B2-8D3E-4A1B-9C6E-7F4D5E2A9B1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5F7A8B2-8D3E-4A1B-9C6E-7F4D5E2A9B1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5F7A8B2-8D3E-4A1B-9C6E-7F4D5E2A9B1C}.Release|Any CPU.Build.0 = Release|Any CPU
{9365803B-933D-4237-93C7-B502C855A71C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9365803B-933D-4237-93C7-B502C855A71C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9365803B-933D-4237-93C7-B502C855A71C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9365803B-933D-4237-93C7-B502C855A71C}.Release|Any CPU.Build.0 = Release|Any CPU
{14E8C9A5-013E-49BA-B435-FFFFFF7DD623}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14E8C9A5-013E-49BA-B435-FFFFFF7DD623}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14E8C9A5-013E-49BA-B435-FFFFFF7DD623}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14E8C9A5-013E-49BA-B435-FFFFFF7DD623}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C353381B-16D4-4298-A97E-6DE0FC4A66B2}
EndGlobalSection
EndGlobal

View File

@@ -21,56 +21,6 @@ namespace AGVEmulator
public char sts_dir = 'F';
public char sts_sensor = '1';
public enum eCommand : byte
{
LOAD = 0, //EEPROM 불러오기
SAVE, //EEPROM 저장
RESET, //초기화
PINGCHK,
SET_PINMODE, //PINMODE 설정
SET_DOUTPUT, //디지털출력설정(포트번호,값[1,0])
SET_AOUTPUT, //아날로그출력설정(포트GET_SETTING = 50, //셋팅값 요청
SET_FLAG,
SET_EEPROM,
SET_MANUALSPEED,
GET_SETTING = 50,
GUIDE_MOT = 90, //가이드커버(양쪽) 0=멈춤,1=UP,2=DN 아스키코드표 90=Z
SET_EEP_DIREV,
};
public enum DOName
{
PINO_GUIDEMOTOR_LDIR,
PINO_GUIDEMOTOR_LRUN,
PINO_GUIDEMOTOR_RDIR,
PINO_GUIDEMOTOR_RRUN,
PINO_EMPTY_26,
PINO_EMPTY_27,
PINO_EMPTY_28,
PINO_EMPTY_29,
}
public enum DIName
{
PINI_EMG,
PINI_BTN_1,
PINI_BTN_2,
PINI_BTN_3,
PINI_BTN_4,
PINI_OVERLOADL,
PINI_OVERLOADR,
PINI_EMPTY_36,
PINI_EMPTY_37,
PINI_EMPTY_38,
PINI_BTN_ZUP,
PINI_BTN_ZDN,
PINI_LIMIT_LU,
PINI_LIMIT_LD,
PINI_LIMIT_RU,
PINI_LIMIT_RD,
PINI_STOP,
}
public enum eerror
{
Emergency = 0,

View File

@@ -84,7 +84,7 @@ namespace AGVEmulator
rtCAL.ColorList = logcolor;
rtAGVPro.ColorList = logcolor;
this.FormClosed += Form1_FormClosed;
//this.FormClosed += Form1_FormClosed;
BMS = new DevBMS();
AGV = new DevAGV();
@@ -678,7 +678,8 @@ private void UpdateVisualAGV()
}
UpdateVisualAGV();
}
}
private void button14_Click(object sender, EventArgs e)
{
//agv 정지

View File

@@ -48,6 +48,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
@@ -58,9 +61,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\AGVState.cs" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
</packages>

1322
Cs_HMI/Data/NewMap.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -42,7 +42,7 @@
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<OutputPath>..\..\..\..\..\Amkor\AGV4\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NOSPEECH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -116,8 +116,7 @@
<HintPath>C:\Program Files (x86)\Microsoft SDKs\Speech\v11.0\Assembly\Microsoft.Speech.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
@@ -187,7 +186,9 @@
<Compile Include="Device\BMS.cs" />
<Compile Include="Device\BMSInformationEventArgs.cs" />
<Compile Include="Device\CFlag.cs" />
<Compile Include="Device\xbee.cs" />
<Compile Include="Device\xbee.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Device\Socket.cs" />
<Compile Include="Dialog\fCounter.cs">
<SubType>Form</SubType>

View File

@@ -8,7 +8,11 @@ using System.Media;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System;
#if SPEECH
using Microsoft.Speech.Synthesis;
#endif
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Linq;
@@ -69,8 +73,9 @@ namespace Project
/// 디버그모니터용 소켓(데이터를 전송만 한다)
/// </summary>
public static Device.Socket sock_debug;
#if SPEECH
private static SpeechSynthesizer voice;
#endif
public static SoundPlayer mplayer;
[DllImport("winmm.dll")]
@@ -108,6 +113,7 @@ namespace Project
Console.WriteLine("speech disabled");
return;
}
#if SPEECH
if (force)
voice.SpeakAsyncCancelAll();
if (voice.State == SynthesizerState.Ready)
@@ -117,6 +123,9 @@ namespace Project
if (logcate.isEmpty()) logcate = "SPEAK";
PUB.log.Add(logcate, m);
}
#else
PUB.log.Add($"스피치컴파일상수OFF");
#endif
}
/// <summary>
@@ -228,7 +237,7 @@ namespace Project
PUB.mplayer.SoundLocation = PUB.setting.musicfile;
SetVolume(PUB.setting.musicvol);
}
#if SPEECH
voice = new SpeechSynthesizer();
try
{
@@ -256,7 +265,7 @@ namespace Project
// 음성 설정 실패 시 기본값 사용
}
voice.SetOutputToDefaultAudioDevice();
#endif
var file_version = System.IO.Path.Combine(UTIL.CurrentPath, "version.txt");
if (System.IO.File.Exists(file_version))
{

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.4" targetFramework="net48" />

Submodule Cs_HMI/SubProject/arCtl deleted from 768d71ebca

View File

@@ -0,0 +1,31 @@
# AGV 버퍼 진입 (Buffer In) 로직 분석
이 문서는 `_SM_RUN_BUFFER_IN.cs` 소스 코드를 기반으로 한 `Buffer In` 동작의 상세 로직 흐름을 설명합니다.
## 개요
**목적**: AGV가 버퍼 스테이션에 도킹하여 짐을 내리는 작업(Unloading)을 수행합니다.
## 선행 조건
1. **충전 해제 (Charge OFF)**: 충전 중이 아니어야 합니다.
2. **라이다 정지 (Lidar Stop)**: 장애물에 의해 차단되지 않아야 합니다.
3. **위치 확인 (Position Check)**: 현재 위치가 확정되어 있어야 합니다.
## 시퀀스 상세 흐름
| 단계 | 동작 | 상세 설명 | 오류 조건 (Error Condition) |
| :--- | :--- | :--- | :--- |
| **1** | **시작 (Start)** | - 로그 기록: "버퍼도킹시작"<br>- 음성 안내: "하차작업을 시작합니다" | (없음) |
| **2** | **이동/정지 확인** | - 현재 AGV가 움직이는 중인지 확인.<br>- 3초 이상 움직이면 강제 정지 명령.<br>- 정지해 있거나 이미 회전(L90) 상태라면 다음 단계로 진행. | (없음) |
| **3** | **회전 명령** | - 현재 회전 상태가 L90(왼쪽 90도)이 아니라면 `좌회전 180도(Left 180 Turn)` 명령 전송.<br>- 로그: "AGV Left Turn" | (없음) |
| **4** | **회전 시작 대기** | - AGV가 회전 동작을 시작했는지(움직임 감지) 확인. | **5초 타임아웃**: 5초 내 미동작 시 오류. |
| **5** | **회전 완료 대기** | - AGV가 회전 동작을 완료하고 멈췄는지 확인. | **15초 타임아웃**: 15초 이상 계속 움직이면 오류. |
| **6** | **리프트 하강** | - `리프트 다운(Lift Down)` 명령 전송. | (없음) |
| **7** | **리프트 확인** | - 리프트 다운 센서 신호 확인. | **10초 타임아웃**: 리프트 하강 미확인 시 오류. |
| **8** | **마크 스탑 설정** | - 마크 스탑(Mark Stop) 모니터링 활성화. | (없음) |
| **9** | **후진 이동 시작** | - 속도: `저속(Low)`<br>- 방향: `후진(Backward)`<br>- 명령: `후진 구동(Run Backward)` | **10초 타임아웃**: 속도 설정 실패 시 오류. |
| **10** | **마크 신호 대기** | - `NEXTSTOP_MARK` (자석/RFID) 신호 감지 대기. | **3초 타임아웃**: 3초 내 신호 미감지 시 오류. |
| **11** | **최종 정지 확인** | - AGV가 완전히 멈출 때까지 대기. | **10초 타임아웃**: 10초 내 정지 안 할 시 오류. |
| **12** | **완료** | - 로그: "버퍼투입완료"<br>- ACS 통신: 버퍼 투입 완료 신호 전송.<br>- 상태 업데이트. | (없음) |
## 관련 파일
* `Project\StateMachine\Step\_SM_RUN_BUFFER_IN.cs`

View File

@@ -0,0 +1,32 @@
# AGV 버퍼 진출 (Buffer Out) 로직 분석
이 문서는 `_SM_RUN_BUFFER_OUT.cs` 소스 코드를 기반으로 한 `Buffer Out` 동작의 상세 로직 흐름을 설명합니다.
## 개요
**목적**: AGV가 버퍼 스테이션에서 도킹을 해제하고 빠져나오는 작업(Move Out)을 수행합니다.
## 선행 조건
1. **충전 해제 (Charge OFF)**: 충전 중이 아니어야 합니다.
2. **라이다 정지 (Lidar Stop)**: 장애물에 의해 차단되지 않아야 합니다.
3. **위치 확인 (Position Check)**: 현재 위치가 확정되어 있어야 합니다.
## 시퀀스 상세 흐름
| 단계 | 동작 | 상세 설명 | 오류 조건 (Error Condition) |
| :--- | :--- | :--- | :--- |
| **1** | **이동 설정** | - 주행 설정: `직진(Strate)`, `전진(Forward)`, `저속(Low Speed)`.<br>- 빈 상태로 아웃(Empty state out) 준비. | (없음) |
| **2** | **전진 이동** | - `전진 구동(Run Forward)` 명령 실행. | (없음) |
| **3** | **마크 스탑 설정** | - "buffer out"용 마크 스탑(Mark Stop) 모니터링 설정. | (없음) |
| **4** | **이동 시작 확인** | - AGV가 실제 이동을 시작했는지 확인. | (없음) |
| **5** | **정지 확인** | - AGV가 마크 위치에 도달하여 정지했는지 확인. | (없음) |
| **6** | **회전 명령** | - `우회전 180도(Right 180 Turn)` 명령 실행. | (없음) |
| **7** | **회전 시작 확인**| - AGV가 회전 동작을 시작했는지 확인. | (없음) |
| **8** | **회전 정지 확인**| - AGV가 회전 동작을 완료하고 멈췄는지 확인. | (없음) |
| **9** | **완료** | - 로그: "BufferOut Complete"<br>- DB 기록: "bufferout 완료". | (없음) |
## 차이점 요약 (vs Buffer In)
* **방향**: Buffer In은 **후진(Backward)****좌회전(Left Turn)**을 사용하는 반면, Buffer Out은 **전진(Forward)** 및 **우회전(Right Turn)**을 사용합니다.
* **리프트**: Buffer Out 로직에는 명시적인 리프트 제어 단계가 없습니다 (이미 내려간 상태 가정).
## 관련 파일
* `Project\StateMachine\Step\_SM_RUN_BUFFER_OUT.cs`