コード例 #1
0
        /// <summary>
        /// Return the downstream data set object by searching appropriate dataset lists. </summary>
        /// <param name="dataset"> the full dataset from which the destination should be extracted </param>
        public virtual StateMod_Data lookupDownstreamDataObject(StateMod_DataSet dataset)
        {
            string downstreamID = getIfrrdn();

            StateMod_OperationalRight_Metadata_SourceOrDestinationType[] downstreamTypes = new StateMod_OperationalRight_Metadata_SourceOrDestinationType[] { StateMod_OperationalRight_Metadata_SourceOrDestinationType.RIVER_NODE };
            IList <StateMod_Data> smdataList = new List <StateMod_Data>();

            for (int i = 0; i < downstreamTypes.Length; i++)
            {
                ((IList <StateMod_Data>)smdataList).AddRange(StateMod_Util.getDataList(downstreamTypes[i], dataset, downstreamID, true));
                if (smdataList.Count > 0)
                {
                    break;
                }
            }
            if (smdataList.Count == 1)
            {
                return(smdataList[0]);
            }
            else if (smdataList.Count == 0)
            {
                return(null);
            }
            else
            {
                throw new Exception("" + smdataList.Count + " data objects returned matching downstream \"" + downstreamID + "\" for instream flow \"" + getID() + " - one is expected.");
            }
        }
コード例 #2
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="plan"> the plan for which to display return information. </param>
        /// <param name="editable"> whether the gui data is editable or not. </param>
        public StateMod_Plan_Return_JFrame(StateMod_DataSet dataset, StateMod_Plan plan, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, plan.getName() + " - Plan Return Flow Table Assignment", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentPlan = plan;
            IList <StateMod_ReturnFlow> allReturns = (IList <StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_PLAN_RETURN).getData();

            __currentPlanReturnList = (IList <StateMod_ReturnFlow>)StateMod_Util.getDataList(allReturns, plan.getID());
            Message.printStatus(2, "", "Have " + __currentPlanReturnList.Count + " return records for plan \"" + __currentPlan.getID() + "\" uniquetempvar.");
            __dataset = dataset;
            // TODO SAM 2011-01-02 For now editing is disabled...
            editable   = false;
            __editable = editable;
            setupGUI();
        }
コード例 #3
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="res"> the Reservoir for which to display return information. </param>
        /// <param name="editable"> whether the gui data is editable or not. </param>
        public StateMod_Reservoir_Return_JFrame(StateMod_DataSet dataset, StateMod_Reservoir res, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, res.getName() + " - Reservoir Return Flow Table Assignment", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentRes = res;
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_ReturnFlow> allReturns = (java.util.List<StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_RETURN).getData();
            IList <StateMod_ReturnFlow> allReturns = (IList <StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_RETURN).getData();

            __currentResReturnList = (IList <StateMod_ReturnFlow>)StateMod_Util.getDataList(allReturns, res.getID());
            Message.printStatus(2, "", "Have " + __currentResReturnList.Count + " return records for reservoir \"" + __currentRes.getID() + "\" uniquetempvar.");
            //__dataset = dataset;
            // TODO SAM 2011-01-02 For now editing is disabled...
            editable   = false;
            __editable = editable;
            setupGUI();
        }