| | |
| | | /// <returns></returns> |
| | | protected IStation.CalcModel.AnaPrj ToAnaPrj(BlockItemList opt_bundle) |
| | | { |
| | | LogHelper.Info(_startOpenPumpCount.ToString()); |
| | | LogHelper.Info(JsonHelper.Object2Json(_startOpenPumpArray)); |
| | | |
| | | if (this._startOpenPumpCount == -1 || _startOpenPumpArray == null) |
| | | {//ä¸ç¥éå¼å§çç¶æ |
| | | return ToAnaPrjæªç¥å¼å§ç¶æ(opt_bundle); |
| | |
| | | #region å¤ç第ä¸ä¸ª |
| | | |
| | | int block_id = 0; |
| | | if (first_open_block_time_item.StartIndx > 1) |
| | | if (first_open_block_time_item.StartIndx > 1 ) |
| | | {//å¼å§æ¶å°±å
³æº |
| | | block_id++; |
| | | var bt1 = BuildAnaPrjBlockTime(block_id, 0, 0, first_open_block_time_item.StartIndx, |
| | |
| | | var pumpSwitchList = new List<AnaPrjSwitchInfo>(); |
| | | var first_block_item = all_time_block.First(); |
| | | int switch_group_id = 1; |
| | | //å¼å§ç¶æ |
| | | //IStation.LogHelper.Info("_startOpenPumpArray:"+_startOpenPumpArray + ",first_block_item.OpenPumpCount:" + first_block_item.OpenPumpCount); |
| | | if (BuildSwitchPumpIndexArray(ref pumpSwitchList, switch_group_id, ref first_block_item, this._startOpenPumpArray)) |
| | | { |
| | | switch_group_id++; |
| | |
| | | switch_group_id++; |
| | | } |
| | | } |
| | | |
| | | // |
| | | switch_group_id++; |
| | | BuildSwitchPumpIndexArray4Finish(ref pumpSwitchList, switch_group_id, all_time_block.Last()); |
| | | #region 计ç®å
·ä½æ¶é´, ä¿è¯æ¶é´é´é, èèé¡ºåº |
| | | |
| | | var max_switch_group_id = switch_group_id; |
| | |
| | | //ç»ææ¶çæ³µå
è®¸ç¶æ |
| | | opt_prj.EndTimeOpenPumpStatus = all_time_block.Last().OpenPumpIndexs; |
| | | |
| | | IStation.LogHelper.Info("pumpSwitchList count:" + pumpSwitchList.Count); |
| | | //IStation.LogHelper.Info("pumpSwitchList count:" + pumpSwitchList.Count); |
| | | |
| | | opt_prj.PumpSwitchs = pumpSwitchList; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | private bool BuildSwitchPumpIndexArray4Finish( |
| | | ref List<AnaPrjSwitchInfo> sw_list, |
| | | int switch_group_id, |
| | | AnaPrjBlockTime current_block_time_item |
| | | ) |
| | | { |
| | | if (current_block_time_item.EndTimeIndex < this._timeList.Count -2) |
| | | return false ; |
| | | |
| | | if (current_block_time_item.OpenPumpCount == 0) |
| | | {//表示ä¸ç¨åæ³µ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | var lastOpenPumpIndexs = current_block_time_item.OpenPumpIndexs; |
| | | if (lastOpenPumpIndexs == null || lastOpenPumpIndexs.Count() == 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | foreach (var idx in IStation.AnaGlobalParas.Setting.OptimalPumpIndexSequence) |
| | | { |
| | | if (!lastOpenPumpIndexs.Contains(idx)) |
| | | continue;//忥齿²¡å¼, å°±ä¸ç¨èè |
| | | |
| | | current_block_time_item.EndSwitchGroupID = switch_group_id; |
| | | |
| | | sw_list.Add(new AnaPrjSwitchInfo() |
| | | { |
| | | GroupID = switch_group_id, |
| | | SwitchType = 0,//å
³é |
| | | Time = current_block_time_item.EndTime, |
| | | PumpIndex = idx |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | return true; |
| | | |
| | | } |
| | | private AnaPrjBlockTime BuildAnaPrjBlockTime(int block_id, int open_pump_count, |
| | | int start_indx, int end_index, |
| | | double reservoir_start_height, double reservoir_end_height) |