|
|
@@ -335,7 +335,7 @@ namespace FurnaceRT.Equipments.PMs
|
|
|
/// <param name="thickness"></param>
|
|
|
public void UpdateRecipeThickness(string recipeName, float thickness)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(recipeName) || thickness <= 0)
|
|
|
+ if (string.IsNullOrEmpty(recipeName))
|
|
|
return;
|
|
|
var item = _dbRecords
|
|
|
.FirstOrDefault(a => a.Item == MaintenanceItemEnum.RecipeThickness.ToString()
|
|
|
@@ -346,7 +346,18 @@ namespace FurnaceRT.Equipments.PMs
|
|
|
return;
|
|
|
|
|
|
if (item != null && item.Item == MaintenanceItemEnum.RecipeThickness.ToString())
|
|
|
- Singleton<ScheduleMaintenanceDataManager>.Instance.Increase(item.Item, thickness);
|
|
|
+ {
|
|
|
+ var currentValue = Singleton<ScheduleMaintenanceDataManager>.Instance.GetItem(item.Item).CurrentValue;
|
|
|
+ if ((currentValue + thickness) <= 0)
|
|
|
+ {
|
|
|
+ Singleton<ScheduleMaintenanceDataManager>.Instance.SetValue(item.Item, 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Singleton<ScheduleMaintenanceDataManager>.Instance.Increase(item.Item, thickness);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
/// <summary>
|