Commit 15c94173 authored by 潘栩锋's avatar 潘栩锋 🚴

IBC 支持数据库

parent 60ec0326
using FLY.Thick.RemoteHistory;
using FObjBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.IBC.Common
{
public class FlyData_IBCCtrl : IFlyData,INotifyPropertyChanged
{
/// <summary>
/// 时间点
/// </summary>
public DateTime Time { get; set; }
/// <summary>
/// 折径显示(mm)
/// </summary>
public float FilmWidth { get; set; }
/// <summary>
/// 进风运行频率(Hz)(自动调节)
/// </summary>
public float InletAirFreq { get; set; }
/// <summary>
/// 出风运行频率(Hz)(手动调节)
/// </summary>
public float OutletAirFreq { get; set; }
/// <summary>
/// 进风-出风
/// </summary>
public float DFreq {
get {
return InletAirFreq - OutletAirFreq;
}
}
public event PropertyChangedEventHandler PropertyChanged;
#region IFlyData
public string GetHeader()
{
string header = "时间";
header += ",折径(mm)";
header += ",进风频率";
header += ",出风频率";
return header;
}
public override string ToString()
{
string str;
str = Time.ToString();//时间
str += "," + FilmWidth.ToString("F1");//折径(mm)
str += "," + InletAirFreq.ToString("F1");//进风频率
str += "," + OutletAirFreq.ToString("F1");//出风频率
return str;
}
public bool TryParse(string header_str, string str)
{
string[] items = header_str.Split(new char[] { ',' });
if (items.Length < 4)
return false;
items = str.Split(new char[] { ',' });
if (items.Length < 4)
return false;
int idx = 0;
DateTime t;
float f;
//时间
if (!DateTime.TryParse(items[idx], out t))
return false;
Time = t;
idx++;
//折径(mm)
if (!float.TryParse(items[idx], out f))
return false;
FilmWidth = f;
idx++;
//进风频率
if (!float.TryParse(items[idx], out f))
return false;
InletAirFreq = f;
idx++;
//出风频率
if (!float.TryParse(items[idx], out f))
return false;
OutletAirFreq = f;
idx++;
return true;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.IBC.Common
{
public class IBCCtrlListData : INotifyPropertyChanged
{
/// <summary>
/// 数据间隔,单位s
/// </summary>
public int Interval { get; set; }
public IBCCtrlListData()
{
Interval = 2;
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
......@@ -48,8 +48,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Client\IBCSystemClient.cs" />
<Compile Include="Common\FlyData_IBCCtrl.cs" />
<Compile Include="Common\IBCCtrlData.cs" />
<Compile Include="Common\ERRNOs.cs" />
<Compile Include="Common\IBCData.cs" />
<Compile Include="IService\IIBCSystemService.cs" />
......
......@@ -60,10 +60,7 @@ namespace FLY.IBC.Server
HistoryDb historyDb;
WarningSystem warning;
static IBCSystem()
{
Misc.SaveToXmlHepler.Regist(typeof(IBCCtrlListData));
}
public IBCSystem()
{
Load();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment