65 lines
2.0 KiB
C#
65 lines
2.0 KiB
C#
using static Step.Model.Constants;
|
|
|
|
namespace Step.Utils
|
|
{
|
|
public static class SupportFunctions
|
|
{
|
|
public static SOFTKEY_TYPE GetSoftKeyType(string type)
|
|
{
|
|
switch (type)
|
|
{
|
|
case "softKey_procedure": return SOFTKEY_TYPE.PROCEDURE;
|
|
case "softKey_group": return SOFTKEY_TYPE.GROUP;
|
|
default: return SOFTKEY_TYPE.TOGGLE;
|
|
}
|
|
}
|
|
|
|
public static HEAD_TYPE GetHeadType(string type)
|
|
{
|
|
switch (type)
|
|
{
|
|
case "SPINDLE": return HEAD_TYPE.SPINDLE;
|
|
case "AWJ": return HEAD_TYPE.AWJ;
|
|
default: return HEAD_TYPE.WJ;
|
|
|
|
}
|
|
}
|
|
|
|
public static int GetPlcIdFromNcSoftKey(string softKey)
|
|
{
|
|
switch (softKey)
|
|
{
|
|
case "auto": return 1;
|
|
case "edit": return 2;
|
|
case "mdi": return 3;
|
|
case "dnc": return 4;
|
|
case "ref": return 5;
|
|
case "jog": return 6;
|
|
case "jogInc": return 7;
|
|
case "restart": return 8;
|
|
case "teach": return 9;
|
|
case "retract": return 10;
|
|
case "wcsMcs": return 11;
|
|
case "handle": return 12;
|
|
case "reset": return 13;
|
|
case "blk": return 14;
|
|
case "blkDel": return 15;
|
|
case "opStop": return 16;
|
|
case "dryRun": return 17;
|
|
case "prgTest": return 18;
|
|
case "manualHandleInterrupt": return 19;
|
|
case "teachIn": return 20;
|
|
case "incPlane": return 21;
|
|
case "plus": return 22;
|
|
case "minus": return 23;
|
|
case "rapid": return 24;
|
|
case "xOne": return 25;
|
|
case "xTen": return 26;
|
|
case "xHundred": return 27;
|
|
case "xThousand": return 28;
|
|
default: return -1;
|
|
}
|
|
}
|
|
}
|
|
}
|