/// <summary> Checks to see if map has already been created. Returns false if has not been created. </summary> public bool CheckForDuplicate(string[] metsUsed, double minUTMX, double minUTMY, int numX, int numY, int reso, int whatToMap, string powerCurve, bool useSR, bool useSepModel, Wake_Model thisWakeModel, bool useTimeSeries) { bool alreadyExists = false; WakeCollection wakeList = new WakeCollection(); MetCollection metList = new MetCollection(); if (ThisCount > 0) { for (int i = 0; i < ThisCount; i++) { if (mapItem[i].minUTMX == minUTMX && mapItem[i].minUTMY == minUTMY && mapItem[i].numX == numX && mapItem[i].numY == numY && mapItem[i].reso == reso && mapItem[i].modelType == whatToMap && metList.sameMets(metsUsed, mapItem[i].metsUsed) && mapItem[i].powerCurve == powerCurve && mapItem[i].useSR == useSR && mapItem[i].useFlowSep == useSepModel && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisWakeModel) && mapItem[i].useTimeSeries == useTimeSeries) { MessageBox.Show("An identical map has already been created.", "Continuum 3"); alreadyExists = true; break; } } } return(alreadyExists); }
/// <summary> Delete all maps that were generated with thisWakeModel </summary> public void RemoveMapByWakeModel(Wake_Model thisWakeModel, WakeCollection wakeList) { int newCount = 0; for (int i = 0; i < ThisCount; i++) { if (mapItem[i].isWaked == false || (mapItem[i].isWaked == true && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisWakeModel) == false)) { newCount++; } } if (newCount > 0) { Map[] tempList = new Map[newCount]; int tempIndex = 0; for (int i = 0; i < ThisCount; i++) { if (mapItem[i].isWaked == false || (mapItem[i].isWaked == true && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisWakeModel) == false)) { tempList[tempIndex] = mapItem[i]; tempIndex++; } } mapItem = new Map[newCount]; mapItem = tempList; } else { mapItem = null; } }
/// <summary> Delete waked wind speed map </summary> public void RemoveMapByWakeGridMap(WakeCollection.WakeGridMap thisWakeGrid, WakeCollection wakeList) { int newCount = 0; for (int i = 0; i < ThisCount; i++) { if (mapItem[i].isWaked == false || (mapItem[i].isWaked == true && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisWakeGrid.wakeModel) == false && mapItem[i].minUTMX != thisWakeGrid.minUTMX && mapItem[i].minUTMY != thisWakeGrid.minUTMY && mapItem[i].numX != thisWakeGrid.numX && mapItem[i].numY != thisWakeGrid.numY && mapItem[i].reso != thisWakeGrid.wakeGridReso)) { newCount++; } } if (newCount > 0) { Map[] tempList = new Map[newCount]; int tempIndex = 0; for (int i = 0; i < ThisCount; i++) { if (mapItem[i].isWaked == false || (mapItem[i].isWaked == true && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisWakeGrid.wakeModel) == false && mapItem[i].minUTMX != thisWakeGrid.minUTMX && mapItem[i].minUTMY != thisWakeGrid.minUTMY && mapItem[i].numX != thisWakeGrid.numX && mapItem[i].numY != thisWakeGrid.numY && mapItem[i].reso != thisWakeGrid.wakeGridReso)) { tempList[tempIndex] = mapItem[i]; tempIndex++; } } mapItem = new Map[newCount]; mapItem = tempList; } else { mapItem = null; } }
/// <summary> Return Map index of incomplete map if it exists, return -999 if not. </summary> public int GetIncompleteMapInd(Map thisMap) { WakeCollection wakeList = new WakeCollection(); MetCollection metList = new MetCollection(); int mapInd = -999; if (ThisCount > 0) { for (int i = 0; i < ThisCount; i++) { if (mapItem[i].isComplete == false && mapItem[i].minUTMX == thisMap.minUTMX && mapItem[i].minUTMY == thisMap.minUTMY && mapItem[i].numX == thisMap.numX && mapItem[i].numY == thisMap.numY && mapItem[i].reso == thisMap.reso && mapItem[i].modelType == thisMap.modelType && metList.sameMets(thisMap.metsUsed, mapItem[i].metsUsed) && mapItem[i].powerCurve == thisMap.powerCurve && mapItem[i].useSR == thisMap.useSR && mapItem[i].useFlowSep == thisMap.useFlowSep && wakeList.IsSameWakeModel(mapItem[i].wakeModel, thisMap.wakeModel) && mapItem[i].useTimeSeries == thisMap.useTimeSeries) { mapInd = i; break; } } } return(mapInd); }