| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Runtime.InteropServices.WindowsRuntime; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.Utils |
| | | { |
| | |
| | | /// </summary> |
| | | public class SystemBussinessHelper |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 模拟时间(返回秒) |
| | | /// </summary> |
| | | /// <param name="workingProcedure"></param> |
| | | /// <returns></returns> |
| | | public static int MoNiTimeForWorkingProcedure(string workingProcedure) |
| | | { |
| | | switch (workingProcedure) |
| | | { |
| | | case "OP10": |
| | | case "OP40": |
| | | return 4; |
| | | case "OP20": |
| | | return 2 * 60; |
| | | case "OP30": |
| | | return 2 * 60; |
| | | case "OP35": |
| | | return 1 * 60; |
| | | case "OP50": |
| | | return 3 * 60; |
| | | case "OP60": |
| | | return 4 * 60; |
| | | default: |
| | | return 1 * 60; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 校验读取的二维码是否正确 |
| | | /// </summary> |
| | | /// <param name="workPieceID"></param> |
| | | /// <returns></returns> |
| | | public static bool ValidateIsRightWorkPieceID(string workPieceID) |
| | | { |
| | | if (string.IsNullOrEmpty(workPieceID)) |
| | | { |
| | | return false; |
| | | } |
| | | if (workPieceID.Length == 22) |
| | | { |
| | | var n_workPieceID = workPieceID.Trim(); |
| | | if (n_workPieceID.Length == 22) |
| | | { |
| | | if (n_workPieceID.IndexOf("ERROR") > -1) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 WorkPieceInfo 的DataCapturePointCname |
| | | /// </summary> |