/// <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> /// Adds a new layer to the layers collection for this cell /// </summary> /// <param name="layer"></param> /// <param name="layerRecycledIndex"></param> public void AddLayer(IProfileLayer layer, int layerRecycledIndex) { // ReSharper disable once UseMethodAny.2 if (!(Layers.Count() == 0 || layer.LastLayerPassTime >= Layers.Last().LastLayerPassTime)) { Log.LogError("Layer times are out of order"); layerRecycledIndex = -1; return; } // If the layer has been recycled then there is no need to add it again to the layer list Layers.Add(layer, layerRecycledIndex); }
/// <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> /// Determines if the recorded time of a given pass lies within the time range of a layer that is /// deemed to be superseded by another layer /// </summary> /// <param name="Pass"></param> /// <returns></returns> public bool IsInSupersededLayer(CellPass Pass) { for (int I = 0; I < Layers.Count(); I++) { IProfileLayer layer = Layers[I]; if ((layer.Status & LayerStatus.Superseded) != 0) { if (Pass.Time >= Passes.FilteredPassData[layer.StartCellPassIdx].FilteredPass.Time && Pass.Time <= layer.LastLayerPassTime) { return(true); } } } return(false); }
public void Test_ProfileCell_RequestNewLayer() { ProfileCell cell = new ProfileCell(); IProfileLayer layer = cell.RequestNewLayer(out int RecycledIndex); cell.Layers.Add(layer, RecycledIndex); Assert.True(layer != null, "RequestNewLayer did not return a new layer"); Assert.True(-1 == RecycledIndex, "Recycled index not -1 for new layer with no recyclbles available"); cell.ClearLayers(); layer = cell.RequestNewLayer(out RecycledIndex); Assert.True(layer != null, "RequestNewLayer did not return a new layer after recycling previous layer"); Assert.True(0 == RecycledIndex, "Recycled index not 0 for new layer with one recyclable available"); }
/// <summary> /// Constructs a new layer from the set of cell passes contained in a multiple cell pass filtering result /// </summary> /// <param name="filteredPassValues"></param> public void AddLayer(FilteredMultiplePassInfo filteredPassValues) { if (Layers.Count() != 0) { Log.LogError("Cannot add a layer via FilteredPassValues if there are already layers in the cell"); return; } if (filteredPassValues.PassCount == 0) { return; } IProfileLayer NewLayer = RequestNewLayer(out int LayerRecycledIndex); NewLayer.StartCellPassIdx = 0; NewLayer.EndCellPassIdx = filteredPassValues.PassCount - 1; NewLayer.Assign(filteredPassValues); AddLayer(NewLayer, LayerRecycledIndex); }