..
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Project
|
||||
ViewForm.fFlag form_flag = null;
|
||||
ViewForm.fAgv form_agv = null;
|
||||
ViewForm.fBms form_bms = null;
|
||||
Dialog.fLog form_log = null;
|
||||
|
||||
readonly usbdetect.DriveDetector usbdet;
|
||||
public fMain()
|
||||
@@ -59,6 +60,10 @@ namespace Project
|
||||
this.FormClosing += __Closing;
|
||||
|
||||
if (PUB.setting.FullScreen) this.WindowState = FormWindowState.Maximized;
|
||||
|
||||
lbTime.Click += (s1,e1) => {
|
||||
PUB.mapctl.ShowDesign();
|
||||
};
|
||||
}
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
@@ -240,10 +245,10 @@ namespace Project
|
||||
this.btDebug.Visible = PUB.setting.UseDebugMode;
|
||||
|
||||
PUB.log.Add("Program Start");
|
||||
UpdateControlText();
|
||||
|
||||
|
||||
//수량표시
|
||||
PUB.counter.PropertyChanged += Counter_PropertyChanged;
|
||||
PUB.counter.PropertyChanged += (s1, e1) => Update_Count();
|
||||
Update_Count();
|
||||
|
||||
PUB.log.Add("프로그램 실행 기록 추가");
|
||||
@@ -256,15 +261,6 @@ namespace Project
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Counter_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
//수량에 변화가 잇다면 업데이트 한다
|
||||
Update_Count();
|
||||
}
|
||||
|
||||
|
||||
#region "Mouse Form Move"
|
||||
|
||||
private Boolean fMove = false;
|
||||
@@ -296,6 +292,137 @@ namespace Project
|
||||
}
|
||||
|
||||
#endregion
|
||||
void socket_SendMessage(object sender, Device.Socket.SocketMessageEventArgs e)
|
||||
{
|
||||
//핑로그가 꺼져있는 상황일때 핑로그는 로그를 기록하지 않는다. 181205
|
||||
if (!PUB.setting.Log_Ping && e.Message.Type == Device.Socket.eType.REPLY && e.Message.SType == Device.Socket.eSType.STATUS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
PUB.log.Add("WS << " + e.rawData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void socket_RecvMessage(object sender, Device.Socket.SocketMessageEventArgs e)
|
||||
{
|
||||
if (e.Message.isError)
|
||||
PUB.log.AddE("WS >> " + e.Message.ErrorMessage + ",RAW=" + e.rawData);
|
||||
else
|
||||
{
|
||||
|
||||
switch (e.Message.Type)
|
||||
{
|
||||
case Device.Socket.eType.REQUEST:
|
||||
if (e.Message.SType == Device.Socket.eSType.STATUS)
|
||||
{
|
||||
var packet = PUB.sock_debug.makeReplyStatus(Device.Socket.eStatus.IDLE);
|
||||
var rlt = PUB.sock_debug.Send(PUB.setting.Asset, Device.Socket.eType.REPLY, Device.Socket.eSType.STATUS, packet);
|
||||
if (!rlt)
|
||||
{
|
||||
PUB.log.AddE("Status Reply Error");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PUB.setting.Log_Ping) PUB.log.AddI("Server Status Reply OK");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.log.Add("WS >> " + e.rawData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void socket_GetMessage(object sender, Device.Socket.MesasgeEventArgs e)
|
||||
{
|
||||
if (e.isError) PUB.log.AddE("WS:" + e.Message);
|
||||
else PUB.log.Add("WS:" + e.Message);
|
||||
}
|
||||
delegate void SelectModelHandler(string modelName);
|
||||
void SelectModelM(string modelName)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new SelectModelHandler(SelectModelM), new object[] { modelName });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void func_sw_start(bool Prompt = false)
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == false) //자동상태가 아니라면
|
||||
{
|
||||
PUB.AGV.AGVErrorReset();
|
||||
if (Prompt)
|
||||
{
|
||||
if (UTIL.MsgQ("AGV상태를 자동으로 전환 할까요?") != DialogResult.Yes) return;
|
||||
}
|
||||
//충전상태확인
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
PUB.popup.needClose = true;
|
||||
PUB.sm.bPause = false;
|
||||
PUB.sm.SetNewStep(eSMStep.RUN);
|
||||
|
||||
if (PUB.Result.CurrentPos == ePosition.NONE || PUB.Result.TargetPos == ePosition.NONE)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.GOHOME);
|
||||
}
|
||||
PUB.Speak(Lang.자동전환);
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, false); //230425 수동전환하면 충전 해제한다
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
PUB.Speak(Lang.작업종료);
|
||||
}
|
||||
}
|
||||
|
||||
void Resultclear()
|
||||
{
|
||||
PUB.Result.Clear();
|
||||
PUB.log.AddI("Clear Resultclear");
|
||||
}
|
||||
|
||||
|
||||
void CheckFreeSpace()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (PUB.path.FullName.StartsWith("\\"))
|
||||
{
|
||||
SSInfo.setTitle(0, 1, "UNC Path Detected");
|
||||
SSInfo.setValue(0, 1, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
double freeSpaceRate_ = PUB.GetFreeSpace();
|
||||
this.freeSpaceRate = freeSpaceRate_;
|
||||
SSInfo.setTitle(0, 1, "FREE(" + PUB.path.FullName.Substring(0, 1) + ") : " + freeSpaceRate.ToString("N2") + "%");
|
||||
if (freeSpaceRate < PUB.setting.AutoDeleteThreshold)
|
||||
{
|
||||
VAR.BOOL[eVarBool.MINSPACE] = true;
|
||||
SSInfo.setValue(0, 1, 2); //lbFreeSpace.ForeColor = Color.Tomato;
|
||||
}
|
||||
else
|
||||
{
|
||||
VAR.BOOL[eVarBool.MINSPACE] = false;
|
||||
SSInfo.setValue(0, 1, 3);// lbFreeSpace.ForeColor = Color.White;
|
||||
}
|
||||
}
|
||||
|
||||
//Pub.log.Add("남은디스크공간확인:" + freeSpaceRate.ToString("N2") + "%"); 190129
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SSInfo.setTitle(0, 1, "FREE SPACE : -ERROR-");
|
||||
PUB.log.AddE("check free space : " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CtlPos1_ItemClick(object sender, CtlPos.ItemClickEventArgs e)
|
||||
@@ -451,191 +578,16 @@ namespace Project
|
||||
if (dlg != null) dlg.Dispose();
|
||||
}
|
||||
|
||||
void socket_SendMessage(object sender, Device.Socket.SocketMessageEventArgs e)
|
||||
{
|
||||
//핑로그가 꺼져있는 상황일때 핑로그는 로그를 기록하지 않는다. 181205
|
||||
if (!PUB.setting.Log_Ping && e.Message.Type == Device.Socket.eType.REPLY && e.Message.SType == Device.Socket.eSType.STATUS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
PUB.log.Add("WS << " + e.rawData);
|
||||
}
|
||||
|
||||
void socket_RecvMessage(object sender, Device.Socket.SocketMessageEventArgs e)
|
||||
{
|
||||
if (e.Message.isError)
|
||||
PUB.log.AddE("WS >> " + e.Message.ErrorMessage + ",RAW=" + e.rawData);
|
||||
else
|
||||
{
|
||||
|
||||
switch (e.Message.Type)
|
||||
{
|
||||
case Device.Socket.eType.REQUEST:
|
||||
if (e.Message.SType == Device.Socket.eSType.STATUS)
|
||||
{
|
||||
var packet = PUB.sock_debug.makeReplyStatus(Device.Socket.eStatus.IDLE);
|
||||
var rlt = PUB.sock_debug.Send(PUB.setting.Asset, Device.Socket.eType.REPLY, Device.Socket.eSType.STATUS, packet);
|
||||
if (!rlt)
|
||||
{
|
||||
PUB.log.AddE("Status Reply Error");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PUB.setting.Log_Ping) PUB.log.AddI("Server Status Reply OK");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.log.Add("WS >> " + e.rawData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void socket_GetMessage(object sender, Device.Socket.MesasgeEventArgs e)
|
||||
{
|
||||
if (e.isError) PUB.log.AddE("WS:" + e.Message);
|
||||
else PUB.log.Add("WS:" + e.Message);
|
||||
}
|
||||
delegate void SelectModelHandler(string modelName);
|
||||
void SelectModelM(string modelName)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new SelectModelHandler(SelectModelM), new object[] { modelName });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void func_sw_start(bool Prompt = false)
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == false) //자동상태가 아니라면
|
||||
{
|
||||
PUB.AGV.AGVErrorReset();
|
||||
if (Prompt)
|
||||
{
|
||||
if (UTIL.MsgQ("AGV상태를 자동으로 전환 할까요?") != DialogResult.Yes) return;
|
||||
}
|
||||
//충전상태확인
|
||||
if (PUB.CheckManualChargeMode() == false) return;
|
||||
PUB.popup.needClose = true;
|
||||
PUB.sm.bPause = false;
|
||||
PUB.sm.SetNewStep(eSMStep.RUN);
|
||||
|
||||
if (PUB.Result.CurrentPos == ePosition.NONE || PUB.Result.TargetPos == ePosition.NONE)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.GOHOME);
|
||||
}
|
||||
PUB.Speak(Lang.자동전환);
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, false); //230425 수동전환하면 충전 해제한다
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
PUB.Speak(Lang.작업종료);
|
||||
}
|
||||
}
|
||||
|
||||
void Resultclear()
|
||||
{
|
||||
PUB.Result.Clear();
|
||||
PUB.log.AddI("Clear Resultclear");
|
||||
}
|
||||
|
||||
|
||||
void CheckFreeSpace()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (PUB.path.FullName.StartsWith("\\"))
|
||||
{
|
||||
SSInfo.setTitle(0, 1, "UNC Path Detected");
|
||||
SSInfo.setValue(0, 1, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
double freeSpaceRate_ = PUB.GetFreeSpace();
|
||||
this.freeSpaceRate = freeSpaceRate_;
|
||||
SSInfo.setTitle(0, 1, "FREE(" + PUB.path.FullName.Substring(0, 1) + ") : " + freeSpaceRate.ToString("N2") + "%");
|
||||
if (freeSpaceRate < PUB.setting.AutoDeleteThreshold)
|
||||
{
|
||||
VAR.BOOL[eVarBool.MINSPACE] = true;
|
||||
SSInfo.setValue(0, 1, 2); //lbFreeSpace.ForeColor = Color.Tomato;
|
||||
}
|
||||
else
|
||||
{
|
||||
VAR.BOOL[eVarBool.MINSPACE] = false;
|
||||
SSInfo.setValue(0, 1, 3);// lbFreeSpace.ForeColor = Color.White;
|
||||
}
|
||||
}
|
||||
|
||||
//Pub.log.Add("남은디스크공간확인:" + freeSpaceRate.ToString("N2") + "%"); 190129
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SSInfo.setTitle(0, 1, "FREE SPACE : -ERROR-");
|
||||
PUB.log.AddE("check free space : " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void demoRunToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.Result.JobEndTime = DateTime.Now;
|
||||
// Pub.flag.Toggle(eFlag.DemoRun);
|
||||
// Pub.log.AddAT(string.Format("데모변경: {0}", Pub.flag.get(eFlag.DemoRun)));
|
||||
}
|
||||
|
||||
private void openMapFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (OpenFileDialog od = new OpenFileDialog())
|
||||
if (od.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
|
||||
//if (orgImage != null) orgImage.Dispose();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void setZValidToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
PUB.log.Add("user set z-home set on");
|
||||
}
|
||||
|
||||
private void gridviewTestToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void 으ㅆㄷㄴㅅToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
/////HB9225-4280A 0901
|
||||
//var striplist = new string[]{
|
||||
// "HB9125-7560A 0704",
|
||||
//"HB9125-7800A 0104",
|
||||
//"HB9125-8480A 0701",
|
||||
//"HB9130-8550A 5108",
|
||||
//"HB9130-8620A 0701",
|
||||
//"HB9131-9340A 0201",
|
||||
//"HB9206-0810A 5301",
|
||||
//"HB9206-0820A 0902",
|
||||
//"HB9222-3020A 0208",
|
||||
//"HB9222-3020A 0508",
|
||||
//"HB9222-3720A 0205",
|
||||
//"HB9222-3720A 0902",
|
||||
//"HB9225-3790A 0604",
|
||||
//"HB9225-4280A 0901",
|
||||
//"HB9228-4840A 0104",
|
||||
//"HB9228-4840A 5908",
|
||||
//"HB9313-7600A 1006",
|
||||
//"HB9319-9540A 6003",
|
||||
//"ZGP490510700 1305"
|
||||
//};
|
||||
|
||||
}
|
||||
|
||||
private void errorToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.popup.setMessage("error\berror message");
|
||||
@@ -651,12 +603,6 @@ namespace Project
|
||||
PUB.popup.setMessage("attention\nattention message", MessageWindow.eWindowType.attention);
|
||||
}
|
||||
|
||||
private void reloadLotListToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void arLabel3_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -676,11 +622,6 @@ namespace Project
|
||||
this.Close();
|
||||
}
|
||||
|
||||
void UpdateControlText()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void arLabel5_Click(object sender, EventArgs e)
|
||||
{
|
||||
//SetScreen(form_setup);
|
||||
@@ -700,7 +641,7 @@ namespace Project
|
||||
}
|
||||
|
||||
VAR.BOOL[eVarBool.FLAG_SETUP] = false;// VAR.BOOL[eVarBool.FLAG_SETUP] = false;//VAR.BOOL[eVarBool.FLAG_SETUP] = false;
|
||||
UpdateControlText();
|
||||
|
||||
if (popmsg) PUB.popup.Visible = true;
|
||||
}
|
||||
|
||||
@@ -737,13 +678,13 @@ namespace Project
|
||||
UTIL.RunExplorer(UTIL.CurrentPath);
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
private void ManualMan_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_manu);
|
||||
MenuMAN.ForeColor = Color.Gold;
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
private void MenuLift_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_zlift);
|
||||
MenuLift.ForeColor = Color.Gold;
|
||||
@@ -755,7 +696,7 @@ namespace Project
|
||||
this.cmDebug.Show(ctl, new Point((int)(ctl.Width / 1.5), (int)(ctl.Height / 1.5)));
|
||||
}
|
||||
|
||||
private void btStart_Click(object sender, EventArgs e)
|
||||
private void btAutorun_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ctl = sender as arCtl.arLabel;
|
||||
if (ctl.Enabled == false) return;
|
||||
@@ -763,20 +704,18 @@ namespace Project
|
||||
func_sw_start(true);
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
private void btMenuAuto_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_auto);
|
||||
MenuAuto.ForeColor = Color.Gold;
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
private void btMenuFlag_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_flag);
|
||||
MenuFlag.ForeColor = Color.Gold;
|
||||
}
|
||||
|
||||
|
||||
Dialog.fLog form_log = null;
|
||||
|
||||
private void btLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (form_log == null || form_log.IsDisposed || form_log.Disposing)
|
||||
@@ -844,8 +783,7 @@ namespace Project
|
||||
PUB.Speak("고경석 수석님 밥은 드셨습니까?", true);
|
||||
UpdateProgressStatus(20, 100, "progre");
|
||||
}
|
||||
|
||||
private void arLabel1_Click(object sender, EventArgs e)
|
||||
private void brHome_Click(object sender, EventArgs e)
|
||||
{
|
||||
var bCharge = PUB.sm.Step == eSMStep.RUN &&
|
||||
(PUB.sm.RunStep == ERunStep.GOHOME);
|
||||
@@ -878,30 +816,6 @@ namespace Project
|
||||
|
||||
}
|
||||
|
||||
//private void btChargeM_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// var bCharge = PUB.flag.get(EFlag.FLAG_CHARGEONM);
|
||||
|
||||
// //충전을 시작해라ㅏ
|
||||
// if (bCharge == true)
|
||||
// {
|
||||
// var dlg = Util.MsgQ("수동 충전 상태를 해제 할까요?");
|
||||
// if (dlg == DialogResult.Yes)
|
||||
// {
|
||||
// PUB.flag.set(EFlag.FLAG_CHARGEONM, false);
|
||||
// Pub.log.Add("수동 충전 상태 해제");
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var dlg = Util.MsgQ("수동 충전 상태를 설정 할까요?\n수동충전이 설정되면 AGV는 움직지 않습니다");
|
||||
// if (dlg == DialogResult.Yes)
|
||||
// {
|
||||
// PUB.flag.set(EFlag.FLAG_CHARGEONM, true);
|
||||
// Pub.log.Add("수동 충전 상태 설정");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
private void arLabel2_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
@@ -911,17 +825,18 @@ namespace Project
|
||||
|
||||
private void lbCNtUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
//down,up둘다 연결해야함
|
||||
using (var f = new Dialog.fCounter())
|
||||
f.ShowDialog();
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
private void btMenuAGV_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_agv);
|
||||
MenuAGV.ForeColor = Color.Gold;
|
||||
}
|
||||
|
||||
private void button2_Click_1(object sender, EventArgs e)
|
||||
private void btMenuBMS_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
SetScreen(form_bms);
|
||||
MenuBMS.ForeColor = Color.Gold;
|
||||
@@ -971,5 +886,10 @@ namespace Project
|
||||
PUB.log.Add("수동 충전 실행");
|
||||
}
|
||||
}
|
||||
|
||||
private void lbTime_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.mapctl.ShowDesign();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user