Imported Upstream version 19990927

parent f0c24817
gwave was written by Steve Tell <tell@cs.unc.edu>
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
#
# Rudimentary makefile for "gwave" analog waveform viewer
# This makefile requires gmake.
#
#
# a few configuration items
# someday real soon we'll use autoconf
# If you have a working POSIX regcomp/regexec(3), define HAVE_POSIX_REGEXP
# and comment out REGEXP_OBJS
DFLAGS=-DHAVE_POSIX_REGEXP
#REGEXP_OBJS=regexp.o regerror.o
HW_OS=$(shell hw_os)
INSTDIR=/usr/msl/vlsi/bin/bin-$(HW_OS)
NAME=gwave-0.0.4
#############################################################################
GTKLIBS = $(shell gtk-config --libs)
GTKCFLAGS = $(shell gtk-config --cflags)
THISDIR=$(notdir $(shell pwd))
CFLAGS = -g -Wall $(GTKCFLAGS) $(DFLAGS)
LDLIBS = $(GTKLIBS)
CC=gcc
LDCC=gcc
all: gwave test_read
GWAVE_OBJS=gwave.o wavelist.o pixmaps.o cmd.o draw.o event.o wavewin.o \
reader.o rd_cazm.o rd_hspice.o gtkmisc.o $(REGEXP_OBJS)
gwave: $(GWAVE_OBJS)
$(LDCC) -o $@ $(GWAVE_OBJS) $(LDLIBS)
test_read: test_read.o reader.o rd_cazm.o rd_hspice.o $(REGEXP_OBJS)
$(LDCC) -o $@ $^ $(LDLIBS)
regexp.o: regexp.c
gcc -traditional $(CFLAGS) -c $*.c
clean:
rm -f core *.o
distclean: clean
rm -f gwave test_read *~
dist: distclean
cd .. ; \
ln -s $(THISDIR) $(NAME) ; \
gtar czvf $(NAME).tar.gz --exclude=RCS --dereference $(NAME); \
rm $(NAME)
install: gwave
cp gwave $(INSTDIR)
# manual dependencies
gwave.o cmd.o draw.o event.o wavewin.o wavelist.o: gwave.h reader.h
gtkmisc.o: gtkmisc.h
gwave.o: reader.h gwave.h
wavelist.o: gtkmisc.h
reader.o: reader.h
rd_cazm.o: reader.h
rd_hspice.o: reader.h
# -*- mode: Makefile -*-
## Process this file with automake to produce Makefile.in
SUBDIRS=spicefile
INCLUDES=-I$(srcdir)/spicefile
bin_PROGRAMS = gwave
gwave_SOURCES = cmd.c gtkmisc.h wavewin.c draw.c \
gwave.c event.c gwave.h gtkmisc.c pixmaps.c wavelist.c dnd.c print.c
gwave_LDADD = $(srcdir)/spicefile/libspicefile.a
gwave_LDFLAGS = @GTK_LIBS@
CFLAGS = @CFLAGS@ @GTK_CFLAGS@
# TODO: get autoconf/automake to compile/link with these if we don't
# HAVE_POSIX_REGEXP: regexp.h regexp.c regerror.c regmagic.h
MOSTLYCLEANFILES = core *~
CLEANFILES = core *~
DISTCLEANFILES = core *~
MAINTAINERCLEANFILES = core *~
EXTRA_DIST=regexp.tar.gz gwave.gtkrc autogen.sh
# distribute some extra directories that don't have anything to build
# or install in them
dist-hook:
mkdir $(distdir)/doc
cp -p doc/* $(distdir)/doc
mkdir $(distdir)/examples
cp -p examples/* $(distdir)/examples
mkdir $(distdir)/iconwork
cp -p iconwork/* $(distdir)/iconwork
This diff is collapsed.
Gwave NEWS --- history of user-visible changes. -*- text -*-
New in 1990716:
Improved handling of HSPICE ascii format in libspicefile - tested on files
from 98.4 on HP-UX and Solaris.
New in 19990601:
- Changed version naming scheme to one based on the date, rather than a number
that suggests some sort of progress on the scale from 0.0 to 1.0.
- Deleting and reloading waveform files
- Detects Gtk 1.0 vs Gtk 1.2, builds on either.
(assumes that Gtk+-1.1.x is like 1.2, which may even be correct somtimes)
- New structure for file-reading code uses a library libspicefile.a, which I
also use in some other tools.
- Should handle HSPICE AC analysis files without ".options probe" better.
known bugs and limitations in 19990601:
- panel setup after adding waveforms may not always be right, in particular
after adding first waveform to a panel. If the horizontal scale looks bogus,
try "zoom all."
- Although it can read HSPICE AC analysis files that have complex variables,
it doesn't display those variables correctly yet. Can't read spice3 or spice2
AC analysis rawfiles containing complex variables.
- I've had some trouble with my adaptation of the spice2 file reader.
- Doesn't always redraw after reloading a waveform file, do zoom all to fix.
New in 0.0.6:
- Inserting/deleting waveform panels.
- added right-button popup menu to waveform panels
- The compile/install process now uses automake and autoconf to generate
the familiar "configure" script
- An attempt at placing the variable list windows in a more convenient position
in relation to the main window. Getting this perfect under all window managers
is a losing proposition.
New in 0.0.5:
- Fixed bug in reading hspice files with lots of columns
- displays signal name list window for files read from the command line.
(note: it will probably be behind the main window)
- incorporated code contributed by Jeff Dionne for reading spice2 rawfiles
New in 0.0.4:
- Fixed bug and/or warning when first waveform is added to display
- Ability to drag vertical bar cursors around, in addition to click-to-place
- Added zoom-to-cursor function; if both cursors have been placed,
zooms so that the time between the cursors fills the display.
- Added zoom-to-window function. Select this menu option, then
press/drag/release mouse button 1 to indicate a region of the X
axis that then zooms to fill the display.
New in 0.0.3:
- Load multiple files at once, either from the command line or
interactively.
- Some operations are moved to pulldown menus.
......@@ -12,66 +12,87 @@ Chapel Hill, NC 27599-3175
tell@cs.unc.edu
Installation:
Edit the top of the makefile if necessary
Compile with GNU make.
./configure (see file INSTALL or run configure --help for more info)
gmake
test gwave on some files in the examples directory
Copy the "gwave" binary to your favorite bin
gmake install
Usage:
wave [-t filetype] [-p number-of-panels] your-waveform-file
gwave [-t filetype] your-waveform-file
Number-of-panels defaults to 2. It understands CAzM transient output
(.N/.B/.W) files, and the binary and ascii outputs from HSPICE (.tr0,
.sw0, and .ac0) files.
If the file type is unspecified, it tries to guess
Gwave can read several file formats. It attempts to guess file formats
based on filename, and then tries all file formats until one succedes.
These file formats are known:
CAzM transient output (*.[BNW])
HSPICE binary and ascii formats (*.tr0, *.sw0, *.ac0)
Spice2 and Spice3 "raw" output (*.raw)
An ascii format with whitespace-seperated columns and column headings,
such as that produced by ACS (Al's circuit simulator). (*.acs, *.asc, *.ascii)
Use the View->Variable List menu to see a list of a list of signals in
your simulation files, then drag-and-drop signals into waveform
panels.
your simulation files, then drag-and-drop signals into the desired waveform
panels. Additional signals can be added to the same waveform panel
simply by double-clicking them.
To delete waves, select one or more of them using the buttons down the
left side of the main window, and then press the "delete" button.
Click on the waveform panels with the left and center mouse buttons to set two
cursors for measuring.
New in 0.0.3:
- Load multiple files at once, either from the command line or
interactively.
- Some operations are moved to pulldown menus.
New in 0.0.4:
- Fixed bug and/or warning when first waveform is added to display
- Ability to drag vertical bar cursors around, in addition to click-to-place
- Added zoom-to-cursor function; if both cursors have been placed,
zooms so that the time between the cursors fills the display.
- Added zoom-to-window function. Select this menu option, then
press/drag/release mouse button 1 to indicate a region of the X
axis that then zooms to fill the display.
Known problems:
- HSPICE data files generated without ".options probe" may not be read
correctly. workaround: try using ".options probe". This mostly happens with
AC sweeps.
cursors for measuring. Hold down these mouse buttons to drag the cursors.
Pressing and holding the right mouse button while the cursor is in a
waveform panel pops up a menu. From this menu you can insert
and delete waveform panels. Some of the zoom commands are also
replicated on this menu.
The "Export Postscript" and "Export PNM" options on the main File menu
provide the rudiments of output for inclusion in other
documentation. They require the graph program from GNU Plotutils to be
installed and found in your $PATH at configure time, and simply write
out files called gwave_out.ps and gwave_out.pnm into the current
directory. In the future, a dialog box will allow configuring the
print and export output.
For more info on GNU plotutils, see
http://www.gnu.ai.mit.edu/software/plotutils/plotutils.html
Known problems: - HSPICE data files generated without ".options probe"
may not be read correctly. workaround: try using ".options probe".
This mostly happens with AC sweeps. (I think this has been fixed -
feedback to the contrary is welcome)
Independent variables must be increasing in value. This isn't a
problem for transient and AC analyses, but for DC sweeps it is
possible to make them go backwards. Old versions of gwave would draw
bogus waveforms for these; Gwave 19990927 and later refuse to read
these files.
This tool is far from complete. Partial contents of the To Do list:
Interactively changing the number of panels instead of using a lame
command-line option
Send feedback and error messages from loading of files to a popup window
or status line instead of to stdout.
Drag-and-drop to move waveform from one panel to another
Logarithmic X and Y axes
Speed up redraws and minimize flashing, especialy flashing
of waveform name/value labels when moving cursors.
Generate a postscript representation for printing or documentation.
Override of wave and panel paramters, like min/max Y value, color, etc.
Saving and restoring waveform/panel configuration
Drawing a labeled graticule in the waveform area
Seperate lists for selecting voltage/current/etc. types of variables
- Send feedback and error messages from loading of files to a popup window
or status line instead of to stdout.
- Drag-and-drop to move waveform from one panel to another
- Logarithmic X and Y axes
- Speed up redraws and minimize flashing, especialy flashing
of waveform name/value labels when moving cursors.
- Override of wave and panel parameters, like min/max Y value, color, etc.
- Improved measurement functions.
ability to turn cursors on and off.
horizontal cursor(s) (1 or 2 per panel? where do their labels go?)
snap cursor to nearest intersection of orthagonal cursor and wave
- Saving and restoring waveform/panel configuration
- Drawing a labeled graticule in the waveform area
- Seperate lists for selecting voltage/current/etc. types of variables
- Clean up reader code by collecting some idioms that appear again and again
into common subroutines. This will make writing new readers a little easier.
- add an extension language for configuring the GUI and creating custom
analysis commands.
Planned next: Starting on the extension language. Future versions of
gwave will require guile (http://www.gnu.ai.mit.edu/software/guile/guile.html)
in order to build.
Feedback is welcome - tell@cs.unc.edu
/* acconfig.h --- documentation for local preprocessor symbols defined
* by configure.
* Use autoheader to process acconfig.h along with configure.in to generate
* config.h.in
* Steve Tell <tell@cs.unc.edu>
*/
/* Name of package. */
#undef PACKAGE
/* Version of package. */
#undef VERSION
/* do we have posix regex routines? */
#undef HAVE_POSIX_REGEXP
/* do we have Gtk+? */
#undef HAVE_GTK
/* does the Gtk+ we found have the new drag-and-drop stuff?
* do we need to use gtk_scrolled_window_add_with_viewport()?
*/
#undef GTK_V12
/* If present, the pathname of graph, from GNU plotutils.
*/
#undef PROG_GRAPH
This diff is collapsed.
## autogen.sh - generate all the twisty little files.
# Generate aclocal.m4 from configure.in
aclocal
# Generate Makefile.in's from Makefile.am's and configure.in
# (adding missing files that may be needed for proper operation)
automake --add-missing --gnu
# Generate config.h.in from acconfig.h and configure.in
autoheader
# Generate configure from configure.in and aclocal.m4
autoconf
# run ./config.status, if it exists, to create new Makefiles in subdirectories.
# (Note that this only is useful if builddir == scrdir, otherwise the
# user may need to run config.status from their builddir(s) manually)
test -x ./config.status && ./config.status
This diff is collapsed.
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* does the Gtk+ we found have the new drag-and-drop stuff?
* do we need to use gtk_scrolled_window_add_with_viewport()?
*/
#undef GTK_V12
/* If present, the pathname of graph, from GNU plotutils.
*/
#undef PROG_GRAPH
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
/* defined if we have POSIX regular expression routines */
#undef HAVE_POSIX_REGEXP
/* defined if we have GTK */
#undef HAVE_GTK
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
dnl ## Initialize autoconf ##
AC_INIT(gwave.c)
AM_INIT_AUTOMAKE(gwave, 19990927)
AM_CONFIG_HEADER(config.h)
dnl Use ANSI mode
AM_PROG_CC_STDC
dnl ## Checks for programs ##
AC_PROG_RANLIB
AC_CHECK_PROG(GRAPH, graph, $ac_dir/$ac_word)
if test ! -z "$GRAPH"; then
AC_DEFINE_UNQUOTED(PROG_GRAPH, "$GRAPH")
fi
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_FUNC_MEMCMP
dnl check for posix regular expression routines
AC_CHECK_HEADER(regex.h, AC_CHECK_FUNC(regcomp, AC_DEFINE(HAVE_POSIX_REGEXP,1,defined if we have POSIX regular expression routines)))
dnl check for GTK+
AM_PATH_GTK(1.0.1, AC_DEFINE(HAVE_GTK,1,defined if we have GTK), AC_MSG_ERROR(Can not find GTK+ 1.0.1 or later on this system))
dnl various attempts at figuring out which gtk DnD API to use.
dnl AC_DEFINE_UNQUOTED(GTK_VERSION,"${gtk_config_major_version}.${gtk_config_minor_version}, Gtk major/minor version number)
case $gtk_config_major_version.$gtk_config_minor_version in
1.0)
;;
1.1|1.2|1.3)
AC_DEFINE(GTK_V12)
;;
esac
AC_OUTPUT(Makefile spicefile/Makefile)
/*
* dnd.c - all of the stuff for the drag-and-drop interaction that gwave does.
*
* Copyright (C) 1998, 1999 Stephen G. Tell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* I've abstracted out the dnd operations I need for gwave because
* the interface is so different between Gtk+ 1.0 and 1.2.
*/
#include <ctype.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
#include <gtk/gtk.h>
#include <config.h>
#include <gwave.h>
#ifndef GTK_V12
#include "gtkmisc.h"
#endif
#define GWAVE_PRIVATE_DND_MAGIC 0xf00bbaad
#ifdef GTK_V12
enum {
TARGET_STRING = 0,
TARGET_DVAR = 1,
TARGET_ROOTWIN = 2,
TARGET_URL = 3
};
static GtkTargetEntry target_table[] = {
{ "x-gwave/dvar", GTK_TARGET_SAME_APP, TARGET_DVAR },
{ "STRING", 0, TARGET_STRING },
{ "text/plain", 0, TARGET_STRING },
{ "application/x-rootwin-drop", 0, TARGET_ROOTWIN }
};
static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
static GdkPixmap *drag_icon_pixmap;
static GdkPixmap *drag_mask_pixmap;
#else
char *possible_drag_types[] = {"x-gwave/dvar"};
char *accepted_drop_types[] = {"x-gwave/dvar"};
#endif
/*
* set up for drag & drop.
*/
void
dnd_init(GtkWindow *window)
{
static GtkWidget *drag_icon = NULL;
static GtkWidget *drop_icon = NULL;
#ifdef GTK_V12
if(!drag_icon_pixmap)
drag_icon_pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL,
gtk_widget_get_colormap(GTK_WIDGET(window)),
&drag_mask_pixmap,
NULL, wave_drag_ok_xpm);
#else
GdkPoint icon_hotspot = {5,5};
if (!drag_icon) {
drag_icon = shape_create_icon_d (drag_no_xpm,
440, 140, 0,0, GTK_WINDOW_POPUP);
gtk_signal_connect (GTK_OBJECT (drag_icon), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&drag_icon);
gtk_widget_hide (drag_icon);
}
if (!drop_icon) {
drop_icon = shape_create_icon_d (wave_drag_ok_xpm,
440, 140, 0,0, GTK_WINDOW_POPUP);
gtk_signal_connect (GTK_OBJECT (drop_icon), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&drop_icon);
gtk_widget_hide (drop_icon);
}
gdk_dnd_set_drag_shape(drag_icon->window,
&icon_hotspot,
drop_icon->window,
&icon_hotspot);
#endif
}
/****************************************************************************
*
* event handler for a drop onto the target, in our case
* when variable gets dropped on a wavepanel
*/
#ifdef GTK_V12
void
dnd_target_event(GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint time,
gpointer d)
{
WavePanel *wp = (WavePanel *)d;
GWDnDData dd;
/* g_print("dnd_target_event info=%d length=%d\n", info, data->length); */
switch(info) {
case TARGET_DVAR:
dd = *(GWDnDData *)data->data;
if(data->length == sizeof(GWDnDData)