已重命名4个文件
已修改11个文件
已添加9个文件
| | |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IStation.WebApi.Core", "WebApi\IStation.WebApi.Core\IStation.WebApi.Core.csproj", "{8077F0D3-3FCC-44BF-8AB3-DF1A105CC798}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IStation.Algorithm", "Schedule\IStation.Algorithm\IStation.Algorithm.csproj", "{FAE82C28-80D5-4D50-93DC-CDBCF697793F}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | | Debug|Any CPU = Debug|Any CPU |
| | |
| | | {8077F0D3-3FCC-44BF-8AB3-DF1A105CC798}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {8077F0D3-3FCC-44BF-8AB3-DF1A105CC798}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {8077F0D3-3FCC-44BF-8AB3-DF1A105CC798}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {FAE82C28-80D5-4D50-93DC-CDBCF697793F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {FAE82C28-80D5-4D50-93DC-CDBCF697793F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {FAE82C28-80D5-4D50-93DC-CDBCF697793F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {FAE82C28-80D5-4D50-93DC-CDBCF697793F}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | |
| | | DAL.ScheduleAnaLog _dalAnaLog = new DAL.ScheduleAnaLog(); |
| | | |
| | | |
| | | /* private List<int> _combineFlags1 = new List<int>() { 11, 12, 13, 14, 16, 17, 18 }; |
| | | private List<int> _combineFlags2 = new List<int>() { 15 };*/ |
| | | public OptimalCombine AnaOptimalCombine(List<Pump> pumps, List<int> flags_part1, List<int> flags_part2, double target_flow, double target_head, List<int> current_open_pump_flags, List<int> must_open_pump_flags, List<int> must_not_open_pump_flags) |
| | | { |
| | | if (pumps == null || !pumps.Any()) |
| | | { |
| | | return default; |
| | | } |
| | | target_flow = Math.Round(target_flow, 1); |
| | | target_head = Math.Round(target_head, 1); |
| | | |
| | | #region åå¨-å½å弿³µå表 |
| | | |
| | | var exist_current_open_pump_flags = current_open_pump_flags != null && current_open_pump_flags.Count > 0; |
| | | |
| | | #endregion |
| | | |
| | | #region åå¨-å¿
弿³µå表 |
| | | |
| | | var must_open_pump_flags_remark = string.Empty; |
| | | var exist_must_open_pump_flags = must_open_pump_flags != null && must_open_pump_flags.Count > 0; |
| | | if (exist_must_open_pump_flags) |
| | | { |
| | | must_open_pump_flags = must_open_pump_flags.OrderBy(x => x).ToList(); |
| | | must_open_pump_flags_remark = IntListHelper.ToString(must_open_pump_flags); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region åå¨-å¿
ä¸è½å¼æ³µå表 |
| | | |
| | | var exist_must_not_open_pump_flags = must_not_open_pump_flags != null && must_not_open_pump_flags.Count > 0; |
| | | |
| | | #endregion |
| | | |
| | | var pump_flag_list = pumps.Select(x => x.ID).ToList(); |
| | | var optimal_combine_list = new List<OptimalCombine>(); |
| | | for (int pumpCount = 1; pumpCount <= pumps.Count; pumpCount++) |
| | | { |
| | | if (pumpCount == 1) |
| | | { |
| | | var max_total_flow = pumps.Max(x => x.Qr); |
| | | if (max_total_flow < target_flow) |
| | | continue; |
| | | } |
| | | var combine_list = PermutationAndCombination<int>.GetCombination(pump_flag_list.ToArray(), pumpCount);//æåç»å |
| | | foreach (var combine in combine_list) |
| | | { |
| | | double combine_merit_ratio = 1;//ç»åæ©ä¼ç |
| | | if (exist_must_open_pump_flags) |
| | | { |
| | | var combine_remark = IntListHelper.ToString(combine.OrderBy(x => x)); |
| | | if (!combine_remark.Contains(must_open_pump_flags_remark)) |
| | | continue; |
| | | } |
| | | if (exist_must_not_open_pump_flags) |
| | | { |
| | | var exist_intersected = combine.Intersect(must_not_open_pump_flags).Count() > 0; |
| | | if (exist_intersected) |
| | | continue; |
| | | } |
| | | |
| | | int start_stop_count = 0;//å¯åæ°é |
| | | if (exist_current_open_pump_flags) |
| | | { |
| | | var start_pump_count = combine.Except(current_open_pump_flags).Count(); |
| | | var close_pump_count = current_open_pump_flags.Except(combine).Count(); |
| | | start_stop_count = start_pump_count + close_pump_count;//å¯åæ°é |
| | | } |
| | | else |
| | | { |
| | | start_stop_count = combine.Count(); |
| | | if (exist_must_open_pump_flags) |
| | | { |
| | | start_stop_count = combine.Except(must_open_pump_flags).Count(); |
| | | } |
| | | } |
| | | var total_loss_ratio = Math.Pow(_start_stop_loss_coefficient, start_stop_count);//å¯å䏿¬¡æå¤±äºè½è |
| | | combine_merit_ratio *= total_loss_ratio; |
| | | |
| | | List<int> combine_flag_list_part1 = new List<int>(); |
| | | List<int> combine_flag_list_part2 = new List<int>(); |
| | | foreach (var pump in combine) |
| | | { |
| | | if (flags_part1.Contains(pump)) |
| | | { |
| | | combine_flag_list_part1.Add(pump); |
| | | } |
| | | else |
| | | { |
| | | combine_flag_list_part2.Add(pump); |
| | | } |
| | | } |
| | | |
| | | //åºåååå·æ³µ |
| | | List<FreCombine> fre_combine_list_part1 = new List<FreCombine>(); |
| | | List<FreCombine> fre_combine_list_part2 = new List<FreCombine>(); |
| | | |
| | | if (combine_flag_list_part1.Count > 0) |
| | | { |
| | | var conclusion_list_dic = new Dictionary<int, List<Entity.ScheduleConclusion>>(); |
| | | foreach (var flag in combine_flag_list_part1) |
| | | { |
| | | var runFlag = GetGFlag(flag); |
| | | if (conclusion_list_dic.ContainsKey(flag)) |
| | | continue; |
| | | var conclusionList = _dalScheduleConclusion.GetList(runFlag, target_head); |
| | | conclusion_list_dic[flag] = conclusionList; |
| | | } |
| | | |
| | | if (conclusion_list_dic.Count < 1) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | for (decimal fre = _frequency_max; fre >= _frequency_min; fre -= _frequency_space) |
| | | { |
| | | var freCombine = new FreCombine(); |
| | | freCombine.Frequency = (double)fre; |
| | | freCombine.Flags = new List<int>(); |
| | | foreach (var item in conclusion_list_dic) |
| | | { |
| | | var conclusion = item.Value.Find(x => x.Pump1 == (double)fre); |
| | | if (conclusion != null) |
| | | { |
| | | freCombine.Flags.Add(item.Key); |
| | | freCombine.Flow += conclusion.Flow; |
| | | freCombine.Power += conclusion.Power; |
| | | freCombine.RunCount++; |
| | | } |
| | | } |
| | | if (freCombine.Flags.Count < 1) |
| | | continue; |
| | | fre_combine_list_part1.Add(freCombine); |
| | | } |
| | | } |
| | | if (combine_flag_list_part2.Count > 0) |
| | | { |
| | | var conclusion_list_dic = new Dictionary<int, List<Entity.ScheduleConclusion>>(); |
| | | foreach (var flag in combine_flag_list_part2) |
| | | { |
| | | var runFlag = GetGFlag(flag); |
| | | if (conclusion_list_dic.ContainsKey(flag)) |
| | | continue; |
| | | var conclusionList = _dalScheduleConclusion.GetList(runFlag, target_head); |
| | | conclusion_list_dic[flag] = conclusionList; |
| | | } |
| | | |
| | | if (conclusion_list_dic.Count < 1) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | for (decimal fre = _frequency_max; fre >= _frequency_min; fre -= _frequency_space) |
| | | { |
| | | var freCombine = new FreCombine(); |
| | | freCombine.Frequency = (double)fre; |
| | | freCombine.Flags = new List<int>(); |
| | | foreach (var item in conclusion_list_dic) |
| | | { |
| | | var conclusion = item.Value.Find(x => x.Pump1 == (double)fre); |
| | | if (conclusion != null) |
| | | { |
| | | freCombine.Flags.Add(item.Key); |
| | | freCombine.Flow += conclusion.Flow; |
| | | freCombine.Power += conclusion.Power; |
| | | freCombine.RunCount++; |
| | | } |
| | | } |
| | | if (freCombine.Flags.Count < 1) |
| | | continue; |
| | | fre_combine_list_part2.Add(freCombine); |
| | | } |
| | | } |
| | | |
| | | if (fre_combine_list_part1.Count == 0 && fre_combine_list_part2.Count == 0) |
| | | continue; |
| | | |
| | | double total_flow_deviation = target_flow;//æ»æµéåå·® |
| | | double total_power = double.MaxValue;//æ»åç |
| | | double total_flow = double.MaxValue;//æ»æµé |
| | | |
| | | FreCombine optimal_combine_part1 = null; |
| | | FreCombine optimal_combine_part2 = null; |
| | | if (fre_combine_list_part1.Count < 1 || fre_combine_list_part2.Count < 1) |
| | | { |
| | | if (fre_combine_list_part1.Count < 1) |
| | | { |
| | | fre_combine_list_part1 = fre_combine_list_part2; |
| | | } |
| | | for (int Index_part1 = 0; Index_part1 < fre_combine_list_part1.Count; Index_part1++) |
| | | { |
| | | var fre_combine1 = fre_combine_list_part1[Index_part1]; |
| | | var current_flow = fre_combine1.Flow; |
| | | var current_power = fre_combine1.Power; |
| | | |
| | | var diff_flow = Math.Abs(current_flow - target_flow); |
| | | if (diff_flow < total_flow_deviation) |
| | | { |
| | | optimal_combine_part1 = fre_combine1; |
| | | total_power = fre_combine1.Power; |
| | | total_flow = current_flow; |
| | | total_flow_deviation = diff_flow; |
| | | } |
| | | |
| | | if (diff_flow < target_flow * 0.01 && current_power < total_power) |
| | | { |
| | | optimal_combine_part1 = fre_combine1; |
| | | total_power = fre_combine1.Power; |
| | | total_flow = current_flow; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int Index_part1 = 0; Index_part1 < fre_combine_list_part1.Count; Index_part1++) |
| | | { |
| | | for (int Index_part2 = 0; Index_part2 < fre_combine_list_part2.Count; Index_part2++) |
| | | { |
| | | var fre_combine1 = fre_combine_list_part1[Index_part1]; |
| | | var fre_combine2 = fre_combine_list_part2[Index_part2]; |
| | | |
| | | var current_flow = fre_combine1.Flow + fre_combine2.Flow; |
| | | var current_power = fre_combine1.Power + fre_combine2.Power; |
| | | |
| | | var diff_flow = Math.Abs(current_flow - target_flow); |
| | | if (diff_flow < total_flow_deviation) |
| | | { |
| | | optimal_combine_part1 = fre_combine1; |
| | | optimal_combine_part2 = fre_combine2; |
| | | total_power = fre_combine1.Power + fre_combine2.Power; |
| | | total_flow = current_flow; |
| | | total_flow_deviation = diff_flow; |
| | | } |
| | | |
| | | if (diff_flow < target_flow * 0.01 && current_power < total_power) |
| | | { |
| | | optimal_combine_part1 = fre_combine1; |
| | | optimal_combine_part2 = fre_combine2; |
| | | total_power = fre_combine1.Power + fre_combine2.Power; |
| | | total_flow = current_flow; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (optimal_combine_part1 == null && optimal_combine_part2 == null) |
| | | continue; |
| | | |
| | | var total_flow_deviation_ratio = Math.Abs((1 - Math.Abs((total_flow / target_flow)))); |
| | | if (total_flow_deviation_ratio > _sel_opt_flow_deviation_ratio) |
| | | continue; |
| | | if (total_flow_deviation_ratio > _sel_opt_reasonable_flow_deviation_ratio) |
| | | { |
| | | combine_merit_ratio -= total_flow_deviation_ratio; |
| | | } |
| | | |
| | | |
| | | #region åææä¼ç»åæ¹æ¡ |
| | | |
| | | var optimal_combine = new OptimalCombine(); |
| | | optimal_combine.Combines = new List<FreCombine>(); |
| | | optimal_combine.Flags = new List<int>(); |
| | | if (optimal_combine_part1 != null) |
| | | { |
| | | optimal_combine.Combines.Add(optimal_combine_part1); |
| | | optimal_combine.Flags.AddRange(optimal_combine_part1.Flags); |
| | | } |
| | | if (optimal_combine_part2 != null) |
| | | { |
| | | optimal_combine.Combines.Add(optimal_combine_part2); |
| | | optimal_combine.Flags.AddRange(optimal_combine_part2.Flags); |
| | | } |
| | | optimal_combine.Flow = Math.Round(total_flow, 1); |
| | | optimal_combine.Power = Math.Round(total_power, 1); |
| | | optimal_combine.Flags = optimal_combine.Flags.OrderBy(x => x).ToList(); |
| | | optimal_combine.FlagCount = optimal_combine.Flags.Count; |
| | | optimal_combine.Remark = IntListHelper.ToString(optimal_combine.Flags); |
| | | |
| | | optimal_combine.MeritRatio = combine_merit_ratio; |
| | | optimal_combine.Head = Math.Round(target_head, 1); |
| | | optimal_combine_list.Add(optimal_combine); |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | |
| | | if (optimal_combine_list.Count < 1) |
| | | return default; |
| | | |
| | | optimal_combine_list = optimal_combine_list.OrderByDescending(x => x.MeritRatio).ToList(); |
| | | return optimal_combine_list.First(); |
| | | } |
| | | |
| | | |
| | | public string Ana(List<Pump> pumps, List<int> flags_part1, List<int> flags_part2, double target_flow, double target_head, List<int> current_open_pump_flags, List<int> must_open_pump_flags, List<int> must_not_open_pump_flags) |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æå
¥åææ¥å¿ |
| | | /// </summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class Log |
| | | { |
| | | /// <summary> |
| | | /// åå
¥ä¿¡æ¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="flowId"></param> |
| | | /// <param name="info"></param> |
| | | public static void Info(string flowId, string info) |
| | | { |
| | | |
| | | Yw.LogHelper.Info(GetLogInfo(flowId, info)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå
¥è°è¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="flowId"></param> |
| | | /// <param name="info"></param> |
| | | public static void Debug(s string info) |
| | | { |
| | | Yw.LogHelper.Debug(GetLogInfo(flowId, info)); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå
¥é误æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="flowId"></param> |
| | | /// <param name="info"></param> |
| | | /// <param name="ex"></param> |
| | | public static void Error(string flowId, string info, Exception ex = null) |
| | | { |
| | | Yw.LogHelper.Error(GetLogInfo(flowId, info), ex); |
| | | } |
| | | |
| | | |
| | | private static string GetLogInfo(string info) |
| | | { |
| | | return $"{flowId}:{info}"; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | /// <summary> |
| | | /// åå
¥ä¿¡æ¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="flowId"></param> |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | public static void Info(string flowId, string info) |
| | | public static void Info(string info) |
| | | { |
| | | |
| | | Yw.LogHelper.Info(GetLogInfo(flowId, info)); |
| | | Yw.LogHelper.Info(GetLogInfo(info)); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå
¥è°è¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="flowId"></param> |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | public static void Debug(string flowId, string info) |
| | | public static void Debug(string info) |
| | | { |
| | | Yw.LogHelper.Debug(GetLogInfo(flowId, info)); |
| | | Yw.LogHelper.Debug(GetLogInfo(info)); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå
¥é误æ¥å¿ |
| | | /// </summary> |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | /// <param name="ex"></param> |
| | | public static void Error(string flowId, string info, Exception ex = null) |
| | | public static void Error(string info, Exception ex = null) |
| | | { |
| | | Yw.LogHelper.Error(GetLogInfo(flowId, info), ex); |
| | | Yw.LogHelper.Error(GetLogInfo(info), ex); |
| | | } |
| | | |
| | | |
| | | private static string GetLogInfo(string flowId, string info) |
| | | private static string GetLogInfo(string info) |
| | | { |
| | | return $"{flowId}:{info}"; |
| | | return $"{info}"; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// è°åº¦æ¹æ¡ |
| | | /// </summary> |
| | | [Route("OpenApi/Dispatch/Solution")] |
| | | [ApiDescriptionSettings("Solution", Name = "éè¡è°åº¦æ¹æ¡", Order = 1)] |
| | | public class DispatchSolution_Controller : IDynamicApiController |
| | | { |
| | | |
| | | /// <summary> |
| | | /// è®¡ç® |
| | | /// </summary> |
| | | [AllowAnonymous] |
| | | [Route("Calculate@V1.0")] |
| | | [HttpPost] |
| | | public async Task<DispatchSolutionOutput> Calculate([Required] StationDispatchInput input) |
| | | { |
| | | if (input == null) |
| | | return null; |
| | | |
| | | string flowId = input.FlowId; |
| | | Log.Debug(flowId, JsonHelper.Object2Json(input)); |
| | | |
| | | var scadaInput = GetScadaDispatchInput(DateTime.Now.AddSeconds(300), DateTime.Now); |
| | | var scadaOutput = await GetRealScada(flowId, scadaInput); |
| | | if (scadaOutput == null || scadaOutput.Scadas == null) |
| | | { |
| | | Log.Info(flowId, "Scada:æ°æ®è·å失败ï¼è°åº¦ç»æ¢!"); |
| | | throw YOops.Oh(eResultCode.Error, InternalErrorCodes.L001, "Scada:æ°æ®è·å失败ï¼è°åº¦ç»æ¢!"); |
| | | } |
| | | |
| | | return TempOutHelper.GetDispatchSolutionOutput(input.FlowId); |
| | | } |
| | | |
| | | private async Task<ScadaDispatchOutput> GetRealScada(string flowId, ScadaDispatchInput input) |
| | | { |
| | | if (input == null) |
| | | { |
| | | Log.Info(flowId, "ScadaDispatchInput is null"); |
| | | return default; |
| | | } |
| | | |
| | | var ws = new ClientWebSocket(); |
| | | ws.Options.RemoteCertificateValidationCallback = delegate { return true; }; |
| | | await ws.ConnectAsync(new Uri("ws://localhost:5102/api/WebSocket/GetNotReadCount"), CancellationToken.None); |
| | | if (ws.State != WebSocketState.Open) |
| | | { |
| | | Log.Info(flowId, "webSocket:è¿æ¥å¤±è´¥!"); |
| | | return default; |
| | | } |
| | | Log.Info(flowId, "webSocket:è¿æ¥æå!"); |
| | | |
| | | ScadaDispatchOutput output = null; |
| | | var inputJson = JsonHelper.Object2Json(input); |
| | | Log.Debug(flowId, inputJson); |
| | | var inputBytes = Encoding.UTF8.GetBytes(inputJson); |
| | | await ws.SendAsync(inputBytes, WebSocketMessageType.Text, true, CancellationToken.None); |
| | | try |
| | | { |
| | | List<byte> outputBytes = new List<byte>();//å
¨é¨æ¶æ¯å®¹å¨ |
| | | var buffer = new byte[1024 * 4];//ç¼å²åº |
| | | var result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); //çå¬Socketä¿¡æ¯ |
| | | while (!result.CloseStatus.HasValue) //æ¯å¦å
³é |
| | | { |
| | | if (result.MessageType == WebSocketMessageType.Text)//ææ¬æ¶æ¯ |
| | | { |
| | | outputBytes.AddRange(buffer.Take(result.Count)); |
| | | if (result.EndOfMessage)//æ¶æ¯æ¯å¦å·²æ¥æ¶å®å
¨ |
| | | { |
| | | //åéè¿æ¥çæ¶æ¯ |
| | | string outputJson = Encoding.UTF8.GetString(outputBytes.ToArray(), 0, outputBytes.Count); |
| | | output = new ScadaDispatchOutput(); |
| | | output.Scadas = JsonHelper.Json2Object<Dictionary<string, Dictionary<DateTime, string>>>(outputJson); |
| | | break; |
| | | } |
| | | } |
| | | result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);//ç»§ç»çå¬Socketä¿¡æ¯ |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log.Error(flowId, ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | //å
³éWebSocket |
| | | await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "AcknowledgeCloseframe", CancellationToken.None); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log.Error(flowId, "å
³éWebSocketå¼å¸¸", ex); |
| | | } |
| | | ws.Abort(); |
| | | ws.Dispose(); |
| | | } |
| | | |
| | | return output; |
| | | } |
| | | |
| | | |
| | | private ScadaDispatchInput GetScadaDispatchInput(DateTime startTime, DateTime endTime, double resolution = 300) |
| | | { |
| | | |
| | | var tagDict = new Dictionary<string, string> |
| | | { |
| | | //{ "_0402010204089903001", "é¿æ±æ°´ä½" }, |
| | | //{ "_0402010204089904009", "äºåæ°´åæ± æ¶²ä½" }, |
| | | //{ "_0402010201030103006", "éè¡æ°´åºæ°´ä½" }, |
| | | //{ "_0402010204012101001", "äºåæ°´1å·æ³µç¶æ" }, |
| | | //{ "_0402010204012201001", "äºåæ°´2å·æ³µç¶æ" }, |
| | | //{ "_0402010204012301001", "äºåæ°´3å·æ³µç¶æ" }, |
| | | //{ "_0402010204012401001", "äºåæ°´4å·æ³µç¶æ" }, |
| | | //{ "_0402010204012501001", "äºåæ°´5å·æ³µç¶æ" }, |
| | | //{ "_0402010204012103002", "äºåæ°´1å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012203002", "äºåæ°´2å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012303002", "äºåæ°´3å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012403002", "äºåæ°´4å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012503002", "äºåæ°´5å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204040193046", "äºåæ°´1å·æ³µæåçµè½" }, |
| | | //{ "_0402010204040193047", "äºåæ°´2å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012308007", "äºåæ°´3å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012408007", "äºåæ°´4å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012508007", "äºåæ°´5å·æ³µæåçµè½" }, |
| | | { "_0402010201090105774", "ä¸è¾æ°´11å·åºå£åå" }, |
| | | { "_0402010201040502031", "ä¸è¾æ°´11å·æååç" }, |
| | | { "_0402010201040502044", "ä¸è¾æ°´11å·æåçµåº¦" }, |
| | | { "_0402010201011195062", "ä¸è¾æ°´11å·æ³µè½¬é" }, |
| | | { "_0402010201011101001", "ä¸è¾æ°´11å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011194012", "ä¸è¾æ°´11å·æ³µé¢ç" }, |
| | | { "_0402010201090105005", "ä¸è¾æ°´12å·åºå£åå" }, |
| | | { "_0402010201041402031", "ä¸è¾æ°´12å·æååç" }, |
| | | { "_0402010201041402044", "ä¸è¾æ°´12å·æåçµåº¦" }, |
| | | { "_0402010201011295062", "ä¸è¾æ°´12å·æ³µè½¬é" }, |
| | | { "_0402010201011201001", "ä¸è¾æ°´12å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011294012", "ä¸è¾æ°´12å·æ³µé¢ç" }, |
| | | { "_0402010201090105776", "ä¸è¾æ°´13å·åºå£åå" }, |
| | | { "_0402010201040602031", "ä¸è¾æ°´13å·æååç" }, |
| | | { "_0402010201040602044", "ä¸è¾æ°´13å·æåçµåº¦" }, |
| | | { "_0402010201011395062", "ä¸è¾æ°´13å·æ³µè½¬é" }, |
| | | { "_0402010201011301001", "ä¸è¾æ°´13å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011394012", "ä¸è¾æ°´13å·æ³µé¢ç" }, |
| | | { "_0402010201090105007", "ä¸è¾æ°´14å·åºå£åå" }, |
| | | { "_0402010201041302031", "ä¸è¾æ°´14å·æååç" }, |
| | | { "_0402010201041302044", "ä¸è¾æ°´14å·æåçµåº¦" }, |
| | | { "_0402010201011495062", "ä¸è¾æ°´14å·æ³µè½¬é" }, |
| | | { "_0402010201011401001", "ä¸è¾æ°´14å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011494012", "ä¸è¾æ°´14å·æ³µé¢ç" }, |
| | | { "_0402010201090105008", "ä¸è¾æ°´15å·åºå£åå" }, |
| | | { "_0402010201040702031", "ä¸è¾æ°´15å·æååç" }, |
| | | { "_0402010201040702044", "ä¸è¾æ°´15å·æåçµåº¦" }, |
| | | { "_0402010201011595062", "ä¸è¾æ°´15å·æ³µè½¬é" }, |
| | | { "_0402010201011501003", "ä¸è¾æ°´15å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105016", "ä¸è¾æ°´16å·åºå£åå" }, |
| | | { "_0402010201041202031", "ä¸è¾æ°´16å·æååç" }, |
| | | { "_0402010201041202044", "ä¸è¾æ°´16å·æåçµåº¦" }, |
| | | { "_0402010201011695062", "ä¸è¾æ°´16å·æ³µè½¬é" }, |
| | | { "_0402010201011601003", "ä¸è¾æ°´16å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105017", "ä¸è¾æ°´17å·åºå£åå" }, |
| | | { "_0402010201040802031", "ä¸è¾æ°´17å·æååç" }, |
| | | { "_0402010201040802044", "ä¸è¾æ°´17å·æåçµåº¦" }, |
| | | { "_0402010201011795062", "ä¸è¾æ°´17å·æ³µè½¬é" }, |
| | | { "_0402010201011795056", "ä¸è¾æ°´17å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105018", "ä¸è¾æ°´18å·åºå£åå" }, |
| | | { "_0402010201041102031", "ä¸è¾æ°´18å·æååç" }, |
| | | { "_0402010201041102044", "ä¸è¾æ°´18å·æåçµåº¦" }, |
| | | { "_0402010201011895062", "ä¸è¾æ°´18å·æ³µè½¬é" }, |
| | | { "_0402010201011895056", "ä¸è¾æ°´18å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090104011", "ä¸è¾æ°´åæ± æ¶²ä½1" }, |
| | | { "_0402010201091104123", "ä¸è¾æ°´åæ± æ¶²ä½2" }, |
| | | { "_0402010201091104122", "ä¸è¾æ°´åæ± æ¶²ä½3" }, |
| | | { "_0402010201090105002", "ä¸è¾æ°´åå®1线åå" }, |
| | | { "_0402010201030191001", "ä¸è¾æ°´åå®1çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201030191002", "ä¸è¾æ°´åå®1线累计æµé" }, |
| | | { "_0402010201090105011", "ä¸è¾æ°´åå®2线åå" }, |
| | | { "_0402010201090199011", "ä¸è¾æ°´åå®2çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201090199012", "ä¸è¾æ°´åå®2线累计æµé" }, |
| | | { "_0402010201090105784", "ä¸è¾æ°´åå®3线åå" }, |
| | | { "_0402010201090199311", "ä¸è¾æ°´åå®3çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201090199312", "ä¸è¾æ°´åå®3线累计æµé" }, |
| | | { "_0402010204012105001", "äºåæ°´ä¸å·æºæ³µåºå£åå" }, |
| | | { "_0402010204012101001", "äºåæ°´ä¸å·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204040193004", "äºåæ°´ä¸å·æºæ³µæååç" }, |
| | | { "_0402010204040193046", "äºåæ°´ä¸å·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012103001", "äºåæ°´ä¸å·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012103002", "äºåæ°´ä¸å·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012305001", "äºåæ°´ä¸å·æºæ³µåºå£åå" }, |
| | | { "_0402010204012301001", "äºåæ°´ä¸å·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012308008", "äºåæ°´ä¸å·æºæ³µæååç" }, |
| | | { "_0402010204012308007", "äºåæ°´ä¸å·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012303001", "äºåæ°´ä¸å·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012303002", "äºåæ°´ä¸å·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012205001", "äºåæ°´äºå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012201001", "äºåæ°´äºå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204040193005", "äºåæ°´äºå·æºæ³µæååç" }, |
| | | { "_0402010204040193047", "äºåæ°´äºå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012203001", "äºåæ°´äºå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012203002", "äºåæ°´äºå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012505001", "äºåæ°´äºå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012501001", "äºåæ°´äºå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012508008", "äºåæ°´äºå·æºæ³µæååç" }, |
| | | { "_0402010204012508007", "äºåæ°´äºå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012503001", "äºåæ°´äºå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012503002", "äºåæ°´äºå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204089904009", "äºåæ°´åæ± æ¶²ä½" }, |
| | | { "_0402010204012405001", "äºåæ°´åå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012401001", "äºåæ°´åå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012408008", "äºåæ°´åå·æºæ³µæååç" }, |
| | | { "_0402010204012408007", "äºåæ°´åå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012403001", "äºåæ°´åå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012403002", "äºåæ°´åå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012105001", "äºè¾æ°´21å·æ³µåºå£åå" }, |
| | | { "_0402010201040102049", "äºè¾æ°´21å·æ³µæååç" }, |
| | | { "_0402010201040102187", "äºè¾æ°´21å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103901", "äºè¾æ°´21å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201010294045", "äºè¾æ°´21å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012199001", "äºè¾æ°´21å·æ³µè½¬é" }, |
| | | { "_0402010201012193021", "äºè¾æ°´21å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102178", "äºè¾æ°´21å·æ³µé¢ç" }, |
| | | { "_0402010201012205001", "äºè¾æ°´22å·æ³µåºå£åå" }, |
| | | { "_0402010201040102053", "äºè¾æ°´22å·æ³µæååç" }, |
| | | { "_0402010201040102213", "äºè¾æ°´22å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103001", "äºè¾æ°´22å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103002", "äºè¾æ°´22å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012299001", "äºè¾æ°´22å·æ³µè½¬é" }, |
| | | { "_0402010201012201001", "äºè¾æ°´22å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102204", "äºè¾æ°´22å·æ³µé¢ç" }, |
| | | { "_0402010201012305001", "äºè¾æ°´23å·æ³µåºå£åå" }, |
| | | { "_0402010201040102055", "äºè¾æ°´23å·æ³µæååç" }, |
| | | { "_0402010201040102136", "äºè¾æ°´23å·æ³µæåçµåº¦" }, |
| | | { "_0402010201040102054", "äºè¾æ°´23å·æ³µçµæµ" }, |
| | | { "_0402010201090103003", "äºè¾æ°´23å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103004", "äºè¾æ°´23å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012399001", "äºè¾æ°´23å·æ³µè½¬é" }, |
| | | { "_0402010201010194135", "äºè¾æ°´23å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102217", "äºè¾æ°´23å·æ³µé¢ç" }, |
| | | { "_0402010201090105003", "äºè¾æ°´2400管åå" }, |
| | | { "_0402010201090103017", "äºè¾æ°´2400ç®¡ç¬æ¶æµé" }, |
| | | { "_0402010201090103018", "äºè¾æ°´2400管累计æµé" }, |
| | | { "_0402010201012405001", "äºè¾æ°´24å·æ³µåºå£åå" }, |
| | | { "_0402010201040102057", "äºè¾æ°´24å·æ³µæååç" }, |
| | | { "_0402010201040102149", "äºè¾æ°´24å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103005", "äºè¾æ°´24å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103006", "äºè¾æ°´24å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012499001", "äºè¾æ°´24å·æ³µè½¬é" }, |
| | | { "_0402010201012401001", "äºè¾æ°´24å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102140", "äºè¾æ°´24å·æ³µé¢ç" }, |
| | | { "_0402010201012505001", "äºè¾æ°´25å·æ³µåºå£åå" }, |
| | | { "_0402010201040202004", "äºè¾æ°´25å·æ³µæååç" }, |
| | | { "_0402010201040202141", "äºè¾æ°´25å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103007", "äºè¾æ°´25å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103008", "äºè¾æ°´25å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012599001", "äºè¾æ°´25å·æ³µè½¬é" }, |
| | | { "_0402010201012501001", "äºè¾æ°´25å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202132", "äºè¾æ°´25å·æ³µé¢ç" }, |
| | | { "_0402010201012605001", "äºè¾æ°´26å·æ³µåºå£åå" }, |
| | | { "_0402010201040202006", "äºè¾æ°´26å·æ³µæååç" }, |
| | | { "_0402010201040202028", "äºè¾æ°´26å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103009", "äºè¾æ°´26å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103010", "äºè¾æ°´26å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012699001", "äºè¾æ°´26å·æ³µè½¬é" }, |
| | | { "_0402010201010194152", "äºè¾æ°´26å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202145", "äºè¾æ°´26å·æ³µé¢ç" }, |
| | | { "_0402010201090105004", "äºè¾æ°´2700管åå" }, |
| | | { "_0402010201090194002", "äºè¾æ°´2700ç®¡ç¬æ¶æµé" }, |
| | | { "_0402010201090194444", "äºè¾æ°´2700管累计æµé" }, |
| | | { "_0402010201012705001", "äºè¾æ°´27å·æ³µåºå£åå" }, |
| | | { "_0402010201040202012", "äºè¾æ°´27å·æ³µæååç" }, |
| | | { "_0402010201040202193", "äºè¾æ°´27å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103903", "äºè¾æ°´27å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090194001", "äºè¾æ°´27å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012799001", "äºè¾æ°´27å·æ³µè½¬é" }, |
| | | { "_0402010201012793021", "äºè¾æ°´27å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202184", "äºè¾æ°´27å·æ³µé¢ç" }, |
| | | { "_0402010204089903001", "éè¡åæ°´å£é¿æ±æ¶²ä½" }, |
| | | { "_0402010201030103006", "éè¡æ°´åºæ¶²ä½" }, |
| | | }; |
| | | |
| | | var input = new ScadaDispatchInput(); |
| | | input.search = "history"; |
| | | input.starttime = startTime.ToString("G"); |
| | | input.endtime = endTime.ToString("G"); |
| | | input.Resolution = resolution.ToString(); |
| | | input.taglist = tagDict.Select(x => x.Key).ToArray(); |
| | | return input; |
| | | } |
| | | |
| | | |
| | | |
| | | //private async Task<ScadaDispatchOutput> GetRealScada(string flowId, ScadaDispatchInput input) |
| | | //{ |
| | | // if (input == null) |
| | | // { |
| | | // Log.Info(flowId, "ScadaDispatchInput is null"); |
| | | // return default; |
| | | // } |
| | | |
| | | // var ws = await CreateAsync("ws://localhost:5102/api/WebSocket/GetNotReadCount"); |
| | | // if (ws == null || ws.State != WebSocketState.Open) |
| | | // { |
| | | // Log.Info(flowId, "webSocket:è¿æ¥å¤±è´¥!"); |
| | | // return default; |
| | | // } |
| | | // Log.Info(flowId, "webSocket:è¿æ¥æå!"); |
| | | |
| | | // ScadaDispatchOutput output = null; |
| | | // var inputJson = JsonHelper.Object2FormatJson(input); |
| | | // Log.Debug(flowId, inputJson); |
| | | // var inputBytes = Encoding.UTF8.GetBytes(inputJson); |
| | | // await ws.SendAsync(inputBytes, WebSocketMessageType.Text, true, CancellationToken.None); |
| | | // try |
| | | // { |
| | | // var buffer = new ArraySegment<byte>(new byte[1024 * 4]); |
| | | // WebSocketReceiveResult result = null; |
| | | // using (var ms = new MemoryStream()) |
| | | // { |
| | | // do |
| | | // { |
| | | // result = await ws.ReceiveAsync(buffer, CancellationToken.None); |
| | | // ms.Write(buffer.Array, buffer.Offset, result.Count); |
| | | // } |
| | | // while (!result.EndOfMessage); |
| | | |
| | | // ms.Seek(0, SeekOrigin.Begin); |
| | | // if (result.MessageType == WebSocketMessageType.Text && !result.CloseStatus.HasValue) |
| | | // { |
| | | // using (var reader = new StreamReader(ms, Encoding.UTF8)) |
| | | // { |
| | | // string outputJson = reader.ReadToEnd(); |
| | | // output = new ScadaDispatchOutput(); |
| | | // output.Scadas = JsonHelper.Json2Object<Dictionary<string, Dictionary<DateTime, string>>>(outputJson); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // Log.Error(flowId, ex.Message); |
| | | // } |
| | | // finally |
| | | // { |
| | | // try |
| | | // { |
| | | // //å
³éWebSocket |
| | | // await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "AcknowledgeCloseframe", CancellationToken.None); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // Log.Error(flowId, "å
³éWebSocketå¼å¸¸", ex); |
| | | // } |
| | | // ws.Abort(); |
| | | // ws.Dispose(); |
| | | // } |
| | | |
| | | // return output; |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// å建客æ·ç«¯å®ä¾ |
| | | ///// </summary> |
| | | ///// <returns></returns> |
| | | //public static async Task<ClientWebSocket> CreateAsync(string ServerUri) |
| | | //{ |
| | | // var webSocket = new ClientWebSocket(); |
| | | // webSocket.Options.RemoteCertificateValidationCallback = delegate { return true; }; |
| | | |
| | | // await webSocket.ConnectAsync(new Uri(ServerUri), CancellationToken.None); |
| | | // if (webSocket.State == WebSocketState.Open) |
| | | // { |
| | | // return webSocket; |
| | | // } |
| | | // return null; |
| | | //} |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// 宿¶æ°æ®è°åº¦ |
| | | /// </summary> |
| | | public class ScadaDispatchInput |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string search { get; set; } = "history"; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string starttime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string endtime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Resolution { get; set; } = "300"; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string[] taglist { get; set; } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// æ³µç«è°åº¦ |
| | | /// </summary> |
| | | public class StationDispatchInput : IValidatableObject |
| | | { |
| | | /// <summary> |
| | | /// è°åº¦æµç¨æ è¯ï¼æ¹æ¡è®¡ç®åè¿åï¼åºåè°åº¦æ¹æ¡çå¯ä¸æ§ï¼ |
| | | /// </summary> |
| | | public string FlowId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°´åå表 |
| | | /// </summary> |
| | | public List<FactoryDispatchInput> Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
| | | { |
| | | if (Factory == null || Factory.Count < 1) |
| | | { |
| | | yield return |
| | | new ValidationResult("Factory ä¸è½ä¸ºç©º", new[] { nameof(Factory) }); |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < Factory.Count; i++) |
| | | { |
| | | var f = Factory[i]; |
| | | if (f.Value < 1) |
| | | { |
| | | yield return |
| | | new ValidationResult($"æ°´å墿°´éè¿ä½! ID:{f.Id} Value:{f.Value}", new[] { nameof(Factory) }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// 宿¶æ°æ® |
| | | /// </summary> |
| | | public class ScadaDispatchOutput |
| | | { |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public Dictionary<string, Dictionary<DateTime, string>> Scadas { get; set; } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// æ³µç«è°åº¦ç»æ |
| | | /// </summary> |
| | | public class StationDispatchOutput |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public StationDispatchOutput() { } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public StationDispatchOutput(StationDispatchOutput rhs) |
| | | { |
| | | this.Id = rhs.Id; |
| | | this.Index = rhs.Index; |
| | | this.Q = rhs.Q; |
| | | this.H = rhs.H; |
| | | this.E = rhs.E; |
| | | this.P = rhs.P; |
| | | this.WP = rhs.WP; |
| | | this.UWP = rhs.UWP; |
| | | this.Pumps = rhs.Pumps?.ToList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ³µç«æ è¯ |
| | | /// </summary> |
| | | public string Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ³µç«ç´¢å¼ 0ï¼éè¡1è¾æ°´ 1ï¼éè¡2è¾æ°´ |
| | | /// </summary> |
| | | public int Index { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµé m³/h |
| | | /// </summary> |
| | | public double Q { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¬ç¨ m |
| | | /// </summary> |
| | | public double H { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç % |
| | | /// </summary> |
| | | public double E { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç kw |
| | | /// </summary> |
| | | public double P { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å卿°´è½è kw/m.m3/h |
| | | /// </summary> |
| | | public double WP { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½è½è kw/m3/h |
| | | /// </summary> |
| | | public double UWP { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ³µå表 |
| | | /// </summary> |
| | | public List<PumpDispatchOutput> Pumps { get; set; } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace IStation.Application |
| | | { |
| | | |
| | | internal class ExternalPipeScada |
| | | { |
| | | public double JD1Flow { get; set; } |
| | | public double JD1Pressure { get; set; } |
| | | |
| | | public double JD2Flow { get; set; } |
| | | public double JD2Pressure { get; set; } |
| | | |
| | | public double JD3Flow { get; set; } |
| | | public double JD3Pressure { get; set; } |
| | | |
| | | public double DN2400Flow { get; set; } |
| | | public double DN2400Pressure { get; set; } |
| | | |
| | | public double DN2700Flow { get; set; } |
| | | public double DN2700Pressure { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using IStation.Common; |
| | | |
| | | namespace IStation.Application |
| | | { |
| | | internal class TempOutHelper |
| | | { |
| | | |
| | | public static DispatchSolutionOutput GetDispatchSolutionOutput(string flowId) |
| | | { |
| | | var output = new DispatchSolutionOutput(); |
| | | output.SolutionId = "temp999"; |
| | | output.FlowId = flowId; |
| | | output.Station = new List<StationDispatchOutput>(); |
| | | |
| | | var chss1Pumps = new List<PumpDispatchOutput> |
| | | { |
| | | GetPumpDispatchOutput("Pump11", 0, true, 4307.7588, 15.8093, 81.6112, 227.219, 37.6271, 444), |
| | | GetPumpDispatchOutput("Pump12", 1, true, 4024.6057, 15.742, 81.3045, 212.1781, 36.523, 431), |
| | | GetPumpDispatchOutput("Pump13", 2, true, 3941.9631, 16.1554, 82.7758, 209.4876, 36.533, 431.1), |
| | | GetPumpDispatchOutput("Pump17", 6, true, 4130.7578, 15.9835, 82.6751, 217.4493, 36.6102, 432) |
| | | }; |
| | | |
| | | // var chss1totalH = 20.7518; |
| | | var chss1totalH = chss1Pumps.Average(x => x.H); |
| | | var chss1totalQ = chss1Pumps.Sum(x => x.Q); |
| | | var chss1totalP = chss1Pumps.Sum(x => x.P); |
| | | |
| | | var chss1totalE = PumpParaHelper.CalculateE(chss1totalQ, chss1totalH, chss1totalP); |
| | | var chss1 = GetStationDispatchOutput(1, chss1totalQ, chss1totalH, chss1totalE, chss1totalP, chss1Pumps); |
| | | |
| | | |
| | | var chss2Pumps = new List<PumpDispatchOutput> |
| | | { |
| | | GetPumpDispatchOutput("Pump22", 1, true, 9589.2422, 15.3166, 75.3, 533.233,33.4343, 331), |
| | | GetPumpDispatchOutput("Pump23", 2, true, 9423.4463, 15.1016, 72.4, 567.1, 34.4242, 340.8), |
| | | GetPumpDispatchOutput("Pump25", 4, true, 10226.1523, 15.0448, 72.4, 563.2, 34.3434, 340), |
| | | GetPumpDispatchOutput("Pump26", 5, true, 10011.1924, 15.1511, 74, 558.6, 33.9394, 336) |
| | | }; |
| | | |
| | | var chss2totalH = chss2Pumps.Average(x => x.H); |
| | | var chss2totalQ = chss2Pumps.Sum(x => x.Q); |
| | | var chss2totalP = chss2Pumps.Sum(x => x.P); |
| | | |
| | | var chss2totalE = PumpParaHelper.CalculateE(chss2totalQ, chss2totalH, chss2totalP); |
| | | var chss2 = GetStationDispatchOutput(2, chss2totalQ, chss2totalH, chss2totalE, chss2totalP, chss2Pumps); |
| | | |
| | | |
| | | output.Station.Add(chss1); |
| | | output.Station.Add(chss2); |
| | | return output; |
| | | } |
| | | |
| | | private static StationDispatchOutput GetStationDispatchOutput(int index, double q, double h, double e, double p, List<PumpDispatchOutput> pumps) |
| | | { |
| | | var model = new StationDispatchOutput(); |
| | | model.Id = index.ToString(); |
| | | model.Index = index; |
| | | model.Q = Math.Round(q, 1); |
| | | model.H = Math.Round(h, 1); |
| | | model.E = Math.Round(e, 1); |
| | | model.P = Math.Round(p, 1); |
| | | model.WP = Math.Round(Calcu_WP(p, q), 1); |
| | | model.UWP = Math.Round(Calcu_UWP(p, q, h), 1); |
| | | model.Pumps = pumps; |
| | | return model; |
| | | } |
| | | |
| | | |
| | | private static PumpDispatchOutput GetPumpDispatchOutput(string id, int index, bool isBp, double q, double h, double e, double p, double fre, double speed) |
| | | { |
| | | var model = new PumpDispatchOutput(); |
| | | model.Id = id; |
| | | model.Index = index; |
| | | model.Name = id; |
| | | model.IsBp = isBp; |
| | | model.Q = Math.Round(q, 1); |
| | | model.H = Math.Round(h, 1); |
| | | model.E = Math.Round(e, 1); |
| | | model.P = Math.Round(p, 1); |
| | | model.Frequency = Math.Round(fre, 1); |
| | | model.Speed = Math.Round(speed, 1); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å使°´è å卿°´ |
| | | /// </summary> |
| | | private static double Calcu_UWP(double P, double Q, double H) |
| | | { |
| | | if (Q <= 0.001) |
| | | return 0; |
| | | if (H <= 0.00001) |
| | | return 0; |
| | | if (P <= 0.001) |
| | | return 0; |
| | | return P * 1000f / Q / H; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å使°´è å卿°´ |
| | | /// </summary> |
| | | private static double Calcu_UWP(double P, double Q, double inletPress, double outletPress) |
| | | { |
| | | double H = (outletPress - inletPress) * 102; |
| | | if (Q <= 0.001) |
| | | return 0; |
| | | if (H <= 0.00001) |
| | | return 0; |
| | | if (P <= 0.001) |
| | | return 0; |
| | | return P * 1000f / Q / H; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å使°´è |
| | | /// </summary> |
| | | private static double Calcu_WP(double P, double Q) |
| | | { |
| | | if (Q <= 0.001) |
| | | return 0; |
| | | |
| | | if (P <= 0.001) |
| | | return 0; |
| | | return P * 1000f / Q; |
| | | } |
| | | } |
| | | } |
| | |
| | | namespace IStation.Application |
| | | using Yw.Calculation; |
| | | |
| | | namespace IStation.Application |
| | | { |
| | | /// <summary> |
| | | /// è°åº¦æ¹æ¡ |
| | |
| | | [ApiDescriptionSettings("Solution", Name = "éè¡è°åº¦æ¹æ¡", Order = 1)] |
| | | public class DispatchSolution_Controller : IDynamicApiController |
| | | { |
| | | |
| | | /// <summary> |
| | | /// è®¡ç® |
| | | /// </summary> |
| | | [AllowAnonymous] |
| | | [Route("Calculate@V1.0")] |
| | | [HttpPost] |
| | | public async Task<DispatchSolutionOutput> Calculate([Required] StationDispatchInput input) |
| | | [NonUnify] |
| | | public async Task<StationDispatchOutput> Calculate([Required] StationDispatchInput input) |
| | | { |
| | | if (input == null) |
| | | return null; |
| | | |
| | | string flowId = input.FlowId; |
| | | Log.Debug(flowId, JsonHelper.Object2Json(input)); |
| | | var receipt_time = DateTime.Now; |
| | | Log.Debug(JsonHelper.Object2Json(input)); |
| | | //è·åScada宿¶æ°æ® |
| | | //...... |
| | | |
| | | var scadaInput = GetScadaDispatchInput(DateTime.Now.AddSeconds(300), DateTime.Now); |
| | | var scadaOutput = await GetRealScada(flowId, scadaInput); |
| | | if (scadaOutput == null || scadaOutput.Scadas == null) |
| | | var total_flow1 = input.objects["TotalFlow1"]; |
| | | var total_pressure1 = input.objects["TotalPressure1"]; |
| | | total_pressure1 = Mpa2M(total_pressure1); |
| | | var total_flow2 = input.objects["TotalFlow2"]; |
| | | var total_pressure2 = input.objects["TotalPressure2"]; |
| | | total_pressure2 = Mpa2M(total_pressure2); |
| | | |
| | | var optimal_combine1 = GetOptimalCombine1(total_flow1, total_pressure1, null, null, null); |
| | | var optimal_combine2 = GetOptimalCombine2(total_flow2, total_pressure2, null, null, null); |
| | | |
| | | var output = new StationDispatchOutput(); |
| | | output.objects = new Dictionary<string, double>(); |
| | | if (optimal_combine1 == null && optimal_combine2 == null) |
| | | { |
| | | Log.Info(flowId, "Scada:æ°æ®è·å失败ï¼è°åº¦ç»æ¢!"); |
| | | throw YOops.Oh(eResultCode.Error, InternalErrorCodes.L001, "Scada:æ°æ®è·å失败ï¼è°åº¦ç»æ¢!"); |
| | | output.flag = 0; |
| | | output.message = "åºå
è°åº¦æ¹æ¡æ æ³è®¡ç®!"; |
| | | Log.Info("计ç®å¤±è´¥ï¼åºå
è°åº¦æ¹æ¡æ æ³è®¡ç®!"); |
| | | } |
| | | |
| | | return TempOutHelper.GetDispatchSolutionOutput(input.FlowId); |
| | | } |
| | | |
| | | private async Task<ScadaDispatchOutput> GetRealScada(string flowId, ScadaDispatchInput input) |
| | | { |
| | | if (input == null) |
| | | else |
| | | { |
| | | Log.Info(flowId, "ScadaDispatchInput is null"); |
| | | return default; |
| | | } |
| | | |
| | | var ws = new ClientWebSocket(); |
| | | ws.Options.RemoteCertificateValidationCallback = delegate { return true; }; |
| | | await ws.ConnectAsync(new Uri("ws://localhost:5102/api/WebSocket/GetNotReadCount"), CancellationToken.None); |
| | | if (ws.State != WebSocketState.Open) |
| | | { |
| | | Log.Info(flowId, "webSocket:è¿æ¥å¤±è´¥!"); |
| | | return default; |
| | | } |
| | | Log.Info(flowId, "webSocket:è¿æ¥æå!"); |
| | | |
| | | ScadaDispatchOutput output = null; |
| | | var inputJson = JsonHelper.Object2Json(input); |
| | | Log.Debug(flowId, inputJson); |
| | | var inputBytes = Encoding.UTF8.GetBytes(inputJson); |
| | | await ws.SendAsync(inputBytes, WebSocketMessageType.Text, true, CancellationToken.None); |
| | | try |
| | | { |
| | | List<byte> outputBytes = new List<byte>();//å
¨é¨æ¶æ¯å®¹å¨ |
| | | var buffer = new byte[1024 * 4];//ç¼å²åº |
| | | var result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); //çå¬Socketä¿¡æ¯ |
| | | while (!result.CloseStatus.HasValue) //æ¯å¦å
³é |
| | | if (optimal_combine1 != null) |
| | | { |
| | | if (result.MessageType == WebSocketMessageType.Text)//ææ¬æ¶æ¯ |
| | | output.objects["1è¾æ°´æ»æµé"] = optimal_combine1.Flow; |
| | | output.objects["1è¾æ°´æ»åå"] = M2Mpa(optimal_combine1.Head); |
| | | foreach (var combine in optimal_combine1.Combines) |
| | | { |
| | | outputBytes.AddRange(buffer.Take(result.Count)); |
| | | if (result.EndOfMessage)//æ¶æ¯æ¯å¦å·²æ¥æ¶å®å
¨ |
| | | foreach (var pump_flag in combine.Flags) |
| | | { |
| | | //åéè¿æ¥çæ¶æ¯ |
| | | string outputJson = Encoding.UTF8.GetString(outputBytes.ToArray(), 0, outputBytes.Count); |
| | | output = new ScadaDispatchOutput(); |
| | | output.Scadas = JsonHelper.Json2Object<Dictionary<string, Dictionary<DateTime, string>>>(outputJson); |
| | | break; |
| | | output.objects[$"1è¾æ°´{pump_flag}#é¢ç"] = combine.Frequency; |
| | | } |
| | | } |
| | | result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);//ç»§ç»çå¬Socketä¿¡æ¯ |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log.Error(flowId, ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | if (optimal_combine2 != null) |
| | | { |
| | | //å
³éWebSocket |
| | | await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "AcknowledgeCloseframe", CancellationToken.None); |
| | | output.objects["2è¾æ°´æ»æµé"] = optimal_combine2.Flow; |
| | | output.objects["2è¾æ°´æ»åå"] = M2Mpa(optimal_combine2.Head); |
| | | foreach (var combine in optimal_combine2.Combines) |
| | | { |
| | | foreach (var pump_flag in combine.Flags) |
| | | { |
| | | output.objects[$"2è¾æ°´{pump_flag}#é¢ç"] = combine.Frequency; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log.Error(flowId, "å
³éWebSocketå¼å¸¸", ex); |
| | | } |
| | | ws.Abort(); |
| | | ws.Dispose(); |
| | | output.flag = 1; |
| | | Log.Info("è®¡ç®æå!"); |
| | | } |
| | | |
| | | output.ReceiptTime = receipt_time; |
| | | output.ReturnTime = DateTime.Now; |
| | | return output; |
| | | } |
| | | |
| | | |
| | | private ScadaDispatchInput GetScadaDispatchInput(DateTime startTime, DateTime endTime, double resolution = 300) |
| | | private string _data_floder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data"); |
| | | private List<IStation.Model.Pump> _station_pumps1 = null; |
| | | private List<IStation.Model.Pump> _station_pumps2 = null; |
| | | |
| | | /// <summary> |
| | | /// è·å1è¾æ°´æä¼è°åº¦æ¹æ¡ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | IStation.Algorithm.OptimalCombine GetOptimalCombine1(double target_flow, double target_head, List<int> current_open_pump_flags, List<int> must_open_pump_flags, List<int> must_not_open_pump_flags) |
| | | { |
| | | |
| | | var tagDict = new Dictionary<string, string> |
| | | if (_station_pumps1 == null) |
| | | { |
| | | //{ "_0402010204089903001", "é¿æ±æ°´ä½" }, |
| | | //{ "_0402010204089904009", "äºåæ°´åæ± æ¶²ä½" }, |
| | | //{ "_0402010201030103006", "éè¡æ°´åºæ°´ä½" }, |
| | | //{ "_0402010204012101001", "äºåæ°´1å·æ³µç¶æ" }, |
| | | //{ "_0402010204012201001", "äºåæ°´2å·æ³µç¶æ" }, |
| | | //{ "_0402010204012301001", "äºåæ°´3å·æ³µç¶æ" }, |
| | | //{ "_0402010204012401001", "äºåæ°´4å·æ³µç¶æ" }, |
| | | //{ "_0402010204012501001", "äºåæ°´5å·æ³µç¶æ" }, |
| | | //{ "_0402010204012103002", "äºåæ°´1å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012203002", "äºåæ°´2å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012303002", "äºåæ°´3å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012403002", "äºåæ°´4å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204012503002", "äºåæ°´5å·æ³µç´¯è®¡æµé" }, |
| | | //{ "_0402010204040193046", "äºåæ°´1å·æ³µæåçµè½" }, |
| | | //{ "_0402010204040193047", "äºåæ°´2å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012308007", "äºåæ°´3å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012408007", "äºåæ°´4å·æ³µæåçµè½" }, |
| | | //{ "_0402010204012508007", "äºåæ°´5å·æ³µæåçµè½" }, |
| | | { "_0402010201090105774", "ä¸è¾æ°´11å·åºå£åå" }, |
| | | { "_0402010201040502031", "ä¸è¾æ°´11å·æååç" }, |
| | | { "_0402010201040502044", "ä¸è¾æ°´11å·æåçµåº¦" }, |
| | | { "_0402010201011195062", "ä¸è¾æ°´11å·æ³µè½¬é" }, |
| | | { "_0402010201011101001", "ä¸è¾æ°´11å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011194012", "ä¸è¾æ°´11å·æ³µé¢ç" }, |
| | | { "_0402010201090105005", "ä¸è¾æ°´12å·åºå£åå" }, |
| | | { "_0402010201041402031", "ä¸è¾æ°´12å·æååç" }, |
| | | { "_0402010201041402044", "ä¸è¾æ°´12å·æåçµåº¦" }, |
| | | { "_0402010201011295062", "ä¸è¾æ°´12å·æ³µè½¬é" }, |
| | | { "_0402010201011201001", "ä¸è¾æ°´12å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011294012", "ä¸è¾æ°´12å·æ³µé¢ç" }, |
| | | { "_0402010201090105776", "ä¸è¾æ°´13å·åºå£åå" }, |
| | | { "_0402010201040602031", "ä¸è¾æ°´13å·æååç" }, |
| | | { "_0402010201040602044", "ä¸è¾æ°´13å·æåçµåº¦" }, |
| | | { "_0402010201011395062", "ä¸è¾æ°´13å·æ³µè½¬é" }, |
| | | { "_0402010201011301001", "ä¸è¾æ°´13å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011394012", "ä¸è¾æ°´13å·æ³µé¢ç" }, |
| | | { "_0402010201090105007", "ä¸è¾æ°´14å·åºå£åå" }, |
| | | { "_0402010201041302031", "ä¸è¾æ°´14å·æååç" }, |
| | | { "_0402010201041302044", "ä¸è¾æ°´14å·æåçµåº¦" }, |
| | | { "_0402010201011495062", "ä¸è¾æ°´14å·æ³µè½¬é" }, |
| | | { "_0402010201011401001", "ä¸è¾æ°´14å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201011494012", "ä¸è¾æ°´14å·æ³µé¢ç" }, |
| | | { "_0402010201090105008", "ä¸è¾æ°´15å·åºå£åå" }, |
| | | { "_0402010201040702031", "ä¸è¾æ°´15å·æååç" }, |
| | | { "_0402010201040702044", "ä¸è¾æ°´15å·æåçµåº¦" }, |
| | | { "_0402010201011595062", "ä¸è¾æ°´15å·æ³µè½¬é" }, |
| | | { "_0402010201011501003", "ä¸è¾æ°´15å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105016", "ä¸è¾æ°´16å·åºå£åå" }, |
| | | { "_0402010201041202031", "ä¸è¾æ°´16å·æååç" }, |
| | | { "_0402010201041202044", "ä¸è¾æ°´16å·æåçµåº¦" }, |
| | | { "_0402010201011695062", "ä¸è¾æ°´16å·æ³µè½¬é" }, |
| | | { "_0402010201011601003", "ä¸è¾æ°´16å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105017", "ä¸è¾æ°´17å·åºå£åå" }, |
| | | { "_0402010201040802031", "ä¸è¾æ°´17å·æååç" }, |
| | | { "_0402010201040802044", "ä¸è¾æ°´17å·æåçµåº¦" }, |
| | | { "_0402010201011795062", "ä¸è¾æ°´17å·æ³µè½¬é" }, |
| | | { "_0402010201011795056", "ä¸è¾æ°´17å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090105018", "ä¸è¾æ°´18å·åºå£åå" }, |
| | | { "_0402010201041102031", "ä¸è¾æ°´18å·æååç" }, |
| | | { "_0402010201041102044", "ä¸è¾æ°´18å·æåçµåº¦" }, |
| | | { "_0402010201011895062", "ä¸è¾æ°´18å·æ³µè½¬é" }, |
| | | { "_0402010201011895056", "ä¸è¾æ°´18å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201090104011", "ä¸è¾æ°´åæ± æ¶²ä½1" }, |
| | | { "_0402010201091104123", "ä¸è¾æ°´åæ± æ¶²ä½2" }, |
| | | { "_0402010201091104122", "ä¸è¾æ°´åæ± æ¶²ä½3" }, |
| | | { "_0402010201090105002", "ä¸è¾æ°´åå®1线åå" }, |
| | | { "_0402010201030191001", "ä¸è¾æ°´åå®1çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201030191002", "ä¸è¾æ°´åå®1线累计æµé" }, |
| | | { "_0402010201090105011", "ä¸è¾æ°´åå®2线åå" }, |
| | | { "_0402010201090199011", "ä¸è¾æ°´åå®2çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201090199012", "ä¸è¾æ°´åå®2线累计æµé" }, |
| | | { "_0402010201090105784", "ä¸è¾æ°´åå®3线åå" }, |
| | | { "_0402010201090199311", "ä¸è¾æ°´åå®3çº¿ç¬æ¶æµé" }, |
| | | { "_0402010201090199312", "ä¸è¾æ°´åå®3线累计æµé" }, |
| | | { "_0402010204012105001", "äºåæ°´ä¸å·æºæ³µåºå£åå" }, |
| | | { "_0402010204012101001", "äºåæ°´ä¸å·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204040193004", "äºåæ°´ä¸å·æºæ³µæååç" }, |
| | | { "_0402010204040193046", "äºåæ°´ä¸å·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012103001", "äºåæ°´ä¸å·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012103002", "äºåæ°´ä¸å·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012305001", "äºåæ°´ä¸å·æºæ³µåºå£åå" }, |
| | | { "_0402010204012301001", "äºåæ°´ä¸å·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012308008", "äºåæ°´ä¸å·æºæ³µæååç" }, |
| | | { "_0402010204012308007", "äºåæ°´ä¸å·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012303001", "äºåæ°´ä¸å·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012303002", "äºåæ°´ä¸å·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012205001", "äºåæ°´äºå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012201001", "äºåæ°´äºå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204040193005", "äºåæ°´äºå·æºæ³µæååç" }, |
| | | { "_0402010204040193047", "äºåæ°´äºå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012203001", "äºåæ°´äºå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012203002", "äºåæ°´äºå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204012505001", "äºåæ°´äºå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012501001", "äºåæ°´äºå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012508008", "äºåæ°´äºå·æºæ³µæååç" }, |
| | | { "_0402010204012508007", "äºåæ°´äºå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012503001", "äºåæ°´äºå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012503002", "äºåæ°´äºå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010204089904009", "äºåæ°´åæ± æ¶²ä½" }, |
| | | { "_0402010204012405001", "äºåæ°´åå·æºæ³µåºå£åå" }, |
| | | { "_0402010204012401001", "äºåæ°´åå·æºæ³µå¼åç¶æ" }, |
| | | { "_0402010204012408008", "äºåæ°´åå·æºæ³µæååç" }, |
| | | { "_0402010204012408007", "äºåæ°´åå·æºæ³µæåçµåº¦" }, |
| | | { "_0402010204012403001", "äºåæ°´åå·æºæ³µç¬æ¶æµé" }, |
| | | { "_0402010204012403002", "äºåæ°´åå·æºæ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012105001", "äºè¾æ°´21å·æ³µåºå£åå" }, |
| | | { "_0402010201040102049", "äºè¾æ°´21å·æ³µæååç" }, |
| | | { "_0402010201040102187", "äºè¾æ°´21å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103901", "äºè¾æ°´21å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201010294045", "äºè¾æ°´21å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012199001", "äºè¾æ°´21å·æ³µè½¬é" }, |
| | | { "_0402010201012193021", "äºè¾æ°´21å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102178", "äºè¾æ°´21å·æ³µé¢ç" }, |
| | | { "_0402010201012205001", "äºè¾æ°´22å·æ³µåºå£åå" }, |
| | | { "_0402010201040102053", "äºè¾æ°´22å·æ³µæååç" }, |
| | | { "_0402010201040102213", "äºè¾æ°´22å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103001", "äºè¾æ°´22å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103002", "äºè¾æ°´22å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012299001", "äºè¾æ°´22å·æ³µè½¬é" }, |
| | | { "_0402010201012201001", "äºè¾æ°´22å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102204", "äºè¾æ°´22å·æ³µé¢ç" }, |
| | | { "_0402010201012305001", "äºè¾æ°´23å·æ³µåºå£åå" }, |
| | | { "_0402010201040102055", "äºè¾æ°´23å·æ³µæååç" }, |
| | | { "_0402010201040102136", "äºè¾æ°´23å·æ³µæåçµåº¦" }, |
| | | { "_0402010201040102054", "äºè¾æ°´23å·æ³µçµæµ" }, |
| | | { "_0402010201090103003", "äºè¾æ°´23å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103004", "äºè¾æ°´23å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012399001", "äºè¾æ°´23å·æ³µè½¬é" }, |
| | | { "_0402010201010194135", "äºè¾æ°´23å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102217", "äºè¾æ°´23å·æ³µé¢ç" }, |
| | | { "_0402010201090105003", "äºè¾æ°´2400管åå" }, |
| | | { "_0402010201090103017", "äºè¾æ°´2400ç®¡ç¬æ¶æµé" }, |
| | | { "_0402010201090103018", "äºè¾æ°´2400管累计æµé" }, |
| | | { "_0402010201012405001", "äºè¾æ°´24å·æ³µåºå£åå" }, |
| | | { "_0402010201040102057", "äºè¾æ°´24å·æ³µæååç" }, |
| | | { "_0402010201040102149", "äºè¾æ°´24å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103005", "äºè¾æ°´24å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103006", "äºè¾æ°´24å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012499001", "äºè¾æ°´24å·æ³µè½¬é" }, |
| | | { "_0402010201012401001", "äºè¾æ°´24å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040102140", "äºè¾æ°´24å·æ³µé¢ç" }, |
| | | { "_0402010201012505001", "äºè¾æ°´25å·æ³µåºå£åå" }, |
| | | { "_0402010201040202004", "äºè¾æ°´25å·æ³µæååç" }, |
| | | { "_0402010201040202141", "äºè¾æ°´25å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103007", "äºè¾æ°´25å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103008", "äºè¾æ°´25å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012599001", "äºè¾æ°´25å·æ³µè½¬é" }, |
| | | { "_0402010201012501001", "äºè¾æ°´25å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202132", "äºè¾æ°´25å·æ³µé¢ç" }, |
| | | { "_0402010201012605001", "äºè¾æ°´26å·æ³µåºå£åå" }, |
| | | { "_0402010201040202006", "äºè¾æ°´26å·æ³µæååç" }, |
| | | { "_0402010201040202028", "äºè¾æ°´26å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103009", "äºè¾æ°´26å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090103010", "äºè¾æ°´26å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012699001", "äºè¾æ°´26å·æ³µè½¬é" }, |
| | | { "_0402010201010194152", "äºè¾æ°´26å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202145", "äºè¾æ°´26å·æ³µé¢ç" }, |
| | | { "_0402010201090105004", "äºè¾æ°´2700管åå" }, |
| | | { "_0402010201090194002", "äºè¾æ°´2700ç®¡ç¬æ¶æµé" }, |
| | | { "_0402010201090194444", "äºè¾æ°´2700管累计æµé" }, |
| | | { "_0402010201012705001", "äºè¾æ°´27å·æ³µåºå£åå" }, |
| | | { "_0402010201040202012", "äºè¾æ°´27å·æ³µæååç" }, |
| | | { "_0402010201040202193", "äºè¾æ°´27å·æ³µæåçµåº¦" }, |
| | | { "_0402010201090103903", "äºè¾æ°´27å·æ³µç¬æ¶æµé" }, |
| | | { "_0402010201090194001", "äºè¾æ°´27å·æ³µç´¯è®¡æµé" }, |
| | | { "_0402010201012799001", "äºè¾æ°´27å·æ³µè½¬é" }, |
| | | { "_0402010201012793021", "äºè¾æ°´27å·æ³µè¿è¡ç¶æ" }, |
| | | { "_0402010201040202184", "äºè¾æ°´27å·æ³µé¢ç" }, |
| | | { "_0402010204089903001", "éè¡åæ°´å£é¿æ±æ¶²ä½" }, |
| | | { "_0402010201030103006", "éè¡æ°´åºæ¶²ä½" }, |
| | | }; |
| | | var filePath = _data_floder + "\\" + "éè¡ä¸è¾.json"; |
| | | var jsonInfo = File.ReadAllText(filePath); |
| | | _station_pumps1 = JsonHelper.Json2Object<List<Model.Pump>>(jsonInfo); |
| | | if (_station_pumps1 == null) |
| | | { |
| | | Log.Error($"æä»¶ç¼ºå¤±:{filePath}"); |
| | | return default; |
| | | } |
| | | } |
| | | |
| | | var input = new ScadaDispatchInput(); |
| | | input.search = "history"; |
| | | input.starttime = startTime.ToString("G"); |
| | | input.endtime = endTime.ToString("G"); |
| | | input.Resolution = resolution.ToString(); |
| | | input.taglist = tagDict.Select(x => x.Key).ToArray(); |
| | | return input; |
| | | var flags_part1 = new List<int>() { 11, 12, 13, 14, 16, 17, 18 }; |
| | | var flags_part2 = new List<int>() { 15 }; |
| | | |
| | | var helper = new Algorithm.SchedulingHelper(); |
| | | var optimal_combine = helper.AnaOptimalCombine(_station_pumps1, flags_part1, flags_part2, target_flow, target_head, current_open_pump_flags, must_open_pump_flags, must_not_open_pump_flags); |
| | | if (optimal_combine == null) |
| | | { |
| | | Log.Error($"ä¸è¾æ°´æ¹æ¡è®¡ç®å¤±è´¥: optimal_combine1 is null"); |
| | | } |
| | | return optimal_combine; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å2è¾æ°´æä¼è°åº¦æ¹æ¡ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | IStation.Algorithm.OptimalCombine GetOptimalCombine2(double target_flow, double target_head, List<int> current_open_pump_flags, List<int> must_open_pump_flags, List<int> must_not_open_pump_flags) |
| | | { |
| | | if (_station_pumps2 == null) |
| | | { |
| | | var filePath = _data_floder + "\\" + "éè¡äºè¾.json"; |
| | | var jsonInfo = File.ReadAllText(filePath); |
| | | _station_pumps2 = JsonHelper.Json2Object<List<Model.Pump>>(jsonInfo); |
| | | if (_station_pumps2 == null) |
| | | { |
| | | Log.Error($"æä»¶ç¼ºå¤±:{filePath}"); |
| | | return default; |
| | | } |
| | | } |
| | | |
| | | var flags_part1 = new List<int>() { 22, 23, 24, 25, 26 }; |
| | | var flags_part2 = new List<int>() { 21, 27 }; |
| | | |
| | | var helper = new Algorithm.SchedulingHelper(); |
| | | var optimal_combine = helper.AnaOptimalCombine(_station_pumps2, flags_part1, flags_part2, target_flow, target_head, current_open_pump_flags, must_open_pump_flags, must_not_open_pump_flags); |
| | | if (optimal_combine == null) |
| | | { |
| | | Log.Error($"äºè¾æ°´æ¹æ¡è®¡ç®å¤±è´¥: optimal_combine1 is null"); |
| | | } |
| | | return optimal_combine; |
| | | } |
| | | |
| | | |
| | | #region Mpa<=>m |
| | | |
| | | //private async Task<ScadaDispatchOutput> GetRealScada(string flowId, ScadaDispatchInput input) |
| | | //{ |
| | | // if (input == null) |
| | | // { |
| | | // Log.Info(flowId, "ScadaDispatchInput is null"); |
| | | // return default; |
| | | // } |
| | | /// <summary> |
| | | /// Mpa=>m |
| | | /// </summary> |
| | | public static double Mpa2M(double mpa) |
| | | { |
| | | return mpa * ConstantParas.WaterDensity / ConstantParas.g; |
| | | } |
| | | |
| | | // var ws = await CreateAsync("ws://localhost:5102/api/WebSocket/GetNotReadCount"); |
| | | // if (ws == null || ws.State != WebSocketState.Open) |
| | | // { |
| | | // Log.Info(flowId, "webSocket:è¿æ¥å¤±è´¥!"); |
| | | // return default; |
| | | // } |
| | | // Log.Info(flowId, "webSocket:è¿æ¥æå!"); |
| | | /// <summary> |
| | | /// m=>Mpa |
| | | /// </summary> |
| | | public static double M2Mpa(double m) |
| | | { |
| | | return m * ConstantParas.g / ConstantParas.WaterDensity; |
| | | } |
| | | |
| | | // ScadaDispatchOutput output = null; |
| | | // var inputJson = JsonHelper.Object2FormatJson(input); |
| | | // Log.Debug(flowId, inputJson); |
| | | // var inputBytes = Encoding.UTF8.GetBytes(inputJson); |
| | | // await ws.SendAsync(inputBytes, WebSocketMessageType.Text, true, CancellationToken.None); |
| | | // try |
| | | // { |
| | | // var buffer = new ArraySegment<byte>(new byte[1024 * 4]); |
| | | // WebSocketReceiveResult result = null; |
| | | // using (var ms = new MemoryStream()) |
| | | // { |
| | | // do |
| | | // { |
| | | // result = await ws.ReceiveAsync(buffer, CancellationToken.None); |
| | | // ms.Write(buffer.Array, buffer.Offset, result.Count); |
| | | // } |
| | | // while (!result.EndOfMessage); |
| | | |
| | | // ms.Seek(0, SeekOrigin.Begin); |
| | | // if (result.MessageType == WebSocketMessageType.Text && !result.CloseStatus.HasValue) |
| | | // { |
| | | // using (var reader = new StreamReader(ms, Encoding.UTF8)) |
| | | // { |
| | | // string outputJson = reader.ReadToEnd(); |
| | | // output = new ScadaDispatchOutput(); |
| | | // output.Scadas = JsonHelper.Json2Object<Dictionary<string, Dictionary<DateTime, string>>>(outputJson); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // Log.Error(flowId, ex.Message); |
| | | // } |
| | | // finally |
| | | // { |
| | | // try |
| | | // { |
| | | // //å
³éWebSocket |
| | | // await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "AcknowledgeCloseframe", CancellationToken.None); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // Log.Error(flowId, "å
³éWebSocketå¼å¸¸", ex); |
| | | // } |
| | | // ws.Abort(); |
| | | // ws.Dispose(); |
| | | // } |
| | | |
| | | // return output; |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// å建客æ·ç«¯å®ä¾ |
| | | ///// </summary> |
| | | ///// <returns></returns> |
| | | //public static async Task<ClientWebSocket> CreateAsync(string ServerUri) |
| | | //{ |
| | | // var webSocket = new ClientWebSocket(); |
| | | // webSocket.Options.RemoteCertificateValidationCallback = delegate { return true; }; |
| | | |
| | | // await webSocket.ConnectAsync(new Uri(ServerUri), CancellationToken.None); |
| | | // if (webSocket.State == WebSocketState.Open) |
| | | // { |
| | | // return webSocket; |
| | | // } |
| | | // return null; |
| | | //} |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | public string[] taglist { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// èªå¨çæ |
| | | /// </summary> |
| | | public void AutoCreate() |
| | | { |
| | | var list = new List<string>(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | public class StationDispatchInput : IValidatableObject |
| | | { |
| | | /// <summary> |
| | | /// è°åº¦æµç¨æ è¯ï¼æ¹æ¡è®¡ç®åè¿åï¼åºåè°åº¦æ¹æ¡çå¯ä¸æ§ï¼ |
| | | /// 对象å表 |
| | | /// </summary> |
| | | public string FlowId { get; set; } |
| | | public Dictionary<string, double> objects { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°´åå表 |
| | | /// 计ç®ç¶æ 0:失败 1:æå |
| | | /// </summary> |
| | | public List<FactoryDispatchInput> Factory { get; set; } |
| | | public int flag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// æ¥æ¶æ¶é´ |
| | | /// </summary> |
| | | public DateTime ReceiptTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿åæ¶é´ |
| | | /// </summary> |
| | | public DateTime ReturnTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ä¿¡æ¯ |
| | | /// </summary> |
| | | public string message { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// éªè¯ |
| | | /// </summary> |
| | | public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
| | | { |
| | | if (Factory == null || Factory.Count < 1) |
| | | if (objects == null || objects.Count < 1) |
| | | { |
| | | yield return |
| | | new ValidationResult("Factory ä¸è½ä¸ºç©º", new[] { nameof(Factory) }); |
| | | new ValidationResult("objects ä¸è½ä¸ºç©º", new[] { nameof(objects) }); |
| | | } |
| | | else if (objects.Count < 4) |
| | | { |
| | | yield return |
| | | new ValidationResult("objects æ°æ®ç¼ºå¤±", new[] { nameof(objects) }); |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < Factory.Count; i++) |
| | | if (!objects.ContainsKey("TotalFlow1")) |
| | | { |
| | | var f = Factory[i]; |
| | | if (f.Value < 1) |
| | | yield return |
| | | new ValidationResult(" objects [TotalFlow1]æ°æ®ç¼ºå¤±", new[] { nameof(objects) }); |
| | | } |
| | | else |
| | | { |
| | | if (objects["TotalFlow1"] < 1) |
| | | { |
| | | yield return |
| | | new ValidationResult($"æ°´å墿°´éè¿ä½! ID:{f.Id} Value:{f.Value}", new[] { nameof(Factory) }); |
| | | new ValidationResult($"ä¸è¾æ°´å¢æ°´éè¿ä½! tag:TotalFlow1 Value:{objects["TotalFlow1"]}", new[] { nameof(objects) }); |
| | | } |
| | | } |
| | | |
| | | if (!objects.ContainsKey("TotalPressure1")) |
| | | { |
| | | yield return |
| | | new ValidationResult(" objects [TotalPressure1]æ°æ®ç¼ºå¤±", new[] { nameof(objects) }); |
| | | } |
| | | else |
| | | { |
| | | if (objects["TotalPressure1"] < 0.01) |
| | | { |
| | | yield return |
| | | new ValidationResult($"ä¸è¾æ°´å¢åè¿ä½! tag:TotalPressure1 Value:{objects["TotalPressure1"]}", new[] { nameof(objects) }); |
| | | } |
| | | } |
| | | |
| | | if (!objects.ContainsKey("TotalFlow2")) |
| | | { |
| | | yield return |
| | | new ValidationResult(" objects [TotalFlow2]æ°æ®ç¼ºå¤±", new[] { nameof(objects) }); |
| | | } |
| | | else |
| | | { |
| | | if (objects["TotalFlow2"] < 1) |
| | | { |
| | | yield return |
| | | new ValidationResult($"äºè¾æ°´å¢æ°´éè¿ä½! tag:TotalFlow2 Value:{objects["TotalFlow2"]}", new[] { nameof(objects) }); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!objects.ContainsKey("TotalPressure2")) |
| | | { |
| | | yield return |
| | | new ValidationResult(" objects [TotalPressure2]æ°æ®ç¼ºå¤±", new[] { nameof(objects) }); |
| | | } |
| | | else |
| | | { |
| | | if (objects["TotalPressure2"] < 0.01) |
| | | { |
| | | yield return |
| | | new ValidationResult($"äºè¾æ°´å¢åè¿ä½! tag:TotalPressure2 Value:{objects["TotalPressure2"]}", new[] { nameof(objects) }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public StationDispatchOutput() { } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 对象å表 |
| | | /// </summary> |
| | | public StationDispatchOutput(StationDispatchOutput rhs) |
| | | { |
| | | this.Id = rhs.Id; |
| | | this.Index = rhs.Index; |
| | | this.Q = rhs.Q; |
| | | this.H = rhs.H; |
| | | this.E = rhs.E; |
| | | this.P = rhs.P; |
| | | this.WP = rhs.WP; |
| | | this.UWP = rhs.UWP; |
| | | this.Pumps = rhs.Pumps?.ToList(); |
| | | } |
| | | public Dictionary<string, double> objects { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ³µç«æ è¯ |
| | | /// 计ç®ç¶æ 0:失败 1:æå |
| | | /// </summary> |
| | | public string Id { get; set; } |
| | | public int flag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ³µç«ç´¢å¼ 0ï¼éè¡1è¾æ°´ 1ï¼éè¡2è¾æ°´ |
| | | /// æ¥æ¶æ¶é´ |
| | | /// </summary> |
| | | public int Index { get; set; } |
| | | public DateTime ReceiptTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµé m³/h |
| | | /// è¿åæ¶é´ |
| | | /// </summary> |
| | | public double Q { get; set; } |
| | | public DateTime ReturnTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¬ç¨ m |
| | | /// 夿³¨ä¿¡æ¯ |
| | | /// </summary> |
| | | public double H { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç % |
| | | /// </summary> |
| | | public double E { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç kw |
| | | /// </summary> |
| | | public double P { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å卿°´è½è kw/m.m3/h |
| | | /// </summary> |
| | | public double WP { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½è½è kw/m3/h |
| | | /// </summary> |
| | | public double UWP { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ³µå表 |
| | | /// </summary> |
| | | public List<PumpDispatchOutput> Pumps { get; set; } |
| | | public string message { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Remove="1-dispatch - å¤å¶\**" /> |
| | | <EmbeddedResource Remove="1-dispatch - å¤å¶\**" /> |
| | | <None Remove="1-dispatch - å¤å¶\**" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Remove="0-core\3-helper\Log - å¤å¶.cs" /> |
| | | <Compile Remove="1-dispatch\1-solution\DispatchSolution_Controller - å¤å¶.cs" /> |
| | | <Compile Remove="1-dispatch\1-solution\dto\input\FactoryDispatchInput.cs" /> |
| | | <Compile Remove="1-dispatch\1-solution\dto\output\DispatchSolutionOutput.cs" /> |
| | | <Compile Remove="1-dispatch\1-solution\dto\output\PumpDispatchOutput.cs" /> |
| | | <Compile Remove="1-dispatch\1-solution\helper\TempOutHelper.cs" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Yw.Application.Core" Version="3.0.5" /> |
| | | <PackageReference Include="Yw.Quartz.Core" Version="1.0.0" /> |
| | | <PackageReference Include="Yw.Quartz.Core" Version="3.0.0" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\..\Schedule\IStation.Algorithm\IStation.Algorithm.csproj" /> |
| | | <ProjectReference Include="..\IStation.Server\IStation.Server.csproj" /> |
| | | <ProjectReference Include="..\IStation.Service.Core\IStation.Service.Core.csproj" /> |
| | | </ItemGroup> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <PropertyGroup> |
| | | <NameOfLastUsedPublishProfile>D:\WorkCode\IStation\Code\Service.Ch.V1.0\WebApi\IStation.Entry.Core\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | --> |
| | | <Project> |
| | | <PropertyGroup> |
| | | <_PublishTargetUrl>D:\WorkData\模å\æé\Yw.Entry.Core\bin\Release\net6.0\publish\</_PublishTargetUrl> |
| | | <History>True|2023-06-26T03:38:29.6648988Z;True|2023-06-21T16:17:40.6226554+08:00;True|2023-06-21T13:30:18.8163322+08:00;True|2023-06-21T13:19:43.9290154+08:00;True|2023-06-21T11:35:28.3376504+08:00;</History> |
| | | <_PublishTargetUrl>D:\WorkCode\IStation\Code\Service.Ch.V1.0\WebApi\IStation.Entry.Core\bin\Release\net6.0\publish\</_PublishTargetUrl> |
| | | <History>True|2024-05-07T02:48:01.6650551Z;True|2024-05-07T10:33:33.1990927+08:00;True|2024-05-07T10:20:40.5715968+08:00;False|2024-05-07T10:20:22.6825823+08:00;False|2024-05-07T10:19:44.6799744+08:00;True|2023-06-26T11:38:29.6648988+08:00;True|2023-06-21T16:17:40.6226554+08:00;True|2023-06-21T13:30:18.8163322+08:00;True|2023-06-21T13:19:43.9290154+08:00;True|2023-06-21T11:35:28.3376504+08:00;</History> |
| | | <LastFailureDetails /> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | global using SqlSugar; |
| | | global using Yw.Untity; |
| | | global using System.Text; |
| | | global using IStation.Epanet.Enums; |
| | | global using System.Text; |
| | | global using Yw; |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Remove="4-dal\1-dispatch_solution\**" /> |
| | | <Compile Remove="6-service\1-dispatch_solution\**" /> |
| | | <EmbeddedResource Remove="4-dal\1-dispatch_solution\**" /> |
| | | <EmbeddedResource Remove="6-service\1-dispatch_solution\**" /> |
| | | <None Remove="4-dal\1-dispatch_solution\**" /> |
| | | <None Remove="6-service\1-dispatch_solution\**" /> |
| | | <Compile Remove="2-model\**" /> |
| | | <Compile Remove="4-dal\**" /> |
| | | <Compile Remove="5-cache\**" /> |
| | | <Compile Remove="6-service\**" /> |
| | | <Compile Remove="7-utils\**" /> |
| | | <EmbeddedResource Remove="2-model\**" /> |
| | | <EmbeddedResource Remove="4-dal\**" /> |
| | | <EmbeddedResource Remove="5-cache\**" /> |
| | | <EmbeddedResource Remove="6-service\**" /> |
| | | <EmbeddedResource Remove="7-utils\**" /> |
| | | <None Remove="2-model\**" /> |
| | | <None Remove="4-dal\**" /> |
| | | <None Remove="5-cache\**" /> |
| | | <None Remove="6-service\**" /> |
| | | <None Remove="7-utils\**" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |