示例#1
0
        public int Start_Load(int Slot_ID, int Slot_Index)
        {
            if (StaticRes.Global.IsOnProgress)
            {
                loaderror(et);
                return(0);
            }
            else
            {
                StaticRes.Global.IsOnProgress = true;
            }

            try
            {
                Params x = new Params();
                x.Slot_ID        = Slot_ID;
                x.Slot_Index     = Slot_Index;
                LoadError       += new loaderrorEventHandler(Load_LoadError);
                LoadComplete    += new LoadCompleteEventHandler(Load_LoadComplete);
                Step            += new StepEventHandler(Load_Step);
                this.Thread_Load = new Thread(new ParameterizedThreadStart(Loading));
                this.Thread_Load.Start(x);
            }
            catch
            {
                loaderror(et);
            }
            return(10);
        }
示例#2
0
 public void  Start_Weight(int Capacity, bool Load_Process, string Scrap_Weight, string Expiry_Time, bool Force_Scrap, string Syringe_Weight)
 {
     if (StaticRes.Global.IsOnProgress)
     {
         weighterror(et);
     }
     else
     {
         StaticRes.Global.IsOnProgress = true;
     }
     try
     {
         Params x = new Params();
         x.Capacity         = Capacity;
         x.Load_Process     = Load_Process;
         x.Scrap_Weight     = Scrap_Weight;
         x.Expiry_Time      = Expiry_Time;
         x.Force_Scrap      = Force_Scrap;
         x.Syringe_Weight   = Syringe_Weight;
         weighterror       += new weighterrorEventHandler(Weight_WeightError);
         weightcomplete    += new WeightCompleteEventHandler(Weight_WeightComplete);
         weightcontinue    += new WeightContinueEventHandler(Weight_WeightContinue);
         Step              += new StepEventHandler(Weight_Step);
         this.Thread_Weight = new Thread(new ParameterizedThreadStart(weighting));
         this.Thread_Weight.Start(x);
     }
     catch
     {
         weighterror(et);
     }
 }
示例#3
0
 public int Start_Return(int Slot_ID, int SLot_Index, bool Reuse)
 {
     if (StaticRes.Global.IsOnProgress)
     {
         returnerror(et);
         return(0);
     }
     else
     {
         StaticRes.Global.IsOnProgress = true;
     }
     try
     {
         Params x = new Params();
         x.Slot_ID          = Slot_ID;
         x.Slot_Index       = SLot_Index;
         x.Reuse            = Reuse;
         ReturnError       += new ReturnerrorEventHandler(Return_ReturnError);
         ReturnComplete    += new ReturnCompleteEventHandler(Return_ReturnComplete);
         Step              += new StepEventHandler(Return_Step);
         this.Thread_Return = new Thread(new ParameterizedThreadStart(Returning));
         this.Thread_Return.Start(x);
     }
     catch
     {
         returnerror(et);
     }
     return(30);
 }
示例#4
0
 public int Start_Home(bool Continue)
 {
     if (StaticRes.Global.IsOnProgress)
     {
         homeerror(et);
         return(0);
     }
     else
     {
         StaticRes.Global.IsOnProgress = true;
     }
     try
     {
         Params x = new Params();
         x.Continue       = Continue;
         homeerror       += new HomeErrorEventHandler(Home_HomeError);
         homecomplete    += new HomeCompleteEventHandler(Home_HomeComplete);
         Step            += new StepEventHandler(Home_Step);
         this.Thread_Home = new Thread(new ParameterizedThreadStart(Homeing));
         this.Thread_Home.Start(x);
     }
     catch
     {
         homeerror(et);
     }
     return(23);
 }
示例#5
0
        public virtual void ApplyStepRateBreakdown(TAmount amount, double percentageRateDivisor, ref TAmount total,
                                                   StepEventHandler stepFinishedEventHandler)
        {
            T      stepAmount;
            T      stepRateAmount;
            double divisor = 100d * percentageRateDivisor;

            if (this.isLowerBoundInclusive)
            {
                foreach (Bracket <TBracketQuantity, TAmount> step in Steps)
                {
                    if (0 >= step.FromAmount.CompareTo(amount))
                    {
                        stepAmount = (0 > amount.CompareTo(step.ToAmount) ? amount : step.ToAmount)
                                     .Subtract(step.FromAmount);
                        stepRateAmount = stepAmount.Multiply(step.PercentageRate / divisor);
                        total          = total.Add(stepRateAmount);
                        if (null != stepFinishedEventHandler)
                        {
                            stepFinishedEventHandler(step, stepRateAmount);
                        }
                    }
                }
            }
            else
            {
                foreach (Bracket <TBracketQuantity, TAmount> step in Steps)
                {
                    if (0 > step.FromAmount.CompareTo(amount))
                    {
                        stepAmount = (0 >= amount.CompareTo(step.ToAmount) ? amount : step.ToAmount)
                                     .Subtract(step.FromAmount);
                        stepRateAmount = stepAmount.Multiply(step.PercentageRate / divisor);
                        total          = total.Add(stepRateAmount);
                        if (null != stepFinishedEventHandler)
                        {
                            stepFinishedEventHandler(step, stepRateAmount);
                        }
                    }
                }
            }
        }
示例#6
0
 public int Start_InventoryCheck()
 {
     if (StaticRes.Global.IsOnProgress)
     {
         inventorycheckcomplete();
     }
     else
     {
         StaticRes.Global.IsOnProgress = true;
     }
     try
     {
         InventoryCheckComplete += new InventoryCheckCompleteEventHandler(Inventory_Check_InventoryCheckComplete);
         Step += new StepEventHandler(Inventory_Check_Step);
         InventoryCheckError        += new inventorycheckerrorEventHandler(Inventory_Check_InventoryCheckError);
         this.Thread_Inventory_Check = new Thread(new ParameterizedThreadStart(Inventory_Checking));
         this.Thread_Inventory_Check.Start();
     }
     catch
     {
         inventorycheckcomplete();
     }
     return(30);
 }