public static void GetFilePaths(ref TableMakerModel tableMakerModel) { var project = tableMakerModel.Project; var programs = tableMakerModel.Programs; var testers = tableMakerModel.Testers; OCVModel ocvModel = new OCVModel(); RCModel rcModel = new RCModel(); MiniModel miniModel = new MiniModel(); StandardModel standardModel = new StandardModel(); AndroidModel androidModel = new AndroidModel(); tableMakerModel.OCVModel = ocvModel; tableMakerModel.RCModel = rcModel; tableMakerModel.MiniModel = miniModel; tableMakerModel.StandardModel = standardModel; tableMakerModel.AndroidModel = androidModel; ocvModel.FilePath = OCVTableMaker.GetOCVTableFilePath(project); rcModel.FilePath = RCTableMaker.GetRCTableFilePath(project); List <string> strFilePaths; GetDriverFilePaths(project.BatteryType.Manufacturer, project.BatteryType.Name, project.AbsoluteMaxCapacity.ToString(), "mini", out strFilePaths); miniModel.FilePaths = strFilePaths; GetDriverFilePaths(project.BatteryType.Manufacturer, project.BatteryType.Name, project.AbsoluteMaxCapacity.ToString(), "standard", out strFilePaths); standardModel.FilePaths = strFilePaths; GetDriverFilePaths(project.BatteryType.Manufacturer, project.BatteryType.Name, project.AbsoluteMaxCapacity.ToString(), "android", out strFilePaths); androidModel.FilePaths = strFilePaths; }
public static void Build(ref TableMakerModel tableMakerModel) { try { var project = tableMakerModel.Project; var programs = tableMakerModel.Programs; var testers = tableMakerModel.Testers; var ocvModel = tableMakerModel.OCVModel; var rcModel = tableMakerModel.RCModel; var miniModel = tableMakerModel.MiniModel; var standardModel = tableMakerModel.StandardModel; var androidModel = tableMakerModel.AndroidModel; List <SourceData> ocvSource; OCVTableMaker.GetOCVSource(project, programs.Where(o => o.Type.Name == "OCV").ToList(), testers, out ocvSource); OCVTableMaker.GetOCVModel(ocvSource, ref ocvModel); List <SourceData> rcSource; RCTableMaker.GetRCSource(project, programs.Select(o => o).Where(o => o.Type.Name == "RC").ToList(), testers, out rcSource); RCTableMaker.GetRCModel(rcSource, project, ref rcModel); MiniDriverMaker.GetMiniModel(ocvSource, rcSource, ocvModel, rcModel, project, ref miniModel); StandardDriverMaker.GetStandardModel(ocvModel, rcModel, ref standardModel); AndroidDriverMaker.GetAndroidModel(ocvModel, rcModel, ref androidModel); OCVTableMaker.GenerateOCVTable(project, ocvModel); RCTableMaker.GenerateRCTable(project, rcModel); MiniDriverMaker.GenerateMiniDriver(miniModel, project); StandardDriverMaker.GenerateStandardDriver(standardModel, project); AndroidDriverMaker.GenerateAndroidDriver(androidModel, project); } catch (Exception e) { MessageBox.Show(e.Message); } }