...
Code Block | ||||
---|---|---|---|---|
| ||||
public void Initialize(System.Collections.Hashtable properties) { _inputExchangeItems = new ArrayList(); _outputExchangeItems = new ArrayList(); // -- Create and initialize the engine -- _simpleRiverEngine = new SimpleRiverEngineDotNetAccess(); if (properties["FilePath"].ToString().Length > 1) { _simpleRiverEngine.Initialize(properties["FilePath"].ToString()); } else { string currentDir = System.IO.Directory.GetCurrentDirectory(); _simpleRiverEngine.Initialize(currentDir); } // -- Time horizon -- char [] delimiter = new char[]{'-',' ',':'}; string[] strings = _simpleRiverEngine.GetSimulationStartDate().Split(delimiter); int StartYear = Convert.ToInt32(strings[0]); int StartMonth = Convert.ToInt32(strings[1]); int StartDay = Convert.ToInt32(strings[2]); int StartHour = Convert.ToInt32(strings[3]); int StartMinute = Convert.ToInt32(strings[4]); int StartSecond = Convert.ToInt32(strings[5]); DateTime startDate = new DateTime(StartYear,StartMonth,StartDay,StartHour,StartMinute,StartSecond); _simulationStartTime = Oatc.OpenMI.Sdk.DevelopmentSupport.CalendarConverter.Gregorian2ModifiedJulian(startDate); // -- Build exchange items --- Dimension flowDimension = new Dimension(); Unit flowUnit = new Unit("m3/sec",1,0,"m3/sec"); Quantity flowQuantity = new Quantity(flowUnit,"description","Flow",global::OpenMI.Standard.ValueType.Scalar,flowDimension); Quantity inFlowQuantity = new Quantity(flowUnit,"description","InFlow",global::OpenMI.Standard.ValueType.Scalar,flowDimension); } |
...