public IEnumerable <DataPointDTO> GetDataSet(IStationData stationData, string[] dataTypes, DateTime start, DateTime end) { DataPointDTO GetData(DateTime date) { var dataAdapter = new DataPointDTOAdapter(date, this._mapper); foreach (var dt in dataTypes) { dataAdapter.AddData(dt, this.GetConvertedData(stationData, dt, date)); } return(dataAdapter.ToDTO()); } var currentDate = start; do { var dataPoint = GetData(currentDate); if (dataPoint.Data.Any()) { yield return(GetData(currentDate)); } } while (currentDate.TryAddDays(1, out currentDate)); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="stationData">計算機で使用するステーション情報</param> public StationSummaryViewModel(IStationData stationData) { Workforce = stationData.Settings.Workforce; // 労働力関係初期化 { _WorkForceModuleInfoModel = new WorkForceModuleInfoModel(stationData.ModulesInfo, stationData.Settings); } { _NeedWareInfoModel = new NeedWareInfoModel(stationData.ModulesInfo, stationData.ProductsInfo); WorkforceNeedWareCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(_NeedWareInfoModel.NeedWareInfoDetails); WorkforceNeedWareCollectionView.SortDescriptions.Clear(); WorkforceNeedWareCollectionView.SortDescriptions.Add(new SortDescription(nameof(NeedWareInfoDetailsItem.Method), ListSortDirection.Ascending)); WorkforceNeedWareCollectionView.SortDescriptions.Add(new SortDescription(nameof(NeedWareInfoDetailsItem.WareName), ListSortDirection.Ascending)); WorkforceNeedWareCollectionView.GroupDescriptions.Clear(); WorkforceNeedWareCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(NeedWareInfoDetailsItem.Method))); } // 損益関係初期化 { _ProfitModel = new ProfitModel(stationData.ProductsInfo); _ProfitModel.PropertyChanged += ProfitModel_PropertyChanged; } // 建造コスト関係初期化 { _BuildingCostModel = new BuildingCostModel(stationData.BuildResourcesInfo); _BuildingCostModel.PropertyChanged += BuildingCostModel_PropertyChanged; } }
protected float?GetConvertedData(IStationData stationData, string dataType, DateTime date) { var data = stationData.GetData(dataType, date); return((data != int.MinValue) ? (float?)this._dataConverters.GetValueOrDefault(dataType, this._noConversionRule).ConvertDataPoint(data) : null); }
public ItemOptions(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IStationData stationData) { /* * IBtwTypeData btwTypeData = DependencyResolver.Current.GetService<IBtwTypeData>(); * ICatagoryData catagoryData = DependencyResolver.Current.GetService<ICatagoryData>(); * IStationData stationData = DependencyResolver.Current.GetService<IStationData>(); */ BtwTypes = btwTypeData.GetAll(); Catagories = catagoryData.GetAll(); Stations = stationData.GetAll(); }
public ItemEdit(IBtwTypeData btwTypeData, ICatagoryData catagoryData, IStationData stationData, Item itemToEdit = null) { if (itemToEdit == null) { ActiveItem = new Item(); } else { ActiveItem = itemToEdit; } Options = new ItemOptions(btwTypeData, catagoryData, stationData); }
public RingoService( IConfiguration configuration, IUserData channelUserData, IStationData stationData, ILogger <RingoService> logger ) { _config = configuration; _userData = channelUserData; _stationData = stationData; _logger = logger; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="stationData">計算機で使用するステーション情報</param> public StoragesGridViewModel(IStationData stationData) { _Model = new StoragesGridModel(stationData.ModulesInfo, stationData.StoragesInfo); SetSelectedExpandedCommand = new DelegateCommand <bool?>(SetSelectedExpanded); }
public IEnumerable <DataPointDTO> GetDataSet(IStationData stationData, string dataType, DateTime start, DateTime end) { return(this.GetDataSet(stationData, dataType.MakeArray(), start, end)); }