示例#1
0
        /// <summary> Gets map settings then adds map to list (which calls background worker to generate map). </summary>
        public void GenerateWakeMap()
        {
            GetMapSettings();

            // Check to see if this wake loss has already been done
            WakeCollection.WakeGridMap This_Wake_grid = thisInst.wakeModelList.CreateNewWakeGrid(minUTMX, minUTMY, numX, numY, thisWakeModel);

            if (thisInst.wakeModelList.WakeGridExists(This_Wake_grid) == false)
            {
                thisInst.wakeModelList.AddWakeGridMap(mapName, minUTMX, minUTMY, numX, numY, gridReso, thisWakeModel);
            }

            thisInst.mapList.AddMap(mapName, minUTMX, minUTMY, gridReso, numX, numY, whatToMap, thisWakeModel.powerCurve.name,
                                    thisInst, true, thisWakeModel, metsUsed, models, useTimeSeries);

            Close();
        }
        /// <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;
            }
        }