/// <summary>
        /// Fills the data type column according to the type of structure selected,
        /// the ID of that structure, and the interval that is selected. </summary>
        /// <param name="row"> the row of the data type column that is being dealt with </param>
        /// <param name="outputOnly"> whether to only display OUTPUT data types. </param>
        /// <param name="station_type"> the type of the station (column _COL_STATION_TYPE) </param>
        /// <param name="id"> the ID of the station (column _COL_ID) </param>
        /// <param name="interval_string"> the data interval (column _COL_INTERVAL ) </param>
        public virtual void fillDataTypeColumn(int row, bool outputOnly, string station_type, string id, string interval_string)
        {
            System.Collections.IList dataTypes = new List <object>();
            int interval = TimeInterval.MONTH;

            if (interval_string.Equals("Day", StringComparison.OrdinalIgnoreCase))
            {
                interval = TimeInterval.DAY;
            }

            if (station_type.Equals(StateMod_Util.STATION_TYPE_DIVERSION, StringComparison.OrdinalIgnoreCase))
            {
                dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_DIVERSION_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
            }
            else if (station_type.Equals(StateMod_Util.STATION_TYPE_INSTREAM_FLOW, StringComparison.OrdinalIgnoreCase))
            {
                dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_INSTREAM_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
            }
            else if (station_type.Equals(StateMod_Util.STATION_TYPE_RESERVOIR, StringComparison.OrdinalIgnoreCase))
            {
                if (outputOnly)
                {
                    dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_RESERVOIR_STATIONS, id, __dataset, "", interval, false, false, true, true, false, true);
                }
                else
                {
                    dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_RESERVOIR_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
                }
            }
            else if (station_type.Equals(StateMod_Util.STATION_TYPE_STREAMGAGE, StringComparison.OrdinalIgnoreCase))
            {
                dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_STREAMGAGE_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
            }
            else if (station_type.Equals(StateMod_Util.STATION_TYPE_STREAMESTIMATE, StringComparison.OrdinalIgnoreCase))
            {
                dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_STREAMESTIMATE_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
            }
            else if (station_type.Equals(StateMod_Util.STATION_TYPE_WELL, StringComparison.OrdinalIgnoreCase))
            {
                dataTypes = StateMod_Util.getTimeSeriesDataTypes(StateMod_DataSet.COMP_WELL_STATIONS, id, __dataset, "", interval, true, true, true, true, false, true);
            }

            if (__worksheet != null)
            {
                __worksheet.setCellSpecificJComboBoxValues(row, _COL_DATA_TYPE, dataTypes);
                System.Collections.IList v = __worksheet.getCellSpecificJComboBoxValues(row, _COL_DATA_TYPE);
                string s = null;
                if (v == null || v.Count == 0)
                {
                    s = "";
                }
                else
                {
                    s = (string)v[0];
                }
                setInternalValueAt(s, row, _COL_DATA_TYPE);
            }
        }
예제 #2
0
        /// <summary>
        /// Fills the parameter column in the given row based on the station type selected for that row. </summary>
        /// <param name="row"> the row for which to fill the parameter column. </param>
        /// <param name="type"> the type of the station in the given row. </param>
        public virtual void fillParameterColumn(int row, string type)
        {
            IList <string> datatypes = new List <string>();

            // Get the model output data types (no input since SmDelta deals with output).
            if (type.Equals("Diversion", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.DIVERSION_TYPE, false);
            }
            else if (type.Equals("Instream flow", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.INSTREAM_TYPE, false);
            }
            else if (type.Equals("Reservoir", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.RESERVOIR_TYPE, false);
            }
            else if (type.Equals("Streamflow", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.STREAM_TYPE, false);
            }
            else if (type.Equals("Well", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.WELL_TYPE, false);
            }
            else if (type.Equals("Stream ID (0* Gages)", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.STREAM_TYPE, false);
            }

            IList <string> finalTypes = new List <string>();

            finalTypes.Add("");

            for (int i = 0; i < datatypes.Count; i++)
            {
                // FIXME SAM 2008-03-20 No need to remove underscores for newer versions of StateMod, right?.
                // Use data types from binary file.
                //finalTypes.add(((String)datatypes.elementAt(i)).replace('_', ' '));
                finalTypes.Add(datatypes[i]);
            }

            if (__worksheet != null)
            {
                //System.out.println("Setting cell-specific stuff");
                __worksheet.setCellSpecificJComboBoxValues(row, COL_PARM, finalTypes);
            }
        }
예제 #3
0
        /// <summary>
        /// Fills the ID column based on the kind of structure selected. </summary>
        /// <param name="row"> the row of the ID column being dealt with </param>
        /// <param name="type"> the type of structure selected (column 1) </param>
        public virtual void fillIDColumn(int row, string type)
        {
            System.Collections.IList ids = new List <object>();
            if (type.Equals("Diversion", StringComparison.OrdinalIgnoreCase))
            {
                ids = __diversionIDs;
            }
            else if (type.Equals("Instream flow", StringComparison.OrdinalIgnoreCase))
            {
                ids = __instreamFlowIDs;
            }
            else if (type.Equals("Reservoir", StringComparison.OrdinalIgnoreCase))
            {
                ids = __reservoirIDs;
            }
            else if (type.Equals("Streamflow", StringComparison.OrdinalIgnoreCase))
            {
                ids = __streamIDs;
            }
            else if (type.Equals("Well", StringComparison.OrdinalIgnoreCase))
            {
                ids = __wellIDs;
            }
            else if (type.Equals("Other", StringComparison.OrdinalIgnoreCase))
            {
                ids = __otherIDs;
            }
            else if (type.Equals("INS", StringComparison.OrdinalIgnoreCase))
            {
                ids = __instreamFlowIDs;
            }
            else if (type.Equals("DIV", StringComparison.OrdinalIgnoreCase))
            {
                ids = __diversionIDs;
            }
            else if (type.Equals("RES", StringComparison.OrdinalIgnoreCase))
            {
                ids = __reservoirIDs;
            }
            else if (type.Equals("STR", StringComparison.OrdinalIgnoreCase))
            {
                ids = __streamIDs;
            }
            else if (type.Equals("WEL", StringComparison.OrdinalIgnoreCase))
            {
                ids = __wellIDs;
            }
            else
            {
                ids = __otherIDs;
            }


            if (__worksheet != null)
            {
                __worksheet.setCellSpecificJComboBoxValues(row, 1, ids);
            }
        }