using System;
|
using System.Collections.Generic;
|
using TProduct.Model;
|
|
namespace TProduct.WinFrmUI.TPump
|
{
|
public class CalcFeatTestBaseDlg : TProduct.WinFrmUI.TBase.CalcBaseDlg
|
{
|
public CalcFeatTestBaseDlg() : base()
|
{
|
}
|
public Action<TProduct.Model.PumpFeatTestRecordViewModel, int> OnSaveRecord = null;
|
|
public virtual bool NewTestRecord(
|
List<TProduct.Model.MonitorPointValuePure> valueList, bool isAutoCalc)
|
{
|
return false;
|
}
|
public virtual bool NewTestRecord4Save(
|
List<TProduct.Model.MonitorPointValuePure> valueList )
|
{
|
return false;
|
}
|
public virtual void EditTestRecord(TProduct.Model.PumpFeatTestRecordViewModel record)
|
{
|
}
|
|
public virtual void InitialMonitorInfo(List<TProduct.Model.WorkBenchMonitorPoint> allMonitorList)
|
{
|
}
|
|
protected TProduct.Model.TestProjectParas _testParas = null;
|
protected bool _isTemperatureTrn = false; //是否温度换算
|
protected double _atmospherePressure = 101.3;//大气压
|
protected double _elevation = 100;//海拔高度
|
protected TProduct.Model.ePowerTestMethod _powerTestMethod = Model.ePowerTestMethod.功率;
|
protected bool _isInlet清水池 = false;
|
|
internal void SetTestInfo(
|
TProduct.Model.WorkBenchBase bench,
|
TProduct.Model.TestProjectItemView testItem)
|
{
|
if (bench == null || testItem == null)
|
return;
|
this._testItemID = testItem.ItemID;
|
this._testItem = testItem;
|
|
|
this._testParas = testItem.ProjectParas;
|
this._isTemperatureTrn = _testParas.IsTemperatureTrn;
|
if (this._testParas.SpeedSimuMethod != null)
|
{
|
this._speedSimuMethod = _testParas.SpeedSimuMethod.Value;
|
}
|
|
|
var method = new Model.WorkBenchMethod4Pump(bench.TestMethod);
|
if (method.Power != null)
|
{
|
_powerTestMethod = method.Power.Value;
|
_isInlet清水池 = method.InletIsUseWaterLevel == 1 ? true : false;
|
}
|
|
var bench_setting = new TProduct.Model.WorkBenchSetting4Pump(bench.TestSetting);
|
this._elevation = bench_setting.Elevation;
|
this._atmospherePressure = bench_setting.AtmosphericPressure;
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
protected double _motorRatedEta = 100;
|
protected double _pumpRatedN = 2900;
|
protected TProduct.Model.eSpeedSimuMethod _speedSimuMethod = eSpeedSimuMethod.转速换算;//是否转速换算到额定转速
|
protected TProduct.Model.RatedParas4Pump _pumpRatedParas = null;
|
protected TProduct.Model.eSupplyCurrentType _supplyCurrentType = eSupplyCurrentType.交流;
|
|
/// <summary>
|
///
|
/// </summary>
|
/// <param name="ratedN"></param>
|
/// <param name="ratedParas"></param>
|
internal virtual void SetPumpInfo(TProduct.Model.ProductSeries series,TProduct.Model.ProductMainExPump pump)
|
{
|
if (pump == null || pump.Ratedn == null)
|
{
|
_speedSimuMethod = eSpeedSimuMethod.不换算; return;
|
}
|
|
if (string.IsNullOrEmpty(pump.RatedParas))
|
{
|
_speedSimuMethod = eSpeedSimuMethod.不换算; return;
|
}
|
this._pumpRatedN = pump.Ratedn.Value;
|
this._pumpRatedParas = TProduct.Model.RatedParas4Pump.ToModel(pump.RatedParas);
|
this._supplyCurrentType = _pumpRatedParas.CurrentType;
|
|
if(this._testParas != null)
|
{
|
if (this._testParas.SpeedSimuMethod == null)
|
{
|
if (series != null && series.Paras != null)
|
{
|
_speedSimuMethod = series.Paras.SpeedSimuMethod;
|
}
|
}
|
else if (this._testParas.SpeedSimuMethod == eSpeedSimuMethod.不换算)
|
{
|
_speedSimuMethod = eSpeedSimuMethod.不换算;
|
}
|
}
|
|
}
|
|
/// <summary>
|
/// 设置电机参数
|
/// </summary>
|
/// <param name="ratedEta"></param>
|
/// <param name="eatCurve"></param>
|
public virtual void SetMotorInfo(TProduct.Model.ProductMainExMotor motor)
|
{
|
}
|
|
/// <summary>
|
/// 设置阀门开度
|
/// </summary>
|
/// <param name="prop"></param>
|
/// <param name="paras"></param>
|
/// <returns></returns>
|
public virtual void SetValveDegree(string prop, double paras)
|
{
|
|
}
|
/// <summary>
|
/// 外部修改了电机效率, 刷新数据
|
/// </summary>
|
/// <param name="eta"></param>
|
public virtual bool RefreshMotorEta(double eta)
|
{
|
return true;
|
}
|
|
/// <summary>
|
/// 外部修改了额定转速, 刷新数据
|
/// </summary>
|
/// <param name="eta"></param>
|
public virtual bool RefreshRatedn(double speed)
|
{
|
this._pumpRatedN = speed;
|
return true;
|
}
|
}
|
}
|