public VariationPoint(int percentRange, ICheckPoint checkPointUpward, ICheckPoint checkPointTopdown, double rangeMin, double rangeMax, double classPrecision,
                              double marginCoefficient = 0.8F)
        {
            PercentRange = percentRange;
            PressureUnitsEnum units = checkPointUpward.PressureUnits;

            // Вычисление вариации
            if (checkPointUpward is CurrentCheckPoint && checkPointTopdown is CurrentCheckPoint)
            {
                const double СurrentMin     = 4;
                const double СurrentMax     = 20;
                double       currentUpwards = (checkPointUpward as CurrentCheckPoint).MeasuredCurrent;
                double       currentTopdown = (checkPointTopdown as CurrentCheckPoint).MeasuredCurrent;
                Value = Math.Round(Math.Abs(100 * (currentUpwards - currentTopdown) / (СurrentMax - СurrentMin)), CalcPrecision, MidpointRounding.AwayFromZero);
            }
            else
            {
                Pressure pressureMax = new Pressure(rangeMax, units);
                Pressure pressureMin = new Pressure(rangeMin, units);
                Value = Math.Round(100 * (checkPointUpward.Pressure.PressureByUnits - checkPointTopdown.Pressure.PressureByUnits) / (pressureMax.PressureByUnits - pressureMin.PressureByUnits),
                                   CalcPrecision, MidpointRounding.AwayFromZero);
            }

            // Тест в точке пройден, если вариация меньше половины класса точности с учетом коэффициента запаса
            Resume = Math.Abs(Value) < classPrecision * marginCoefficient / 2;
        }
 public CheckPointTests()
 {
     checkPoint = new CheckPoint();
     sampleDataPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + @"\SampleData";
     inputFolderPath = sampleDataPath + @"\Input";
     outputFolderPath = sampleDataPath + @"\Output";
     InvalidDataFolderPath = sampleDataPath + @"\InvalidData";
 }
 public AggregateEventSubscriber(IConnectionMultiplexer connectionMultiplexer, IServiceProvider provider,
                                 ICheckPoint checkPoint, Configuration configuration = null)
 {
     _connectionMultiplexer = connectionMultiplexer;
     _checkPoint            = checkPoint;
     _configuration         = configuration ?? new Configuration();
     _eventDispatcher       = new EventDispatcher(provider);
 }
Beispiel #4
0
        public GameObject CreateCheckPoint(ICheckPoint checkPoint)
        {
            GameObject      go = Instantiate(CheckPointPrefabs[checkPoint.GetPointType()], m_Root.transform);
            UnityCheckPoint unityCheckPoint = go.GetComponent <UnityCheckPoint>();

            go.name = "checkPoint " + checkPoint.GetX() + " " + checkPoint.GetY();
            go.transform.position = new Vector3(checkPoint.GetX() * CellSize, 0, checkPoint.GetY() * CellSize);

            m_CheckPoints.Add(unityCheckPoint);

            unityCheckPoint.Init(checkPoint);

            return(go);
        }
Beispiel #5
0
        public void RemoveCheckPointAt(int x, int y)
        {
            for (int i = 0; i < m_CheckPoints.Count; ++i)
            {
                ICheckPoint checkPointObj = m_CheckPoints[i].GetCheckPoint();
                if (checkPointObj.GetX().Equals(x) && checkPointObj.GetY().Equals(y))
                {
                    DestroyImmediate(m_CheckPoints[i].gameObject);
                    m_CheckPoints.RemoveAt(i);

                    break;
                }
            }
        }
Beispiel #6
0
        private void AddMeasureTestPoint(double point, MeasureResults measureResults,
                                         CancellationToken cancellationToken, IProgress <int> progress)
        {
            ICheckPoint checkPoint = measurmentTools.GetCheckPoint(point, rangeMin_Pa, rangeMax_Pa, absoluteType, pressureUnits,
                                                                   classPrecision, marginCoefficient, cancellationToken);

            if (measureResults == null)
            {
                measureResults = new MeasureResults();
            }
            measureResults.Add(checkPoint);
            UpdResultsEvent?.Invoke(this, new EventArgs());
            progressValue += deltaProgress;
            progress.Report((int)progressValue);
            waitContinue?.Invoke(cancellationToken);
        }
Beispiel #7
0
 public void Add(ICheckPoint checkPoint)
 {
     checkPoints.Add(checkPoint);
 }
Beispiel #8
0
 public void AddCheckPoint(ICheckPoint checkPoint)
 {
     m_CheckPoints.Add(checkPoint.GetIndex(), checkPoint);
 }
 public void Init(ICheckPoint checkPoint)
 {
     m_CheckPoint = checkPoint;
 }
Beispiel #10
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(ICheckPoint source, params string[] includedColumns)
		{
			if (includedColumns.Contains(CheckPointsTable.IdCol)) this.Id = source.Id;
			if (includedColumns.Contains(CheckPointsTable.NameIdCol)) this.NameId = source.NameId;
			if (includedColumns.Contains(CheckPointsTable.CheckPointTimeCol)) this.CheckPointTime = source.CheckPointTime;
			if (includedColumns.Contains(CheckPointsTable.DescriptionCol)) this.Description = source.Description;
			if (includedColumns.Contains(CheckPointsTable.ModificationLaterThanCol)) this.ModificationLaterThan = source.ModificationLaterThan;
			if (includedColumns.Contains(CheckPointsTable.LastUpdateTokenCol)) this.LastUpdateToken = source.LastUpdateToken;
		}
Beispiel #11
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(ICheckPoint source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.Id = source.Id;
			this.NameId = source.NameId;
			this.CheckPointTime = source.CheckPointTime;
			this.Description = source.Description;
			this.ModificationLaterThan = source.ModificationLaterThan;
			this.LastUpdateToken = source.LastUpdateToken;
		}
Beispiel #12
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(ICheckPoint target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.Id = this.Id;
			target.NameId = this.NameId;
			target.CheckPointTime = this.CheckPointTime;
			target.Description = this.Description;
			target.ModificationLaterThan = this.ModificationLaterThan;
			target.LastUpdateToken = this.LastUpdateToken;
		}