|
@@ -1217,27 +1217,30 @@ namespace Venus_RT.Modules
|
|
|
public bool ExcuteCommand(string command, object[] paras, out string reason)
|
|
|
{
|
|
|
reason = "";
|
|
|
- switch (command)
|
|
|
+ switch (command.ToUpper())
|
|
|
{
|
|
|
case "PP-SELECT":
|
|
|
return FaCreateJob(paras, out reason);
|
|
|
- case "StartJob":
|
|
|
+ case "STARTJOB":
|
|
|
return FaStartJob(paras[0].ToString(), out reason);
|
|
|
- case "StopJob":
|
|
|
+ case "STOPJOB":
|
|
|
return FaStopJob(paras[0].ToString(), out reason);
|
|
|
- case "AbortJob":
|
|
|
+ case "ABORTJOB":
|
|
|
return FaAbortob(paras[0].ToString(), out reason);
|
|
|
- case "PauseJob":
|
|
|
+ case "PAUSEJOB":
|
|
|
return FaPauseJob(paras[0].ToString(), out reason);
|
|
|
- case "ResumeJob":
|
|
|
- return FaResumeJob(paras[0].ToString(), out reason);
|
|
|
- case "Load":
|
|
|
+ case "RESUMEJOB":
|
|
|
+ return FaResumeJob(paras[0].ToString(), out reason);
|
|
|
+ case "MAPCASSETTE":
|
|
|
+ return FaMapCassete(paras[0].ToString(), out reason);
|
|
|
+ case "LOAD":
|
|
|
return FaLoad(paras[0].ToString(), out reason);
|
|
|
- case "Unload":
|
|
|
+ case "UNLOAD":
|
|
|
return FaUnLoad(paras[0].ToString(), out reason);
|
|
|
- case "ReadID":
|
|
|
- return FaReadId(paras[0].ToString(), out reason);
|
|
|
-
|
|
|
+ case "READID":
|
|
|
+ return FaReadId(paras[0].ToString(), out reason);
|
|
|
+ case "WRITEID":
|
|
|
+ return FaWriteId(paras[0].ToString(),paras[1].ToString(),out reason);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -1330,16 +1333,50 @@ namespace Venus_RT.Modules
|
|
|
private bool FaLoad(string lp, out string reason)
|
|
|
{
|
|
|
reason = "";
|
|
|
- Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
- if (loadport != null)
|
|
|
- {
|
|
|
- loadport.Load();
|
|
|
- return true;
|
|
|
+ if (RtInstance.ConfigType == ConfigType.VenusSE || RtInstance.ConfigType == ConfigType.VenusDE)
|
|
|
+ {
|
|
|
+ VceEntity vce = GetVceEntity(lp, out reason);
|
|
|
+ return vce.CheckToPostMessage((int)VceMSG.SafeLoad);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
+ if (loadport != null)
|
|
|
+ {
|
|
|
+ loadport.Load();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 获取VCE实体
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="lp"></param>
|
|
|
+ /// <param name="reason"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private VceEntity GetVceEntity(string lp,out string reason)
|
|
|
+ {
|
|
|
+ reason = "";
|
|
|
+ if (int.TryParse(lp, out var lpValue))
|
|
|
+ {
|
|
|
+ if(lpValue==1)
|
|
|
+ {
|
|
|
+ return VCEA;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return VCEB;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return false;
|
|
|
- }
|
|
|
+ reason = $"{lp} is invalid data";
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取LoadPort对象
|
|
@@ -1376,6 +1413,34 @@ namespace Venus_RT.Modules
|
|
|
reason = $"{lp} is invalid data";
|
|
|
return null;
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 读取Id
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="lp"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool FaMapCassete(string lp, out string reason)
|
|
|
+ {
|
|
|
+ reason = "";
|
|
|
+ if (RtInstance.ConfigType == ConfigType.VenusSE || RtInstance.ConfigType == ConfigType.VenusDE)
|
|
|
+ {
|
|
|
+ VceEntity vce = GetVceEntity(lp, out reason);
|
|
|
+ return vce.CheckToPostMessage((int)VceMSG.Map);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
+ if (loadport != null)
|
|
|
+ {
|
|
|
+ loadport.Map();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 读取Id
|
|
@@ -1384,16 +1449,51 @@ namespace Venus_RT.Modules
|
|
|
/// <returns></returns>
|
|
|
private bool FaReadId(string lp, out string reason)
|
|
|
{
|
|
|
- reason = "";
|
|
|
- Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
- if (loadport != null)
|
|
|
- {
|
|
|
- loadport.ReadCarrierID();
|
|
|
- return true;
|
|
|
+ reason = "";
|
|
|
+ if (RtInstance.ConfigType == ConfigType.VenusSE || RtInstance.ConfigType == ConfigType.VenusDE)
|
|
|
+ {
|
|
|
+ reason = "VCE device not support readId Command";
|
|
|
+ return false;
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- return false;
|
|
|
+ {
|
|
|
+ Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
+ if (loadport != null)
|
|
|
+ {
|
|
|
+ loadport.ReadCarrierID();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 读取Id
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="lp"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool FaWriteId(string lp,string carrierId, out string reason)
|
|
|
+ {
|
|
|
+ reason = "";
|
|
|
+ if (RtInstance.ConfigType == ConfigType.VenusSE || RtInstance.ConfigType == ConfigType.VenusDE)
|
|
|
+ {
|
|
|
+ reason = "VCE device not support readId Command";
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
+ if (loadport != null)
|
|
|
+ {
|
|
|
+ loadport.WriteCarrierID(carrierId);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -1404,15 +1504,23 @@ namespace Venus_RT.Modules
|
|
|
private bool FaUnLoad(string lp, out string reason)
|
|
|
{
|
|
|
reason = "";
|
|
|
- Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
- if (loadport != null)
|
|
|
- {
|
|
|
- loadport.Unload();
|
|
|
- return true;
|
|
|
+ if (RtInstance.ConfigType == ConfigType.VenusSE || RtInstance.ConfigType == ConfigType.VenusDE)
|
|
|
+ {
|
|
|
+ VceEntity vce = GetVceEntity(lp, out reason);
|
|
|
+ return vce.CheckToPostMessage((int)VceMSG.SafeUnload);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- return false;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Loadport loadport = FaGetLoadPort(lp, out reason);
|
|
|
+ if (loadport != null)
|
|
|
+ {
|
|
|
+ loadport.Unload();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -1420,28 +1528,50 @@ namespace Venus_RT.Modules
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public string[] GetSequenceList()
|
|
|
- {
|
|
|
+ {
|
|
|
return RecipeFileManager.Instance.GetSequenceNameList().ToArray();
|
|
|
}
|
|
|
|
|
|
public string GetSequenceBody(string ppid)
|
|
|
- {
|
|
|
+ {
|
|
|
return RecipeFileManager.Instance.GetSequence(ppid, false);
|
|
|
}
|
|
|
|
|
|
public List<string> GetFormatedSequence(string ppid)
|
|
|
- {
|
|
|
- return null;
|
|
|
+ {
|
|
|
+ List<string> result = new List<string>();
|
|
|
+ string reason = string.Empty;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string content = "";
|
|
|
+ if (ppid.StartsWith("PMA") || ppid.StartsWith("PMB") || ppid.StartsWith("PMC"))
|
|
|
+ {
|
|
|
+ content = RecipeFileManager.Instance.LoadRecipe("", ppid, false);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ content = RecipeFileManager.Instance.GetSequence(ppid, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ result.Add(content);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ reason = ex.Message;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public bool deleteSequence(string ppid)
|
|
|
- {
|
|
|
- return true;
|
|
|
+ {
|
|
|
+ return RecipeFileManager.Instance.DeleteSequence(ppid);
|
|
|
}
|
|
|
|
|
|
public bool UpdateSequence(string ppid, string body)
|
|
|
- {
|
|
|
- return true;
|
|
|
+ {
|
|
|
+ return RecipeFileManager.Instance.SaveSequence(ppid, body, false);
|
|
|
}
|
|
|
|
|
|
public void ShowTerminalMessage(string message)
|