12345678910111213141516171819202122232425262728293031323334353637 |
- using Ips.DevAlgorithm;
- using Ips.Library.Basic;
- using Ips.Library.DxpLib;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Ips.Sps.Cfqs
- {
- public class CfqManager
- {
- public static CfqManager Default = new CfqManager();
- public static string CfqCliPath = Path.Combine(IpsPath.CliRootDir, "bpq", "bpq.exe");
- public bool SetCfqList(IEnumerable<SetCfqItem> setCfqList, out string errMsg, CancellationToken token = default)
- {
- bool result = false;
- errMsg = "";
- if (CfqCliPath.IsNotNullOrWhitespace())
- {
- if (!CfqUtil.SetFreqByCli(CfqCliPath, setCfqList, out errMsg, token))
- {
- IpsLogger.Warn(errMsg);
- }
- else
- {
- IpsLogger.Info($"设置变频器成功,频点:{setCfqList.OrderBy(m => m.CfqAddr).Select(m => m.FreqPoint.E6m()).JoinAsString(",")}");
- result = true;
- }
- }
- return result;
- }
- }
- }
|