/// <summary> /// Assigns the contents of another profile layer to this profile layer /// </summary> public void Assign(IProfileLayer source_) { ProfileLayer source = (ProfileLayer)source_; MachineID = source.MachineID; LastLayerPassTime = source.LastLayerPassTime; CCV = source.CCV; TargetCCV = source.TargetCCV; MDP = source.MDP; TargetMDP = source.TargetMDP; CCA = source.CCA; TargetCCA = source.TargetCCA; RadioLatency = source.RadioLatency; StartCellPassIdx = source.StartCellPassIdx; EndCellPassIdx = source.EndCellPassIdx; TargetPassCount = source.TargetPassCount; Status = source.Status; Thickness = source.Thickness; TargetThickness = source.Thickness; Height = source.Height; RMV = source.RMV; Frequency = source.Frequency; Amplitude = source.Amplitude; MaterialTemperature = source.MaterialTemperature; MaxThickness = source.MaxThickness; }
/// <summary> /// Requests a new layer, which may be provision from the recycle list in the layer /// </summary> /// <param name="layerRecycledIndex"></param> /// <returns></returns> public IProfileLayer RequestNewLayer(out int layerRecycledIndex) { IProfileLayer result = Layers.GetRecycledLayer(out layerRecycledIndex); if (layerRecycledIndex != -1) { result.Clear(); } else { result = new ProfileLayer(this); } return(result); }
/// <summary> /// Serializes content from the writer /// </summary> public override void InternalFromBinary(IBinaryRawReader reader) { base.InternalFromBinary(reader); var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER); if (version == 1) { Layers = new ProfileLayers(); var numberOfLayers = reader.ReadInt(); for (var i = 1; i <= numberOfLayers; i++) { var layer = new ProfileLayer(this); layer.FromBinary(reader); Layers.Add(layer, -1); } CellLowestElev = reader.ReadFloat(); CellHighestElev = reader.ReadFloat(); CellLastElev = reader.ReadFloat(); CellFirstElev = reader.ReadFloat(); CellLowestCompositeElev = reader.ReadFloat(); CellHighestCompositeElev = reader.ReadFloat(); CellLastCompositeElev = reader.ReadFloat(); CellFirstCompositeElev = reader.ReadFloat(); CellCCV = reader.ReadShort(); CellTargetCCV = reader.ReadShort(); CellPreviousMeasuredCCV = reader.ReadShort(); CellPreviousMeasuredTargetCCV = reader.ReadShort(); CellCCVElev = reader.ReadFloat(); CellMDP = reader.ReadShort(); CellTargetMDP = reader.ReadShort(); CellMDPElev = reader.ReadFloat(); CellCCA = reader.ReadByte(); CellTargetCCA = reader.ReadShort(); CellCCAElev = reader.ReadFloat(); CellTopLayerThickness = reader.ReadFloat(); IncludesProductionData = reader.ReadBoolean(); TopLayerPassCount = (ushort)reader.ReadInt(); TopLayerPassCountTargetRangeMin = (ushort)reader.ReadInt(); TopLayerPassCountTargetRangeMax = (ushort)reader.ReadInt(); CellMaxSpeed = (ushort)reader.ReadInt(); CellMinSpeed = (ushort)reader.ReadInt(); (Passes ?? (Passes = new FilteredMultiplePassInfo())).FromBinary(reader); FilteredPassFlags = reader.ReadBooleanArray(); FilteredPassCount = reader.ReadInt(); FilteredHalfPassCount = reader.ReadInt(); AttributeExistenceFlags = (ProfileCellAttributeExistenceFlags)reader.ReadInt(); CellMaterialTemperature = (ushort)reader.ReadInt(); CellMaterialTemperatureWarnMin = (ushort)reader.ReadInt(); CellMaterialTemperatureWarnMax = (ushort)reader.ReadInt(); CellMaterialTemperatureElev = reader.ReadFloat(); } }
/// <summary> /// Checks to see if compaction as measured by CCV/MDP or CCA has met or not the compaction metrics /// </summary> public void CheckLiftCompaction(ProfileLayer layer, IOverrideParameters overrides, GridDataType gridDataType) { // CCA tracking vars int Tolerance = 0; // How many extra passes is OK before over-compaction is set bool TargetMeet = false; int ValidCCAPasses = 0; bool IsCCV = gridDataType == GridDataType.CCV || gridDataType == GridDataType.CCVPercent; bool IsMDP = gridDataType == GridDataType.MDP || gridDataType == GridDataType.MDPPercent; bool IsCCA = gridDataType == GridDataType.CCA || gridDataType == GridDataType.CCAPercent; short ATargetCCV = overrides.OverrideMachineCCV ? overrides.OverridingMachineCCV : CellPassConsts.NullCCV; short ATargetMDP = overrides.OverrideMachineMDP ? overrides.OverridingMachineMDP : CellPassConsts.NullMDP; for (int I = layer.EndCellPassIdx; I >= layer.StartCellPassIdx; I--) { if (Passes.FilteredPassData[I].FilteredPass.CCV == CellPassConsts.NullCCV && Passes.FilteredPassData[I].FilteredPass.MDP == CellPassConsts.NullMDP && Passes.FilteredPassData[I].FilteredPass.CCA == CellPassConsts.NullCCA) { continue; } if (!FilteredPassFlags[I]) { continue; } // If gridType = icdtAll then only one type should have a non null value if (IsCCV || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].FilteredPass.CCV != CellPassConsts.NullCCV) { if (!overrides.OverrideMachineCCV) { ATargetCCV = Passes.FilteredPassData[I].TargetValues.TargetCCV; } if (ATargetCCV == CellPassConsts.NullCCV) { continue; } if (Passes.FilteredPassData[I].FilteredPass.CCV < ATargetCCV * overrides.CMVRange.Min / 100) { layer.Status |= LayerStatus.Undercompacted; } else if (Passes.FilteredPassData[I].FilteredPass.CCV > ATargetCCV * overrides.CMVRange.Max / 100) { layer.Status |= LayerStatus.Overcompacted; } } } if (IsMDP || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].FilteredPass.MDP != CellPassConsts.NullMDP) { if (!overrides.OverrideMachineMDP) { ATargetMDP = Passes.FilteredPassData[I].TargetValues.TargetMDP; } if (ATargetMDP == CellPassConsts.NullMDP) { continue; } if (Passes.FilteredPassData[I].FilteredPass.MDP < ATargetMDP * overrides.MDPRange.Min / 100) { layer.Status |= LayerStatus.Undercompacted; } else if (Passes.FilteredPassData[I].FilteredPass.MDP > ATargetMDP * overrides.MDPRange.Max / 100) { layer.Status |= LayerStatus.Overcompacted; } } } // For CCA it will always be for one machine we are looking at // Also compaction logic is different to above compaction types if (IsCCA || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].TargetValues.TargetCCA == CellPassConsts.NullCCA) { continue; } if (Passes.FilteredPassData[I].FilteredPass.CCA != CellPassConsts.NullCCA) { ValidCCAPasses++; // Last valid CCA pass is the most important to state if ((Passes.FilteredPassData[I].FilteredPass.CCA / 2) >= Passes.FilteredPassData[I].TargetValues.TargetCCA ) // is target meet { if (TargetMeet) // has happened before { if ((ValidCCAPasses - 1) > Tolerance) { // They have done too much work layer.Status |= LayerStatus.Overcompacted; break; } } else { TargetMeet = true; // Next check to see if previous pass also meet target } } else { // Target not meet layer.Status |= TargetMeet ? LayerStatus.Complete : LayerStatus.Undercompacted; break; } } if (I == layer.StartCellPassIdx) // if no more passes to check { layer.Status |= TargetMeet ? LayerStatus.Complete : LayerStatus.Undercompacted; } continue; // Continue until satisfied checking for over-compacted or at end of layer } break; } }