forked from ddrilling/AsbCloudServer
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
{
|
|
#nullable enable
|
|
class DetectorSlipsTime : DetectorAbstract
|
|
{
|
|
public DetectorSlipsTime() : base(10_001, "Удержание в клиньях")
|
|
{
|
|
}
|
|
|
|
public double HookWeightSP { get; set; } = 20;
|
|
public double PressureSP { get; set; } = 15;
|
|
public double PosisionSP { get; set; } = 8;
|
|
|
|
protected override bool DetectStart(DetectableTelemetry[] telemetry, int position)
|
|
{
|
|
var item = telemetry[position];
|
|
|
|
var result = item.HookWeight < HookWeightSP &&
|
|
item.Pressure < PressureSP &&
|
|
item.BlockPosition < PosisionSP;
|
|
|
|
return result;
|
|
}
|
|
|
|
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position)
|
|
{
|
|
var item = telemetry[position];
|
|
|
|
var result = item.Pressure > PressureSP &&
|
|
item.BlockPosition > PosisionSP;
|
|
|
|
return result;
|
|
}
|
|
}
|
|
#nullable disable
|
|
}
|