|
|
@@ -32,25 +32,47 @@ namespace FurnaceRT.Equipments.PMs
|
|
|
{
|
|
|
public partial class PMModule
|
|
|
{
|
|
|
- public void InitScheduleMaintenanceSubscribe()
|
|
|
- {
|
|
|
- DATA.Subscribe($"Boat.CurrentFilmThickness", () => GetBoatCurrentFilmThicknes());
|
|
|
- }
|
|
|
|
|
|
private List<ScheduleMaintenanceDataItem> _dbRecords { get; set; } = new List<ScheduleMaintenanceDataItem>();
|
|
|
|
|
|
- public string GetBoatCurrentFilmThicknes()
|
|
|
+ public void InitScheduleData()
|
|
|
{
|
|
|
- var item = _dbRecords.FirstOrDefault(a => a.Item == MaintenanceItemEnum.BoatRecipeThickness1.ToString() && a.Path == $"{DataItemEnum.Boat}");
|
|
|
+ if (_dbRecords == null || _dbRecords.Count == 0)
|
|
|
+ {
|
|
|
+ GetAllDBRecord();
|
|
|
+ }
|
|
|
|
|
|
+ InitBoatCurrentFilmThicknes();
|
|
|
+ }
|
|
|
+ private void InitBoatCurrentFilmThicknes()
|
|
|
+ {
|
|
|
+ float value = 0;
|
|
|
+ var item = _dbRecords.FirstOrDefault(a => a.Item == MaintenanceItemEnum.BoatRecipeThickness1.ToString() && a.Path == $"{DataItemEnum.Boat}");
|
|
|
if (item == null)
|
|
|
- return "0";
|
|
|
-
|
|
|
- if (item != null && item.Item == MaintenanceItemEnum.BoatRecipeThickness1.ToString())
|
|
|
- return item.CurrentValue.ToString();
|
|
|
-
|
|
|
- return "0";
|
|
|
-
|
|
|
+ {
|
|
|
+ value = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (item != null && item.Item == MaintenanceItemEnum.BoatRecipeThickness1.ToString())
|
|
|
+ value = item.CurrentValue;
|
|
|
+ }
|
|
|
+ SetCurrentFilmThickness(value);
|
|
|
+ }
|
|
|
+ private void InitDryClearCount()
|
|
|
+ {
|
|
|
+ float value = 0;
|
|
|
+ var item = _dbRecords.FirstOrDefault(a => a.Item == MaintenanceItemEnum.RecipeStepExecuteFreq2.ToString() && a.Path.StartsWith($"{DataItemEnum.Reactor}"));
|
|
|
+ if (item == null)
|
|
|
+ {
|
|
|
+ value = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (item != null && item.Item == MaintenanceItemEnum.RecipeStepExecuteFreq2.ToString())
|
|
|
+ value = item.CurrentValue;
|
|
|
+ }
|
|
|
+ SetDryClearCount(value);
|
|
|
}
|
|
|
public void GetAllDBRecord()
|
|
|
{
|
|
|
@@ -191,7 +213,10 @@ namespace FurnaceRT.Equipments.PMs
|
|
|
return;
|
|
|
|
|
|
if (item != null && item.Item == MaintenanceItemEnum.BoatRecipeThickness1.ToString())
|
|
|
+ {
|
|
|
Singleton<ScheduleMaintenanceDataManager>.Instance.Increase(item.Item, thickness);
|
|
|
+ SetCurrentFilmThickness(Singleton<ScheduleMaintenanceDataManager>.Instance.GetItem(item.Item).CurrentValue);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|