mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 00:21:25 +00:00
API: switch to Distance type for thermal settings
This commit is contained in:
parent
ecfc868832
commit
0ba869465c
@ -423,9 +423,9 @@ enum CustomPadShapeZoneFillStrategy
|
||||
|
||||
message ThermalSpokeSettings
|
||||
{
|
||||
optional int64 width = 1;
|
||||
kiapi.common.types.Distance width = 1;
|
||||
kiapi.common.types.Angle angle = 2;
|
||||
optional int64 gap = 3;
|
||||
kiapi.common.types.Distance gap = 3;
|
||||
}
|
||||
|
||||
message Pad
|
||||
|
@ -243,10 +243,10 @@ bool PADSTACK::Deserialize( const google::protobuf::Any& aContainer )
|
||||
const ThermalSpokeSettings& thermals = padstack.zone_settings().thermal_spokes();
|
||||
|
||||
if( thermals.has_gap() )
|
||||
CopperLayer( ALL_LAYERS ).thermal_gap = thermals.gap();
|
||||
CopperLayer( ALL_LAYERS ).thermal_gap = thermals.gap().value_nm();
|
||||
|
||||
if( thermals.has_width() )
|
||||
CopperLayer( ALL_LAYERS ).thermal_spoke_width = thermals.width();
|
||||
CopperLayer( ALL_LAYERS ).thermal_spoke_width = thermals.width().value_nm();
|
||||
|
||||
SetThermalSpokeAngle( thermals.angle().value_degrees(), F_Cu );
|
||||
}
|
||||
@ -452,11 +452,11 @@ void PADSTACK::Serialize( google::protobuf::Any& aContainer ) const
|
||||
*CopperLayer( ALL_LAYERS ).zone_connection ) );
|
||||
}
|
||||
|
||||
if( CopperLayer( ALL_LAYERS ).thermal_spoke_width.has_value() )
|
||||
thermalSettings->set_width( *CopperLayer( ALL_LAYERS ).thermal_spoke_width );
|
||||
if( std::optional<int> width = CopperLayer( ALL_LAYERS ).thermal_spoke_width )
|
||||
thermalSettings->mutable_width()->set_value_nm( *width );
|
||||
|
||||
if( CopperLayer( ALL_LAYERS ).thermal_gap.has_value() )
|
||||
thermalSettings->set_gap( *CopperLayer( ALL_LAYERS ).thermal_gap );
|
||||
if( std::optional<int> gap = CopperLayer( ALL_LAYERS ).thermal_gap )
|
||||
thermalSettings->mutable_gap()->set_value_nm( *gap );
|
||||
|
||||
thermalSettings->mutable_angle()->set_value_degrees( ThermalSpokeAngle( F_Cu ).AsDegrees() );
|
||||
|
||||
|
@ -255,8 +255,8 @@ void ZONE::Serialize( google::protobuf::Any& aContainer ) const
|
||||
ToProtoEnum<ZONE_CONNECTION, types::ZoneConnectionStyle>( m_PadConnection ) );
|
||||
|
||||
types::ThermalSpokeSettings* thermals = cu->mutable_connection()->mutable_thermal_spokes();
|
||||
thermals->set_width( m_thermalReliefSpokeWidth );
|
||||
thermals->set_gap( m_thermalReliefGap );
|
||||
thermals->mutable_width()->set_value_nm( m_thermalReliefSpokeWidth );
|
||||
thermals->mutable_gap()->set_value_nm( m_thermalReliefGap );
|
||||
// n.b. zones don't currently have an overall thermal angle override
|
||||
|
||||
cu->mutable_clearance()->set_value_nm( m_ZoneClearance );
|
||||
@ -343,8 +343,8 @@ bool ZONE::Deserialize( const google::protobuf::Any& aContainer )
|
||||
{
|
||||
const types::CopperZoneSettings& cu = zone.copper_settings();
|
||||
m_PadConnection = FromProtoEnum<ZONE_CONNECTION>( cu.connection().zone_connection() );
|
||||
m_thermalReliefSpokeWidth = cu.connection().thermal_spokes().width();
|
||||
m_thermalReliefGap = cu.connection().thermal_spokes().gap();
|
||||
m_thermalReliefSpokeWidth = cu.connection().thermal_spokes().width().value_nm();
|
||||
m_thermalReliefGap = cu.connection().thermal_spokes().gap().value_nm();
|
||||
m_ZoneClearance = cu.clearance().value_nm();
|
||||
m_ZoneMinThickness = cu.min_thickness().value_nm();
|
||||
m_islandRemovalMode = FromProtoEnum<ISLAND_REMOVAL_MODE>( cu.island_mode() );
|
||||
|
Loading…
Reference in New Issue
Block a user