Moved API and DB methods to interfaces in order to leverage Dependency Injection, disolved APICaller class, including functionality in several other functions, included Single Load Lock information into Production Passdown report, changed persistant data file to json instead of xml, and adjusted persistant data file to include a week's worth of data instead of a single day.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using ReportingServices.ReportingObjects;
|
||||
using ReportingServices.HelperClasses;
|
||||
using ReportingServices.ReportingObjects;
|
||||
|
||||
namespace ReportingServices.Models.ProductionReport
|
||||
{
|
||||
@ -6,17 +7,80 @@ namespace ReportingServices.Models.ProductionReport
|
||||
{
|
||||
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
||||
public List<ScrapByDay> ScrapByDay { get; set; }
|
||||
public Dictionary<string, ToolAvailibilityByType> ToolAvailibilityByType { get; set; }
|
||||
public Dictionary<string, List<EquipmentStateByDay>> ToolAvailibilityByType { get; set; }
|
||||
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
|
||||
public List<ManualReportEntriesByDay> Entries { get; set; }
|
||||
|
||||
public DailyReport(List<ReactorOutsByDay> outsByDay, List<ScrapByDay> scrapByDay, Dictionary<string, ToolAvailibilityByType> toolAvailibilityByType, Dictionary<string, ToolStateByType> toolStateByType)
|
||||
public DailyReport()
|
||||
{
|
||||
OutsByDay = outsByDay;
|
||||
ScrapByDay = scrapByDay;
|
||||
ToolAvailibilityByType = toolAvailibilityByType;
|
||||
ToolStateByType = toolStateByType;
|
||||
ToolAvailibilityByType = new();
|
||||
ToolStateByType = new();
|
||||
}
|
||||
|
||||
public void SetOutsByDay(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
OutsByDay = GetReactorOutsByDay(outs);
|
||||
}
|
||||
|
||||
public void SetScrapByDay(List<ScrapByDay> scrap)
|
||||
{
|
||||
ScrapByDay = scrap;
|
||||
}
|
||||
|
||||
public void AddToolAvailibilityByType(string key, List<EquipmentStateByDay> states)
|
||||
{
|
||||
ToolAvailibilityByType.Add(key, states);
|
||||
}
|
||||
|
||||
public void AddToolStateByType(string key, List<ToolStateCurrent> states)
|
||||
{
|
||||
ToolStateByType state = new ToolStateByType(states);
|
||||
|
||||
ToolStateByType.Add(key, state);
|
||||
}
|
||||
|
||||
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
List<string> dates = new();
|
||||
|
||||
foreach (ReactorOutsByRDS rout in outs)
|
||||
{
|
||||
if (!dates.Contains(DateTime.Parse(rout.EndProcessTime).Date.ToString()))
|
||||
dates.Add(DateTime.Parse(rout.EndProcessTime).Date.ToString());
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
||||
public static List<ReactorOutsByDay> GetReactorOutsByDay(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
List<ReactorOutsByDay> outsByDay = new();
|
||||
|
||||
List<string> dates = GetDistinctDatesFromReactorOuts(outs);
|
||||
|
||||
foreach (string date in dates)
|
||||
{
|
||||
int waferCount = 0;
|
||||
|
||||
foreach (ReactorOutsByRDS rout in outs)
|
||||
{
|
||||
if (DateTime.Parse(rout.EndProcessTime).Date.ToString() == date)
|
||||
waferCount += (int)float.Parse(rout.Units);
|
||||
}
|
||||
|
||||
outsByDay.Add(new ReactorOutsByDay(date, waferCount));
|
||||
}
|
||||
|
||||
return outsByDay;
|
||||
}
|
||||
|
||||
public void ReverseLists()
|
||||
{
|
||||
ScrapByDay = APIHelperFunctions.ReverseList(ScrapByDay);
|
||||
|
||||
ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]);
|
||||
ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]);
|
||||
ToolAvailibilityByType["HTR"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["HTR"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user