..
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
<DependentUpon>DataSet1.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Device\CFlag.cs" />
|
||||
<Compile Include="Device\Xbee.cs" />
|
||||
<Compile Include="Device\xbee.cs" />
|
||||
<Compile Include="Device\Socket.cs" />
|
||||
<Compile Include="Dialog\fCounter.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -264,7 +264,6 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PUB.cs" />
|
||||
<Compile Include="CSetting.cs" />
|
||||
<Compile Include="StateMachine\Display\GetErrorMessage.cs" />
|
||||
<Compile Include="StateMachine\Step\_SM_RUN_CHGOFF.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -298,6 +297,9 @@
|
||||
<Compile Include="StateMachine\Step\_SM_RUN_INIT.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StateMachine\_Xbee.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StateMachine\_DIO.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -328,8 +330,6 @@
|
||||
<Compile Include="StateMachine\DisplayTextHandler.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util.cs" />
|
||||
<Compile Include="Util_FG.cs" />
|
||||
<Compile Include="ViewForm\fBms.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -547,7 +547,9 @@
|
||||
<Name>ENIGProtocol</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="StateMachine\Display\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>rem xcopy "$(TargetDir)*.exe" "\\192.168.1.80\Amkor\AGV2" /Y
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Drawing.Design;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Management;
|
||||
using System.IO.Ports;
|
||||
using AR;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
@@ -413,7 +414,7 @@ namespace Project
|
||||
|
||||
if (Language.isEmpty()) Language = "Kor";
|
||||
if (Password_Setup.isEmpty()) Password_Setup = "0000";
|
||||
if (musicfile.isEmpty()) musicfile = Util.CurrentPath + "music.mp3";
|
||||
if (musicfile.isEmpty()) musicfile = UTIL.CurrentPath + "music.mp3";
|
||||
if (musicvol == 0) musicvol = 50;
|
||||
|
||||
|
||||
@@ -565,7 +566,7 @@ namespace Project
|
||||
|
||||
public CounterSetting()
|
||||
{
|
||||
this.filename = Util.CurrentPath + "counter.xml";
|
||||
this.filename = AR.UTIL.CurrentPath + "counter.xml";
|
||||
}
|
||||
public override void AfterLoad()
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
// SrcText = s;
|
||||
// Check_error(SrcText);
|
||||
// if (this.isError)
|
||||
// Util.MsgE(ErrMsg.ToString());// Interaction.MsgBox(ErrMsg.ToString(), MsgBoxStyle.Critical, "오류");
|
||||
// UTIL.MsgE(ErrMsg.ToString());// Interaction.MsgBox(ErrMsg.ToString(), MsgBoxStyle.Critical, "오류");
|
||||
// }
|
||||
|
||||
// protected string Buffer1 = "";
|
||||
@@ -395,7 +395,7 @@
|
||||
// else
|
||||
// {
|
||||
// object Param1 = RunParam(ParamList[0].ToString(), NEwValue.ToString());
|
||||
// Util.MsgE(Param1, MsgBoxStyle.Information, "확인");
|
||||
// UTIL.MsgE(Param1, MsgBoxStyle.Information, "확인");
|
||||
// }
|
||||
|
||||
// break;
|
||||
@@ -718,7 +718,7 @@
|
||||
// case "SAVE1":
|
||||
// {
|
||||
// if (ParamList.Count < 1)
|
||||
// Util.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// UTIL.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// else
|
||||
// {
|
||||
// object Param1 = RunParam(ParamList[0].ToString(), NEwValue.ToString());
|
||||
@@ -731,7 +731,7 @@
|
||||
// case "SAVE2":
|
||||
// {
|
||||
// if (ParamList.Count < 1)
|
||||
// Util.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// UTIL.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// else
|
||||
// {
|
||||
// object Param1 = RunParam(ParamList[0].ToString(), NEwValue.ToString());
|
||||
@@ -744,7 +744,7 @@
|
||||
// case "SAVE3":
|
||||
// {
|
||||
// if (ParamList.Count < 1)
|
||||
// Util.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// UTIL.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// else
|
||||
// {
|
||||
// object Param1 = RunParam(ParamList[0].ToString(), NEwValue.ToString());
|
||||
@@ -757,7 +757,7 @@
|
||||
// case "SAVE4":
|
||||
// {
|
||||
// if (ParamList.Count < 1)
|
||||
// Util.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// UTIL.MsgE("SAVE1 함수에 1개의 파라미터가 없습니다");
|
||||
// else
|
||||
// {
|
||||
// object Param1 = RunParam(ParamList[0].ToString(), NEwValue.ToString());
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Project.StateMachine;
|
||||
using AR;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
@@ -174,7 +175,7 @@ namespace Project
|
||||
public void SetResultMessage(eResult code, eECode err, eNextStep systempause, params object[] args)
|
||||
{
|
||||
|
||||
var rltMsg = UTIL.GetResultCodeMessage(code);
|
||||
var rltMsg = PUB.GetResultCodeMessage(code);
|
||||
var codeMSg = $"[E{(int)err}] ";// + Util.GetResultCodeMessage(code);
|
||||
if (err == eECode.MESSAGE_ERROR)
|
||||
{
|
||||
@@ -187,7 +188,7 @@ namespace Project
|
||||
|
||||
|
||||
|
||||
var erMsg = UTIL.GetErrorMessage(err, args);
|
||||
var erMsg = PUB.GetErrorMessage(err, args);
|
||||
var msg = codeMSg + erMsg;
|
||||
|
||||
this.ResultCode = code;
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Security.Cryptography;
|
||||
using AR;
|
||||
using System.IO.Ports;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project.Device
|
||||
{
|
||||
@@ -21,6 +22,20 @@ namespace Project.Device
|
||||
public DateTime LastStatusSendTime = DateTime.Now;
|
||||
private EEProtocol proto;
|
||||
|
||||
public class MessageArgs : EventArgs
|
||||
{
|
||||
public bool IsError { get; set; }
|
||||
public string Message { get; set; }
|
||||
public MessageArgs(bool iserr,string m)
|
||||
{
|
||||
this.IsError = iserr;
|
||||
this.Message = m;
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<MessageArgs> MessageReceived;
|
||||
public event EventHandler<EEProtocol.DataEventArgs> ProtocReceived;
|
||||
|
||||
public Xbee()
|
||||
{
|
||||
this.DataReceived += Xbee_DataReceived;
|
||||
@@ -35,7 +50,7 @@ namespace Project.Device
|
||||
proto.OnMessage -= Proto_OnMessage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 지그비장치에 데이터를 전송합니다
|
||||
/// </summary>
|
||||
@@ -78,100 +93,15 @@ namespace Project.Device
|
||||
var id = e.ReceivedPacket.ID.ToString("X2");
|
||||
PUB.logxbee.Add("RX", $"{hexstrRaw}\nID:{id},CMD:{cmd},DATA:{hexstr}");
|
||||
|
||||
//TODO : 기능 처리필요 (XBee 메세지 데이터처리)
|
||||
//PUB.CheckManualChargeMode() : 수동충전확인
|
||||
//VAR.BOOL[eVarBool.FLAG_AUTORUN] : 자동실행
|
||||
//PUB.Speak("현재 위치는 QA 입니다.") : 음성출력
|
||||
ProtocReceived?.Invoke(this, e);
|
||||
|
||||
//ACS 수신 데이터 처리(타 장비는 확인하지 않는다)
|
||||
if (e.ReceivedPacket.ID == 0)
|
||||
{
|
||||
var data = e.ReceivedPacket.Data;
|
||||
switch (e.ReceivedPacket.Command)
|
||||
{
|
||||
case 1: //Request PATH
|
||||
var pathID = data[0];
|
||||
var pathPage = data[1];
|
||||
|
||||
//TODO : 요청받은 맵 데이터를 전송해야한다
|
||||
|
||||
|
||||
break;
|
||||
case 100: //move to tag
|
||||
var TargetTag = System.Text.Encoding.Default.GetString(data, 0, 6);
|
||||
|
||||
//1.현재위치에서 경로계산 하여 경로저장
|
||||
//2.현재위치를 모를경우 이전 이동 기록을 통해 위치를 추정한다
|
||||
//3.대상태그에 맞는 전/후진 방향을 결정하여 이동을 수행한다
|
||||
|
||||
break;
|
||||
case 101: //stop
|
||||
PUB.AGV.AGVMoveStop("xbee");
|
||||
break;
|
||||
case 102: //Error Reset
|
||||
PUB.AGV.AGVErrorReset();
|
||||
break;
|
||||
case 103: //charing command (0:off, 1:on)
|
||||
var CharingCmd = data[0];
|
||||
|
||||
//0.자동모드가 아니라면 실행하지 않는다
|
||||
//1.충전프로세스를 시작한다
|
||||
//2.1분간 충전진행 신호가 없다면 반대편으로 1TAG이동하여 다시 시도한다
|
||||
//3.3회 시도 실패시 오류 데이터를 HOST에 전송한다
|
||||
|
||||
break;
|
||||
case 104: //Manual Move (Direction, speed, runtime)
|
||||
var Direction = data[0]; //0=back, 1=forward, 2=left, 3=right
|
||||
var Speed = data[1]; //0=slow, 1=normal, 2=fast
|
||||
var Runtime = data[2]; // running seconds
|
||||
|
||||
arDev.Narumi.ManulOpt opt = arDev.Narumi.ManulOpt.BS;
|
||||
arDev.Narumi.Speed spd = arDev.Narumi.Speed.Low;
|
||||
if (Speed == 1) spd = arDev.Narumi.Speed.Mid;
|
||||
else if (Speed == 2) spd = arDev.Narumi.Speed.High;
|
||||
|
||||
//0.자동모드가 아니라면 실행하지 않는다
|
||||
//1.입력된 파라미터로 AGV를 이동한다
|
||||
if (Direction == 0) opt = arDev.Narumi.ManulOpt.BS;
|
||||
else if (Direction == 1) opt = arDev.Narumi.ManulOpt.FS;
|
||||
else if (Direction == 2) opt = arDev.Narumi.ManulOpt.LT;
|
||||
else if (Direction == 3) opt = arDev.Narumi.ManulOpt.RT;
|
||||
|
||||
PUB.AGV.AGVMoveManual(opt, spd, arDev.Narumi.Sensor.PBSOn);
|
||||
break;
|
||||
case 105: //Set MarkStop
|
||||
var MarkStop = data[0]; //0=off, 1=on
|
||||
|
||||
//마크센서에서 멈추게 한다
|
||||
PUB.AGV.AGVMoveStop("Xbee", arDev.Narumi.eStopOpt.MarkStop);
|
||||
break;
|
||||
case 106: //Lift Control
|
||||
var LiftCommand = data[0]; //0=stop, 1=up, 2=down
|
||||
arDev.Narumi.LiftCommand LCmd = arDev.Narumi.LiftCommand.STP;
|
||||
if (LiftCommand == 1) LCmd = arDev.Narumi.LiftCommand.UP;
|
||||
else if (LiftCommand == 2) LCmd = arDev.Narumi.LiftCommand.DN;
|
||||
|
||||
//리프트제어
|
||||
PUB.AGV.LiftControl(LCmd);
|
||||
break;
|
||||
|
||||
case 107: //clear path
|
||||
//TODO: 현재 설정된 경로삭제기능 필요
|
||||
break;
|
||||
case 108: //send path
|
||||
//TODO : 경로정보를 수신받고 페이지가 1을 초과하면 나머지 페이지정보도 요청할 수 있어야 한다
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
private void Proto_OnMessage(object sender, EEProtocol.MessageEventArgs e)
|
||||
{
|
||||
if (e.IsError) PUB.log.AddE(e.Message);
|
||||
else PUB.log.Add(e.Message);
|
||||
MessageReceived?.Invoke(this, new MessageArgs(e.IsError, e.Message));
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +137,7 @@ namespace Project.Device
|
||||
Send(packet);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using AR;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Project.Dialog
|
||||
@@ -22,12 +23,12 @@ namespace Project.Dialog
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.RunProcess(@"c:\windows\system32\shutdown.exe", "-r -t 5");
|
||||
UTIL.RunProcess(@"c:\windows\system32\shutdown.exe", "-r -t 5");
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.RunProcess(@"c:\windows\system32\shutdown.exe", "-s -t 5");
|
||||
UTIL.RunProcess(@"c:\windows\system32\shutdown.exe", "-s -t 5");
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
@@ -65,7 +66,7 @@ namespace Project.Dialog
|
||||
private void arLabel9_Click(object sender, EventArgs e)
|
||||
{
|
||||
shutdown = true;
|
||||
Util.SystemShutdown(10);
|
||||
PUB.SystemShutdown(10);
|
||||
this.Close();
|
||||
|
||||
}
|
||||
@@ -73,7 +74,7 @@ namespace Project.Dialog
|
||||
private void arLabel10_Click(object sender, EventArgs e)
|
||||
{
|
||||
shutdown = true;
|
||||
Util.SystemReboot(10);
|
||||
PUB.SystemReboot(10);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
@@ -93,7 +94,7 @@ namespace Project.Dialog
|
||||
if (prc.ProcessName.StartsWith("svchost")) continue;
|
||||
sb.Append(" " + prc.ProcessName);
|
||||
}
|
||||
Util.MsgI(sb.ToString(),true);
|
||||
UTIL.MsgI(sb.ToString(),true);
|
||||
}
|
||||
|
||||
private void fSystem_Load(object sender, EventArgs e)
|
||||
@@ -104,14 +105,14 @@ namespace Project.Dialog
|
||||
|
||||
private void arLabel3_Click(object sender, EventArgs e)
|
||||
{
|
||||
var file = System.IO.Path.Combine( Util.CurrentPath, "Emulator.exe");
|
||||
var file = System.IO.Path.Combine(UTIL.CurrentPath, "Emulator.exe");
|
||||
if(System.IO.File.Exists(file)==false)
|
||||
{
|
||||
Util.MsgE("에물레이터 실행 파일이 없습니다", true);
|
||||
UTIL.MsgE("에물레이터 실행 파일이 없습니다", true);
|
||||
return;
|
||||
}
|
||||
|
||||
Util.RunProcess(file);
|
||||
UTIL.RunProcess(file);
|
||||
}
|
||||
|
||||
private void arLabel5_Click(object sender, EventArgs e)
|
||||
@@ -122,7 +123,7 @@ namespace Project.Dialog
|
||||
var file_exe = System.IO.Path.Combine(path.FullName, "amkor.exe");
|
||||
if(System.IO.File.Exists(file_exe)==false)
|
||||
{
|
||||
Util.MsgE("실행파일 amkor.exe 가 없습니다.");
|
||||
UTIL.MsgE("실행파일 amkor.exe 가 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,12 +147,12 @@ namespace Project.Dialog
|
||||
// 임시 폴더 삭제
|
||||
Directory.Delete(tempDir, true);
|
||||
|
||||
Util.MsgI("다음 패치 파일이 생성됨\n" + newfilename);
|
||||
UTIL.MsgI("다음 패치 파일이 생성됨\n" + newfilename);
|
||||
}
|
||||
|
||||
private void arLabel7_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.SystemReboot(5,true);
|
||||
PUB.SystemReboot(5,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using AR;
|
||||
|
||||
namespace Project.Dialog
|
||||
{
|
||||
@@ -195,7 +196,7 @@ namespace Project.Dialog
|
||||
if(System.IO.File.Exists(file))
|
||||
{
|
||||
//이 파일을 _patch 폴더에 압축해제한다.
|
||||
var dir_path = new System.IO.DirectoryInfo(System.IO.Path.Combine(Util.CurrentPath,"_patch"));
|
||||
var dir_path = new System.IO.DirectoryInfo(System.IO.Path.Combine(UTIL.CurrentPath ,"_patch"));
|
||||
if (dir_path.Exists == true)
|
||||
{
|
||||
try
|
||||
@@ -203,7 +204,7 @@ namespace Project.Dialog
|
||||
dir_path.Delete(true);
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Util.MsgE(ex.Message);
|
||||
UTIL.MsgE(ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -224,7 +225,7 @@ namespace Project.Dialog
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.MsgE("패치파일이 없습니다\n" + file);
|
||||
UTIL.MsgE("패치파일이 없습니다\n" + file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Project.Dialog
|
||||
//if (dev == null)
|
||||
//{
|
||||
// trackBar1.Enabled = false;
|
||||
// Util.MsgE("사운드 장치가 없습니다", true);
|
||||
// UTIL.MsgE("사운드 장치가 없습니다", true);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AR;
|
||||
|
||||
namespace Project.Manager
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace Project.Manager
|
||||
dt = new DataSet1.ResultDataDataTable();
|
||||
|
||||
this.dataPath = dataPath_;
|
||||
if (dataPath_.Length == 0) dataPath = new string[]{ System.IO.Path.Combine(Util.CurrentPath, "Data")};
|
||||
if (dataPath_.Length == 0) dataPath = new string[]{ System.IO.Path.Combine(UTIL.CurrentPath, "Data")};
|
||||
|
||||
//최대버퍼갯수(이 갯수를 넘어가면 실제 파일에 기록한다)
|
||||
MaxBufferCount = _MaxBufferCount;
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Project
|
||||
public static bool Automodeonreboot = false;
|
||||
public static bool AutRebootAlreay = false;
|
||||
public static bool DriveSpeed = false;
|
||||
public static AGVControl.MapControl mapctl;
|
||||
|
||||
#region "Hardware"
|
||||
|
||||
@@ -94,7 +95,7 @@ namespace Project
|
||||
voice.SpeakAsyncCancelAll();
|
||||
if (voice.State == SynthesizerState.Ready)
|
||||
voice.SpeakAsync(m);
|
||||
if (addlog) PUB.log.Add("SPEAK",m);
|
||||
if (addlog) PUB.log.Add("SPEAK", m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,7 +112,7 @@ namespace Project
|
||||
VAR.BOOL[eVarBool.WAIT_COVER_DOWN] == false &&
|
||||
VAR.BOOL[eVarBool.WAIT_COVER_UP] == false)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
@@ -188,13 +189,13 @@ namespace Project
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
||||
|
||||
Result = new CResult();
|
||||
|
||||
//state machine
|
||||
sm = new StateMachine.StateMachine();
|
||||
|
||||
path = new System.IO.DirectoryInfo(Util.CurrentPath);
|
||||
path = new System.IO.DirectoryInfo(UTIL.CurrentPath);
|
||||
|
||||
|
||||
|
||||
@@ -234,7 +235,7 @@ namespace Project
|
||||
}
|
||||
voice.SetOutputToDefaultAudioDevice();
|
||||
|
||||
var file_version = System.IO.Path.Combine(Util.CurrentPath, "version.txt");
|
||||
var file_version = System.IO.Path.Combine(UTIL.CurrentPath, "version.txt");
|
||||
if (System.IO.File.Exists(file_version))
|
||||
{
|
||||
PUB.PatchVersion = System.IO.File.ReadAllText(file_version, System.Text.Encoding.UTF8);
|
||||
@@ -242,16 +243,16 @@ namespace Project
|
||||
else PUB.PatchVersion = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Boolean CheckManualChargeMode(bool Prompt = true )
|
||||
|
||||
public static Boolean CheckManualChargeMode(bool Prompt = true)
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONM] == true)
|
||||
{
|
||||
string msg = "수동 충전 상태이므로 진행 할 수 없습니다";
|
||||
PUB.Speak(msg);
|
||||
if(Prompt)
|
||||
Util.MsgE(msg);
|
||||
if (Prompt)
|
||||
UTIL.MsgE(msg);
|
||||
return false;
|
||||
}
|
||||
else return true;
|
||||
@@ -334,13 +335,13 @@ namespace Project
|
||||
var step = PUB.sm.Step.ToString();
|
||||
var rtep = PUB.sm.RunStep.ToString();
|
||||
var mcid = PUB.setting.MCID;
|
||||
var path = System.IO.Path.Combine(Util.CurrentPath, "Status");
|
||||
var path = System.IO.Path.Combine(UTIL.CurrentPath, "Status");
|
||||
var file = System.IO.Path.Combine(path, $"{DateTime.Now.ToString("HHmmssfff")}_{step}_{rtep}.sql");
|
||||
var wdate = DateTime.Now;
|
||||
try
|
||||
{
|
||||
var sql = "insert into AGV_History(mcid,step,runstep,remark,ip,wdate) values('{0}','{1}','{2}','{3}','{4}','{5}')";
|
||||
sql = string.Format(sql, mcid, step, rtep, remark,IP,wdate.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
sql = string.Format(sql, mcid, step, rtep, remark, IP, wdate.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
System.IO.File.WriteAllText(file, sql, System.Text.Encoding.Default);
|
||||
|
||||
//만들어진지 3분이 지난 파일은 삭제한다.
|
||||
@@ -354,7 +355,27 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetResultCodeMessage(eResult err)
|
||||
{
|
||||
return err.ToString().ToUpper();
|
||||
}
|
||||
|
||||
|
||||
public static string GetErrorMessage(eECode err, params object[] values)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case eECode.NOTALLOWUP:
|
||||
return "상차 허용 위치가 아닙니다";
|
||||
case eECode.AGVCONN:
|
||||
return Lang.AGV연결실패;
|
||||
case eECode.PLCCONN:
|
||||
return Lang.PLC통신실패;
|
||||
|
||||
default:
|
||||
return err.ToString();
|
||||
}
|
||||
}
|
||||
public static string IP { get; set; }
|
||||
public static string MAC { get; set; }
|
||||
|
||||
@@ -448,23 +469,100 @@ namespace Project
|
||||
}
|
||||
});
|
||||
}
|
||||
public static string SelectSerialPort()
|
||||
{
|
||||
var f = new System.Windows.Forms.Form();
|
||||
f.WindowState = System.Windows.Forms.FormWindowState.Normal;
|
||||
f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
f.Size = new System.Drawing.Size(800, 400);
|
||||
f.MaximizeBox = false;
|
||||
f.MinimizeBox = false;
|
||||
f.Text = "Select Port";
|
||||
f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
var lst = new System.Windows.Forms.ListBox();
|
||||
lst.Font = new System.Drawing.Font("Consolas", 15, System.Drawing.FontStyle.Bold);
|
||||
lst.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
lst.DoubleClick += (s1, e1) =>
|
||||
{
|
||||
if (lst.SelectedItem != null) f.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
};
|
||||
using (var searcher = new ManagementObjectSearcher("SELECT * FROM WIN32_SerialPort"))
|
||||
{
|
||||
var portnames = System.IO.Ports.SerialPort.GetPortNames().OrderBy(t => t);
|
||||
var ports = searcher.Get().Cast<ManagementBaseObject>().ToList();
|
||||
foreach (var port in portnames)
|
||||
{
|
||||
var desc = "";
|
||||
var portInfo = ports.Where(t => t["DeviceId"].ToString() == port).FirstOrDefault();
|
||||
if (portInfo != null) desc = portInfo["Caption"].ToString();
|
||||
lst.Items.Add(string.Format("{0} - {1}", port, desc));
|
||||
}
|
||||
}
|
||||
f.Controls.Add(lst);
|
||||
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
var name = lst.SelectedItem.ToString().Split('-');
|
||||
return name[0].Trim();
|
||||
}
|
||||
else return string.Empty;
|
||||
}
|
||||
|
||||
public static void SystemReboot(UInt16 timeout, bool setautomode = false)
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo();
|
||||
si.FileName = @"c:\windows\system32\shutdown.exe";
|
||||
si.Arguments = "-r -t " + timeout.ToString();
|
||||
si.UseShellExecute = false;
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
prc.StartInfo = si;
|
||||
|
||||
PUB.AGV.AGVMoveStop("user reboot");
|
||||
|
||||
if (setautomode)
|
||||
{
|
||||
PUB.Automodeonreboot = true;
|
||||
PUB.setting.SetAutoModeOn = true;
|
||||
PUB.setting.AUtoRebootLastTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
PUB.setting.Save();
|
||||
}
|
||||
|
||||
|
||||
prc.Start();
|
||||
|
||||
}
|
||||
public static void SystemShutdown(UInt16 timeout)
|
||||
{
|
||||
//System.Text.StringBuilder sb = new StringBuilder();
|
||||
//sb.AppendLine("@echo off");
|
||||
//sb.AppendLine("echo System OFF After " + timeout.ToString() + "Seconds");
|
||||
//sb.AppendLine("shutdown -s -t " + timeout.ToString());
|
||||
//string bfile = AppDomain.CurrentDomain.BaseDirectory + "Shutdown.bat";
|
||||
//System.IO.File.WriteAllText(bfile, string.Format(sb.ToString(), AppDomain.CurrentDomain.BaseDirectory), System.Text.Encoding.Default);
|
||||
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo();
|
||||
si.FileName = @"c:\windows\system32\shutdown.exe";
|
||||
si.Arguments = "-s -t " + timeout.ToString();
|
||||
si.UseShellExecute = false;
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
}
|
||||
|
||||
public static void ChangeUIPopup(System.Windows.Forms.NumericUpDown valueCtl)
|
||||
{
|
||||
var value = valueCtl.Value.ToString();
|
||||
var f = AR.UTIL.InputBox("input", value);// new Dialog.fInput(value);
|
||||
var f = UTIL.InputBox("input", value);// new Dialog.fInput(value);
|
||||
if (f.Item1)
|
||||
{
|
||||
var val = decimal.Parse(f.Item2);
|
||||
if (val < valueCtl.Minimum)
|
||||
{
|
||||
Util.MsgE(string.Format("최소 입력값은 {0} 입니다.", valueCtl.Minimum));
|
||||
UTIL.MsgE(string.Format("최소 입력값은 {0} 입니다.", valueCtl.Minimum));
|
||||
val = valueCtl.Minimum;
|
||||
}
|
||||
if (val > valueCtl.Maximum)
|
||||
{
|
||||
Util.MsgE(string.Format("최대 입력값은 {0} 입니다.", valueCtl.Maximum));
|
||||
UTIL.MsgE(string.Format("최대 입력값은 {0} 입니다.", valueCtl.Maximum));
|
||||
val = valueCtl.Maximum;
|
||||
}
|
||||
valueCtl.Value = val;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Project
|
||||
string emsg = "Fatal Error(UHE)\n\n" + e.ExceptionObject.ToString();
|
||||
PUB.log.AddE(emsg);
|
||||
PUB.log.Flush();
|
||||
Util.SaveBugReport(emsg);
|
||||
AR.UTIL.SaveBugReport(emsg);
|
||||
var f = new fErrorException(emsg);
|
||||
f.ShowDialog();
|
||||
Application.ExitThread();
|
||||
@@ -50,7 +50,7 @@ namespace Project
|
||||
string emsg = "Fatal Error(ATE)\n\n" + e.Exception.ToString();
|
||||
PUB.log.AddE(emsg);
|
||||
PUB.log.Flush();
|
||||
Util.SaveBugReport(emsg);
|
||||
AR.UTIL.SaveBugReport(emsg);
|
||||
var f = new fErrorException(emsg);
|
||||
f.ShowDialog();
|
||||
Application.ExitThread();
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Management;
|
||||
using COMM;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public static partial class UTIL
|
||||
{
|
||||
public static string GetResultCodeMessage(eResult err)
|
||||
{
|
||||
return err.ToString().ToUpper();
|
||||
}
|
||||
|
||||
|
||||
public static string GetErrorMessage(eECode err, params object[] values)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case eECode.NOTALLOWUP:
|
||||
return "상차 허용 위치가 아닙니다";
|
||||
case eECode.AGVCONN:
|
||||
return Lang.AGV연결실패;
|
||||
case eECode.PLCCONN:
|
||||
return Lang.PLC통신실패;
|
||||
|
||||
default:
|
||||
return err.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace Project
|
||||
}
|
||||
}
|
||||
|
||||
ePosition ParsePosition(int tag, out string dirBW)
|
||||
ePosition ParsePosition(uint tag, out string dirBW)
|
||||
{
|
||||
var tagstr = tag.ToString();
|
||||
var tagno = tagstr.Substring(0, tagstr.Length - 1);
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Project
|
||||
if (System.Diagnostics.Debugger.IsAttached == false)
|
||||
{
|
||||
PUB.Speak(Lang.자동재부팅을실행합니다);
|
||||
Util.SystemReboot(5, true);
|
||||
PUB.SystemReboot(5, true);
|
||||
}
|
||||
else PUB.setting.SetAutoModeOn = true;
|
||||
|
||||
|
||||
115
Cs_HMI/Project/StateMachine/_Xbee.cs
Normal file
115
Cs_HMI/Project/StateMachine/_Xbee.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AR;
|
||||
using arDev;
|
||||
using COMM;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public partial class fMain
|
||||
{
|
||||
|
||||
private void XBE_ProtocReceived(object sender, ENIG.EEProtocol.DataEventArgs e)
|
||||
{
|
||||
//TODO : 기능 처리필요 (XBee 메세지 데이터처리)
|
||||
//PUB.CheckManualChargeMode() : 수동충전확인
|
||||
//VAR.BOOL[eVarBool.FLAG_AUTORUN] : 자동실행
|
||||
//PUB.Speak("현재 위치는 QA 입니다.") : 음성출력
|
||||
|
||||
//ACS 수신 데이터 처리(타 장비는 확인하지 않는다)
|
||||
if (e.ReceivedPacket.ID == 0)
|
||||
{
|
||||
var data = e.ReceivedPacket.Data;
|
||||
var dataStr = System.Text.Encoding.Default.GetString(data);
|
||||
var cmd = (ENIGProtocol.AGVCommands)e.ReceivedPacket.Command;
|
||||
switch (cmd)
|
||||
{
|
||||
|
||||
case ENIGProtocol.AGVCommands.SetCurrent: //Set Current Position
|
||||
|
||||
if (uint.TryParse(dataStr, out uint tagno))
|
||||
{
|
||||
if (PUB.mapctl.SetCurrentPosition(tagno) == true)
|
||||
{
|
||||
PUB.log.AddI($"Set Position:{tagno}");
|
||||
}
|
||||
else PUB.log.AddE($"Position Error:{tagno}");
|
||||
}
|
||||
else PUB.log.AddE($"Position Param Error:{dataStr}");
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.Goto: //move to tag
|
||||
if (uint.TryParse(dataStr, out uint tagno2))
|
||||
{
|
||||
var currPos = PUB.mapctl.agv.CurrentRFID;///.AGVMoveToRFID(;
|
||||
if (currPos == 0) currPos = 10;
|
||||
var pathRlt = PUB.mapctl.CalculatePath(currPos,tagno2);
|
||||
if (pathRlt.Success == true)
|
||||
{
|
||||
PUB.log.AddI($"New Target:{tagno2}");
|
||||
}
|
||||
else PUB.log.AddE($"Path Error {pathRlt.Message} : {tagno2}");
|
||||
}
|
||||
else PUB.log.AddE($"Path Param Error :{dataStr}");
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.Stop: //stop
|
||||
PUB.AGV.AGVMoveStop("xbee");
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.Reset: //Error Reset
|
||||
PUB.AGV.AGVErrorReset();
|
||||
break;
|
||||
|
||||
case ENIGProtocol.AGVCommands.Manual: //Manual Move (Direction, speed, runtime)
|
||||
var Direction = data[0]; //0=back, 1=forward, 2=left, 3=right
|
||||
var Speed = data[1]; //0=slow, 1=normal, 2=fast
|
||||
var Runtime = data[2]; // running seconds
|
||||
|
||||
arDev.Narumi.ManulOpt opt = arDev.Narumi.ManulOpt.BS;
|
||||
arDev.Narumi.Speed spd = arDev.Narumi.Speed.Low;
|
||||
if (Speed == 1) spd = arDev.Narumi.Speed.Mid;
|
||||
else if (Speed == 2) spd = arDev.Narumi.Speed.High;
|
||||
|
||||
//0.자동모드가 아니라면 실행하지 않는다
|
||||
//1.입력된 파라미터로 AGV를 이동한다
|
||||
if (Direction == 0) opt = arDev.Narumi.ManulOpt.BS;
|
||||
else if (Direction == 1) opt = arDev.Narumi.ManulOpt.FS;
|
||||
else if (Direction == 2) opt = arDev.Narumi.ManulOpt.LT;
|
||||
else if (Direction == 3) opt = arDev.Narumi.ManulOpt.RT;
|
||||
|
||||
PUB.AGV.AGVMoveManual(opt, spd, arDev.Narumi.Sensor.PBSOn);
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.MarkStop: //Set MarkStop
|
||||
var MarkStop = data[0]; //0=off, 1=on
|
||||
|
||||
//마크센서에서 멈추게 한다
|
||||
PUB.AGV.AGVMoveStop("Xbee", arDev.Narumi.eStopOpt.MarkStop);
|
||||
break;
|
||||
case ENIGProtocol.AGVCommands.LiftControl: //Lift Control
|
||||
var LiftCommand = data[0]; //0=stop, 1=up, 2=down
|
||||
arDev.Narumi.LiftCommand LCmd = arDev.Narumi.LiftCommand.STP;
|
||||
if (LiftCommand == 1) LCmd = arDev.Narumi.LiftCommand.UP;
|
||||
else if (LiftCommand == 2) LCmd = arDev.Narumi.LiftCommand.DN;
|
||||
|
||||
//리프트제어
|
||||
PUB.AGV.LiftControl(LCmd);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void XBE_MessageReceived(object sender, Device.Xbee.MessageArgs e)
|
||||
{
|
||||
if (e.IsError) PUB.log.AddE(e.Message);
|
||||
else PUB.log.Add(e.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,510 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public static class Util
|
||||
{
|
||||
#region "MessageBox"
|
||||
public static void MsgI(string m, Boolean legacy = false)
|
||||
{
|
||||
if (legacy)
|
||||
{
|
||||
MessageBox.Show(m, "확인", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
var f = new fMessageWindow("알림\n" + m);
|
||||
f.SetWindowColor(fMessageWindow.EWinColor.Information);
|
||||
f.btNo.Visible = false;
|
||||
f.btYes.Text = "확인";
|
||||
f.EnableUserClose = true;
|
||||
f.DialogMode = true;
|
||||
f.ShowDialog();
|
||||
}
|
||||
}
|
||||
public static void MsgE(string m, Boolean legacy = false)
|
||||
{
|
||||
if (legacy)
|
||||
{
|
||||
MessageBox.Show(m, "오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
var f = new fMessageWindow("오류 알림\n" + m);
|
||||
f.SetWindowColor(fMessageWindow.EWinColor.Error);
|
||||
f.btNo.Visible = false;
|
||||
f.btYes.Text = "확인";
|
||||
f.EnableUserClose = true;
|
||||
f.DialogMode = true;
|
||||
f.ShowDialog();
|
||||
}
|
||||
}
|
||||
public static DialogResult MsgQ(string m, Boolean legacy = false, string btOK = "확인", string btCancel = "아니오")
|
||||
{
|
||||
if (legacy)
|
||||
{
|
||||
DialogResult dlg = MessageBox.Show(m, "확인", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
return dlg;
|
||||
}
|
||||
else
|
||||
{
|
||||
var f = new fMessageWindow("선택 알림\n" + m);
|
||||
f.SetWindowColor(fMessageWindow.EWinColor.Attention);
|
||||
f.EnableUserClose = true;
|
||||
f.DialogMode = true;
|
||||
f.btNo.Text = btCancel;
|
||||
f.btYes.Text = btOK;
|
||||
var dlg = f.ShowDialog();
|
||||
return dlg;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static string SelectSerialPort()
|
||||
{
|
||||
var f = new System.Windows.Forms.Form();
|
||||
f.WindowState = System.Windows.Forms.FormWindowState.Normal;
|
||||
f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
f.Size = new System.Drawing.Size(800, 400);
|
||||
f.MaximizeBox = false;
|
||||
f.MinimizeBox = false;
|
||||
f.Text = "Select Port";
|
||||
f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
var lst = new System.Windows.Forms.ListBox();
|
||||
lst.Font = new System.Drawing.Font("Consolas", 15, System.Drawing.FontStyle.Bold);
|
||||
lst.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
lst.DoubleClick += (s1, e1) =>
|
||||
{
|
||||
if (lst.SelectedItem != null) f.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
};
|
||||
using (var searcher = new ManagementObjectSearcher("SELECT * FROM WIN32_SerialPort"))
|
||||
{
|
||||
var portnames = System.IO.Ports.SerialPort.GetPortNames().OrderBy(t => t);
|
||||
var ports = searcher.Get().Cast<ManagementBaseObject>().ToList();
|
||||
foreach (var port in portnames)
|
||||
{
|
||||
var desc = "";
|
||||
var portInfo = ports.Where(t => t["DeviceId"].ToString() == port).FirstOrDefault();
|
||||
if (portInfo != null) desc = portInfo["Caption"].ToString();
|
||||
lst.Items.Add(string.Format("{0} - {1}", port, desc));
|
||||
}
|
||||
}
|
||||
f.Controls.Add(lst);
|
||||
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
var name = lst.SelectedItem.ToString().Split('-');
|
||||
return name[0].Trim();
|
||||
}
|
||||
else return string.Empty;
|
||||
}
|
||||
|
||||
public static void ScreenCaptrue(int _BitmapWidth, int _BitmapHeight, System.Drawing.Point ptSouce)
|
||||
{
|
||||
try
|
||||
{
|
||||
Bitmap bitmap = new Bitmap(_BitmapWidth, _BitmapHeight);
|
||||
Graphics _graphic = Graphics.FromImage(bitmap);
|
||||
|
||||
_graphic.CopyFromScreen(ptSouce, new System.Drawing.Point(0, 0), new System.Drawing.Size(_BitmapWidth, _BitmapHeight));
|
||||
|
||||
string savefile = System.IO.Path.Combine(Util.CurrentPath, "ScreenShot", DateTime.Now.ToString("yyyyMMddHHmmss") + ".png");
|
||||
System.IO.FileInfo grpath = new FileInfo(savefile);
|
||||
if (!grpath.Directory.Exists) grpath.Directory.Create();
|
||||
|
||||
bitmap.Save(grpath.FullName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
Util.MsgI("화면 캡쳐 성공\n" +
|
||||
"위치:" + grpath.Directory.FullName + "\n" +
|
||||
"파일명: " + grpath.Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Util.MsgE("화면 캡쳐 실패\n" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SystemReboot(UInt16 timeout, bool setautomode = false)
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo();
|
||||
si.FileName = @"c:\windows\system32\shutdown.exe";
|
||||
si.Arguments = "-r -t " + timeout.ToString();
|
||||
si.UseShellExecute = false;
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
prc.StartInfo = si;
|
||||
|
||||
PUB.AGV.AGVMoveStop("user reboot");
|
||||
|
||||
if (setautomode)
|
||||
{
|
||||
PUB.Automodeonreboot = true;
|
||||
PUB.setting.SetAutoModeOn = true;
|
||||
PUB.setting.AUtoRebootLastTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
PUB.setting.Save();
|
||||
}
|
||||
|
||||
|
||||
prc.Start();
|
||||
|
||||
}
|
||||
public static void SystemShutdown(UInt16 timeout)
|
||||
{
|
||||
//System.Text.StringBuilder sb = new StringBuilder();
|
||||
//sb.AppendLine("@echo off");
|
||||
//sb.AppendLine("echo System OFF After " + timeout.ToString() + "Seconds");
|
||||
//sb.AppendLine("shutdown -s -t " + timeout.ToString());
|
||||
//string bfile = AppDomain.CurrentDomain.BaseDirectory + "Shutdown.bat";
|
||||
//System.IO.File.WriteAllText(bfile, string.Format(sb.ToString(), AppDomain.CurrentDomain.BaseDirectory), System.Text.Encoding.Default);
|
||||
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo();
|
||||
si.FileName = @"c:\windows\system32\shutdown.exe";
|
||||
si.Arguments = "-s -t " + timeout.ToString();
|
||||
si.UseShellExecute = false;
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
}
|
||||
public static void SaveBugReport(string content, string subdirName = "BugReport")
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = CurrentPath + subdirName;
|
||||
if (!System.IO.Directory.Exists(path)) System.IO.Directory.CreateDirectory(path);
|
||||
var file = path + "\\" + DateTime.Now.ToString("yyyyMMdd_HHmmss_fff") + ".txt";
|
||||
System.IO.File.WriteAllText(file, content, System.Text.Encoding.UTF8);
|
||||
}
|
||||
catch
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
}
|
||||
|
||||
public static void CopyData(System.Data.DataRow drSrc, System.Data.DataRow drDes)
|
||||
{
|
||||
if (drDes == null || drSrc == null) return;
|
||||
foreach (System.Data.DataColumn col in drSrc.Table.Columns)
|
||||
{
|
||||
if (col.ColumnName.ToUpper() == "IDX") continue;
|
||||
drDes[col.ColumnName] = drSrc[col.ColumnName];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재실행중인폴더를 반환합니다.
|
||||
/// </summary>
|
||||
public static string CurrentPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppDomain.CurrentDomain.BaseDirectory;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 콤마와 줄바꿈등을 제거합니다.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string ToCSVString(string src)
|
||||
{
|
||||
string retval = src.Replace("\r", "").Replace("\n", "").Replace(",", "");
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static Boolean RunProcess(string file, string arg = "")
|
||||
{
|
||||
var fi = new System.IO.FileInfo(file);
|
||||
if (!fi.Exists)
|
||||
{
|
||||
PUB.log.AddE("Run Error : " + file);
|
||||
return false;
|
||||
}
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo(file);
|
||||
si.Arguments = arg;
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
return true;
|
||||
}
|
||||
|
||||
#region "convert"
|
||||
public static string RectToStr(Rectangle rect)
|
||||
{
|
||||
return string.Format("{0};{1};{2};{3}", rect.X, rect.Y, rect.Width, rect.Height);
|
||||
}
|
||||
public static string RectToStr(RectangleF rect)
|
||||
{
|
||||
return string.Format("{0};{1};{2};{3}", rect.X, rect.Y, rect.Width, rect.Height);
|
||||
}
|
||||
public static string PointToStr(System.Drawing.Point pt)
|
||||
{
|
||||
return string.Format("{0};{1}", pt.X, pt.Y);
|
||||
}
|
||||
public static string PointToStr(PointF pt)
|
||||
{
|
||||
return string.Format("{0};{1}", pt.X, pt.Y);
|
||||
}
|
||||
public static Rectangle StrToRect(string str)
|
||||
{
|
||||
if (str.isEmpty() || str.Split(';').Length != 4) str = "0;0;0;0";
|
||||
var roibuf1 = str.Split(';');
|
||||
return new System.Drawing.Rectangle(
|
||||
int.Parse(roibuf1[0]),
|
||||
int.Parse(roibuf1[1]),
|
||||
int.Parse(roibuf1[2]),
|
||||
int.Parse(roibuf1[3]));
|
||||
}
|
||||
public static RectangleF StrToRectF(string str)
|
||||
{
|
||||
if (str.isEmpty() || str.Split(';').Length != 4) str = "0;0;0;0";
|
||||
var roibuf1 = str.Split(';');
|
||||
return new System.Drawing.RectangleF(
|
||||
float.Parse(roibuf1[0]),
|
||||
float.Parse(roibuf1[1]),
|
||||
float.Parse(roibuf1[2]),
|
||||
float.Parse(roibuf1[3]));
|
||||
}
|
||||
public static System.Drawing.Point StrToPoint(string str)
|
||||
{
|
||||
if (str.isEmpty() || str.Split(';').Length != 2) str = "0;0";
|
||||
var roibuf1 = str.Split(';');
|
||||
return new System.Drawing.Point(
|
||||
int.Parse(roibuf1[0]),
|
||||
int.Parse(roibuf1[1]));
|
||||
}
|
||||
public static PointF StrToPointF(string str)
|
||||
{
|
||||
if (str.isEmpty() || str.Split(';').Length != 2) str = "0;0";
|
||||
var roibuf1 = str.Split(';');
|
||||
return new System.Drawing.PointF(
|
||||
float.Parse(roibuf1[0]),
|
||||
float.Parse(roibuf1[1]));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "NIC"
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 nic카드가 현재 목록에 존재하는지 확인한다.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Boolean ExistNIC(string NICName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(NICName)) return false;
|
||||
foreach (string NetName in NICCardList())
|
||||
{
|
||||
if (NetName.ToLower() == NICName.ToLower())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ehternet Card 를 사용안함으로 설정합니다.(관리자권한필요)
|
||||
/// </summary>
|
||||
/// <param name="NicName"></param>
|
||||
public static Boolean NICDisable(string NICName)
|
||||
{
|
||||
//해당 nic 가 현재 목록에 존재하는지 확인한다.
|
||||
|
||||
string cmd = "interface set interface " + NICName + " disable";
|
||||
Process prc = new Process();
|
||||
ProcessStartInfo si = new ProcessStartInfo("netsh", cmd);
|
||||
si.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
|
||||
////목록에서 사라질때까지 기다린다.
|
||||
DateTime SD = DateTime.Now;
|
||||
Boolean timeout = false;
|
||||
while ((true))
|
||||
{
|
||||
|
||||
bool FindNetwork = false;
|
||||
foreach (string NetName in NICCardList())
|
||||
{
|
||||
if (NetName == NICName.ToLower())
|
||||
{
|
||||
FindNetwork = true;
|
||||
break; // TODO: might not be correct. Was : Exit For
|
||||
}
|
||||
}
|
||||
|
||||
if (!FindNetwork)
|
||||
break; // TODO: might not be correct. Was : Exit While
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
TimeSpan ts = DateTime.Now - SD;
|
||||
if (ts.TotalSeconds > 10)
|
||||
{
|
||||
timeout = true;
|
||||
break; // TODO: might not be correct. Was : Exit While
|
||||
}
|
||||
}
|
||||
return !timeout;
|
||||
}
|
||||
|
||||
public static List<String> NICCardList()
|
||||
{
|
||||
List<String> Retval = new List<string>();
|
||||
foreach (System.Net.NetworkInformation.NetworkInterface Net in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
|
||||
{
|
||||
if (Net.NetworkInterfaceType == System.Net.NetworkInformation.NetworkInterfaceType.Ethernet)
|
||||
{
|
||||
Retval.Add(Net.Name.ToUpper());
|
||||
}
|
||||
}
|
||||
return Retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이더넷카드를 사용함으로 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="NicName"></param>
|
||||
public static Boolean NICEnable(string NICName)
|
||||
{
|
||||
string cmd = "interface set interface " + NICName + " enable";
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo("netsh", cmd);
|
||||
si.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
|
||||
|
||||
////목록에생길떄까지 대기
|
||||
DateTime SD = DateTime.Now;
|
||||
while ((true))
|
||||
{
|
||||
|
||||
bool FindNetwork = false;
|
||||
foreach (string NetName in NICCardList())
|
||||
{
|
||||
if (NetName.ToLower() == NICName.ToLower())
|
||||
{
|
||||
FindNetwork = true;
|
||||
break; // TODO: might not be correct. Was : Exit For
|
||||
}
|
||||
}
|
||||
|
||||
if (FindNetwork)
|
||||
break; // TODO: might not be correct. Was : Exit While
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
TimeSpan ts = DateTime.Now - SD;
|
||||
if (ts.TotalSeconds > 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
////결이 완료될떄까지 기다린다.
|
||||
SD = DateTime.Now;
|
||||
while ((true))
|
||||
{
|
||||
|
||||
bool FindNetwork = false;
|
||||
foreach (System.Net.NetworkInformation.NetworkInterface Net in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
|
||||
{
|
||||
if (Net.NetworkInterfaceType != System.Net.NetworkInformation.NetworkInterfaceType.GigabitEthernet &&
|
||||
Net.NetworkInterfaceType != System.Net.NetworkInformation.NetworkInterfaceType.Ethernet) continue;
|
||||
if (Net.Name.ToLower() == NICName.ToLower())
|
||||
{
|
||||
//string data = Net.GetIPProperties().GatewayAddresses[0].ToString();
|
||||
|
||||
if (Net.OperationalStatus == System.Net.NetworkInformation.OperationalStatus.Up)
|
||||
{
|
||||
|
||||
FindNetwork = true;
|
||||
break; // TODO: might not be correct. Was : Exit For
|
||||
}
|
||||
}
|
||||
}
|
||||
if (FindNetwork)
|
||||
return true;
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
TimeSpan ts = DateTime.Now - SD;
|
||||
if (ts.TotalSeconds > 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void RunExplorer(string arg)
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo si = new ProcessStartInfo("explorer");
|
||||
si.Arguments = arg;
|
||||
System.Diagnostics.Process.Start(si);
|
||||
}
|
||||
|
||||
#region "watchdog"
|
||||
public static void WatchDog_Run()
|
||||
{
|
||||
System.IO.FileInfo fi = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "WatchCat.exe");
|
||||
if (!fi.Exists) return;
|
||||
var Exist = CheckExistProcess("watchcat");
|
||||
if (Exist) return;
|
||||
RunProcess(fi.FullName);
|
||||
}
|
||||
|
||||
public static Boolean CheckExistProcess(string ProcessName)
|
||||
{
|
||||
foreach (var prc in System.Diagnostics.Process.GetProcesses())
|
||||
{
|
||||
if (prc.ProcessName.StartsWith("svchost")) continue;
|
||||
if (prc.ProcessName.ToUpper() == ProcessName.ToUpper()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "web function"
|
||||
/// <summary>
|
||||
/// URL로부터 문자열을 수신합니다.
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="isError"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetStrfromurl(string url, out Boolean isError)
|
||||
{
|
||||
isError = false;
|
||||
string result = "";
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(url));
|
||||
request.Timeout = 60000;
|
||||
request.ReadWriteTimeout = 60000;
|
||||
|
||||
request.MaximumAutomaticRedirections = 4;
|
||||
request.MaximumResponseHeadersLength = 4;
|
||||
request.Credentials = CredentialCache.DefaultCredentials;
|
||||
var response = request.GetResponse() as HttpWebResponse;
|
||||
var txtReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||
result = txtReader.ReadToEnd();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
isError = true;
|
||||
result = ex.Message.ToString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
///*
|
||||
// * Created by SharpDevelop.
|
||||
// * User: amkor
|
||||
// * Date: 5/16/2018
|
||||
// * Time: 3:08 PM
|
||||
// *
|
||||
// * To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
// */
|
||||
//using System;
|
||||
|
||||
//namespace Project
|
||||
//{
|
||||
// public static class Util_DO
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// ADLink I/O Board input status
|
||||
// /// </summary>
|
||||
// /// <param name="pin"></param>
|
||||
// /// <returns></returns>
|
||||
// public static Boolean GetIOInput(eDIName pin)
|
||||
// {
|
||||
// var curValue = Pub.dio.INPUT(GetDINum(pin) - 1);
|
||||
// if (pin == eDIName.EMERGENCY ||
|
||||
// pin == eDIName.PCB_PUSHER_END ||
|
||||
// pin == eDIName.PCB_PUSHER_HOME ||
|
||||
// pin == eDIName.PCB_IN_MGZ ||
|
||||
// pin == eDIName.PCB_OVERLOAD ||
|
||||
// pin == eDIName.PCB_PUSHER_OVR)
|
||||
// {
|
||||
// return !curValue;
|
||||
// }
|
||||
// else return curValue;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// ADLink I/O Board Output Status
|
||||
// /// </summary>
|
||||
// /// <param name="pin"></param>
|
||||
// /// <returns></returns>
|
||||
// public static Boolean GetIOOutput(eDOName pin)
|
||||
// {
|
||||
// return Pub.dio.OUTPUT(GetDONum(pin) - 1);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// A/D Link Digital input Pin number
|
||||
// /// </summary>
|
||||
// /// <param name="pin"></param>
|
||||
// /// <returns></returns>
|
||||
// public static int GetDINum(eDIName pin)
|
||||
// {
|
||||
// return (int)pin + 1;
|
||||
// //return Pub.setting.DI[(byte)pin];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// adlink digital output in number
|
||||
// /// </summary>
|
||||
// /// <param name="pin"></param>
|
||||
// /// <returns></returns>
|
||||
// public static int GetDONum(eDOName pin)
|
||||
// {
|
||||
// return (int)pin + 1;
|
||||
// //return Pub.setting.DO[(byte)pin];
|
||||
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 도어각 닫혀있는 경우 TRUE,
|
||||
// /// </summary>
|
||||
// /// <returns></returns>
|
||||
// public static Boolean CheckDoorSafty()
|
||||
// {
|
||||
// var door1 = CheckDoorSafty_Front();
|
||||
// var door2 = CheckDoorSafty_Rear();
|
||||
// var door3 = CheckDoorSafty_Left();
|
||||
// var door4 = CheckDoorSafty_Right();
|
||||
// if (door1 && door2 && door3 && door4) return true;
|
||||
// else return false;
|
||||
// }
|
||||
// public static Boolean CheckDoorSafty_Front()
|
||||
// {
|
||||
// var door = GetIOInput(eDIName.DOOR_FRONT) || Pub.setting.DisableDoorFront;
|
||||
// return door;
|
||||
// }
|
||||
// public static Boolean CheckDoorSafty_Rear()
|
||||
// {
|
||||
// var door = GetIOInput(eDIName.DOOR_REAR) || Pub.setting.DisableDoorRear;
|
||||
// return door;
|
||||
// }
|
||||
// public static Boolean CheckDoorSafty_Left()
|
||||
// {
|
||||
// var door = GetIOInput(eDIName.DOOR_LEFT) || Pub.setting.DisableDoorLeft;
|
||||
// return door;
|
||||
// }
|
||||
// public static Boolean CheckDoorSafty_Right()
|
||||
// {
|
||||
// var door = GetIOInput(eDIName.DOOR_RIGHT) || Pub.setting.DisableDoorRight;
|
||||
// return door;
|
||||
// }
|
||||
|
||||
// public static Boolean checkMGZReady()
|
||||
// {
|
||||
// var ready1 = GetIOInput(eDIName.MGZ_CLAMP_RDY1);
|
||||
// var ready2 = GetIOInput(eDIName.MGZ_CLAMP_RDY2);
|
||||
// return ready1 && ready2;
|
||||
// }
|
||||
|
||||
// public static Boolean SetAIR(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.MAIN_AIR) - 1, ON);
|
||||
|
||||
// }
|
||||
// //public static Boolean SetEMGLamp(Boolean ON)
|
||||
// //{
|
||||
// // if (Pub.dio == null || !Pub.dio.initOK) return false;
|
||||
// // return Pub.dio.SetOutput(GetDONum(eDOName.em) - 1, ON);
|
||||
// //}
|
||||
// public static Boolean SetPusher(eMotDir Direction)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// if (Direction == eMotDir.CW)
|
||||
// {
|
||||
// if(Util_DO.GetIOInput( eDIName.MGZ_CLAMP_RDY1)==false &&
|
||||
// Util_DO.GetIOInput(eDIName.MGZ_CLAMP_RDY2)==false)
|
||||
// {
|
||||
// Pub.log.AddE("매거진이 없어서 푸셔 작동이 불가 합니다");
|
||||
// return false;
|
||||
// }
|
||||
// Pub.dio.SetOutput(GetDONum(eDOName.PCB_PUSHER_DIR) - 1, true);
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.PCB_PUSHER_RUN) - 1, true);
|
||||
// }
|
||||
// else if (Direction == eMotDir.CCW)
|
||||
// {
|
||||
// Pub.dio.SetOutput(GetDONum(eDOName.PCB_PUSHER_DIR) - 1, false);
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.PCB_PUSHER_RUN) - 1, true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.PCB_PUSHER_RUN) - 1, false);
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static Boolean SetMGZMotor(Boolean run)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// if (run)
|
||||
// {
|
||||
// Pub.MGZRunTime = DateTime.Now;
|
||||
// Pub.log.Add("MGZ In Run : " + Pub.MGZRunTime.ToString());
|
||||
// return Pub.dio.SetOutput((int)eDOName.MGZ_IN, true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return Pub.dio.SetOutput((int)eDOName.MGZ_IN, false);
|
||||
// }
|
||||
// }
|
||||
|
||||
// #region "Tower Lamp"
|
||||
|
||||
// /// <summary>
|
||||
// /// 타워램프버튼 작업
|
||||
// /// </summary>
|
||||
// /// <param name="g"></param>
|
||||
// /// <param name="r"></param>
|
||||
// /// <param name="y"></param>
|
||||
// public static void SetTWLamp(Boolean r, Boolean g, Boolean y)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return;
|
||||
// if (Util_DO.GetIOOutput(eDOName.TWR_GRN) != g) Pub.dio.SetOutput(GetDONum(eDOName.TWR_GRN) - 1, g);
|
||||
// if (Util_DO.GetIOOutput(eDOName.TWR_RED) != r) Pub.dio.SetOutput(GetDONum(eDOName.TWR_RED) - 1, r);
|
||||
// if (Util_DO.GetIOOutput(eDOName.TWR_YEL) != y) Pub.dio.SetOutput(GetDONum(eDOName.TWR_YEL) - 1, y);
|
||||
|
||||
// if (Util_DO.GetIOOutput(eDOName.LED_START) != g) Pub.dio.SetOutput(GetDONum(eDOName.LED_START) - 1, g);
|
||||
// if (Util_DO.GetIOOutput(eDOName.LED_STOP) != r) Pub.dio.SetOutput(GetDONum(eDOName.LED_STOP) - 1, r);
|
||||
// if (Util_DO.GetIOOutput(eDOName.LED_RESET) != y) Pub.dio.SetOutput(GetDONum(eDOName.LED_RESET) - 1, y);
|
||||
// }
|
||||
|
||||
// public static Boolean SetTwRed(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// Pub.dio.SetOutput(GetDONum(eDOName.LED_STOP) - 1, ON);
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.TWR_RED) - 1, ON);
|
||||
// }
|
||||
// public static Boolean SetTwYel(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// Pub.dio.SetOutput(GetDONum(eDOName.LED_RESET) - 1, ON);
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.TWR_YEL) - 1, ON);
|
||||
// }
|
||||
// public static Boolean SetTwGrn(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// Pub.dio.SetOutput(GetDONum(eDOName.LED_START) - 1, ON);
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.TWR_GRN) - 1, ON);
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
// public static void ToggleRoomLight()
|
||||
// {
|
||||
// var current = Util_DO.GetIOOutput(eDOName.ROOM_LIGHT);
|
||||
// Pub.dio.SetOutput((int)eDOName.ROOM_LIGHT, !current);
|
||||
// }
|
||||
|
||||
|
||||
// public static Boolean SetBrake(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.BRAKE_OFF) - 1, !ON);
|
||||
// }
|
||||
|
||||
// public static Boolean SetBuzzer(Boolean ON)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// if (ON)
|
||||
// {
|
||||
// Pub.BuzzerTime = DateTime.Now;
|
||||
// if (Pub.setting.EnableBuzzer == false) return true; //부저기능OFF시 사용 안함
|
||||
// }
|
||||
// if (ON && Pub.setting.EnableBuzzer==false)
|
||||
// {
|
||||
// Pub.log.AddAT("buzzer Disabled");
|
||||
// ON = false;
|
||||
// }
|
||||
// return Pub.dio.SetOutput(GetDONum(eDOName.BUZZER) - 1, ON);
|
||||
// }
|
||||
// public static Boolean getBrakeOn()
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// return !GetIOOutput(eDOName.BRAKE_OFF);
|
||||
// }
|
||||
|
||||
// public static Boolean setGripper(Boolean close)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// var rlt = Pub.dio.SetOutput(GetDONum(eDOName.PCB_GRIPPER_CLOSE) - 1, close);
|
||||
// if (!rlt) Pub.log.AddE("Grip Set Error vlaue=" + close.ToString());
|
||||
// else
|
||||
// {
|
||||
// System.Threading.Thread.Sleep(Pub.setting.GripperOnOffDelay);
|
||||
// //Pub.log.Add("DELAY:GRIP:" + Pub.setting.GripperOnOffDelay);
|
||||
// }
|
||||
// return rlt;
|
||||
// }
|
||||
// public static Boolean setMGZClamp(Boolean close)
|
||||
// {
|
||||
// if (Pub.dio == null || !Pub.dio.IsInit) return false;
|
||||
// bool rlt1, rlt2;
|
||||
// if (close)
|
||||
// {
|
||||
// rlt1 = Pub.dio.SetOutput((int)eDOName.MGZ_CLAMP_OPEN, false);
|
||||
// rlt2 = Pub.dio.SetOutput((int)eDOName.MGZ_CLAMP_CLOSE, true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rlt2 = Pub.dio.SetOutput((int)eDOName.MGZ_CLAMP_CLOSE, false);
|
||||
// rlt1 = Pub.dio.SetOutput((int)eDOName.MGZ_CLAMP_OPEN, true);
|
||||
// }
|
||||
|
||||
// Pub.log.AddAT("gripper set close = " + close.ToString());
|
||||
|
||||
// if (rlt1 == false || rlt2 == false) Pub.log.AddE("Grip Set Error vlaue=" + close.ToString());
|
||||
// else
|
||||
// {
|
||||
// System.Threading.Thread.Sleep(Pub.setting.GripperOnOffDelay);
|
||||
// // Pub.log.Add("DELAY:GRIP:" + Pub.setting.GripperOnOffDelay);
|
||||
// }
|
||||
// return rlt1 && rlt2;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -10,12 +10,13 @@ using System.Windows.Forms;
|
||||
using Project.StateMachine;
|
||||
using COMM;
|
||||
using AR;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Project.ViewForm
|
||||
{
|
||||
public partial class fAuto : Form
|
||||
{
|
||||
AGVControl.MapControl mapctl;
|
||||
|
||||
public fAuto()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -26,12 +27,12 @@ namespace Project.ViewForm
|
||||
this.ctlAuto1.Scean = CtlAuto.eScean.Progress;
|
||||
else
|
||||
this.ctlAuto1.Scean = CtlAuto.eScean.Normal;
|
||||
this.mapctl = new AGVControl.MapControl();
|
||||
this.mapctl.Dock = DockStyle.Fill;
|
||||
this.mapctl.Visible = true;
|
||||
this.mapctl.Font = this.panel1.Font;
|
||||
this.mapctl.BackColor = Color.FromArgb(32, 32, 32);
|
||||
this.panel1.Controls.Add(mapctl);
|
||||
PUB.mapctl = new AGVControl.MapControl();
|
||||
PUB.mapctl.Dock = DockStyle.Fill;
|
||||
PUB.mapctl.Visible = true;
|
||||
PUB.mapctl.Font = this.panel1.Font;
|
||||
PUB.mapctl.BackColor = Color.FromArgb(32, 32, 32);
|
||||
this.panel1.Controls.Add(PUB.mapctl);
|
||||
}
|
||||
private void fAuto_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -41,7 +42,8 @@ namespace Project.ViewForm
|
||||
ctlAuto1.dev_xbe = PUB.XBE;
|
||||
this.timer1.Start();
|
||||
PUB.AGV.DataReceive += AGV_DataReceive;
|
||||
|
||||
|
||||
|
||||
//auto load
|
||||
var path = new System.IO.DirectoryInfo("route");
|
||||
if (path.Exists == false) path.Create();
|
||||
@@ -61,7 +63,8 @@ namespace Project.ViewForm
|
||||
if (fi.Exists)
|
||||
{
|
||||
PUB.log.Add($"autoload : {fi.FullName}");
|
||||
this.mapctl.LoadFromFile(fi.FullName);
|
||||
var errmsg = PUB.mapctl.LoadFromFile(fi.FullName);
|
||||
if (errmsg.isEmpty() == false) AR.UTIL.MsgE(errmsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +75,8 @@ namespace Project.ViewForm
|
||||
{
|
||||
case arDev.Narumi.DataType.TAG:
|
||||
var tagno = PUB.AGV.data.TagNo;
|
||||
this.mapctl.AGVMoveToRFID(tagno.ToString());
|
||||
PUB.log.Add($"[auto] recv tag : {tagno}");
|
||||
PUB.mapctl.SetCurrentPosition(tagno);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,12 +69,12 @@ namespace Project.ViewForm
|
||||
//후진
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA])
|
||||
{
|
||||
Util.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
UTIL.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
else if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
UTIL.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
@@ -92,12 +92,12 @@ namespace Project.ViewForm
|
||||
//전진
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA])
|
||||
{
|
||||
Util.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
UTIL.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
else if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
UTIL.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
@@ -115,12 +115,12 @@ namespace Project.ViewForm
|
||||
//우회전
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA])
|
||||
{
|
||||
Util.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
UTIL.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
else if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
UTIL.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
@@ -138,12 +138,12 @@ namespace Project.ViewForm
|
||||
//좌회전
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA])
|
||||
{
|
||||
Util.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
UTIL.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
else if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
UTIL.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
@@ -160,19 +160,19 @@ namespace Project.ViewForm
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA])
|
||||
{
|
||||
Util.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
UTIL.MsgE("자동 충전 중입니다\n충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
else if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
UTIL.MsgE("수동 충전 중입니다\b충전을 해제 하세요");
|
||||
return;
|
||||
}
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
PUB.sm.SetNewStep(StateMachine.eSMStep.IDLE);
|
||||
if (PUB.AGV.system1.agv_run == false && PUB.AGV.system1.agv_run_manual == false)
|
||||
{
|
||||
var dlg = Util.MsgQ("자동 진행을 시작할까요?\n우측 옵션을 확인 하세요");
|
||||
var dlg = UTIL.MsgQ("자동 진행을 시작할까요?\n우측 옵션을 확인 하세요");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
var opt = makeopt();
|
||||
PUB.AGV.AGVMoveSet(opt);
|
||||
@@ -301,7 +301,7 @@ namespace Project.ViewForm
|
||||
|
||||
private void btchargeOff_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Util.MsgQ("충전 해제 명령을 전송 할까요?") == DialogResult.Yes)
|
||||
if (UTIL.MsgQ("충전 해제 명령을 전송 할까요?") == DialogResult.Yes)
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, false);
|
||||
}
|
||||
|
||||
@@ -309,10 +309,10 @@ namespace Project.ViewForm
|
||||
{
|
||||
if (PUB.AGV.signal.mark_sensor == false)
|
||||
{
|
||||
Util.MsgE("마크센서가 확인되지 않아 충전을 시작할 수 없습니다");
|
||||
UTIL.MsgE("마크센서가 확인되지 않아 충전을 시작할 수 없습니다");
|
||||
return;
|
||||
}
|
||||
var dlg = Util.MsgQ("충전 시작 명령을 전송 할까요?");
|
||||
var dlg = UTIL.MsgQ("충전 시작 명령을 전송 할까요?");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, true);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ using COMM;
|
||||
using System.CodeDom;
|
||||
using AR;
|
||||
using Project.StateMachine;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
@@ -112,14 +113,14 @@ namespace Project
|
||||
_STEP_CLOSING_START(PUB.sm.Step);
|
||||
PUB.sm.Stop();
|
||||
|
||||
var patchfile = new System.IO.FileInfo(System.IO.Path.Combine(Util.CurrentPath, "SWPatch.exe"));
|
||||
var patchfile = new System.IO.FileInfo(System.IO.Path.Combine(UTIL.CurrentPath, "SWPatch.exe"));
|
||||
if (patchfile.Exists == false)
|
||||
{
|
||||
Util.MsgE("패치파일(" + patchfile.Name + ")이 없습니다.\n프로그램을 다시 실행해주세요", true);
|
||||
UTIL.MsgE("패치파일(" + patchfile.Name + ")이 없습니다.\n프로그램을 다시 실행해주세요", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.RunProcess(patchfile.FullName);
|
||||
UTIL.RunProcess(patchfile.FullName);
|
||||
}
|
||||
}
|
||||
else if (forceClose == true)
|
||||
@@ -130,19 +131,19 @@ namespace Project
|
||||
_STEP_CLOSING_START(PUB.sm.Step);
|
||||
PUB.sm.Stop();
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PUB.sm.Step == eSMStep.RUN)
|
||||
{
|
||||
Util.MsgE("동작 중에는 종료 할 수 없습니다.");
|
||||
UTIL.MsgE("동작 중에는 종료 할 수 없습니다.");
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
if (PUB.sm.Step < eSMStep.CLOSING)
|
||||
{
|
||||
var rlt = Util.MsgQ("종료하시겠습니까");
|
||||
var rlt = UTIL.MsgQ("종료하시겠습니까");
|
||||
if (rlt == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
//비젼의 측정상태가 변경된 경우
|
||||
@@ -193,7 +194,9 @@ namespace Project
|
||||
|
||||
//지그비통신
|
||||
PUB.XBE = new Device.Xbee();
|
||||
//PUB.XBE.Message += Xbee_Message;
|
||||
PUB.XBE.MessageReceived += XBE_MessageReceived;
|
||||
PUB.XBE.ProtocReceived += XBE_ProtocReceived;
|
||||
|
||||
//HWState.setTitle(1, 3, Pub.setting.Port_Xbee);
|
||||
//HWState.setTitle(1, 0, Pub.setting.Address_RFID);
|
||||
|
||||
@@ -253,6 +256,7 @@ namespace Project
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Counter_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -293,17 +297,17 @@ namespace Project
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
private void CtlPos1_ItemClick(object sender, CtlPos.ItemClickEventArgs e)
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONM] == true)
|
||||
{
|
||||
Util.MsgE("수동 충전 상태이므로 진행 할 수 없습니다");
|
||||
UTIL.MsgE("수동 충전 상태이므로 진행 할 수 없습니다");
|
||||
return;
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.EMERGENCY]==true)
|
||||
if (VAR.BOOL[eVarBool.EMERGENCY] == true)
|
||||
{
|
||||
var dlgE = Util.MsgQ("비상정지 상태입니다.\n오류를 먼저 소거하고 실행 할까요?");
|
||||
var dlgE = UTIL.MsgQ("비상정지 상태입니다.\n오류를 먼저 소거하고 실행 할까요?");
|
||||
if (dlgE == DialogResult.Yes) PUB.AGV.AGVErrorReset();
|
||||
else return;
|
||||
}
|
||||
@@ -511,7 +515,7 @@ namespace Project
|
||||
PUB.AGV.AGVErrorReset();
|
||||
if (Prompt)
|
||||
{
|
||||
if (Util.MsgQ("AGV상태를 자동으로 전환 할까요?") != DialogResult.Yes) return;
|
||||
if (UTIL.MsgQ("AGV상태를 자동으로 전환 할까요?") != DialogResult.Yes) return;
|
||||
}
|
||||
//충전상태확인
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
@@ -656,15 +660,15 @@ namespace Project
|
||||
|
||||
private void arLabel3_Click(object sender, EventArgs e)
|
||||
{
|
||||
string file = System.IO.Path.Combine(Util.CurrentPath, "manual.pdf");
|
||||
string file = System.IO.Path.Combine(UTIL.CurrentPath, "manual.pdf");
|
||||
if (System.IO.File.Exists(file) == false)
|
||||
{
|
||||
Util.MsgE("사용설명서 파일이 존재하지 않습니다\n" +
|
||||
UTIL.MsgE("사용설명서 파일이 존재하지 않습니다\n" +
|
||||
"문의 : T8567 (장비기술 1파트)\n" +
|
||||
"파일명 : " + file);
|
||||
return;
|
||||
}
|
||||
Util.RunExplorer(file);
|
||||
UTIL.RunExplorer(file);
|
||||
}
|
||||
|
||||
private void btClose_Click(object sender, EventArgs e)
|
||||
@@ -680,7 +684,7 @@ namespace Project
|
||||
private void arLabel5_Click(object sender, EventArgs e)
|
||||
{
|
||||
//SetScreen(form_setup);
|
||||
|
||||
|
||||
|
||||
var popmsg = PUB.popup.Visible;
|
||||
PUB.popup.Visible = false;
|
||||
@@ -688,7 +692,7 @@ namespace Project
|
||||
using (var f = new fSetup())
|
||||
if (f.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
|
||||
|
||||
|
||||
//AGV정보 싱크
|
||||
PUB.sm.ResetRunStepSeq();
|
||||
@@ -705,7 +709,7 @@ namespace Project
|
||||
|
||||
//if (Pub.sm.Step != eSMStep.IDLE)
|
||||
//{
|
||||
var dlg = Util.MsgQ(
|
||||
var dlg = UTIL.MsgQ(
|
||||
"프로그램 상태를 초기화 하시겠습니까?\n" +
|
||||
"진행 중인 사항은 모두 취소 됩니다");
|
||||
if (dlg != System.Windows.Forms.DialogResult.Yes) return;
|
||||
@@ -725,12 +729,12 @@ namespace Project
|
||||
|
||||
private void btCapture_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.ScreenCaptrue(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height, new Point(0, 0));
|
||||
UTIL.ScreenCapture(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height, new Point(0, 0));
|
||||
}
|
||||
|
||||
private void btOpenDir_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.RunExplorer(Util.CurrentPath);
|
||||
UTIL.RunExplorer(UTIL.CurrentPath);
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
@@ -792,14 +796,14 @@ namespace Project
|
||||
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
Util.MsgE("수동 충전 상태이므로 진행 할 수 없습니다");
|
||||
UTIL.MsgE("수동 충전 상태이므로 진행 할 수 없습니다");
|
||||
return;
|
||||
}
|
||||
|
||||
//충전을 시작해라ㅏ
|
||||
if (bCharge == true)
|
||||
{
|
||||
var dlg = Util.MsgQ("충전을 중지할까요?");
|
||||
var dlg = UTIL.MsgQ("충전을 중지할까요?");
|
||||
if (dlg == DialogResult.Yes)
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
@@ -810,7 +814,7 @@ namespace Project
|
||||
}
|
||||
else
|
||||
{
|
||||
var dlg = Util.MsgQ("충전을 시작할까요?");
|
||||
var dlg = UTIL.MsgQ("충전을 시작할까요?");
|
||||
if (dlg == DialogResult.Yes)
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
@@ -850,7 +854,7 @@ namespace Project
|
||||
|
||||
if (bCharge == true)
|
||||
{
|
||||
var dlg = Util.MsgQ("홈(QC) 이동을 취소 할까요?");
|
||||
var dlg = UTIL.MsgQ("홈(QC) 이동을 취소 할까요?");
|
||||
if (dlg == DialogResult.Yes)
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
@@ -862,7 +866,7 @@ namespace Project
|
||||
}
|
||||
else
|
||||
{
|
||||
var dlg = Util.MsgQ("홈(QC) 이동을 실행 할까요?");
|
||||
var dlg = UTIL.MsgQ("홈(QC) 이동을 실행 할까요?");
|
||||
if (dlg == DialogResult.Yes)
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
@@ -949,7 +953,7 @@ namespace Project
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONM])
|
||||
{
|
||||
var dlg = Util.MsgQ("수동 충전을 해제 할까요?");
|
||||
var dlg = UTIL.MsgQ("수동 충전을 해제 할까요?");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
VAR.BOOL[eVarBool.FLAG_CHARGEONM] = false;
|
||||
PUB.log.Add("수동 충전 실행");
|
||||
@@ -958,10 +962,10 @@ namespace Project
|
||||
{
|
||||
if (PUB.AGV.system1.Battery_charging)
|
||||
{
|
||||
Util.MsgE("현재 자동 충전 중이라 진행 할 수 없습니다");
|
||||
UTIL.MsgE("현재 자동 충전 중이라 진행 할 수 없습니다");
|
||||
return;
|
||||
}
|
||||
var dlg = Util.MsgQ("수동 충전을 진행 할까요?");
|
||||
var dlg = UTIL.MsgQ("수동 충전을 진행 할까요?");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
VAR.BOOL[eVarBool.FLAG_CHARGEONM] = true;
|
||||
PUB.log.Add("수동 충전 실행");
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace Project
|
||||
{
|
||||
if (PUB.CheckPassword() == false)
|
||||
{
|
||||
Util.MsgE("암호가 일치하지 않습니다");
|
||||
UTIL.MsgE("암호가 일치하지 않습니다");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace Project
|
||||
" * [충전] 탭에서 설정값을 확인할 수 있습니다";
|
||||
else if (tagStr == "2") msg += "[배경음악]\n" +
|
||||
" * 이동시 음악을 플레이 합니다";
|
||||
var dlg = Util.MsgQ(msg);
|
||||
var dlg = UTIL.MsgQ(msg);
|
||||
if (dlg == DialogResult.Yes)
|
||||
{
|
||||
SetColorValue(button, true);
|
||||
@@ -483,7 +483,7 @@ namespace Project
|
||||
//포트를 선택한 후 표시해준다.
|
||||
var but = sender as Button;
|
||||
var tagStr = but.Tag.ToString();
|
||||
var newPort = Util.SelectSerialPort();
|
||||
var newPort = PUB.SelectSerialPort();
|
||||
if (newPort.isEmpty()) return;
|
||||
|
||||
if (tagStr == "XBE") tbPortXBE.Text = newPort;
|
||||
@@ -523,7 +523,7 @@ namespace Project
|
||||
{
|
||||
if (System.IO.File.Exists(tbMusic.Text) == false)
|
||||
{
|
||||
Util.MsgE("파일이 없습니다");
|
||||
UTIL.MsgE("파일이 없습니다");
|
||||
return;
|
||||
}
|
||||
try
|
||||
@@ -535,7 +535,7 @@ namespace Project
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Util.MsgE("music open error\n\n" + ex.Message);
|
||||
UTIL.MsgE("music open error\n\n" + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,83 +1,109 @@
|
||||
[RFID_POINTS]
|
||||
100,486,T0002
|
||||
164,494,T0003
|
||||
229,493,T0004
|
||||
309,489,T0005
|
||||
370,490,T0006
|
||||
437,486,T0007
|
||||
483,459,T0008
|
||||
511,421,T0009
|
||||
543,371,T0010
|
||||
569,329,T0011
|
||||
608,289,T0012
|
||||
661,279,T0013
|
||||
700,297,T0014
|
||||
698,349,T0015
|
||||
698,391,T0016
|
||||
699,449,T0017
|
||||
691,491,T0018
|
||||
569,275,T0019
|
||||
518,264,T0020
|
||||
454,264,T0021
|
||||
388,261,T0022
|
||||
314,258,T0023
|
||||
639,234,T0024
|
||||
621,182,T0025
|
||||
629,143,T0026
|
||||
657,101,T0027
|
||||
627,82,T0028
|
||||
560,73,T0029
|
||||
499,65,T0030
|
||||
432,65,T0031
|
||||
264,232,T0032
|
||||
363,60,T0033
|
||||
654,508,T0034
|
||||
96,542,T0050
|
||||
159,542,T0051
|
||||
226,542,T0061
|
||||
309,541,T0070
|
||||
369,542,T0071
|
||||
483,165,T0010
|
||||
735,163,T0011
|
||||
523,170,T0001
|
||||
565,175,T0002
|
||||
597,182,T0003
|
||||
665,181,T0004
|
||||
700,176,T0005
|
||||
721,170,T0006
|
||||
[MAGNET_LINES]
|
||||
99,485,220,492
|
||||
220,492,375,488
|
||||
375,488,457,479
|
||||
457,479,512,432
|
||||
512,432,552,353
|
||||
552,353,602,291
|
||||
602,291,651,278
|
||||
651,278,700,289
|
||||
700,289,704,380
|
||||
704,380,700,469
|
||||
700,469,688,488
|
||||
666,277,637,229
|
||||
637,229,625,170
|
||||
625,170,654,94
|
||||
654,94,624,78
|
||||
624,78,484,63
|
||||
484,63,365,64
|
||||
608,287,523,267
|
||||
523,267,409,260
|
||||
409,260,275,258
|
||||
99,486,95,542
|
||||
161,495,161,543
|
||||
230,496,228,537
|
||||
228,537,228,544
|
||||
306,488,306,543
|
||||
373,489,371,544
|
||||
655,508,691,486
|
||||
481,164,624,183
|
||||
624,183,706,181
|
||||
706,181,743,161
|
||||
100,486,0002
|
||||
164,494,0003
|
||||
229,493,0004
|
||||
309,489,0005
|
||||
370,490,0006
|
||||
437,486,0007
|
||||
483,459,0008
|
||||
511,421,0009
|
||||
543,371,0010
|
||||
569,329,0011
|
||||
608,289,0012
|
||||
661,279,0013
|
||||
700,297,0014
|
||||
698,349,0015
|
||||
698,391,0016
|
||||
699,449,0017
|
||||
691,491,0018
|
||||
569,275,0019
|
||||
518,264,0020
|
||||
454,264,0021
|
||||
388,261,0022
|
||||
314,258,0023
|
||||
639,234,0024
|
||||
621,182,0025
|
||||
629,143,0026
|
||||
657,101,0027
|
||||
627,82,0028
|
||||
560,73,0029
|
||||
499,65,0030
|
||||
432,65,0031
|
||||
264,232,0032
|
||||
363,60,0033
|
||||
654,508,0034
|
||||
96,542,0050
|
||||
159,542,0051
|
||||
226,542,0061
|
||||
309,541,0070
|
||||
369,542,0071
|
||||
483,165,0010
|
||||
735,163,0011
|
||||
523,170,0001
|
||||
565,175,0002
|
||||
597,182,0003
|
||||
665,181,0004
|
||||
700,176,0005
|
||||
721,170,0006
|
||||
|
||||
[RFID_LINES]
|
||||
96,542,100,486,0005,0002,False,56.14267
|
||||
100,486,164,494,0002,0003,False,64.49806
|
||||
164,494,229,493,0003,0004,False,65.00769
|
||||
229,493,309,489,0004,0005,False,80.09994
|
||||
309,489,370,490,0005,0006,False,61.0082
|
||||
370,490,437,486,0006,0007,False,67.11929
|
||||
437,486,483,459,0007,0008,False,53.33854
|
||||
483,459,511,421,0008,0009,False,47.20169
|
||||
511,421,543,371,0009,0010,False,59.36329
|
||||
543,371,569,329,0010,0011,False,49.39635
|
||||
569,329,608,289,0011,0012,False,55.86591
|
||||
608,289,661,279,0012,0013,False,53.93515
|
||||
661,279,700,297,0013,0014,False,42.95346
|
||||
700,297,698,349,0014,0015,False,52.03845
|
||||
698,349,698,391,0015,0016,False,42
|
||||
698,391,699,449,0016,0017,False,58.00862
|
||||
699,449,691,491,0017,0018,False,42.75512
|
||||
691,491,654,508,0018,0034,False,40.71855
|
||||
159,542,164,494,0006,0003,False,48.25971
|
||||
226,542,229,493,0007,0004,False,49.09175
|
||||
309,541,309,489,0008,0005,False,52
|
||||
369,542,370,490,0009,0006,False,52.00961
|
||||
370,490,370,490,0006,0006,False,0
|
||||
608,289,569,275,0012,0019,False,41.4367
|
||||
569,275,518,264,0019,0020,False,52.17279
|
||||
518,264,454,264,0020,0021,False,64
|
||||
454,264,388,261,0021,0022,False,66.06815
|
||||
388,261,314,258,0022,0023,False,74.06078
|
||||
661,279,639,234,0013,0024,False,50.08992
|
||||
639,234,621,182,0024,0025,False,55.02727
|
||||
621,182,629,143,0025,0026,False,39.81206
|
||||
629,143,657,101,0026,0027,False,50.47772
|
||||
657,101,627,82,0027,0028,False,35.51056
|
||||
627,82,560,73,0028,0029,False,67.60178
|
||||
560,73,499,65,0029,0030,False,61.52235
|
||||
483,165,523,170,0010,0001,False,40.31129
|
||||
523,170,565,175,0001,0002,False,42.29657
|
||||
565,175,597,182,0002,0003,False,32.75668
|
||||
597,182,621,182,0003,0025,False,24
|
||||
621,182,665,181,0025,0004,False,44.01136
|
||||
665,181,700,176,0004,0005,False,35.35534
|
||||
700,176,721,170,0005,0006,False,21.84033
|
||||
721,170,735,163,0006,0011,False,15.65248
|
||||
735,163,721,170,0011,0006,False,15.65248
|
||||
721,170,735,163,0006,0011,False,15.65248
|
||||
314,258,388,261,0023,0022,False,74.06078
|
||||
388,261,454,264,0022,0021,False,66.06815
|
||||
454,264,518,264,0021,0020,False,64
|
||||
518,264,569,275,0020,0019,False,52.17279
|
||||
569,275,608,289,0019,0012,False,41.4367
|
||||
264,232,314,258,0032,0023,False,56.35601
|
||||
363,60,432,65,0033,0031,False,69.18092
|
||||
432,65,499,65,0031,0030,False,67
|
||||
|
||||
|
||||
[MAP_TEXTS]
|
||||
179,251,-1,-16777216,Arial,12,TOPS-2
|
||||
179,251,-1,-16777216,Arial,12,OPS-2
|
||||
239,52,-256,-65408,Arial,12,SSOTRON-3
|
||||
617,527,-16711936,-16777216,Arial,12,SSOTRON-1
|
||||
87,551,-16777216,16777215,Arial,12,B1
|
||||
@@ -88,57 +114,3 @@
|
||||
453,128,-16777216,-8323073,Arial,12,CHG1
|
||||
725,124,-16777216,-8323073,Arial,12,CHG2
|
||||
[CUSTOM_LINES]
|
||||
[RFID_LINES]
|
||||
96,542,100,486,T0005,T0002,True,56.14267
|
||||
100,486,164,494,T0002,T0003,True,64.49806
|
||||
164,494,229,493,T0003,T0004,True,65.00769
|
||||
229,493,309,489,T0004,T0005,True,80.09994
|
||||
309,489,370,490,T0005,T0006,True,61.0082
|
||||
370,490,437,486,T0006,T0007,True,67.11929
|
||||
437,486,483,459,T0007,T0008,True,53.33854
|
||||
483,459,511,421,T0008,T0009,True,47.20169
|
||||
511,421,543,371,T0009,T0010,True,59.36329
|
||||
543,371,569,329,T0010,T0011,True,49.39635
|
||||
569,329,608,289,T0011,T0012,True,55.86591
|
||||
608,289,661,279,T0012,T0013,True,53.93515
|
||||
661,279,700,297,T0013,T0014,True,42.95346
|
||||
700,297,698,349,T0014,T0015,True,52.03845
|
||||
698,349,698,391,T0015,T0016,True,42
|
||||
698,391,699,449,T0016,T0017,True,58.00862
|
||||
699,449,691,491,T0017,T0018,True,42.75512
|
||||
691,491,654,508,T0018,T0034,True,40.71855
|
||||
159,542,164,494,T0006,T0003,True,48.25971
|
||||
226,542,229,493,T0007,T0004,True,49.09175
|
||||
309,541,309,489,T0008,T0005,True,52
|
||||
369,542,370,490,T0009,T0006,True,52.00961
|
||||
370,490,370,490,T0006,T0006,True,0
|
||||
608,289,569,275,T0012,T0019,True,41.4367
|
||||
569,275,518,264,T0019,T0020,True,52.17279
|
||||
518,264,454,264,T0020,T0021,True,64
|
||||
454,264,388,261,T0021,T0022,True,66.06815
|
||||
388,261,314,258,T0022,T0023,True,74.06078
|
||||
661,279,639,234,T0013,T0024,True,50.08992
|
||||
639,234,621,182,T0024,T0025,True,55.02727
|
||||
621,182,629,143,T0025,T0026,True,39.81206
|
||||
629,143,657,101,T0026,T0027,True,50.47772
|
||||
657,101,627,82,T0027,T0028,True,35.51056
|
||||
627,82,560,73,T0028,T0029,True,67.60178
|
||||
560,73,499,65,T0029,T0030,True,61.52235
|
||||
483,165,523,170,T0010,T0001,True,40.31129
|
||||
523,170,565,175,T0001,T0002,True,42.29657
|
||||
565,175,597,182,T0002,T0003,True,32.75668
|
||||
597,182,621,182,T0003,T0025,True,24
|
||||
621,182,665,181,T0025,T0004,True,44.01136
|
||||
665,181,700,176,T0004,T0005,True,35.35534
|
||||
700,176,721,170,T0005,T0006,True,21.84033
|
||||
721,170,735,163,T0006,T0011,True,15.65248
|
||||
735,163,721,170,T0011,T0006,True,15.65248
|
||||
721,170,735,163,T0006,T0011,True,15.65248
|
||||
314,258,388,261,T0023,T0022,True,74.06078
|
||||
388,261,454,264,T0022,T0021,True,66.06815
|
||||
454,264,518,264,T0021,T0020,True,64
|
||||
518,264,569,275,T0020,T0019,True,52.17279
|
||||
569,275,608,289,T0019,T0012,True,41.4367
|
||||
264,232,314,258,T0032,T0023,True,56.35601
|
||||
363,60,432,65,T0033,T0031,True,69.18092
|
||||
432,65,499,65,T0031,T0030,True,67
|
||||
|
||||
Reference in New Issue
Block a user