This commit is contained in:
ChiKyun Kim
2025-09-23 15:41:16 +09:00
parent 02028afc27
commit b037dd53e6
74 changed files with 4269 additions and 7917 deletions

View File

@@ -11,164 +11,6 @@ namespace Project
public partial class FMain
{
private void Joystick_InputChanged(object sender, arDev.Joystick.JoystickRaw.InputChangedEventHandler e)
{
var keyName = e.input.ToString();
if (e.input == HidSharp.Reports.Usage.Button5) keyName = "L-TRIGGER";
else if (e.input == HidSharp.Reports.Usage.Button6) keyName = "R-TRIGGER";
else if (e.input == HidSharp.Reports.Usage.Button9) keyName = "SELECT";
else if (e.input == HidSharp.Reports.Usage.Button10) keyName = "START";
else if (e.input == HidSharp.Reports.Usage.Button4) keyName = "BUT-Y";
else if (e.input == HidSharp.Reports.Usage.Button1) keyName = "BUT-X";
PUB.log.Add("JOYSTICK", string.Format("[{0}] {1}->{2}", keyName, e.oldValue, e.newValue));
if (PUB.sm.Step != eSMStep.IDLE && PUB.sm.Step != eSMStep.ERROR && PUB.flag.get(eVarBool.FG_MOVE_PICKER) == false && PUB.sm.Step != eSMStep.WAITSTART) return;
if (e.input == HidSharp.Reports.Usage.Button4) //stop
{
if (e.newValue > 0)
{
PUB.log.Add("Joystick Click : Stop");
_BUTTON_STOP();
}
}
else if (e.input == HidSharp.Reports.Usage.Button1) //reset
{
if (e.newValue > 0)
{
PUB.log.Add("Joystick Click : Reset");
_BUTTON_RESET();
}
}
else if (e.input == HidSharp.Reports.Usage.Button9) //select button
{
if (e.newValue == 1)
{
PUB.Result.JoystickAxisGroup += 1;
if (PUB.Result.JoystickAxisGroup > 3) PUB.Result.JoystickAxisGroup = 0;
}
}
else if (e.input == HidSharp.Reports.Usage.Button10) //start button
{
if (e.newValue == 1 && PUB.flag.get(eVarBool.FG_SCR_JOBSELECT) == false)
{
if (PUB.sm.Step >= eSMStep.IDLE)
{
PUB.log.AddI("START BUTTON");
this._BUTTON_START();
}
}
}
else if (e.input == HidSharp.Reports.Usage.Button5) //ltrigger
{
AR.SETTING.Data.Enable_SpeedLimit = true;
}
else if (e.input == HidSharp.Reports.Usage.Button6) //ltrigger
{
AR.SETTING.Data.Enable_SpeedLimit = false;
}
//트리거 L,R을 눌렀을때 홈 가능한 위치라면 홈을 진행한다
if (e.newValue > 0 && (e.input == HidSharp.Reports.Usage.Button5 || e.input == HidSharp.Reports.Usage.Button6))
{
//두개가 동시에 눌렷을때
if (PUB.joystick.Buttons[4] && PUB.joystick.Buttons[5])
{
if (PUB.flag.get(eVarBool.FG_INIT_MOTIO) == false) return;
if (PUB.sm.isRunning == true) return;
if (DIO.IsEmergencyOn() == true) return;
if (PUB.sm.Step == eSMStep.RUN) return;
PUB.log.AddAT("Home initialization operation with joystick");
Func_sw_initialize();
}
}
//동작중만 아니면 작동하게한다.
if (PUB.sm.Step != eSMStep.RUN)
{
short axisH = 0;
short axisV = 1;
if (PUB.Result.JoystickAxisGroup == 1) //왼쪽뭉치
{
axisH = 2;
axisV = 3;
}
else if (PUB.Result.JoystickAxisGroup == 2) //오른쪽뭉치
{
axisH = 4;
axisV = 5;
}
else if (PUB.Result.JoystickAxisGroup == 3) //theta, picker-Z
{
axisH = 6;
axisV = 1;
}
//X축으로 이동하는것은 PX,
if (e.input == HidSharp.Reports.Usage.GenericDesktopX)
{
if (e.newValue == 0)
{
//좌
PUB.mot.JOG(axisH, arDev.MOT.MOTION_DIRECTION.Negative, 100, 500, false, false);
PUB.flag.set(eVarBool.FG_JOYSTICK, true, "joystick");
}
else if (e.newValue == 127)
{
//멈춤
PUB.mot.MoveStop("Joystick", axisH);
PUB.flag.set(eVarBool.FG_JOYSTICK, false, "joystick");
}
else if (e.newValue == 255)
{
//우
PUB.mot.JOG(axisH, arDev.MOT.MOTION_DIRECTION.Positive, 100, 500, false, false);
PUB.flag.set(eVarBool.FG_JOYSTICK, true, "joystick");
}
}
else if (e.input == HidSharp.Reports.Usage.GenericDesktopY)
{
if (e.newValue == 0)
{
//상
PUB.mot.JOG(axisV, arDev.MOT.MOTION_DIRECTION.Negative, 100, 500, false, false);
PUB.flag.set(eVarBool.FG_JOYSTICK, true, "joystick");
}
else if (e.newValue == 127)
{
//멈춤
PUB.mot.MoveStop("Joystick", axisV);
PUB.flag.set(eVarBool.FG_JOYSTICK, false, "joystick");
}
else if (e.newValue == 255)
{
//하
PUB.mot.JOG(axisV, arDev.MOT.MOTION_DIRECTION.Positive, 100, 500, false, false);
PUB.flag.set(eVarBool.FG_JOYSTICK, true, "joystick");
}
}
}
}
private void Joystick_Disconnected(object sender, EventArgs e)
{
PUB.log.AddE("Joystick connection terminated");
}
private void Joystick_Connected(object sender, EventArgs e)
{
PUB.log.AddI("Joystick connection completed");
}
private void Joystick_Changed(object sender, EventArgs e)
{
PUB.log.AddAT("Joystick detected");
}
}
}

View File

@@ -133,9 +133,6 @@ namespace Project
hmi1.PrintLPICK = DIO.GetIOInput(eDIName.L_PICK_VAC);
hmi1.PrintRPICK = DIO.GetIOInput(eDIName.R_PICK_VAC);
hmi1.arJoystickGroup = PUB.Result.JoystickAxisGroup;
hmi1.arJoystickOn = PUB.joystick.IsOpen;
hmi1.arPortLItemOn = PUB.flag.get(eVarBool.FG_PORTL_ITEMON);
hmi1.arPortRItemOn = PUB.flag.get(eVarBool.FG_PORTR_ITEMON);

View File

@@ -135,7 +135,6 @@ namespace Project
var modelName = PUB.Result.vModel.Title;
PUB.Result.BCDPattern = PUB.GetPatterns(modelName, false);
PUB.Result.BCDIgnorePattern = PUB.GetPatterns(modelName, true);
PUB.Result.BCDPrintPattern = PUB.GetPrintPatterns();
PUB.log.Add($"Model pattern loading: {PUB.Result.BCDPattern.Count}/{PUB.Result.BCDIgnorePattern.Count}");
//변환SID SID확인여부데이터 삭제

View File

@@ -160,8 +160,10 @@ namespace Project
//바코드설정업데이트
if (systembypassmode == false)
{
var k1 = PUB.UpLoadBarcodeConfig(PUB.keyenceF);
var k2 = PUB.UpLoadBarcodeConfig(PUB.keyenceR);
bool k1, k2;
k1 = PUB.MemLoadBarcodeConfig(PUB.keyenceF);
k2 = PUB.MemLoadBarcodeConfig(PUB.keyenceR);
if (k1 == false && k2 == false) //결과확인하도록함 230511
{
PUB.Result.SetResultMessage(eResult.HARDWARE, eECode.CONFIG_KEYENCE, eNextStep.ERROR);

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Security.Cryptography;
using System.Text;
using System.Web.UI.WebControls;
using AR;
using Chilkat;

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.ServiceModel.Configuration;
using System.Text;
using AR;
using Project.Class;

View File

@@ -68,7 +68,7 @@ namespace Project
//####################################################
if (PUB.sm.seq.Get(cmdIndex) == idx++)
{
PUB.log.Add($"[{target}] 프린트 ON 작업 시작");
PUB.log.Add($"[{target}] Print ON operation started");
PUB.sm.seq.Update(cmdIndex);
return false;
}

View File

@@ -393,7 +393,7 @@ namespace Project
VAR.DBL[eVarDBL.RIGT_ITEM_PICKOFF] = 0;
VAR.I32[eVarInt32.RIGT_ITEM_COUNT] += 1;
}
PUB.log.Add($"[{target}] 릴을 내려놓습니다");
PUB.log.Add($"[{target}] Placing reel down");
PUB.sm.seq.Update(cmdIndex);

View File

@@ -171,7 +171,7 @@ namespace Project
}
DIO.SetPortMotor(idx, eMotDir.CCW, true, "얼라인(DN)");
PUB.log.Add("PORT", "포트를 강제로 하강 합니다");
PUB.log.Add("PORT", "Force port to descend");
}
//자재가 감지되면 시간을 다시 초기화해서 충분히 내려가도록 한다 210402
@@ -211,7 +211,7 @@ namespace Project
}
DIO.SetPortMotor(idx, eMotDir.CW, true, "MOT_PORT");
PUB.log.Add("PORT", "강제 상승(9에서 멈춰있음)");
PUB.log.Add("PORT", "Force ascend (stopped at position 9)");
}
}
}

View File

@@ -60,7 +60,7 @@ namespace Project
private void SM_StepCompleted(object sender, EventArgs e)
{
PUB.log.Add($"스텝완료({PUB.sm.Step})");
PUB.log.Add($"Step completed({PUB.sm.Step})");
//초기화가 완료되면 컨트롤 글자를 변경 해준다.
if (PUB.sm.Step == eSMStep.INIT)

View File

@@ -56,7 +56,7 @@ namespace Project
else
{
hmi1.ClearMessage();
PUB.log.Add($"정의되지 않은 STEP({step}) 시작");
PUB.log.Add($"Undefined STEP({step}) started");
}
if (step == eSMStep.HOME_QUICK || step == eSMStep.HOME_FULL || PUB.sm.getOldStep == eSMStep.IDLE || PUB.sm.getOldStep == eSMStep.FINISH)

View File

@@ -78,7 +78,7 @@ namespace Project
var regx = new Regex(pt.Pattern, RegexOptions.IgnoreCase, new TimeSpan(0, 0, 10));
if (regx.IsMatch(bcd))
{
PUB.log.Add($"무시바코드:{bcd},PAT:{pt.Pattern},SYM:{pt.Symbol}");
PUB.log.Add($"Ignore barcode:{bcd},PAT:{pt.Pattern},SYM:{pt.Symbol}");
IgnoreBarcode = true;
break;
}
@@ -118,7 +118,6 @@ namespace Project
var data = mat.Groups[matchdata.GroupNo];
if (PUB.SetBCDValue(vdata, matchdata.TargetPos, data.Value, pt.IsTrust))
ValueApplyCount += 1;
}
}
}
@@ -142,7 +141,6 @@ namespace Project
return new Tuple<int, List<string>>(ValueApplyCount, list);
}
/// <summary>
/// barcod eprocess
/// </summary>
@@ -174,7 +172,7 @@ namespace Project
bcdObj.Ignore = IgnoreBcd;
//기타바코드 무시기능 적용 221018
if (vm != null && vm.IgnoreOtherBarcode == true && findregex == false)
if (bcdObj.Ignore == false && vm != null && vm.IgnoreOtherBarcode == true && findregex == false)
bcdObj.Ignore = true;
bcdObj.RefExApply = (ValueApplyCount?.Item1 ?? 0) > 0;
@@ -182,6 +180,5 @@ namespace Project
}
}
}
}
}
}

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Security.Cryptography;
using System.Text;
using AR;
using Microsoft.Owin.Hosting;
namespace Project
{
@@ -106,13 +105,6 @@ namespace Project
//조명 ON
DIO.SetRoomLight(true);
// Start OWIN host
var baseAddress = "http://*:9001";
WebApp.Start<OWIN.Startup>(url: baseAddress);
PUB.log.AddI($"Hosting service ON: {baseAddress}");
}
public StepResult _STEP_INIT(eSMStep step, TimeSpan stepTime, TimeSpan seqTime)