Exemple #1
0
 public void mainWindow(int windowid)
 {
     GUILayout.BeginVertical();
     if (GUILayout.Button("Overlay"))
     {
         showOverlayWindow = !showOverlayWindow;
     }
     GUILayout.Space(1);
     GUILayout.Space(1);
     if (MapOverlay.getHoverCell().HasValue)
     {
         Cell cell = MapOverlay.getHoverCell().Value;
         GUILayout.Label("Temperature: " + WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell) + " °K");
         GUILayout.Label("Pressure: " + WeatherFunctions.GetCellPressure(PD.index, currentLayer, cell) + " Pa");
         GUILayout.Label("Rel Humidity: " + WeatherFunctions.GetCellRH(PD.index, currentLayer, cell) * 100 + " %");
         GUILayout.Label("Air Density: " + String.Format("{0:0.000000}", WeatherFunctions.D_Wet(PD.index, cell, WeatherFunctions.GetCellAltitude(PD.index, currentLayer, cell))) + " Kg/m³");
         GUILayout.Label("wind horz: " + String.Format("{0:0.0000}", WeatherFunctions.GetCellwindH(PD.index, currentLayer, cell)) + " m/s");
         GUILayout.Label("wind Dir : " + String.Format("{0:000.0}", WeatherFunctions.GetCellwindDir(PD.index, currentLayer, cell)) + " °");
         GUILayout.Label("wind vert : " + String.Format("{0:+0.00000;-0.00000}", WeatherFunctions.GetCellwindV(PD.index, currentLayer, cell)) + " m/s");
         GUILayout.Label("CCN : " + WeatherFunctions.GetCellCCN(PD.index, currentLayer, cell) * 100 + " %");
         GUILayout.Label("Cloud water : " + WeatherFunctions.GetCellWaterContent(PD.index, currentLayer, cell) + " Kg/m³");
         int Iced = Math.Sign(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell));
         GUILayout.Label("droplet Size: " + Math.Abs(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell) * 1000.0f) + " mm");
         GUILayout.Label("cloud thickness: " + WeatherFunctions.GetCellthickness(PD.index, currentLayer, cell) + " m " + (Iced < 0 ? "Iced" : Iced > 0 ? "Liqd" : "None"));
         GUILayout.Label("rain duration: " + WeatherFunctions.GetCellrainDuration(PD.index, currentLayer, cell) + " cycles");
         GUILayout.Label("rain decay: " + WeatherFunctions.GetCellrainDecay(PD.index, currentLayer, cell) / 256.0f);
     }
     GUILayout.EndVertical();
     GUI.DragWindow();
 }
Exemple #2
0
        private static Color32 getCellColor(int layer, Cell cell)
        {
            double?deposit  = 0;
            double deposit2 = 0;

            switch (resource.Resource)
            {
            case "Temperature":
                deposit = PD.LiveMap[layer][cell].temperature;
                break;

            case "Pressure":
                deposit = PD.LiveMap[layer][cell].pressure;
                break;

            case "Wind H Speed":
                deposit = WeatherFunctions.GetCellwindH(PD.index, layer, cell);
                break;

            case "Wind H Vector":
                //deposit = WeatherFunctions.GetCellwindDir(PD.index, layer, cell);
                deposit  = PD.LiveMap[layer][cell].windVector.x;
                deposit2 = PD.LiveMap[layer][cell].windVector.z;
                break;

            case "Wind Vertical":
                deposit = WeatherFunctions.GetCellwindV(PD.index, layer, cell);     // PD.LiveMap[layer][cell].windVector.y);
                break;

            case "Rel. Humidity":
                deposit = PD.LiveMap[layer][cell].relativeHumidity;
                break;

            case "Cloud water":
                deposit  = PD.LiveMap[layer][cell].cloud.getwaterContent();
                deposit2 = WeatherFunctions.GetSunriseFactor(PD.index, cell);
                break;

            case "Geodesy":
                // deposit = cell.Position.magnitude;
                deposit = Math.Sqrt(cell.Position.x * cell.Position.x + cell.Position.y * cell.Position.y + cell.Position.z * cell.Position.z);
                break;

            case "DeltaDistanceDiff":
                double DDD  = 0.0;
                double DDD2 = 0.0;
                int    n    = 0;
                foreach (Cell neighbor in cell.GetNeighbors(PD.gridLevel))
                {
                    double DeltaDistance = WeatherFunctions.GetDistanceBetweenCells(PD.index, cell, neighbor, WeatherFunctions.GetCellAltitude(PD.index, layer, cell));
                    DDD  += DeltaDistance;
                    DDD2 += DeltaDistance * DeltaDistance;
                    n++;
                }
                DDD    /= n;
                DDD2   /= n;
                deposit = Math.Sqrt(Math.Abs(DDD2 - DDD * DDD)) / DDD;
                break;

            case "Delta Temp":
                deposit = (WeatherSimulator.GetInitTemperature(PD, currentLayer, cell) - WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell));
                break;
            }

            var scanned = true;
            var color   = (revealAll ? deposit != null : scanned) ? getDepositColor(resource, deposit, deposit2) : colorUnknown;

            return(color);
        }