def getDamParOutputFromDNATables(self, _xsDataDnaTables): xsDataResultBest = XSDataResultBest() xsTablesCollectionStrategy = EDUtilsTable.getTableListFromTables(_xsDataDnaTables, "dam_par_plan") iCollectionPlanNumber = 1 for xsTableCollectionStrategy in xsTablesCollectionStrategy: xsDataBestCollectionPlan = XSDataBestCollectionPlan() xsDataStrategySummary = XSDataBestStrategySummary() xsGeneralList = EDUtilsTable.getListsFromTable(xsTableCollectionStrategy, "general")[0] xsCollectionRunList = EDUtilsTable.getListsFromTable(xsTableCollectionStrategy, "collection_run") iCollectionRunNumber = 1 for xsCollectionRunItemList in xsCollectionRunList: xsDataCollectionRun = self.collectionRunItemListToCollectionRun(xsCollectionRunItemList, iCollectionRunNumber) xsDataBestCollectionPlan.addCollectionRun(xsDataCollectionRun) iCollectionRunNumber = iCollectionRunNumber + 1 xsDataBestCollectionPlan.setCollectionPlanNumber(XSDataInteger(iCollectionPlanNumber)) xsDataResultBest.addCollectionPlan(xsDataBestCollectionPlan) iCollectionPlanNumber = iCollectionPlanNumber + 1 xsItemDistance = EDUtilsTable.getItemFromList(xsGeneralList, "distance") fDistance = float(xsItemDistance.getValueOf_()) xsDataStrategySummary.setDistance(XSDataLength(fDistance)) xsItemResolution = EDUtilsTable.getItemFromList(xsGeneralList, "resolution") fResolution = float(xsItemResolution.getValueOf_()) xsDataStrategySummary.setResolution(XSDataDouble(fResolution)) xsDataBestCollectionPlan.setStrategySummary(xsDataStrategySummary) return xsDataResultBest
def getDamParOutputFromDNATables(self, _xsDataDnaTables): xsDataResultBest = XSDataResultBest() xsTablesCollectionStrategy = EDUtilsTable.getTableListFromTables( _xsDataDnaTables, "dam_par_plan") iCollectionPlanNumber = 1 for xsTableCollectionStrategy in xsTablesCollectionStrategy: xsDataBestCollectionPlan = XSDataBestCollectionPlan() xsDataStrategySummary = XSDataBestStrategySummary() xsGeneralList = EDUtilsTable.getListsFromTable( xsTableCollectionStrategy, "general")[0] xsCollectionRunList = EDUtilsTable.getListsFromTable( xsTableCollectionStrategy, "collection_run") iCollectionRunNumber = 1 for xsCollectionRunItemList in xsCollectionRunList: xsDataCollectionRun = self.collectionRunItemListToCollectionRun( xsCollectionRunItemList, iCollectionRunNumber) xsDataBestCollectionPlan.addCollectionRun(xsDataCollectionRun) iCollectionRunNumber = iCollectionRunNumber + 1 xsDataBestCollectionPlan.setCollectionPlanNumber( XSDataInteger(iCollectionPlanNumber)) xsDataResultBest.addCollectionPlan(xsDataBestCollectionPlan) iCollectionPlanNumber = iCollectionPlanNumber + 1 xsItemDistance = EDUtilsTable.getItemFromList( xsGeneralList, "distance") fDistance = float(xsItemDistance.getValueOf_()) xsDataStrategySummary.setDistance(XSDataLength(fDistance)) xsItemResolution = EDUtilsTable.getItemFromList( xsGeneralList, "resolution") fResolution = float(xsItemResolution.getValueOf_()) xsDataStrategySummary.setResolution(XSDataDouble(fResolution)) xsDataBestCollectionPlan.setStrategySummary(xsDataStrategySummary) return xsDataResultBest
def getDataCollectionOutputDataFromDNATables(self, _xsDataDnaTables): xsDataResultBest = XSDataResultBest() # SubWedges xsTablesCollectionStrategy = EDUtilsTable.getTableListFromTables(_xsDataDnaTables, "data_collection_strategy") iCollectionPlanNumber = 1 for xsTableCollectionStrategy in xsTablesCollectionStrategy: xsDataBestCollectionPlan = XSDataBestCollectionPlan() xsCollectionRunList = EDUtilsTable.getListsFromTable(xsTableCollectionStrategy, "collection_run") iCollectionRunNumber = 1 for xsCollectionRunItemList in xsCollectionRunList: xsDataCollectionRun = self.collectionRunItemListToCollectionRun(xsCollectionRunItemList, iCollectionRunNumber) xsDataBestCollectionPlan.addCollectionRun(xsDataCollectionRun) iCollectionRunNumber = iCollectionRunNumber + 1 # Strategy Summary xsStrategySummaryItemList = EDUtilsTable.getListsFromTable(xsTableCollectionStrategy, "summary") xsDataStrategySummary = self.strategySummaryItemListToStrategySummary(xsStrategySummaryItemList[0]) # Ranking Resolution # Not part of strategySummaryItemListToStrategySummary method since it is in the general_form part xsTableGeneralInform = EDUtilsTable.getTableFromTables(_xsDataDnaTables, "general_inform") xsRankingResolutionItemList = EDUtilsTable.getListsFromTable(xsTableGeneralInform, "ranking_resolution") xsItemRankingResolution = EDUtilsTable.getItemFromList(xsRankingResolutionItemList[0], "dmin") fRankingResolution = float(xsItemRankingResolution.getValueOf_()) xsDataStrategySummary.setRankingResolution(XSDataDouble(fRankingResolution)) xsDataBestCollectionPlan.setStrategySummary(xsDataStrategySummary) # Satistics xsTablesStatisticalPrediction = EDUtilsTable.getTableListFromTables(_xsDataDnaTables, "statistical_prediction") for xsTableStatisticalPrediction in xsTablesStatisticalPrediction: if(xsTableStatisticalPrediction.getIndex() == xsTableCollectionStrategy.getIndex()): xsResolutionBinList = EDUtilsTable.getListsFromTable(xsTableStatisticalPrediction, "resolution_bin") xsDataStatisticalPrediction = XSDataBestStatisticalPrediction() for xsResolutionBinItemList in xsResolutionBinList: xsDataResolutionBin = self.resolutionBinItemListToResolutionBin(xsResolutionBinItemList) xsDataStatisticalPrediction.addResolutionBin(xsDataResolutionBin) xsDataBestCollectionPlan.setStatisticalPrediction(xsDataStatisticalPrediction) xsDataBestCollectionPlan.setCollectionPlanNumber(XSDataInteger(iCollectionPlanNumber)) xsDataResultBest.addCollectionPlan(xsDataBestCollectionPlan) iCollectionPlanNumber = iCollectionPlanNumber + 1 # Fix the order of the collection plans - then low resolution pass should be the first one listCollectionPlan = xsDataResultBest.getCollectionPlan() if (len(listCollectionPlan) > 1): bIsModified = False for xsDataCollectionPlan in listCollectionPlan: xsDataStrategySummary = xsDataCollectionPlan.getStrategySummary() strReasoning = xsDataStrategySummary.getResolutionReasoning().getValue() if ((strReasoning.find("Low-resolution") != -1) and xsDataCollectionPlan.getCollectionPlanNumber().getValue() != 1): listCollectionPlan.remove(xsDataCollectionPlan) listCollectionPlan.insert(0, xsDataCollectionPlan) bIsModified = True if (bIsModified): iCollectionPlanNumber = 1 for xsDataCollectionPlan in listCollectionPlan: xsDataCollectionPlan.setCollectionPlanNumber(XSDataInteger(iCollectionPlanNumber)) iCollectionPlanNumber = iCollectionPlanNumber + 1 return xsDataResultBest
def getDataCollectionOutputDataFromDNATables(self, _xsDataDnaTables): xsDataResultBest = XSDataResultBest() # SubWedges xsTablesCollectionStrategy = EDUtilsTable.getTableListFromTables( _xsDataDnaTables, "data_collection_strategy") iCollectionPlanNumber = 1 for xsTableCollectionStrategy in xsTablesCollectionStrategy: xsDataBestCollectionPlan = XSDataBestCollectionPlan() xsCollectionRunList = EDUtilsTable.getListsFromTable( xsTableCollectionStrategy, "collection_run") iCollectionRunNumber = 1 for xsCollectionRunItemList in xsCollectionRunList: xsDataCollectionRun = self.collectionRunItemListToCollectionRun( xsCollectionRunItemList, iCollectionRunNumber) xsDataBestCollectionPlan.addCollectionRun(xsDataCollectionRun) iCollectionRunNumber = iCollectionRunNumber + 1 # Strategy Summary xsStrategySummaryItemList = EDUtilsTable.getListsFromTable( xsTableCollectionStrategy, "summary") xsDataStrategySummary = self.strategySummaryItemListToStrategySummary( xsStrategySummaryItemList[0]) # Ranking Resolution # Not part of strategySummaryItemListToStrategySummary method since it is in the general_form part xsTableGeneralInform = EDUtilsTable.getTableFromTables( _xsDataDnaTables, "general_inform") xsRankingResolutionItemList = EDUtilsTable.getListsFromTable( xsTableGeneralInform, "ranking_resolution") xsItemRankingResolution = EDUtilsTable.getItemFromList( xsRankingResolutionItemList[0], "dmin") fRankingResolution = float(xsItemRankingResolution.getValueOf_()) xsDataStrategySummary.setRankingResolution( XSDataDouble(fRankingResolution)) xsDataBestCollectionPlan.setStrategySummary(xsDataStrategySummary) # Satistics xsTablesStatisticalPrediction = EDUtilsTable.getTableListFromTables( _xsDataDnaTables, "statistical_prediction") for xsTableStatisticalPrediction in xsTablesStatisticalPrediction: if (xsTableStatisticalPrediction.getIndex() == xsTableCollectionStrategy.getIndex()): xsResolutionBinList = EDUtilsTable.getListsFromTable( xsTableStatisticalPrediction, "resolution_bin") xsDataStatisticalPrediction = XSDataBestStatisticalPrediction( ) for xsResolutionBinItemList in xsResolutionBinList: xsDataResolutionBin = self.resolutionBinItemListToResolutionBin( xsResolutionBinItemList) xsDataStatisticalPrediction.addResolutionBin( xsDataResolutionBin) xsDataBestCollectionPlan.setStatisticalPrediction( xsDataStatisticalPrediction) xsDataBestCollectionPlan.setCollectionPlanNumber( XSDataInteger(iCollectionPlanNumber)) xsDataResultBest.addCollectionPlan(xsDataBestCollectionPlan) iCollectionPlanNumber = iCollectionPlanNumber + 1 # Fix the order of the collection plans - then low resolution pass should be the first one listCollectionPlan = xsDataResultBest.getCollectionPlan() if (len(listCollectionPlan) > 1): bIsModified = False for xsDataCollectionPlan in listCollectionPlan: xsDataStrategySummary = xsDataCollectionPlan.getStrategySummary( ) strReasoning = xsDataStrategySummary.getResolutionReasoning( ).getValue() if ((strReasoning.find("Low-resolution") != -1) and xsDataCollectionPlan.getCollectionPlanNumber( ).getValue() != 1): listCollectionPlan.remove(xsDataCollectionPlan) listCollectionPlan.insert(0, xsDataCollectionPlan) bIsModified = True if (bIsModified): iCollectionPlanNumber = 1 for xsDataCollectionPlan in listCollectionPlan: xsDataCollectionPlan.setCollectionPlanNumber( XSDataInteger(iCollectionPlanNumber)) iCollectionPlanNumber = iCollectionPlanNumber + 1 return xsDataResultBest