public PcsIndividualParametersBase(string parameterName, string batchNum, string recipeName, RecipeTypes recipeType, IPcsToleranceParameterRepository _PcsToleranceRepository) { _pcsToleranceRepository = _PcsToleranceRepository; ParameterName = parameterName; BatchNumber = batchNum; RecipeType = recipeType; RecipeName = recipeName; }
public IRecipe GetRecipe(RecipeTypes recipeType) { if (recipeType == RecipeTypes.Beer) { return(new BeerRecipe()); } else { throw new ArgumentException("Invalid Recipe Type"); } }
public IViewComponentResult Invoke(RecipeTypes recipeType, string title, double value, LimitType limitType, int height, int width) { CreateGuageViewModel guageViewModel = new CreateGuageViewModel() { ActualValue = value, Title = title, RecipeLimit = _RecipeLimitRepository.GetLimitInfo(recipeType, limitType), Height = height, Width = width }; return(View(guageViewModel)); }
public Recipe(string name, double energyRequired = 0.5 , RecipeTypes recipeType = RecipeTypes.Normal, PhysicalProperties physicalProperty = PhysicalProperties.Item) { if (energyRequired <= 0) { throw new ArgumentOutOfRangeException(nameof(energyRequired)); } if (!recipeType.Verify()) { throw new ArgumentException($"{nameof(recipeType)} is unexpected types."); } if (!physicalProperty.Verify()) { throw new ArgumentException($"{nameof(physicalProperty)} is unexpected types"); } Name = name ?? throw new ArgumentNullException(nameof(name)); EnergyRequired = energyRequired; RecipeType = recipeType; PhysicalProperty = physicalProperty; }
private string ChangeRecipeTypeNameForDemo(RecipeTypes recipeTypes) { if (_applicationData.ApplicationMode != "demo") { return(recipeTypes.ToString()); } else { switch (recipeTypes) { case RecipeTypes.Conc: return("Recipe Type 1"); case RecipeTypes.Reg: return("Recipe Type 2"); case RecipeTypes.BigBang: return("Recipe Type 3"); default: return(recipeTypes.ToString()); } } }
public List <PcsWeightParameters> GetParametersForRecipeType(RecipeTypes recipeType) { return(parameters.Where(x => x.RecipeType == recipeType).ToList()); }
//public List<decimal> GetListOfDistinctTempsForRecipe(RecipeTypes recipeType) //{ // return _batchContext.PcsTempsTargets.Where(x => x.RecipeType == recipeType).Select(x => x.Target).Distinct().ToList(); //} public Dictionary <decimal, List <PcsTempTargets> > GetListOfTargetsSeperatedByTargetTemps(RecipeTypes recipeType) { var recipeByType = _batchContext.PcsTempsTargets.Where(x => x.RecipeType == recipeType).ToList(); var recipesSeperatedByTargets = recipeByType.GroupBy(x => x.Target).ToDictionary(group => group.Key, group => group.ToList()); return(recipesSeperatedByTargets); }
public RecipeLimits GetLimitInfo(RecipeTypes recipeType, LimitType limitType) { return(_context.RecipeLimits.Where(x => x.RecipeType == recipeType && x.LimitTypes == limitType).FirstOrDefault()); }
public List <decimal> GetListOfDistinctTempsForRecipe(RecipeTypes recipeType) { return(pcsTempTargets.Where(x => x.RecipeType == recipeType).Select(x => x.Target).Distinct().ToList()); }
public PcsDyes(string parameterName, string batchNum, string recipeName, decimal targetWeight, decimal dyeWeight, RecipeTypes recipeType, IPcsToleranceParameterRepository pcsToleranceParameterRepository) : base(parameterName, batchNum, recipeName, recipeType, pcsToleranceParameterRepository) { ActualWeight = dyeWeight; TargetWeight = targetWeight; SetTolerances(); SetLimits(); IsOutOfTolerance = CalculateOutOfSpec(UpperLimit, LowerLimit); IsOutOfRange = CalculateOutOfSpec(OutOfRangeUpperLimit, OutOfRangeLowerLimit); }
public PcsWeights(string parameterName, string batchNum, string recipeName, decimal targetWeight, decimal actualWeight, RecipeTypes recipeType, IPcsToleranceParameterRepository pcsToleranceParameterRepository) : base(parameterName, batchNum, recipeName, recipeType, pcsToleranceParameterRepository) { if (parameterName.ToLower() == "fatty alc") { Console.WriteLine(); } TargetWeight = targetWeight; ActualWeight = actualWeight; SetTolerances(); SetLimits(); IsOutOfTolerance = CalculateOutOfSpec(UpperLimit, LowerLimit); IsOutOfRange = CalculateOutOfSpec(OutOfRangeUpperLimit, OutOfRangeLowerLimit); }
private List <PcsParameterTotals> GetWeightsForRecipeType(List <BatchReport> dayReports, RecipeTypes recipeType) { List <PcsWeightParameters> parametersToLookFor = _pcsParameterRepository.GetParametersForRecipeType(recipeType); List <PcsParameterTotals> materials = new List <PcsParameterTotals>(); foreach (var parameter in parametersToLookFor) { List <IPcsIndividualParameters> weights = GetWeights(dayReports.Where(x => x.RecipeType == recipeType).ToList(), parameter.Parameter); string parameterShortName = _materialDetailsRepository.GetSingleMaterial(parameter.Parameter).ShortName; if (weights.Count != 0) { decimal tolerance = weights.Select(x => x.Tolerance).FirstOrDefault(); materials.Add(new PcsParameterTotals(parameterShortName + " (+/- " + tolerance.ToString() + "%)", weights, _pcsScoringRepository)); } } return(materials); }
public PcsActiveTemps(string parameterName, string batchNum, string recipeName, decimal vesselTemp, RecipeTypes recipeType, IPcsActiveTempParameters pcsActiveTempParameters, IPcsToleranceParameterRepository pcsToleranceParameterRepository) : base(parameterName, batchNum, recipeName, recipeType, pcsToleranceParameterRepository) { _pcsActiveTempParameters = pcsActiveTempParameters; ActualWeight = vesselTemp; SetLimits(); IsOutOfTolerance = CalculateOutOfSpec(UpperLimit, LowerLimit); IsOutOfRange = CalculateOutOfSpec(OutOfRangeUpperLimit, OutOfRangeLowerLimit); }