commit
2e8d94ca2d
2 changed files with 37 additions and 70 deletions
|
|
@ -46,7 +46,7 @@ fill_pattern = honeycomb
|
||||||
first_layer_acceleration = 0
|
first_layer_acceleration = 0
|
||||||
first_layer_bed_temperature = 75
|
first_layer_bed_temperature = 75
|
||||||
first_layer_extrusion_width = 100%
|
first_layer_extrusion_width = 100%
|
||||||
first_layer_height = 0.5
|
first_layer_height = 0.3
|
||||||
first_layer_speed = 30%
|
first_layer_speed = 30%
|
||||||
first_layer_temperature = 205
|
first_layer_temperature = 205
|
||||||
g0 = 0
|
g0 = 0
|
||||||
|
|
|
||||||
|
|
@ -91,25 +91,17 @@ namespace MatterControl.Tests.MatterControl
|
||||||
ValidateOnAllPrinters(printer =>
|
ValidateOnAllPrinters(printer =>
|
||||||
{
|
{
|
||||||
string extruderCountString = printer.SettingsLayer.ValueOrDefault("extruder_count");
|
string extruderCountString = printer.SettingsLayer.ValueOrDefault("extruder_count");
|
||||||
|
if (!string.IsNullOrEmpty(extruderCountString))
|
||||||
// TODO: Should extruder count be required as originally expected?
|
|
||||||
if (string.IsNullOrEmpty(extruderCountString))
|
|
||||||
{
|
{
|
||||||
Console.WriteLine("extruder_count missing: " + printer.RelativeConfigPath);
|
int extruderCount;
|
||||||
return;
|
if (!int.TryParse(extruderCountString, out extruderCount))
|
||||||
|
{
|
||||||
|
Assert.Fail("Invalid [extruder_count] value (int parse failed): " + printer.RelativeConfigPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must be greater than zero
|
||||||
|
Assert.Greater(extruderCount, 0, "[extruder_count]: " + printer.RelativeConfigPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must exist in all configs
|
|
||||||
Assert.IsNotNullOrEmpty(extruderCountString, "[extruder_count] must exist: " + printer.RelativeConfigPath);
|
|
||||||
|
|
||||||
int extruderCount;
|
|
||||||
if (!int.TryParse(extruderCountString, out extruderCount))
|
|
||||||
{
|
|
||||||
Assert.Fail("Invalid [extruder_count] value (int parse failed): " + printer.RelativeConfigPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be greater than zero
|
|
||||||
Assert.Greater(extruderCount, 0, "[extruder_count]: " + printer.RelativeConfigPath);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,27 +205,43 @@ namespace MatterControl.Tests.MatterControl
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void FirstLayerHeightLessThanNozzleDiameter()
|
public void FirstLayerHeightLessThanNozzleDiameterXExtrusionMultiplier()
|
||||||
{
|
{
|
||||||
ValidateOnAllPrinters(printer =>
|
ValidateOnAllPrinters(printer =>
|
||||||
{
|
{
|
||||||
float nozzleDiameter = float.Parse(printer.SettingsLayer.ValueOrDefault("nozzle_diameter"));
|
float nozzleDiameter = float.Parse(printer.SettingsLayer.ValueOrDefault("nozzle_diameter"));
|
||||||
float layerHeight = float.Parse(printer.SettingsLayer.ValueOrDefault("layer_height"));
|
float layerHeight = float.Parse(printer.SettingsLayer.ValueOrDefault("layer_height"));
|
||||||
|
|
||||||
|
|
||||||
|
float firstLayerExtrusionWidth;
|
||||||
|
|
||||||
|
string firstLayerExtrusionWidthString = printer.SettingsLayer.ValueOrDefault("first_layer_extrusion_width");
|
||||||
|
if (!string.IsNullOrEmpty(firstLayerExtrusionWidthString) && firstLayerExtrusionWidthString.Trim() != "0")
|
||||||
|
{
|
||||||
|
firstLayerExtrusionWidth = ValueOrPercentageOf(firstLayerExtrusionWidthString, nozzleDiameter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
firstLayerExtrusionWidth = nozzleDiameter;
|
||||||
|
}
|
||||||
|
|
||||||
string firstLayerHeightString = printer.SettingsLayer.ValueOrDefault("first_layer_height");
|
string firstLayerHeightString = printer.SettingsLayer.ValueOrDefault("first_layer_height");
|
||||||
if (!string.IsNullOrEmpty(firstLayerHeightString))
|
if (!string.IsNullOrEmpty(firstLayerHeightString))
|
||||||
{
|
{
|
||||||
float firstLayerHeight = ValueOrPercentageOf(firstLayerHeightString, layerHeight);
|
float firstLayerHeight = ValueOrPercentageOf(firstLayerHeightString, layerHeight);
|
||||||
|
|
||||||
|
double minimumLayerHeight = firstLayerExtrusionWidth * 0.85;
|
||||||
|
|
||||||
// TODO: Remove once validated and resolved
|
// TODO: Remove once validated and resolved
|
||||||
if (firstLayerHeight >= nozzleDiameter)
|
if (firstLayerHeight >= minimumLayerHeight)
|
||||||
{
|
{
|
||||||
printer.RuleViolated = true;
|
printer.RuleViolated = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.Less(firstLayerHeight, nozzleDiameter, "[first_layer_height] must be less than [nozzle_diameter]: " + printer.RelativeConfigPath);
|
Assert.Less(firstLayerHeight, minimumLayerHeight, "[first_layer_height] must be less than [firstLayerExtrusionWidth]: " + printer.RelativeConfigPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,20 +253,21 @@ namespace MatterControl.Tests.MatterControl
|
||||||
float nozzleDiameter = float.Parse(printer.SettingsLayer.ValueOrDefault("nozzle_diameter"));
|
float nozzleDiameter = float.Parse(printer.SettingsLayer.ValueOrDefault("nozzle_diameter"));
|
||||||
float layerHeight = float.Parse(printer.SettingsLayer.ValueOrDefault("layer_height"));
|
float layerHeight = float.Parse(printer.SettingsLayer.ValueOrDefault("layer_height"));
|
||||||
|
|
||||||
|
double minimumLayerHeight = nozzleDiameter * 0.85;
|
||||||
|
|
||||||
// TODO: Remove once validated and resolved
|
// TODO: Remove once validated and resolved
|
||||||
if (layerHeight >= nozzleDiameter)
|
if (layerHeight >= minimumLayerHeight)
|
||||||
{
|
{
|
||||||
printer.RuleViolated = true;
|
printer.RuleViolated = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.Less(layerHeight, nozzleDiameter, "[layer_height] must be less than [nozzle_diameter]: " + printer.RelativeConfigPath);
|
Assert.Less(layerHeight, minimumLayerHeight, "[layer_height] must be less than [minimumLayerHeight]: " + printer.RelativeConfigPath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Requires review
|
|
||||||
[Test]
|
[Test]
|
||||||
public void LayerHeightAcceptable()
|
public void FirstLayerExtrusionWidthGreaterThanNozzleDiameterIfSet()
|
||||||
{
|
{
|
||||||
ValidateOnAllPrinters(printer =>
|
ValidateOnAllPrinters(printer =>
|
||||||
{
|
{
|
||||||
|
|
@ -268,55 +277,13 @@ namespace MatterControl.Tests.MatterControl
|
||||||
if (!string.IsNullOrEmpty(firstLayerExtrusionWidthString))
|
if (!string.IsNullOrEmpty(firstLayerExtrusionWidthString))
|
||||||
{
|
{
|
||||||
float firstLayerExtrusionWidth = ValueOrPercentageOf(firstLayerExtrusionWidthString, nozzleDiameter);
|
float firstLayerExtrusionWidth = ValueOrPercentageOf(firstLayerExtrusionWidthString, nozzleDiameter);
|
||||||
|
if (firstLayerExtrusionWidth == 0)
|
||||||
// TODO: Why are we finding the product of the extrusion width and nozzleDiameter?
|
|
||||||
float firstLayerExtrusionWidthToTest = firstLayerExtrusionWidth * nozzleDiameter;
|
|
||||||
float firstLayerExtrusionWidthThreshold = nozzleDiameter * 4;
|
|
||||||
|
|
||||||
if (firstLayerExtrusionWidthToTest >= firstLayerExtrusionWidthThreshold ||
|
|
||||||
firstLayerExtrusionWidthToTest <= 0 )
|
|
||||||
{
|
{
|
||||||
if (firstLayerExtrusionWidthToTest >= firstLayerExtrusionWidthThreshold)
|
// Ignore zeros
|
||||||
{
|
|
||||||
Console.WriteLine("Extrusion width greater than threshold: " + printer.RelativeConfigPath);
|
|
||||||
}
|
|
||||||
else if (firstLayerExtrusionWidthToTest <= 0)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Extrusion width <= 0: " + printer.RelativeConfigPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
printer.RuleViolated = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.Less(firstLayerExtrusionWidthToTest, firstLayerExtrusionWidthThreshold, "[first_layer_extrusion_width] greater than acceptable value: " + printer.RelativeConfigPath);
|
Assert.GreaterOrEqual(firstLayerExtrusionWidth, nozzleDiameter, "[first_layer_extrusion_width] must be nozzle diameter or greater: " + printer.RelativeConfigPath);
|
||||||
|
|
||||||
// TODO: We're not validating first_layer_extrusion_width as we have the product of nozzleDiameter and firstLayerExtrusionWidth. Seems confusing
|
|
||||||
Assert.Greater(firstLayerExtrusionWidthToTest, 0, "First layer extrusion width cannot be zero: " + printer.RelativeConfigPath);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void FirstLayerExtrusionWidthGreaterThanZero()
|
|
||||||
{
|
|
||||||
ValidateOnAllPrinters(printer =>
|
|
||||||
{
|
|
||||||
float nozzleDiameter = float.Parse(printer.SettingsLayer.ValueOrDefault("nozzle_diameter"));
|
|
||||||
|
|
||||||
string firstLayerExtrusionWidthString = printer.SettingsLayer.ValueOrDefault("first_layer_extrusion_width");
|
|
||||||
if (!string.IsNullOrEmpty(firstLayerExtrusionWidthString))
|
|
||||||
{
|
|
||||||
float firstLayerExtrusionWidth = ValueOrPercentageOf(firstLayerExtrusionWidthString, nozzleDiameter);
|
|
||||||
|
|
||||||
// TODO: Remove once validated and resolved
|
|
||||||
if (firstLayerExtrusionWidth <= 0)
|
|
||||||
{
|
|
||||||
printer.RuleViolated = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert.Greater(firstLayerExtrusionWidth, 0, "[first_layer_extrusion_width] must be greater than zero: " + printer.RelativeConfigPath);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue