Loading pcbnew/specctra.h +14 −2 Original line number Diff line number Diff line Loading @@ -3578,6 +3578,8 @@ class SPECCTRA_DB : public OUTPUTFORMATTER std::string quote_char; bool modulesAreFlipped; STRINGFORMATTER sf; STRINGS layerIds; ///< indexed by PCB layer number Loading Loading @@ -3822,6 +3824,11 @@ class SPECCTRA_DB : public OUTPUTFORMATTER nets.clear(); } /** * Function flipMODULEs * flips the modules which are on the back side of the board to the front. */ void flipMODULEs( BOARD* aBoard ); //-----<FromSESSION>----------------------------------------------------- Loading Loading @@ -3850,6 +3857,7 @@ public: session = 0; fp = 0; quote_char += '"'; modulesAreFlipped = false; } virtual ~SPECCTRA_DB() Loading Loading @@ -3957,7 +3965,6 @@ public: */ void FromBOARD( BOARD* aBoard ) throw( IOError ); /** * Function FromSESSION * adds the entire SESSION info to a BOARD but does not write it out. The Loading @@ -3968,7 +3975,6 @@ public: */ void FromSESSION( BOARD* aBoard ) throw( IOError ); /** * Function ExportSESSION * writes the internal SESSION instance out as a SPECTRA DSN format file. Loading @@ -3976,6 +3982,12 @@ public: * @param aFilename The file to save to. */ void ExportSESSION( wxString aFilename ); /** * Function RevertMODULEs * flips the modules which were on the back side of the board back to the back. */ void RevertMODULEs( BOARD* aBoard ); }; Loading pcbnew/specctra_export.cpp +34 −10 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) setlocale( LC_NUMERIC, "" ); // revert to the current locale // this is called in FromBOARD() too, but if it throws an exception, that call // does not happen, so call it again just in case here. db.RevertMODULEs( m_Pcb ); // The two calls below to BOARD::Change_Side_Module(), both set the // modified flag, yet their actions cancel each other out, so it should // be ok to clear the modify flag. Loading Loading @@ -727,15 +732,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) // DSN Images (=Kicad MODULES and pads) must be presented from the // top view. So we temporarily flip any modules which are on the back // side of the board to the front, and record this in the MODULE's flag field. for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) { module->flag = 0; if( module->GetLayer() == COPPER_LAYER_N ) { aBoard->Change_Side_Module( module, NULL ); module->flag = 1; } } flipMODULEs( aBoard ); //-----<layer_descriptor>----------------------------------------------- { Loading Loading @@ -1220,7 +1217,32 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) } //-----<restore MODULEs>------------------------------------------------ //-----<flip modules back>---------------------------------------------- RevertMODULEs( aBoard ); } void SPECCTRA_DB::flipMODULEs( BOARD* aBoard ) { for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) { module->flag = 0; if( module->GetLayer() == COPPER_LAYER_N ) { aBoard->Change_Side_Module( module, NULL ); module->flag = 1; } } modulesAreFlipped = true; } void SPECCTRA_DB::RevertMODULEs( BOARD* aBoard ) { if( !modulesAreFlipped ) return; // DSN Images (=Kicad MODULES and pads) must be presented from the // top view. Restore those that were flipped. Loading @@ -1232,6 +1254,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) module->flag = 0; } } modulesAreFlipped = false; } Loading Loading
pcbnew/specctra.h +14 −2 Original line number Diff line number Diff line Loading @@ -3578,6 +3578,8 @@ class SPECCTRA_DB : public OUTPUTFORMATTER std::string quote_char; bool modulesAreFlipped; STRINGFORMATTER sf; STRINGS layerIds; ///< indexed by PCB layer number Loading Loading @@ -3822,6 +3824,11 @@ class SPECCTRA_DB : public OUTPUTFORMATTER nets.clear(); } /** * Function flipMODULEs * flips the modules which are on the back side of the board to the front. */ void flipMODULEs( BOARD* aBoard ); //-----<FromSESSION>----------------------------------------------------- Loading Loading @@ -3850,6 +3857,7 @@ public: session = 0; fp = 0; quote_char += '"'; modulesAreFlipped = false; } virtual ~SPECCTRA_DB() Loading Loading @@ -3957,7 +3965,6 @@ public: */ void FromBOARD( BOARD* aBoard ) throw( IOError ); /** * Function FromSESSION * adds the entire SESSION info to a BOARD but does not write it out. The Loading @@ -3968,7 +3975,6 @@ public: */ void FromSESSION( BOARD* aBoard ) throw( IOError ); /** * Function ExportSESSION * writes the internal SESSION instance out as a SPECTRA DSN format file. Loading @@ -3976,6 +3982,12 @@ public: * @param aFilename The file to save to. */ void ExportSESSION( wxString aFilename ); /** * Function RevertMODULEs * flips the modules which were on the back side of the board back to the back. */ void RevertMODULEs( BOARD* aBoard ); }; Loading
pcbnew/specctra_export.cpp +34 −10 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) setlocale( LC_NUMERIC, "" ); // revert to the current locale // this is called in FromBOARD() too, but if it throws an exception, that call // does not happen, so call it again just in case here. db.RevertMODULEs( m_Pcb ); // The two calls below to BOARD::Change_Side_Module(), both set the // modified flag, yet their actions cancel each other out, so it should // be ok to clear the modify flag. Loading Loading @@ -727,15 +732,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) // DSN Images (=Kicad MODULES and pads) must be presented from the // top view. So we temporarily flip any modules which are on the back // side of the board to the front, and record this in the MODULE's flag field. for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) { module->flag = 0; if( module->GetLayer() == COPPER_LAYER_N ) { aBoard->Change_Side_Module( module, NULL ); module->flag = 1; } } flipMODULEs( aBoard ); //-----<layer_descriptor>----------------------------------------------- { Loading Loading @@ -1220,7 +1217,32 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) } //-----<restore MODULEs>------------------------------------------------ //-----<flip modules back>---------------------------------------------- RevertMODULEs( aBoard ); } void SPECCTRA_DB::flipMODULEs( BOARD* aBoard ) { for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) { module->flag = 0; if( module->GetLayer() == COPPER_LAYER_N ) { aBoard->Change_Side_Module( module, NULL ); module->flag = 1; } } modulesAreFlipped = true; } void SPECCTRA_DB::RevertMODULEs( BOARD* aBoard ) { if( !modulesAreFlipped ) return; // DSN Images (=Kicad MODULES and pads) must be presented from the // top view. Restore those that were flipped. Loading @@ -1232,6 +1254,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) module->flag = 0; } } modulesAreFlipped = false; } Loading