Re: gEDA-user: OT: Vintage uP

2011-03-03 Thread Stephan Boettcher

Ethan,

Thanks a lot!

Stephan

Ethan Swint eswint.r...@verizon.net writes:

 Stephan-

 Here's what I've got in the Motorola family:
 MC68010L8 - 1 unit
 SC87876L8 - 1 unit
 MC68000P8 - 2 units
 MC68000P10 - 2 units

 These are all 64-pin devices; I'm not sure about the SC87876.  It
 looks like shipping is reasonable - USD$13.25 for a DVD-sized box.

 Regards,
 Ethan

 On 02/13/2011 05:57 PM, Stephan Boettcher wrote:
 Ethan,

 Ethan Swinteswint.r...@verizon.net  writes:

 I recently ran across a cache of 'vintage' microprocessors - a
 Motorola MC68010L8 and other MC68K chips, Dallas Semi Speed it uP, AMD
 8088, etc.  The are all in new condition, most in ESD foam.  Any of
 these of interest to the list?
 Well, if you could ship to Europe in an unsusicious package to avoid
 customs excessive duties, I'd be interested in an MC68010L8 and maybe
 other MC68K chips (what are those? UART? FPU?)  I could pay via paypal.

 Cheers, Stephan

 Regards,
 Ethan



 ___
 geda-user mailing list
 geda-user@moria.seul.org
 http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

-- 
Stephan Böttcher FAX: +49-431-85660
Extraterrestrische PhysikTel: +49-431-880-2508
I.f.Exp.u.Angew.Physik   mailto:boettc...@physik.uni-kiel.de
Leibnizstr. 11, 24118 Kiel, Germany


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Please test new grids for GTK PCB

2011-03-03 Thread Krzysztof Kościuszkiewicz
2011/3/3 jpka jo...@kvidex.ru:

 There's no need to write a callback; default one will refresh the
 GtkTreeView widget to include your changes to the model.
 Please have a look at the attached patch.

 Thanks for help!
 Both codes work well in case of initial drawing radiobuttons instead of
 string, and result looks good.
 But in case of user input, when i apply this patch, i fall into several
 problems.
 1. If i use patch 'as is', editing of grid values not work:
 my 'cb_edited_mm_or_mil' assumes PCB-CurrentGrid already changed to
 current before call:
 it uses PCB-Grid[PCB-CurrentGrid] = .
 , but when i use patch, editing value in table not switch PCB-
CurrentGrid: it was tied to treeview row selection before and was done
 before editing (it was when i place cursor on needed row), but now it's
 not true: when i select row but not touch toggle button, PCB-CurrentGrid
 not updates.
 And anyway i prefer use radiobuttons here only for display but not for
 callback.
 BUT...

Okay, I missed that part :)
I would decouple changing the grid from editing the grid settings.
The editing callbacks can query the path in the model and update
PCB-Grid directly.
The ultimate (but also most time consuming) would be to provide a
custom implementation of GtkTreeModel that would map operations on the
PCB-Grid and vice-versa.

 2. If i try to restore my previous state when PCB-CurrentGrid updates
 not here
  g_signal_connect(renderer, toggled, (GCallback) cb_toggled_active,
 treeview);
 but here
  g_signal_connect(select, changed, G_CALLBACK(on_changed), select);
 (i.e. even work using cursor keys in treeview to select row)
 then i again and again fall into same hair-tearing problem as before this
 patch:
 ...
 Sorry for this long text.

Each signal handler has its required signature. This can be found in
the GTK docs.
Same for the function passed to gtk_tree_view_foreach() etc.

 BTW2 -
 why do you store grid mm and mil spacings as strings??

 Sorry i don't precisely understand you. The only place for strings in my
 code is in display/editing routines. Spacing is
  double  PCB-Grid[PCB-CurrentGrid];
  int  PCB-GridStep[PCB-CurrentGrid];
 regardless of mil or mm mode.

I was asking why in the model you keep strings and not ints/floats?
-- 
Krzysztof Kościuszkiewicz
Simplicity is the ultimate sophistication -- Leonardo da Vinci


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Please test new grids for GTK PCB

2011-03-03 Thread Krzysztof Kościuszkiewicz
Please check the attached patch - now everything in the model is updated
correctly.
-- 
Krzysztof Kościuszkiewicz
Simplicity is the ultimate sophistication -- Leonardo da Vinci
From 9e58163f910c9e24ecd6400b2dc81e158c86152b Mon Sep 17 00:00:00 2001
From: Krzysztof Kosciuszkiewicz k.kosciuszkiew...@gmail.com
Date: Fri, 4 Mar 2011 02:14:53 +0100
Subject: [PATCH 2/2] hid/gtk: further improvements to new grid config

---
 src/const.h  |4 +-
 src/hid/gtk/gtkhid-gdk.c |2 +
 src/hid/gtk/gui-config.c |  116 -
 3 files changed, 76 insertions(+), 46 deletions(-)

diff --git a/src/const.h b/src/const.h
index 7b952f8..8062569 100644
--- a/src/const.h
+++ b/src/const.h
@@ -71,8 +71,8 @@
 #define COOR_TO_MM		0.000254000
 #define MM_TO_COOR		3937.007874
 
-#define COOR_TO_MIL		1. / 100		//added 02.02.2011 for uniformity
-#define MIL_TO_COOR		100. / 1
+#define COOR_TO_MIL		0.01		//added 02.02.2011 for uniformity
+#define MIL_TO_COOR		100.0
 enum// Currently not used except mil and mm, but i will
 {   // become happy if at least microns can be added.
   MIL = 0,  // Major code changes in some places need for this, though.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 55951e4..c78d1e8 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -132,6 +132,8 @@ ghid_draw_grid (void)
 
   if (d==0) { // static grid without any check to min distance, zooming, etc,
 // made by request
+if (g == 0)
+  return;
 gridmode = 1;
 pcbgrid = g;
   } else {
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index e864da1..1cb82ae 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -1352,45 +1352,74 @@ enum
   NUM_COLS
 } ;
 
-void cb_edited_mm_or_mil(GtkCellRendererText *cell, gchar *path, gchar *text,
-		 GtkTreeView *treeview) {
-	double d;
-	GtkListStore *store;
-	GtkTreeIter  iter;
-	int units;
-	store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
-	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), iter, path);
-	units = (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), column)) == 0) ? MM : MIL;
-printf(%d\n,units);
-	d = c_strtod(text);
-	if (d0) {d=0;}
-	PCB-Grid[PCB-CurrentGrid] = (units) ? (d * MM_TO_COOR) : (d * MIL_TO_COOR);
-	if (Settings.DrawGrid) UpdateAll ();
-	ghid_set_status_line_label();
-	gtk_list_store_set (store, iter, COL_GRID_MM, (units) ? (c_dtostr(d)) : (c_dtostr(d*MIL_TO_MM)), -1);
-	gtk_list_store_set (store, iter, COL_GRID_MIL, (units) ? (c_dtostr(d*MM_TO_MIL)) : (c_dtostr(d)), -1);
-}
-
-
-void cb_edited_step(GtkCellRendererText *cell, gchar *path, gchar *text, GtkTreeView *treeview) {
-	int i;
-	GtkListStore *store;
-	GtkTreeIter  iter;
-	store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
-	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), iter, path);
-	i=(int)c_strtod(text);
-	if (i0) {i=0;}
-if (i==1) {i=2;}
-	if (i100) {i=100;}
-	PCB-GridStep[PCB-CurrentGrid] = i;
-	if (Settings.DrawGrid) UpdateAll ();
-//	ghid_set_status_line_label();
-	gtk_list_store_set (store, iter, COL_GRIDSTEP, i, -1);
+void cb_edited_mm_or_mil (GtkCellRendererText *cell,
+  gchar *path,
+  gchar *text,
+  GtkTreeView *treeview)
+{
+  GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+  GtkTreePath *treePath = gtk_tree_path_new_from_string (path);
+  int gridNum = CLAMP (gtk_tree_path_get_indices (treePath)[0],
+   0,
+   MAX_USER_GRIDS-1);
+  gboolean unitsMm;
+  GtkTreeIter iter;
+  double d;
+
+  unitsMm = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), column)) == COL_GRID_MM;
+  d = MAX (0, c_strtod(text));
+  PCB-Grid[gridNum] = (unitsMm) ? (d * MM_TO_COOR) : (d * MIL_TO_COOR);
+
+  if (gridNum == PCB-CurrentGrid) {
+if (Settings.DrawGrid)
+  UpdateAll ();
+ghid_set_status_line_label();
+  }
+
+  gtk_tree_model_get_iter (model, iter, treePath);
+  /* two separate calls because c_dtostr() uses static buffer */
+  gtk_list_store_set (GTK_LIST_STORE (model), iter,
+  COL_GRID_MM,  unitsMm ? c_dtostr(d) : c_dtostr(d*MIL_TO_MM),
+  -1);
+  gtk_list_store_set (GTK_LIST_STORE (model), iter,
+  COL_GRID_MIL, unitsMm ? c_dtostr(d*MM_TO_MIL) : c_dtostr(d),
+  -1);
+  gtk_tree_model_row_changed (model, treePath, iter);
+  gtk_tree_path_free (treePath);
+}
+
+
+void cb_edited_step (GtkCellRendererText *cell,
+ gchar *path,
+ gchar *text,
+ GtkTreeView *treeview)
+{
+  GtkTreeModel *model = gtk_tree_view_get_model (treeview);
+  GtkTreePath *treePath = gtk_tree_path_new_from_string (path);
+  int gridNum = CLAMP (gtk_tree_path_get_indices (treePath)[0],
+   0,
+