not possible to disable frame sheet ref in schematic

Bug #636830 reported by Frank Buss
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Wishlist
Unassigned

Bug Description

There is a variable m_Draw_Sheet_Ref, which is used in worksheet.cpp in TraceWorkSheet to control the drawing of the sheet ref, but it is not possible to configure this variable. Attached is a patch. This is only a short term solution, maybe would be better not to hardcode the drawing of the sheet ref, but to add it as editable symbols. But at least my patch should be enhanced to work with the same option for printing, e.g. using the same variable and deleting the printer option to draw the sheet ref, because it doesn't make sense to enable this option in two different places.

Revision history for this message
Frank Buss (fb-frank-buss) wrote :
Revision history for this message
jean-pierre charras (jp-charras) wrote : Re: [Bug 636830] [NEW] not possible to disable frame sheet ref in schematic

Le 13/09/2010 08:00, Frank Buss a écrit :
>
> Public bug reported:
>
> There is a variable m_Draw_Sheet_Ref, which is used in worksheet.cpp in
> TraceWorkSheet to control the drawing of the sheet ref, but it is not
> possible to configure this variable. Attached is a patch. This is only a
> short term solution, maybe would be better not to hardcode the drawing
> of the sheet ref, but to add it as editable symbols. But at least my
> patch should be enhanced to work with the same option for printing, e.g.
> using the same variable and deleting the printer option to draw the
> sheet ref, because it doesn't make sense to enable this option in two
> different places.
>
> ** Affects: kicad
> Importance: Undecided
> Status: New
>
Frank,
dialog_eeschema_options_base.cpp and dialog_eeschema_options_base.h cannot be modified "by hand".
because they are automaticaly created by wxFormBuilder (a tool to create dialogs for wxWidgets)

You must use wxFormBuilder to modify eeschema_options_base.fbp (wxFormBuilder is very easy to use)
otherwise, changes in dialog_eeschema_options_base.cpp will be lost the next time eeschema_options_base.fbp is modified.

--
Jean-Pierre CHARRAS

Revision history for this message
jean-pierre charras (jp-charras) wrote :

>
> Le 13/09/2010 08:00, Frank Buss a écrit :
>>
>> Public bug reported:
>>
>> There is a variable m_Draw_Sheet_Ref, which is used in worksheet.cpp in
>> TraceWorkSheet to control the drawing of the sheet ref, but it is not
>> possible to configure this variable. Attached is a patch. This is only a
>> short term solution, maybe would be better not to hardcode the drawing
>> of the sheet ref, but to add it as editable symbols. But at least my
>> patch should be enhanced to work with the same option for printing, e.g.
>> using the same variable and deleting the printer option to draw the
>> sheet ref, because it doesn't make sense to enable this option in two
>> different places.
>>
>> ** Affects: kicad
>> Importance: Undecided
>> Status: New
>>
> Frank,
> dialog_eeschema_options_base.cpp and dialog_eeschema_options_base.h cannot be modified "by hand".
> because they are automaticaly created by wxFormBuilder (a tool to create dialogs for wxWidgets)
>
> You must use wxFormBuilder to modify eeschema_options_base.fbp (wxFormBuilder is very easy to use)
> otherwise, changes in dialog_eeschema_options_base.cpp will be lost the next time eeschema_options_base.fbp is modified.
>

Also, what is the interest to disable the sheet ref in schematic ?
Once disable, how a guy knows if drawings are inside or outside the page ?

--
Jean-Pierre CHARRAS

Revision history for this message
Frank Buss (fb-frank-buss) wrote :
Download full text (4.4 KiB)

Heiko Lechner wrote a patch for the eeschema_options_base.fbp, see below. The reason to disable is for the final resolution: using your own reference frame. Not all users are happy with the built-in reference frame. See e.g. Eagle: There is a library with different reference frames, which you can add, if you need it, and which could be different for different clients. The base sheet is empty, just a small cross in the origin.

--- ./eeschema/dialog_eeschema_options_base.fbp Fri Sep 10 15:53:58 2010
+++ ./eeschema/dialog_eeschema_options_base.fbp Mon Sep 13 14:21:18 2010
@@ -1482,22 +1482,74 @@

<event name="OnMouseEvents"></event>

<event name="OnMouseWheel"></event>

<event name="OnPaint"></event>

<event name="OnRightDClick"></event>

<event name="OnRightDown"></event>

<event name="OnRightUp"></event>

<event name="OnSetFocus"></event>

<event name="OnSize"></event>

<event name="OnUpdateUI"></event>
                                                                  </object>
                                                              </object>
+ <object
class="sizeritem" expanded="1">
+
<property name="border">3</property>
+
<property name="flag">wxALL|wxEXPAND</property>
+
<property name="proportion">0</property>
+ <object
class="wxCheckBox" expanded="1">
+
<property name="bg"></property>
+
<property name="checked">0</property>
+
<property name="context_help"></property>
+
<property name="enabled">1</property>
+
<property name="fg"></property>
+
<property name="font"></property>
+
<property name="hidden">0</property>
+
<property name="id">wxID_ANY</property>
+
<property name="label">Show sheet ref</property>
+
<property name="maximum_size"></property>
+
<property name="minimum_size"></property>
+
<property name="name">m_checkSheetRef</property>
+
<property name="permission">protected</property>
+
<property name="pos"></property>
+
<property name="size"></property>
+
<property name="style"></property>
+
<property name="subclass"></property>
+
<property name="tooltip"></property>
+
<property name="window_extra_style"></property>
+
<property name="window_name"></property>
+
<property name="window_style"></property>
+
<event name="OnChar"></event>
+
<event name="OnCheckBox"></event>
+
<event name="OnEnterWindow"></event>
+
<event name="OnEraseBackground"></event>
+
<event name="OnKeyDown"></event>
+
<event name="OnKeyUp"></event>
+
<event name="OnKillFocus"></event>
+
<event name="OnLeaveWindow"></event>
+
<event name="OnLeftDClick"></event>
+
<event name="OnLeftDown"></event>
+
<event name="OnLeftUp"></event>
+
<event name="OnMiddleDClick"></event>
+
<event name="OnMiddleDown"></event>
+
<event name="OnMiddleUp"></event>
+
<event name="OnMotion"></event>
+
<event name="OnMouseEvents"></event>
+
<event name="OnMouseWheel"></event>
+
<event name="OnPaint"></event>
+
<event name="OnRightDClick"></event>
+
<event name="OnRightDown"></event>
+
<event nam...

Read more...

Revision history for this message
Heiko Lechner (no-spam-to-me) wrote :
Download full text (9.8 KiB)

Hi!

Here are the unidiff files for the latest bzr version.

HTH, Heiko.

=== verändert Datei common/drawframe.cpp
--- common/drawframe.cpp 2010-07-27 16:49:38 +0000
+++ common/drawframe.cpp 2010-09-15 13:47:05 +0000
@@ -33,6 +33,7 @@
 static const wxString ShowGridEntryKeyword( wxT( "ShowGrid" ) );
 static const wxString GridColorEntryKeyword( wxT( "GridColor" ) );
 static const wxString LastGridSizeId( wxT( "_LastGridSize" ) );
+static const wxString ShowFrameRefKeyword( wxT( "ShowFrameRef" ) );

 BEGIN_EVENT_TABLE( WinEDA_DrawFrame, WinEDA_BasicFrame )
@@ -703,6 +704,8 @@
     if( cfg->Read( m_FrameName + GridColorEntryKeyword, &itmp ) )
         SetGridColor(itmp);
     cfg->Read( m_FrameName + LastGridSizeId, &m_LastGridSizeId, 0L );
+ if ( cfg->Read( m_FrameName + ShowFrameRefKeyword, &btmp ) )
+ m_Draw_Sheet_Ref = TRUE;
 }

@@ -723,6 +726,7 @@
     cfg->Write( m_FrameName + ShowGridEntryKeyword, IsGridVisible() );
     cfg->Write( m_FrameName + GridColorEntryKeyword, GetGridColor() );
     cfg->Write( m_FrameName + LastGridSizeId, ( long ) m_LastGridSizeId );
+ cfg->Write( m_FrameName + ShowFrameRefKeyword, m_Draw_Sheet_Ref );
 }

=== verändert Datei eeschema/dialog_eeschema_options.h
--- eeschema/dialog_eeschema_options.h 2010-06-17 16:30:10 +0000
+++ eeschema/dialog_eeschema_options.h 2010-09-15 13:49:46 +0000
@@ -92,6 +92,14 @@
         return m_checkPageLimits->GetValue();
     }

+ void SetShowSheetRef( bool show )
+ {
+ m_checkSheetRef->SetValue( show );
+ }
+ bool GetShowSheetRef( void )
+ {
+ return m_checkSheetRef->GetValue();
+ }

     /** Set the field \a aNdx textctrl to \a aName */
     void SetFieldName( int aNdx, wxString aName);

=== verändert Datei eeschema/dialog_eeschema_options_base.cpp
--- eeschema/dialog_eeschema_options_base.cpp 2010-07-30 19:31:05 +0000
+++ eeschema/dialog_eeschema_options_base.cpp 2010-09-15 13:42:52 +0000
@@ -143,6 +143,10 @@

  bSizer2->Add( m_checkPageLimits, 0, wxALL|wxEXPAND, 3 );

+ m_checkSheetRef = new wxCheckBox( m_panel1, wxID_ANY, _("Show sh&eet ref"), wxDefaultPosition, wxDefaultSize, 0 );
+
+ bSizer2->Add( m_checkSheetRef, 0, wxALL|wxEXPAND, 3 );
+
  bSizer3->Add( bSizer2, 0, wxEXPAND, 0 );

=== verändert Datei eeschema/dialog_eeschema_options_base.fbp
--- eeschema/dialog_eeschema_options_base.fbp 2010-07-30 19:31:05 +0000
+++ eeschema/dialog_eeschema_options_base.fbp 2010-09-15 13:42:49 +0000
@@ -1490,6 +1490,58 @@
                                                                     <event name="OnUpdateUI"></event>
                                                                 </object>
                                                             </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">3</property>
+ <property name="flag">wxALL|wxEXPAND</property>
+ <property name="proportion">0</property>
+ ...

Revision history for this message
Jan Kandziora (jjj-gmx) wrote :

Jean-Pierre, the fixed drawing frame is a real early showstopper for a lot of people who would otherwise give KiCAD a try. I was for me, too. But I'm stubborn, so I've looked for a patch. We all have our own collection of drawing frames. Often they are required by company policy. Sure, we'll need to draw a single frame for each paper size then, but then paper sizes are defined by company policy, too.

If there was a poll for patches, I'd vote for this one.

Revision history for this message
Joerg Schulze-Clewing (joergsch) wrote :

Bonjour Jean-Pierre,

Here I'll have to second Frank's and Jan's input. The fixed frame is not desirable. I don't know if the goal is to make Kicad also palatable to industry but they could not live with that at all. Even some university institutes could not because the professor might insist that everything has their logo, shapes, form factors and so on.

Your question as to how we'd know whether we are outside the sheet: We don't have to know. On Eagle which I use right now you either place a frame and then you have the limits, or you just draw without any frame which is what I typically do. No boundaries. One click on a menu button zooms out and adjusts the schematic to your monitor so you have everything in front of you. Then you can still decide "Oh, I think the page is a little too wide" and move some stuff. Other CAD has lines around the schematic but they never print, they are only there to show you where the sheet boundaries are and when you need more space you can select a larger "paper size". That's how it was done in the 80's when DOS ruled.

Cordialement,

Joerg

Revision history for this message
Heiko Lechner (no-spam-to-me) wrote :

Here are the patches again- now zipped and readable ;)

Revision history for this message
Lorenzo Marcantonio (l-marcantonio) wrote : Re: [Bug 636830] Re: not possible to disable frame sheet ref in schematic
Download full text (6.4 KiB)

On Wed, 3 Nov 2010, Joerg Schulze-Clewing wrote:

> Bonjour Jean-Pierre,
>
> Here I'll have to second Frank's and Jan's input. The fixed frame is not
> desirable. I don't know if the goal is to make Kicad also palatable to
> industry but they could not live with that at all. Even some university
> institutes could not because the professor might insist that everything
> has their logo, shapes, form factors and so on.

ALSO, I would add, there is already a *big* conditional compile for the
GOST frame sheet, that would be strippet out.

> select a larger "paper size". That's how it was done in the 80's when
> DOS ruled.

I'd propose an intermediate solution, which I think would help everyone.
The biggest problem with the 'frame sheet as a component' is where to
put label and stuff. Also I really like the 'fixed page size' since,
anyway, you could just enlarge it in the properties, but you'd still
have the 'gray border' as a reference.

Since now we have arbitrary attribute support we could:
- Completely strip out the title block generation (which is *entirely
   duplicated* in both the display code *and* the plotting code; IIRC the
   printing code path is the display one).

- Handle the sheet border/title block as graphics components, I.E.
   a component big as the sheet (like eagle and many other do).

- Have in these 'title components' predefined custom attributes (i.e.
   title, page number, revision and so on) which are automagically
   populated from the sheet info (this substitution would be the only
   code to write! all the rest is preexisting infrastructure);

- At the end just provide a default A4_title_block, A3_title_block and
   so on component in a component library (so we make work the library
   team too :D)

Use cases:
- New schematic: I pick a page size, see the blank page, maybe set the
   schematic properties with title and so on (it's the first thing I do);

   Add the frame/title block component (just like I would add
   a resistor) and put it at the origin (of course the 'component' is so
   designed, to obtain good margins and so on). Whammo, I have the title
   block and the special field get their value;

   Draw stuff;

   => Profit :D

- I want to change page size: schematic properties, choose what I want;
   Right click on the block, choose another chip name;

   => Profit :D

- I have an old drawing: load it, see no border nor title block; no
   panic: add component, choose a title block component place it at the
   origin;

   => Profit :D

- I want to change revision/title/stuff: schematic properties edit
   stuff; autorepopulation occurs;

   => Profit :D

BIG ISSUES:
- First thing the 'insert at origin' is somewhat inconvenient, but
   nothing devastating: it's done only one time at the beginning and
   anyway I have to do even on eagle and other packages;

- The 'title block' get a reference and appears in the BOM; who cares,
   fiducials and mounting holes appears here too; will be fixed with the
   new scriptable reporter (the XML/Python stuff, if you're still doing
   it);

- The reference grid must be user drawn and not necessarily match with
   the one computed by the reporter;

- The worst of it: the ti...

Read more...

Revision history for this message
Jan Kandziora (jjj-gmx) wrote :

I've backported the patch for kicad-2010.05.05-BZR2356, the version which is currently in the OpenSuSE science repositories.
Along with the .diff is a spec file if anyone likes to rebuild the src.rpm. Tested with http://download.opensuse.org/repositories/science/openSUSE_11.1/src/kicad-2010.05.05-1.3.src.rpm

Revision history for this message
Brian Bidulock (bidulock) wrote : Re: [Bug 636830] Re: not possible to disable frame sheet ref in schematic

Lorenzo,

On Thu, 04 Nov 2010, Lorenzo Marcantonio wrote:

>
> FINAL RECOMMENDATION:
>
> I'd personally use proposal (2), and for pcbnew the 'template board'
> approach (i.e. the title block/frame is actually composed by stock
> instances of user drawings).
>
> As for the reference grid issue just trust the user to put it in the
> 'right' place, if he cares about it (not everyone uses them) or put
> somewhere a 'grid calibration' for the reported; or most probably just
> pass the coordinates to the new reporting script which would be
> customized for the right grid.
>
> Other ideas?

The template board for pcbnew is a show stopper. There is no
separate sheet-ref layer. How do you get the sheet reference to
appear on all layers? How do you draw it in the first place?
You can't draw on the sheet frame.

How about keeping the sheet frame (without the title block)
fixed, and importing just the title block (with %s type
replacements) from another drawing format? We could then create
an EDA_TitleBlock base object than would import from the
external file format (XFig, DXF, SVG) and have to be written to
the .sch and .brd file to be saved. A .sch or .brd file not
containing the title block could simply default the object to a
version of the current title block (GOST or otherwise). Note
that GOST is more than just the title block, it requires A4
portrait sheet frames rather than A4 landscape sheet frames.

I would suggest that this object should have attributes to
anchor it to a corner, perhaps with an offset. There is another
thing and that is the size and style of the text (which is
different for all). I was considering making all of the
worksheet text EDA_TextStruct based to handle styling of the
text. Right-clicking EDA_TextStruct objects within the
EDA_TitleBlock objects could use existing text dialogs to set
the attributes. That way someone that doesn't care about the
title block lines (its just a table after all), but just
wants to affect the contents of some cells, can just edit
the text in the block.

--brian

Revision history for this message
Lorenzo Marcantonio (l-marcantonio) wrote : Re: [Bug 636830] Re: not possible to disable frame sheet ref in schematic
Download full text (3.3 KiB)

On Thu, 4 Nov 2010, Brian Bidulock wrote:

> The template board for pcbnew is a show stopper. There is no
> separate sheet-ref layer. How do you get the sheet reference to
> appear on all layers? How do you draw it in the first place?
> You can't draw on the sheet frame.

Uhm didn't think about the 'all layer' issue, actually... and ATM a new
dedicated layer isn't easy to add. I agree it's a problem.

> How about keeping the sheet frame (without the title block)
> fixed, and importing just the title block (with %s type
> replacements) from another drawing format? We could then create
> an EDA_TitleBlock base object than would import from the
> external file format (XFig, DXF, SVG) and have to be written to
> the .sch and .brd file to be saved. A .sch or .brd file not
> containing the title block could simply default the object to a
> version of the current title block (GOST or otherwise). Note
> that GOST is more than just the title block, it requires A4
> portrait sheet frames rather than A4 landscape sheet frames.

You're substantially talking about the 'scripted' title block. And, BTW
there is an ISO portrait frame too :D also IIRC the GOST compile option
changed other stuff too, like the subreferences (instead of U1A it goes
like U1.1 or something similar); anyway the frame drawing code is
duplicated about 4 times with little differences (view/plot and
standard/GOST).

> I would suggest that this object should have attributes to
> anchor it to a corner, perhaps with an offset. There is another
> thing and that is the size and style of the text (which is
> different for all). I was considering making all of the
> worksheet text EDA_TextStruct based to handle styling of the
> text. Right-clicking EDA_TextStruct objects within the
> EDA_TitleBlock objects could use existing text dialogs to set
> the attributes. That way someone that doesn't care about the
> title block lines (its just a table after all), but just
> wants to affect the contents of some cells, can just edit
> the text in the block.

The 'text style' issue is another big thing to ponder about...

BTW is there a title block style which isn't lower left attached? never
seen one around...

A simple script could have commands like:
LINE fromx fromy tox toy
TEXT fromx fromy sizex sizey pen bolditalic "text"

(and I'd say nothing else for the moment, they you could maybe add
filled polygons) in whichever format you like (like the sexp/EDIF format
or whatever you can parse easily). In "text" you handle simple $PAGE
replacements (I think somewhere in wx there is some string utility to do
it) and you're done.

But then everyone uses a different page frame, simple, with borders,
arrows for microfilming, strange stuff and so on. So ditch the whole
frame drawing code and pull everything from this file. Use global page
coordinates, it doesn't hurt anyone.

How to generate it? For a start it could be trivial to autogenerate it
with a 'default' style. Or, as you said, importing some kind of external
format. Keep in mind that title block definition is something you do
only a time in your life, anyway...

I'd start with an hand/script generated one, then if there's interest
you could ...

Read more...

Revision history for this message
-stf- (local25) wrote :

Any progress on this? I would like to keep the page frame but to ged rid of the title box (or make it way smaller, best layout would be one or 2 lines at bottom (whole width of the page frame) containing only title and possibly sheet number - all other informations are only waste of space on the paper for me and sometimes i need the space to put 2 or 3 components right in the title position). Or which source files should I edit to compile my own version to achieve that? Also I would like to be able to set page margins (best to 2 mm to use all possible printing area on the page).

Revision history for this message
Nick Østergaard (nickoe) wrote :

Did you try the new pl_editor (I guess it stands for page layout editor), https://lists.launchpad.net/kicad-developers/msg10759.html

I have not used it myself. But does it solve this bug?

Martin Errenst (imp-d)
tags: added: eeschema frame gost
Revision history for this message
Lorenzo Marcantonio (l-marcantonio) wrote :

All of this and more are implemented in the page layout editor (pl_editor).
The preference is project-local, so to change the default you'll need to change the template project.
The 'page limit' option is for the 'physical' paper border, by the way.

Changed in kicad:
status: New → Fix Released
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.