Ejemplo n.º 1
0
        private void PayloadChanged(object sender, EventArgs e)
        {
            MonitorWeightChange = false;

            try
            {
                var payloadKg = payload.GetWeightKg();

                if (payloadKg >= 0.0)
                {
                    zfw.SetWeight(oew.GetWeightKg() + payload.GetWeightKg());
                    payloadTrackBar.Value = RoundToInt(payload.GetWeightKg());
                }
            }
            catch { }

            MonitorWeightChange = true;
        }
Ejemplo n.º 2
0
 private static double TryGetWeightKg(WeightTextBoxController c)
 {
     try
     {
         return(c.GetWeightKg());
     }
     catch
     {
         return(0.0);
     }
 }
Ejemplo n.º 3
0
        private static double ImportRequireNonNegative(
            WeightTextBoxController weightControl, string exceptionMsg)
        {
            double weightKg;

            try
            {
                weightKg = weightControl.GetWeightKg();
            }
            catch
            {
                throw new InvalidUserInputException(exceptionMsg);
            }

            if (weightKg < 0.0)
            {
                throw new InvalidUserInputException(exceptionMsg);
            }

            return(weightKg);
        }