Commit Graph

72 Commits

Author SHA1 Message Date
jean-pierre charras a5367391a9 Plot PS and PDF: fix bug Bug #1457215 (rect/trap pads plotted with an incorrect pen size, and therefore an incorrect size and shape. Only noticeable with a large default pen size)
Very minor coding style fixes.
2015-05-21 11:04:47 +02:00
jean-pierre charras 85bc2ae015 Rework on Gerber plot functions: add X2 attributes in J5 version. Minor code cleaning. 2015-03-25 14:07:05 +01:00
unknown f87577ca72 class PLOTTER: dash lines parameters in one place for plot. I made minor changes (values in mm and set to give the same size as dashed lines drawn by wxDC, using short dash.) 2015-03-10 21:00:50 +01:00
jean-pierre charras c586d9735e Eeschema: fix bug #142970 (broken append sheet function)
Fix a few minor coverity warnings.
2015-03-10 19:31:21 +01:00
jean-pierre charras 086ff54ef0 Fix minor issues: plot svg did not handle dashed lines.
Eeschema now uses dashed lines for graphic lines (to be consistent with plot functions and toolbal icon).
Fix an old bug in some envionments which warp the mouse on a bad monitor when opening eeschema, pcbnew and some other windows, only noticeable guys who are lucky enough to have more than one monitor.
2015-03-06 18:46:04 +01:00
jean-pierre charras 10d67ffbd9 Fix some coverity warnings (not initialized members). Add comments. Better (more informative) title in dialog to download .pretty libs. 2015-02-26 11:33:15 +01:00
jean-pierre charras bc230f7650 Code cleaning: move class PAGE_INFO from common.h to class_page_info.h;
Fix issue when using a page layout file in project folder: eeschema and Pcbnew did not use it, unless using an absolute path.
Now, if the file path is nor absolute, it is seen as relative to the project (which is the expected behavior)
fp lib wizard: when pcbnew id compiled with USE_GITHUB_PLUGIN=OFF, the github plugin option is no more accessible (and the web viewer no more used).
2014-12-23 14:01:59 +01:00
Wayne Stambaugh e8362df15f Add missing source file licenses and code policy fixes. 2014-10-19 16:20:16 -04:00
jean-pierre charras ab58dbfced Pcbnew: Rework on Gerber ouput: allows choice between format 4.5 and 4.6. Fix a minor issue in Gerber layers attributes.
fix print issue when printing each layer on a separate page.
2014-07-04 16:22:38 +02:00
jean-pierre charras b50872edca Gerber output: Some changes after evaluation of Gerber files by Ucamco (the manager of GERBER format):
* default file ext is now .gbr (the "official extension")
* some outdated commands remoded.
* mainly use mm and 4.5 format instead of inches and 3.4 format. this is mandatory,
  because the 3.4 format (comming from old pcbned internal units) creates truncations in coordinates.
  (with serious issues in polygons which can appear self-intersecting afer truncation)
2014-06-30 12:00:21 +02:00
jean-pierre charras 9ee8dac056 Pcbnew, python console: make it not dockable (workaround to avoid the fact accelerator keys which are used in the main menu are not sent to the console, in docked mode).
Minor cosmetic enhancement.
2014-06-19 08:26:53 +02:00
jean-pierre charras 7b843ecac8 Plots function: fix a bug about virtual PLOTTER::Text, which was not virtual for derived classes due to a missing parameter in ::Text in these classes. Noticeable only in SVG plot.
SVG plot, fix a missing reinitialization in plot lines, which could define a filled polyline, instead of a simple polyline
(these fixes solve Bug #1313084 )
2014-04-28 18:13:18 +02:00
Baranovskiy Konstantin 065966291c Fix worksheet multiple line text plotting bug. (fixes lp:1261906) 2013-12-23 11:25:13 -05:00
jean-pierre charras 4374e25219 Plot functions: some enhancements in mirror mode (Pcbnew specific): boards are mirrored horizontally, and the page layout is no more mirrored, and therefore is always readable. 2013-12-06 19:31:15 +01:00
Maciej Suminski e9ebdf2583 Upstream merge. 2013-06-05 10:01:53 +02:00
Lorenzo Marcantonio d00c83cde9 Migrated the interfaces accepting angles to the double type
The plan goes like this:
- eeschema still uses int in decidegrees
- all the other things internally use double in decidegrees (or radians
  in temporaries)
- in pcbnew UI the unit is *still* int in decidegrees

The idea is to have better precision everywhere while keeping the user with int i
angles. Hopefully, if a fractional angle doesn't come in from the outside, everything
should *look* like an integer angle (unless I forgot something and it broke)

When the time comes, simply updating the UI for allowing doubles from the user should
be enough to get arbitrary angles in pcbnew.
2013-05-05 09:17:48 +02:00
Maciej Suminski 07cd3bcb56 Upstream merged 2013-04-10 15:03:35 +02:00
Lorenzo Marcantonio 63e987edd0 Removed the default generation of phantom text by the postscript plot driver.
It crashes Adobe's own implementation of postscript!
2013-04-05 10:55:46 +02:00
Lorenzo Marcantonio d12a45923b More work on EDA_COLOR_T and layers.
In particular the new mechanism for handling extended color palettes is in place,
included renaming the ini keys and saving the color name instead of its index; this means better forward compatibility with palette changes.

Since ini keys are changed, colors will be reset
2013-04-04 23:35:01 +02:00
Maciej Suminski 30e1aaec26 Replacement of classes BOX2 and VECTOR2 with their extended versions
include/vector2d.h: Removed old version
include/math/math_util.h: rescale() for VECTOR2
include/math/vector2d.h: New version of VECTOR2
include/math/box2.h: New version of BOX2
common/drawframe.cpp: Refactorization of code, so it is compatible with new classes
include/plot_common.h, pcbnew/basepcbframe.cpp: Changed header inclusion path
CMakeLists.txt: Added definition to turn on WX_COMPATIBILITY for replacement classes
2013-03-28 17:30:09 +01:00
Dick Hollenbeck eed97c549d plotter output file being left open fix. 2013-02-06 09:21:37 -06:00
jean-pierre charras 410644343d Eeschema, Libedit: fixes color artifacts when moving/placing a pin.
Very minor other fixes.
2013-02-06 12:54:51 +01:00
jean-pierre charras 621a43c4ad Eeschema: always stores sheet filename in unix-like notation, and fix a bug when editing sheet file name.
Pcbnew: add PDF format  for drill map generation.
Plotter classes: tweaking code.
2012-10-13 20:54:33 +02:00
jean-pierre charras 143af26952 Eeschema: code cleanup, remove dead code and some global and useless variables 2012-09-28 19:47:41 +02:00
jean-pierre charras cc47e88b9e Pcbnew, plot functions: fix bug in SVG plotter, fix a minor other bug when using PS plotter (trcak width fine adjust not working)
and plot code cleaning continued
2012-09-24 08:39:59 +02:00
Craig Southeren 436c17f60b This fixes a MSVC compile error caused by a static scalar initialiser. 2012-09-20 08:54:35 -05:00
jean-pierre charras a9744e3f84 Pcbnew: added: SVG plotter. Need refinements, but works.
Mainly to plot drill maps, but can be used to plot boards, for documentation.
The print svg still exists, but the plot SVG has more options (mirroring, holes in pads),
however  print svg allows color print, and full board printing, and plot does not.
2012-09-15 14:13:03 +02:00
jean-pierre charras 819589cf05 All: fix most of Doxygen warnings. 2012-09-12 19:28:55 +02:00
Lorenzo Marcantonio fef8347176 Script plotting patch 2012-08-29 18:59:50 +02:00
Marco Mattila 5a6c088bd9 Use circular interpolation for circles and arcs in pcbnew gerber plots. 2012-07-15 20:28:52 +03:00
jean-pierre charras 61acac28e1 Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added) 2012-05-03 20:37:56 +02:00
Dick Hollenbeck c24863c078 // Dick Hollenbeck's KiROUND R&D
// This provides better project control over rounding to int from double
// than wxRound() did.  This scheme provides better logging in Debug builds
// and it provides for compile time calculation of constants.


#include <stdio.h>
#include <assert.h>
#include <limits.h>

//-----<KiROUND KIT>------------------------------------------------------------

/**
 * KiROUND
 * rounds a floating point number to an int using
 * "round halfway cases away from zero".
 * In Debug build an assert fires if will not fit into an int.
 */

#if defined( DEBUG )

// DEBUG: a macro to capture line and file, then calls this inline

static inline int KiRound( double v, int line, const char* filename )
{
    v = v < 0 ? v - 0.5 : v + 0.5;
    if( v > INT_MAX + 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' > 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    else if( v < INT_MIN - 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' < 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    return int( v );
}

#define KiROUND( v )    KiRound( v, __LINE__, __FILE__ )

#else

// RELEASE: a macro so compile can pre-compute constants.

#define KiROUND( v )  int( (v) < 0 ? (v) - 0.5 : (v) + 0.5 )

#endif


//-----</KiROUND KIT>-----------------------------------------------------------

// Only a macro is compile time calculated, an inline function causes a static constructor
// in a situation like this.
// Therefore the Release build is best done with a MACRO not an inline function.
int Computed = KiROUND( 14.3 * 8 );


int main( int argc, char** argv )
{
    for( double d = double(INT_MAX)-1;  d < double(INT_MAX)+8;  d += 2.0 )
    {
        int i = KiROUND( d );

        printf( "t: %d  %.16g\n", i, d );
    }

    return 0;
}
2012-04-19 01:55:45 -05:00
Wayne Stambaugh bed96be750 Internal unit improvements and Pcbnew s-expression file format changes.
* Move EDA_TEXT object into separate header and source file.
* Compile EDA_TEXT class separately for BOARD_ITEM and SCH_ITEM units.
* Compile PAGE_INFO  class separately for BOARD_ITEM and SCH_ITEM units.
* Minor formatting tweaks to Pcbnew s-expression file.
* Move internal unit formatting functions into BOARD_ITEM and SCH_ITEM.
2012-04-12 17:31:31 -04:00
Wayne Stambaugh 45445dd88f Minor code improvements and coding policy fixes.
* BLOCK_SELECTOR class is not longer derived from EDA_ITEM.
* Encapsulate BLOCK_SELECTOR class member variables and add access methods.
* Move HandleBlockBegin() function from block_commande.cpp to drawframe.cpp.
* Remove virtual methods from top level derived objects per future
  coding policy change.
* Remove Doxygen copydoc statement from objects derived from EDA_ITEM
  since the comments are automatically copied to the derived object.
* Removed copy and pasted Doxygen comments from objects derived from
  EDA_ITEM.
2012-03-26 19:47:08 -04:00
Alexander Zakamaldin 625e964c8d Alexander's patches, with refinements 2012-03-26 16:45:05 -05:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Александр Закамалдин 6d3fd3a01d Patch drifted with time, and a patch hunk was erroneously applied by the patch program,
rather than being rejected.
2012-01-07 15:49:24 -06:00
Александр Закамалдин 2caa72f063 This patch implements width tuning (width correction) for PS plotting of tracks, pads and vias.
This feature is very useful for electronics hobbyists who use DIY PCB technology 
(both toner transfer and photoresist methods).
Also width correction may be useful for PCB designers who take care of track width etching.
This patch also fixes some minor PS plotting issues.
2012-01-07 00:02:38 -06:00
Dick Hollenbeck dd091fc6b9 merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support 2012-01-05 10:30:58 -06:00
Wayne Stambaugh b774d96fb0 Minor coding policy and code readability improvements. 2012-01-03 12:14:17 -05:00
Dick Hollenbeck 697f912307 moving objects into BOARD which are saved in a *.brd file, for PLUGIN access 2011-12-30 23:44:00 -06:00
Dick Hollenbeck 0d4598656b rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD 2011-12-22 15:57:50 -06:00
jean-pierre charras 4402c97c7a Eeschema: Fix a subtle bug in undo command when editing texts and labels.
Add a new schematic item: SCH_BITMAP. One can insert now images in a schematic.
Add Fabrizio Tappero as contributor  in Kicad About dialog
2011-08-31 16:59:20 +02:00
jean-pierre charras c89070da83 Plot poly code cleaning. Suppress erreurs for malformed polygons (< 2 corners) 2011-04-20 10:13:21 +02:00
jean-pierre charras 5daccd29dd Pcbnew plot functions: code cleanup, coding and UI policy fixes and minor enhancements 2010-12-12 12:41:18 +01:00
Dick Hollenbeck 9e8fb76123 touch ups mostly to Marco's draw_gerber_screen patch 2010-12-11 20:29:33 -06:00
jean-pierre charras e9f557e65a Pcbnew plot functions: code cleanup, coding policy fixes and minor enhancements 2010-12-11 19:40:39 +01:00
Dick Hollenbeck f0790efd39 fixups for dialog and formatting to Marco's patch 2010-12-06 16:18:39 -06:00
Marco Mattila 9dc9cc1f78 Board manufacturers typically do not print silkscreen on areas without
soldermask. Nevertheless, it would be nice to have proper gerbers to
begin with, i.e., gerbers with no silkscreen in soldermaskless areas.
Of course, most of the problem can be taken care of by drawing the
footprints properly. However, sometimes the silkscreen of one
footprint ends up on the pads of another one (think components under a
so-dimm card, for example). The attached patch adds an option to
subtract the soldermask from the silkscreen when doing gerber output.

marco
2010-12-06 16:05:12 -06:00
Dick Hollenbeck 6c9244e8c3 fix function comments, this time ones in *.cpp files until they
can be deleted later if they exist in the headers, or moved to 
headers if they should exist in the headers.
2010-11-12 10:59:16 -06:00