Fix minor bug (layer color not updated in toolbar when changed in layer manager)

Pcbnew: fix that prevents loading modules from libraries (footprint name not identified in lib)
Module Editor: Try to fix incorrect printing. Fixed now only for scale 1. Nor working for other scales. (Work in progress).
Gerbview: Known bug: printing not working.
VRML export: Fix incorrect export of 3D shapes rotations when the 3D shape was rotated.
This commit is contained in:
jean-pierre charras 2011-01-15 19:06:10 +01:00
parent 1f0f784d8f
commit 73585a8514
10 changed files with 38 additions and 20 deletions

View File

@ -6,7 +6,7 @@
#endif
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-01-07 BZR 2718)"
#define KICAD_BUILD_VERSION "(2011-01-12 BZR 2730)"
#endif
//#define VERSION_STABILITY "stable"

View File

@ -36,5 +36,6 @@ unsigned FILTER_READER::ReadLine() throw( IO_ERROR )
if( !strchr( "#\n\r", reader[0] ) )
break;
}
strtok( reader, "\n\r" );
return ret;
}

View File

@ -1,6 +1,8 @@
/**
* @file dialog_edit_component_in_schematic.cpp
*/
#include <wx/tooltip.h>
#include <algorithm>
#include "fctsys.h"
#include "appl_wxstruct.h"
@ -12,7 +14,6 @@
#include "wxEeschemaStruct.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "sch_component.h"
#include "dialog_helpers.h"

View File

@ -194,6 +194,7 @@ void GERBER_LAYER_WIDGET::ReFill()
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
{
myframe->GetBoard()->SetLayerColor( aLayer, aColor );
myframe->m_SelLayerBox->ResyncBitmapOnly();
myframe->DrawPanel->Refresh();
}

View File

@ -17,7 +17,7 @@
; General Product Description Definitions
!define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.01.07"
!define PRODUCT_VERSION "2011.01.12"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME ""

View File

@ -289,6 +289,7 @@ void PCB_LAYER_WIDGET::ReFill()
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
{
myframe->GetBoard()->SetLayerColor( aLayer, aColor );
myframe->ReCreateLayerBox( NULL );
myframe->DrawPanel->Refresh();
}

View File

@ -1051,17 +1051,25 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
* for footprints that are flipped
* When flipped, axis rotation is the horizontal axis (X axis)
*/
int rotx = wxRound( vrmlm->m_MatRotation.x );
double rotx = - vrmlm->m_MatRotation.x;
double roty = - vrmlm->m_MatRotation.y;
double rotz = - vrmlm->m_MatRotation.z;
if ( isFlipped )
rotx += 1800;
{
rotx += 180.0;
NEGATE(roty);
NEGATE(rotz);
}
/* Do some quaternion munching */
double q1[4], q2[4], rot[4];
build_quat( 1, 0, 0, rotx / 1800.0 * M_PI, q1 );
build_quat( 0, 1, 0, vrmlm->m_MatRotation.y / 1800.0 * M_PI, q2 );
build_quat( 1, 0, 0, rotx / 180.0 * M_PI, q1 );
build_quat( 0, 1, 0, roty / 180.0 * M_PI, q2 );
compose_quat( q1, q2, q1 );
build_quat( 0, 0, 1, vrmlm->m_MatRotation.z / 1800.0 * M_PI, q2 );
build_quat( 0, 0, 1, rotz / 180.0 * M_PI, q2 );
compose_quat( q1, q2, q1 );
// Note here aModule->m_Orient is in 0.1 degrees,
// so module rotation is aModule->m_Orient / 1800.0
build_quat( 0, 0, 1, aModule->m_Orient / 1800.0 * M_PI, q2 );
compose_quat( q1, q2, q1 );
from_quat( q1, rot );

View File

@ -81,9 +81,18 @@ void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC,
Module = (MODULE*) Pcb->m_Modules;
int tmp = D_PAD::m_PadSketchModePenSize;
D_PAD::m_PadSketchModePenSize = defaultPenSize;
wxPoint offset;
offset.x = GetScreen()->m_CurrentSheetDesc->m_Size.x / 2;
offset.y = GetScreen()->m_CurrentSheetDesc->m_Size.y / 2;
// offset is in mils, converts in internal units
offset.x *= m_InternalUnits / 1000;
offset.y *= m_InternalUnits / 1000;
for( ; Module != NULL; Module = Module->Next() )
{
Module->Move( offset );
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
Module->Move( -offset );
}
D_PAD::m_PadSketchModePenSize = tmp;

View File

@ -137,15 +137,9 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0;
ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0;
// Gerbview uses a very large sheet (called "World" in gerber language)
// to print a sheet, uses A4 is better
SheetSize = ActiveScreen->m_CurrentSheetDesc->m_Size; // size in 1/1000 inch
if( m_Parent->m_Ident == GERBER_FRAME )
{
SheetSize = g_Sheet_A4.m_Size; // size in 1/1000 inch
}
SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in internal units
WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent;
pcbframe->GetBoard()->ComputeBoundaryBox();
@ -234,8 +228,11 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
WinEDA_DrawPanel* panel = m_Parent->DrawPanel;
EDA_Rect tmp = panel->m_ClipBox;
// SEt clip box to the max size
#define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer
// and that allows calculations without overflow
panel->m_ClipBox.SetOrigin( wxPoint( 0, 0 ) );
panel->m_ClipBox.SetSize( wxSize( 0x7FFFFF0, 0x7FFFFF0 ) );
panel->m_ClipBox.SetSize( wxSize( MAX_VALUE, MAX_VALUE ) );
m_Parent->GetBaseScreen()->m_IsPrinting = true;
int bg_color = g_DrawBgColor;
@ -280,7 +277,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
#else
ActiveScreen->m_DrawOrg = DrawOffset;
#endif
panel->m_ClipBox.SetOrigin( wxPoint( -0x7FFFFF, -0x7FFFFF ) );
panel->m_ClipBox.SetOrigin( wxPoint( -MAX_VALUE/2, -MAX_VALUE/2 ) );
}
g_DrawBgColor = WHITE;

View File

@ -1,4 +1,4 @@
release version:
2011 jan 07 (BZR 2718)
2011 jan 12 (BZR 2730)
files (.zip,.tgz):
kicad-2011-01-07
kicad-2011-01-12