using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using IStation.Model.Api;
using IStation.ViewModel;
using AutoMapper;
using System.IO;
using Microsoft.Web.Http;
namespace IStation.WebApi.Controllers.OpenApi
{
///
/// 给原水的
///
[RoutePrefix("OpenApi/DispatchAna/SHYS")]
[ApiVersion("OpenApi")]
public class ShysDispatchAnaController : ApiController
{
#region 计算保持的方案
///
/// 计算保持的方案
///
[Route("CalcuKeepDispatch")]
[HttpPost]
public IStation.Dto.SHYS.AnaScheme CalcuKeepDispatch(IStation.Dto.SHYS.DispatchStationEx dispatch)
{
//if(dispatch.type)
return IStation.WebApi.Controllers.OpenApi.DispatchAnaCalcHelper.Station长兴岛(dispatch );
}
#endregion
///
/// 根据流量扬程计算(简易)
///
/// 青草沙输水泵房
///
///
/// 排序方式
/// 方案数据
///
//[Route("SimpleCalcByFlowHead")]
//[HttpGet]
//public Result SimpleCalcByFlowHead(string StationName, double Flow, double Head, int SortType, int Number)
//{
// long StationID = 51;//青草沙输水泵站(要根据入参判断泵站ID)
// SortType = 0;
// IStation.WebApi.DispatchAnaHelper helper = new IStation.WebApi.DispatchAnaHelper();
// helper.InitialParas(StationID, Flow, Head, null, null);
// DispatchAnaHelper.eSortType sortType = DispatchAnaHelper.eSortType.功率;
// if (SortType == 0 || SortType == 1)
// sortType = (DispatchAnaHelper.eSortType)SortType;
// var items = helper.CalcProject(sortType, Number);
// if (items == null || items.Count() == 0)
// {
// return new Result(IStation.Model.Api.Code.Alert, "未找到任何组合符合当前参数");
// }
// else
// {
// return new Result>(items);
// }
//}
#region 测试接口
///
/// 根据流量扬程计算(测试)
///
/*[Route("CeShi")]
[HttpPost]
public Result CeShi(double Flow1, double Flow2, double Press1, double Press2, double Level, int Status)
{
var q = Flow2 + Flow1;
var h = (Press1 + Press2) / 2;
h = MPaToM(h);
var helper = new DispatchAnaHelper();
if (!helper.InitialParas(4, 2, q, h, "", ""))
{
return new Result("初始化失败!");
}
var list = helper.CalcProject(DispatchAnaHelper.eSortType.流量差值, 10);
return new Result>(list);
}*/
#endregion
}
}