/// <summary> /// <para>判斷自己是屬於哪個 Cabinet Home;</para> /// 可以判斷: 回傳 Tuple<true, Cabinet Home 代碼> /// <para>自己就是 Cabinet Home: 回傳 Tuple<false, 自己></para> /// 無法判別: 回傳回傳型態的預設值 /// </summary> /// <param name="inst"></param> /// <returns></returns> public static Tuple <bool, BoxrobotTransferLocation> GetCabinetHomeCode(this BoxrobotTransferLocation inst) { if (inst.IsDrawer()) { if (inst < BoxrobotTransferLocationExtends.Cabinet2Start) { return(Tuple.Create(true, BoxrobotTransferLocation.Cabinet_01_Home)); } else { return(Tuple.Create(true, BoxrobotTransferLocation.Cabinet_02_Home)); } } else { if (inst == BoxrobotTransferLocation.Cabinet_01_Home || inst == BoxrobotTransferLocation.Cabinet_02_Home) { return(Tuple.Create(false, inst)); } else { return(default(Tuple <bool, BoxrobotTransferLocation>)); } } }
/// <summary> /// <para>將自己轉換為 4 碼的Drawer 代碼, 如果是,回傳 Tuple<true,代碼>如果不是 Drawer Location 的列舉, 就回傳 Tuple<false,""></para> /// <para>代碼格式, 如:0101, 0102, 0704, ......</para> /// </summary> /// <param name="inst"></param> /// <returns></returns> public static Tuple <bool, string> To4DigitDrawerCode(this BoxrobotTransferLocation inst) { Tuple <bool, string> rtnV = null; if (inst.IsDrawer()) { try { var drawerText = inst.ToString(); string code = ""; string[] ary = drawerText.Split('_'); int aryLength = ary.Length; code = ary[ary.Length - 2] + ary[aryLength - 1]; rtnV = Tuple.Create(true, code); } catch (Exception ex) { rtnV = Tuple.Create(false, string.Empty); } } else { rtnV = Tuple.Create(false, string.Empty); } return(rtnV); }
private string FromStartPointToGet(BoxrobotTransferLocation startPoint) { string fullFileName, fileName; const string connetSign = FileNameConnectSign; fileName = startPoint.ToText() + connetSign + BoxrobotTransferActionType.GET.ToText() + this.ExetendedFileName; fullFileName = this.FilePath + fileName; return(fullFileName); }
public static string ToText(this BoxrobotTransferLocation inst) { string rtnV = inst.ToDefaultText(); if (inst != BoxrobotTransferLocation.Dontcare) { rtnV = inst.ToString(); } return(rtnV); }
/// <summary>是不是 Drawer 的代碼?</summary> /// <param name="inst"></param> /// <returns></returns> public static bool IsDrawer(this BoxrobotTransferLocation inst) { if (inst < BoxrobotTransferLocationExtends.DrawerStart || inst > BoxrobotTransferLocationExtends.DrawerEnd) { return(false); } else { return(true); } }
/// <summary>由起點到終點的檔案名稱</summary> /// <param name="startPoint">起點</param> /// <param name="destination">終點</param> /// <param name="direction">方向(去、 回)</param> /// <param name="actionType">動作方式(取、 放)</param> /// <returns></returns> private string FromStartPointToDestinationPathFile(BoxrobotTransferLocation startPoint, BoxrobotTransferLocation destination, BoxrobotTransferDirection direction, BoxrobotTransferActionType actionType) { string fullFileName, fileName; const string connetSign = FileNameConnectSign; /** // vs 2013 * fileName = $"{startPoint.ToText()}{connetSign}{direction.ToText()}{connetSign}{destination.ToText()}{connetSign}{actionType}{this.ExetendedFileName}"; * fullFileName = $"{this.FilePath}{fileName}"; */ fileName = startPoint.ToText() + connetSign + direction.ToText() + connetSign + destination.ToText() + connetSign + actionType + this.ExetendedFileName; fullFileName = this.FilePath + fileName; return(fullFileName); }
private string CabinetHomePathFile(BoxrobotTransferLocation cabinetHome) { string fullFileName, fileName; //const string connetSign = FileNameConnectSign; /** // vs 2013 * fileName = $"{cabinetHome.ToText()}{this.ExetendedFileName}"; * fullFileName = $"{this.FilePath}{fileName}"; */ fileName = cabinetHome.ToText() + this.ExetendedFileName; fullFileName = this.FilePath + fileName; return(fullFileName); }
//[DataRow(BoxrobotTransferLocation.Drawer_01_01)] //[DataRow(BoxrobotTransferLocation.Drawer_07_01)] public void TestMethod_BankOut(/*BoxrobotTransferLocation drawerNumber*/) { // DataRow BoxrobotTransferLocation drawerNumber = BoxrobotTransferLocation.Drawer_01_01; var MachineMgr = new MacMachineMgr(); MachineMgr.MvCfInit(); var MachineCtrl = MachineMgr.CtrlMachines[EnumMachineID.MID_BT_A_ASB.ToString()] as MacMcBoxTransfer; var MS = MachineCtrl.StateMachine; MS.Initial(); MS.MoveToCabinetGet(drawerNumber); MS.MoveToOpenStagePut(); }
public static BoxrobotTransferLocationDrawerRange GetDrawerRange(this BoxrobotTransferLocation inst) { var rtnV = new BoxrobotTransferLocationDrawerRange(); return(rtnV); }
public MacStateDrawerReleasingEntryArgs(BoxrobotTransferLocation drawerLocation) : this(drawerLocation, null) { }
/// <summary>從 指定的Drawer 到 Cabinet 2 Home(PUT)</summary> /// <param name="drawer">指定的 Drawer</param> /// <returns></returns> public string FromDrawerToCabinet02Home_PUT_PathFile(BoxrobotTransferLocation drawer) { var fullFileName = FromStartPointToDestinationPathFile(drawer, BoxrobotTransferLocation.Cabinet_02_Home, BoxrobotTransferDirection.Backward, BoxrobotTransferActionType.PUT); return(fullFileName); }
/// <summary>從Cabinet 1 Home 到指定的 Drawer (PUT)</summary> /// <param name="drawer"></param> /// <returns></returns> public string FromCabinet01HomeToDrawer_PUT_PathFile(BoxrobotTransferLocation drawer) {//[V] var fullFileName = FromStartPointToDestinationPathFile(BoxrobotTransferLocation.Cabinet_01_Home, drawer, BoxrobotTransferDirection.Forward, BoxrobotTransferActionType.PUT); return(fullFileName); }
public MacStateMovingToCB1HomeClampedFromDrawerEntryEventArgs(BoxrobotTransferLocation targetLocation) : this(targetLocation, null) { }
public string FromDrawerToGetPathFile(BoxrobotTransferLocation drawer) { var fileName = FromStartPointToGet(drawer); return(fileName); }
public MacStateMovingToCB1HomeFromDrawerEntryEventArgs(BoxrobotTransferLocation drawerLocation) : this(drawerLocation, null) { }
public MacStateMovingToCB1HomeFromDrawerEntryEventArgs(BoxrobotTransferLocation drawerLocation, object parameter) : base(parameter) { DrawerLocation = drawerLocation; }
public MacStateDrawerClampingEntryEventArgs(BoxrobotTransferLocation drawerLocation, uint boxType, object parameter) : base(parameter) { DrawerLocation = drawerLocation; BoxType = boxType; }
public MacStateDrawerClampingEntryEventArgs(BoxrobotTransferLocation drawerLocation, uint boxType) : this(drawerLocation, boxType, null) { }
public static string ToDefaultText(this BoxrobotTransferLocation inst) { return(default(string)); }
public MacStateDrawerReleasingEntryArgs(BoxrobotTransferLocation drawerLocation, object parameter) : base(parameter) { DrawerLocation = drawerLocation; }
public MacStateMovingToDrawerForReleaseEntryEventArgs(BoxrobotTransferLocation drawerLocation) : this(drawerLocation, null) { }
public MacStateMovingToDrawerForReleaseEntryEventArgs(BoxrobotTransferLocation drawerLocation, object parameter) : base(parameter) { DrawerLocation = drawerLocation; }
public static string GetFromCabinetHomeToDrawerPutPath(this BoxrobotTransferPathFile instance, BoxrobotTransferLocation drawerLocation) { var drawerHome = drawerLocation.GetCabinetHomeCode(); if (drawerHome.Item1 == false) { return(""); } if (drawerHome.Item2 == BoxrobotTransferLocation.Cabinet_01_Home) { var path = instance.FromCabinet01HomeToDrawer_PUT_PathFile(drawerLocation); return(path); } else// if(drawerHome.Item2 == BoxrobotTransferLocation.Cabinet_02_Home) { var path = instance.FromCabinet02HomeToDrawer_PUT_PathFile(drawerLocation); return(path); } }