当前位置: 首页>>代码示例>>C#>>正文


C# TimeSeries.timeForItem方法代码示例

本文整理汇总了C#中TimeSeries.timeForItem方法的典型用法代码示例。如果您正苦于以下问题:C# TimeSeries.timeForItem方法的具体用法?C# TimeSeries.timeForItem怎么用?C# TimeSeries.timeForItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeSeries的用法示例。


在下文中一共展示了TimeSeries.timeForItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FromTimeSeries

        public static TimeSeriesComplexType FromTimeSeries(TimeSeries ts,string forcedTimeStamp)
        {
            TimeSeriesComplexType result = new TimeSeriesComplexType( );

            string locationName = LocationName(ts.name);
            result.header = new HeaderComplexType
                {
                    type = timeSeriesType.mean,
                    locationId = locationName,
                    //stationName = locationName,
                    startDate = new DateTimeComplexType {DateTime = MergeDT(ts.Start,forcedTimeStamp)},
                    endDate = new DateTimeComplexType {DateTime = MergeDT(ts.End,forcedTimeStamp)},
                    missVal = ts.NullValue,
                    units = PIUnits(ts),
                    timeStep = PITimeStep(ts.timeStep),
                    parameterId = ParameterName(ts.name)
                };

            IList<EventComplexType> events = new List<EventComplexType>();
            for (int i = 0; i < ts.count(); i++)
            {
                var fewsDT = new DateTimeComplexType {DateTime = MergeDT(ts.timeForItem(i),forcedTimeStamp)};
                events.Add( new EventComplexType
                    {
                        date = fewsDT.date,
                        time = fewsDT.time,
                        flag = 2,
                        flagSpecified = true,
                        value = ts[i]
                    });
            }

            [email protected] = events.ToArray();
            return result;
        }
开发者ID:eWaterTest,项目名称:SourceFEWSAdapter,代码行数:35,代码来源:TIMEProxy.cs

示例2: SimpleTimeSeries

        public SimpleTimeSeries(TimeSeries source):base(source)
        {
            if (source == null)
            {
                Events = new TimeSeriesEvent[0];
                return;
            }

            IList<TimeSeriesEvent> eventList = new List<TimeSeriesEvent>();
            for (int i = 0; i < source.count(); i++)
                eventList.Add(new TimeSeriesEvent
                    {
                        Date = source.timeForItem(i).ToString(CultureInfo.InvariantCulture),
                        Value = source[i]
                    });

            Events = eventList.ToArray();
        }
开发者ID:flowmatters,项目名称:Veneer,代码行数:18,代码来源:SimpleTimeSeries.cs


注:本文中的TimeSeries.timeForItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。