Altium schematic: support custom sheet sizes.

(cherry picked from commit 16062bbe33)
This commit is contained in:
Alex Shvartzkop 2023-09-11 10:02:59 +03:00
parent c11ae8bd02
commit 6ee909b958
3 changed files with 37 additions and 20 deletions

View File

@ -800,6 +800,11 @@ ASCH_SHEET::ASCH_SHEET( const std::map<wxString, wxString>& aProps )
for( int i = 1; i <= fontidcount; i++ ) for( int i = 1; i <= fontidcount; i++ )
fonts.emplace_back( aProps, i ); fonts.emplace_back( aProps, i );
useCustomSheet = ALTIUM_PARSER::ReadBool( aProps, "USECUSTOMSHEET", false );
customSize = VECTOR2I( ReadKiCadUnitFrac( aProps, "CUSTOMX" ),
ReadKiCadUnitFrac( aProps, "CUSTOMY" ) );
sheetSize = ReadEnum<ASCH_SHEET_SIZE>( aProps, "SHEETSTYLE", 0, 17, ASCH_SHEET_SIZE::A4 ); sheetSize = ReadEnum<ASCH_SHEET_SIZE>( aProps, "SHEETSTYLE", 0, 17, ASCH_SHEET_SIZE::A4 );
sheetOrientation = ReadEnum<ASCH_SHEET_WORKSPACEORIENTATION>( sheetOrientation = ReadEnum<ASCH_SHEET_WORKSPACEORIENTATION>(
aProps, "WORKSPACEORIENTATION", 0, 1, ASCH_SHEET_WORKSPACEORIENTATION::LANDSCAPE ); aProps, "WORKSPACEORIENTATION", 0, 1, ASCH_SHEET_WORKSPACEORIENTATION::LANDSCAPE );

View File

@ -773,6 +773,9 @@ struct ASCH_SHEET
{ {
std::vector<ASCH_SHEET_FONT> fonts; std::vector<ASCH_SHEET_FONT> fonts;
bool useCustomSheet;
VECTOR2I customSize;
ASCH_SHEET_SIZE sheetSize; ASCH_SHEET_SIZE sheetSize;
ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation; ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation;

View File

@ -2788,6 +2788,14 @@ void SCH_ALTIUM_PLUGIN::ParseSheet( const std::map<wxString, wxString>& aPropert
bool isPortrait = m_altiumSheet->sheetOrientation == ASCH_SHEET_WORKSPACEORIENTATION::PORTRAIT; bool isPortrait = m_altiumSheet->sheetOrientation == ASCH_SHEET_WORKSPACEORIENTATION::PORTRAIT;
if( m_altiumSheet->useCustomSheet )
{
PAGE_INFO::SetCustomWidthMils( schIUScale.IUToMils( m_altiumSheet->customSize.x ) );
PAGE_INFO::SetCustomHeightMils( schIUScale.IUToMils( m_altiumSheet->customSize.y ) );
pageInfo.SetType( PAGE_INFO::Custom, isPortrait );
}
else
{
switch( m_altiumSheet->sheetSize ) switch( m_altiumSheet->sheetSize )
{ {
default: default:
@ -2810,6 +2818,7 @@ void SCH_ALTIUM_PLUGIN::ParseSheet( const std::map<wxString, wxString>& aPropert
case ASCH_SHEET_SIZE::ORCAD_D: pageInfo.SetType( "D", isPortrait ); break; case ASCH_SHEET_SIZE::ORCAD_D: pageInfo.SetType( "D", isPortrait ); break;
case ASCH_SHEET_SIZE::ORCAD_E: pageInfo.SetType( "E", isPortrait ); break; case ASCH_SHEET_SIZE::ORCAD_E: pageInfo.SetType( "E", isPortrait ); break;
} }
}
screen->SetPageSettings( pageInfo ); screen->SetPageSettings( pageInfo );