59 wxFileName tempDir = MakeTempDir();
60 wxFileName boardFile( tempDir.GetFullPath(), wxT(
"backdrill_board.kicad_pcb" ) );
72 via->SetSecondaryDrillStartLayer(
F_Cu );
77 via->SetFrontPostMachiningAngle( 900 );
85 wxFileName excellonFile( tempDir.GetFullPath(), wxT(
"backdrill_board_Backdrills_Drill_1_4.drl" ) );
88 wxFFile excellonStream( excellonFile.GetFullPath(), wxT(
"rb" ) );
89 wxString excellonContents;
91 BOOST_CHECK( excellonContents.Contains( wxT(
"TF.FileFunction,NonPlated,1,4,Blind" ) ) );
92 BOOST_CHECK( excellonContents.Contains( wxT(
"; Backdrill" ) ) );
93 BOOST_CHECK( excellonContents.Contains( wxT(
"post-machining" ) ) );
95 wxFileName layerPairFile( tempDir.GetFullPath(), wxT(
"backdrill_board-front-in3-backdrill.drl" ) );
98 wxFFile layerPairStream( layerPairFile.GetFullPath(), wxT(
"rb" ) );
99 wxString layerPairContents;
100 BOOST_REQUIRE( layerPairStream.ReadAll( &layerPairContents ) );
101 BOOST_CHECK( layerPairContents.Contains( wxT(
"; backdrill" ) ) );
103 wxFileName pthFile( tempDir.GetFullPath(), wxT(
"backdrill_board-PTH.drl" ) );
106 wxFFile pthStream( pthFile.GetFullPath(), wxT(
"rb" ) );
107 wxString pthContents;
109 BOOST_CHECK( pthContents.Contains( wxT(
"; Post-machining front countersink dia 0.600mm depth 0.150mm angle 90deg" ) ) );
116 wxFileName gerberFile( tempDir.GetFullPath(), wxT(
"backdrill_board_Backdrills_Drill_1_4-drl.gbr" ) );
119 wxFFile gerberStream( gerberFile.GetFullPath(), wxT(
"rb" ) );
120 wxString gerberContents;
122 BOOST_CHECK( gerberContents.Contains( wxT(
"%TA.AperFunction,BackDrill*%" ) ) );
123 BOOST_CHECK( gerberContents.Contains( wxT(
"%TF.FileFunction,NonPlated,1,4,Blind,Drill*%" ) ) );
125 wxFileName gerberLayerPairFile( tempDir.GetFullPath(),
126 wxT(
"backdrill_board-front-in3-backdrill-drl.gbr" ) );
129 wxFFile gerberLayerPairStream( gerberLayerPairFile.GetFullPath(), wxT(
"rb" ) );
130 wxString gerberLayerPairContents;
131 BOOST_REQUIRE( gerberLayerPairStream.ReadAll( &gerberLayerPairContents ) );
132 BOOST_CHECK( gerberLayerPairContents.Contains( wxT(
"%TF.FileFunction,NonPlated,1,4,Blind,Drill*%" ) ) );
133 BOOST_CHECK( gerberLayerPairContents.Contains( wxT(
"%TA.AperFunction,BackDrill*%" ) ) );
135 wxFileName odbRoot( tempDir.GetFullPath(), wxEmptyString );
136 odbRoot.AppendDir( wxT(
"odb_out" ) );
137 BOOST_REQUIRE( odbRoot.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) );
140 std::map<std::string, UTF8> props;
141 props[
"units"] =
"mm";
142 props[
"sigfig"] =
"4";
143 BOOST_REQUIRE_NO_THROW( odbExporter.
SaveBoard( odbRoot.GetFullPath(), &board, &props ) );
145 wxFileName drill1Dir( odbRoot.GetFullPath(), wxEmptyString );
146 drill1Dir.AppendDir( wxT(
"steps" ) );
147 drill1Dir.AppendDir( wxT(
"pcb" ) );
148 drill1Dir.AppendDir( wxT(
"layers" ) );
149 drill1Dir.AppendDir( wxT(
"drill1" ) );
152 wxFileName toolsFile( drill1Dir.GetFullPath(), wxT(
"tools" ) );
155 wxFFile toolsStream( toolsFile.GetFullPath(), wxT(
"rb" ) );
156 wxString toolsContents;
158 BOOST_CHECK( toolsContents.Contains( wxT(
"TYPE=NON_PLATED" ) ) );
159 BOOST_CHECK( toolsContents.Contains( wxT(
"TYPE2=BLIND" ) ) );
161 wxFileName matrixFile( odbRoot.GetFullPath(), wxEmptyString );
162 matrixFile.AppendDir( wxT(
"matrix" ) );
163 matrixFile.SetFullName( wxT(
"matrix" ) );
166 wxFFile matrixStream( matrixFile.GetFullPath(), wxT(
"rb" ) );
167 wxString matrixContents;
169 BOOST_CHECK( matrixContents.Contains( wxT(
"ADD_TYPE=BACKDRILL" ) ) );
171 matrixStream.Close();
173 gerberStream.Close();
174 gerberLayerPairStream.Close();
175 excellonStream.Close();
176 layerPairStream.Close();
179 wxFileName::Rmdir( odbRoot.GetFullPath(), wxPATH_RMDIR_RECURSIVE );
180 wxFileName::Rmdir( tempDir.GetFullPath(), wxPATH_RMDIR_RECURSIVE );