xoscope-2.0/0000777000175000017500000000000011221217134010032 500000000000000xoscope-2.0/TODO0000644000175000017500000001757011221055472010455 00000000000000 x*oscope infinite TODO list, in rough order of suggestion This is a the original text of (most) everything that's been thought up or suggested along with my comments and any status updates. Things that are mostly done have now been moved to TODO.old for historical reference. I don't know how many of the remaining ones will ever get done or if some of them are even practical without major work. 1 16 bit sampling (Jeff_Tranter@Mitel.Com) Oscope would just divide by 256 to show 1/1 scale. The obvious advantage to this is better clarity when you zoom in on signals of small amplitude, or for use with x10 probes. For math to work, the size of everything would need doubled from 16 to 32 bits to avoid overflow. v1.1: I made a hardware solution for amplifying x10 probes. See HARDWARE and buff.*. 16-bit would still be useful though. v1.10: COMEDI data source handles 16-bit devices, though math may still need to be fixed to avoid overflow 3 envelope mode (Jeff_Tranter@Mitel.Com) This only applies at slower sweep speeds, right? See #23. 7 smarter maximum sample rate (twitham@pcocd2.intel.com) If your sound card can do greater than 44kHz, oscope won't currently take advantage of it. It should determine the optimum rate at run-time. I used 44kHz because it was the most my card could do at a one sample per pixel screen resolution. But, for example, if your card can do 88kHz it could plot every other sample until you zoom in to get 1:1. 8 trigger on math or memory (twitham@pcocd2.intel.com) You could hide 1 and 2 and use an external command as input. Also allows you to trigger when 1 equals 2 or whatever. Problem - how to handle things like the Bitscope that _have_ to have a trigger. See #33. 9 show pre-trigger samples (twitham@pcocd2.intel.com) Let user position trigger horizontally. Remember samples until we find trigger, then capture h_points - pos more. v1.4: Of course this wouldn't work with ProbeScope since we have no samples before trigger. 10 external command history (twitham@pcocd2.intel.com) Remember previous commands and make them available in a list. Possibly record them all to the data file. v1.6: GTK+ interface now has a combo box of useful commands. 11 vertical scale calibration (Grant_Siemers@ccm.fm.intel.com) Ask user to apply a signal of known amplitude and use the result to correctly label voltage on the Y axis. I wonder how many folks could actually do this? v1.4: ProbeScope voltage is labeled correctly, no calibration needed. v1.10: COMEDI voltage is labeled correctly, no calibration needed. 12 channel colors (Grant_Siemers@ccm.fm.intel.com) Let user customize the colors of the channels. 15 autosetup (Sean_Eilert@ccm.fm.intel.com) Auto-find one period and set the time scale appropriately. 23 more acquisition modes (twitham@pcocd2.intel.com) With #22, we could do various modes like peak detect, envelope, average. I'm thinking all samples could really be stored in memory in which case these would really be display modes. That is, how you see a combination of samples represented at one horizontal pixel position on the screen. 25 separate sample / display buffers (twitham@pcocd2.intel.com) Internally, collect samples in a different buffer and then move them into a separate waveform buffer. This would greatly simplify implementation of several of the above features. v1.3: I've re-written the display routine to understand arbitrary sample rates. Well, anything below 44000 for now. So maybe this won't be necessary. v1.4: The display now works with rates up to 20,000,000 S/s. v1.8: The display now works with rates up to at least 25,000,000 S/s. 30 BitScope support (www.bitscope.com) I plan to write this in the year 2000 when I will finally have time. v1.8: Well, 2000 blew by and I never got it done due to an unexpected life outside of computers. So I won't put a date on it now. The BitScope is a "Mixed Signal Capture Engine." Way cool programmable hardware that aquires data and makes it available through a serial port. With its 2 analog channels and 8 digital, it has the potential to turn xoscope into a real combined digital scope and logic analyzer at up to 100 MHz! My rough initial plan of attack is: + 2 way serial communications to the device + modularized programming and I/O functions + a new channel display mode that instead of drawing one analog line draws 8 digital ones. This way the existing buffer memory capabilities will work for the LA too. v1.7: This display mode is now available; hit ` or ~ to change the number of bits displayed. + the keyboard interface may need replaced with some sort of on-screen menu system to organize the many features, similar to the menus of real DSOs. + this likely will be a separate configuration at build-time, completely separate from soundcard and probeScope devices since the hardware is so much more sophistocated. In other words, it will produce a separate program, for BitScope only. v1.8: Actually, now I think not. But it will require GTK+ for a decent user interface. I have used Glade to build a control dialog and believe this will work nicely. Obviously this will not be trivial but will be very well worth the effort. Sorry I never had time to do it yet. I am still looking forward to using BitScope with xoscope on Linux. 32 Improved display handling Right now, the graticule (display grid) is re-drawn every time the data changes. Under X Windows, the display code could be implemented using a bitmask to prevent the signal lines from drawing over the graticule when it is in "over" mode. In "under" mode, the inverse bitmask could be used to "draw" the signal lines only where the graticule is, using the color of the graticule. End result should be more efficient X Windows performance. On a psuedo-color (or svgalib) display, signal lines could be drawn using reserved bits in a custom colormap, removing the need for any special graticule handling at all. Code could be smarter about figuring out which x-coordinates have been erased, and only re-draw signal lines for those coordinates, instead of redrawing entire signal lines. Don't have to use backing pixmap unless we're in accumulate mode. 33 Multi-threading Some of the data sources (like Bitscope) tend to block and wait for serial line operations. An easy way to avoid this would be to implement a multi-threaded data source interface, where the data collection thread ran independant from the display thread. Main problem I see here is synchronization between the main thread and the data collection thread, especially at the end of a sweep - you have to signal the main thread that data is ready, then wait until everything in the main thread is done processing the data before starting a second sweep. 34 16-bit and digital triggering Triggering code currently works well for 8-bit triggering (the original soundcard design), but for 16-bit sources and digital sources, not so well. How to scale the trigger values for 16-bit sources, and do something intellegent with digital triggering sources? 99 mini TODOs new defaults - default device, default min update interval Bitscope dialog - test it and finish it memory utilization figure out how to use stock buttons on Glade dialogs count.dat anti-jitter in COMEDI's rt_timer max rate option in COMEDI's rt_timer fix multi-sample scan delay in COMEDI's rt_timer investigate RTAI scheduling issues - how badly do we need anti-jitter? ability to resize to a small(er) window COMEDI gain control shouldn't lose display information when moving signal up/down time scale normalization - when it's done and how noise causing false triggers on 16-bit data sources should we note clipping? older versions did COMEDI rate logic make sure -m option works (screen size) cursors - should always show same voltage left/right cursors - move around if sampling rate on active channel changes xoscope-2.0/TODO.old0000644000175000017500000003246111221055441011222 00000000000000 x*oscope mostly finished TODO list. This file holds old TODOs that are mostly done, for historical reference and status updates. See the TODO file for outstanding TODOs. 2 single shot mode (Jeff_Tranter@Mitel.Com) This should be fairly easy to do and should be done. v1.2: DONE. Use space bar to select `wait' mode, then the first trigger event will `stop' the scope. 4 make drawing area mouse aware (Jeff_Tranter@Mitel.Com) Be able to drag signals up and down for example. v1.6: Under GTK+, left-click will select a channel and right-click is a context-sensitive pop-up menu. 5 clean up the cluttered screen (twitham@pcocd2.intel.com) Tough to do unless I invent a smarter menu-driven interface. And how do I do that on svgalib? Maybe drop console support? I could at least hide the (keys) and let them show up when you hit a certain help key, say (?). That's how freq does it. v1.2: DONE. Just hit the `?' key to toggle. v1.3: now shows oscope version number. v1.5: GTK+ version now has an easy to use menu interface. v1.6: GTK+ now has context-sensitive pop-up tearable menus. 6 X-Y mode (Grant_Siemers@ccm.fm.intel.com) To be of most use, X and/or Y should be able to come from memory or math. This could be an external command as described in the external spectrum analyzer idea, #16. v1.2: DONE. As an external command, hit `$' key and enter `xy'. v1.3: You can now use the `xy' command with memory buffers by simply recalling the recorded signals into channel 1 or 2 with `xy' running on an another channel. 13 redefine external interface (Sean_Eilert@ccm.fm.intel.com) Let user decide which signals to pass to external command. This lets you do math on memory or on other math. Enables you to ask questions like what is the difference between this signal and a previous reference in memory? There would need to be a command protocol established on the pipe. This could also mark the trigger points so externals could "sync" correctly after window resizing. v1.3: DONE? You can now do math (internal or external) on memory by simply recalling the recorded signals into channel 1 or 2. This should be sufficient. 14 redefine internal math (twitham@pcocd2.intel.com) Let internal math operate on arbitrary channels so you can do math on references or on other math. v1.3: DONE? You can now do math (internal or external) on memory by simply recalling the recorded signals into channel 1 or 2. This should be sufficient. 16 external spectrum analyzer (Sean_Eilert@ccm.fm.intel.com) For xoscope, modify Philip VanBaren's xfreq to be an external command, displaying the frequency domain in another window! This idea could be used for X-Y also. Of course it only works with a windowing system (X11). v1.1: DONE. Hit the `$' key and run `ofreq' on a channel. See README.f51 for instructions on building ofreq from freq51. v1.4: Patch updated to work with ProbeScope by allowing 1kS/s to 20MS/s sample rates and scaling the input to 8 bit range. 17 no hard-wired inputs (twitham@pcocd2.intel.com) Disconnect the "hard-wiring" of Left and Right sound inputs to channel 1 and 2. Make all display channels equivalent. This could enable the sound card to become optional and make it easier to add other types of input "devices" to any channel. v1.3: DONE? Left and Right are now "hard-wired" to X and Y which can be "recalled" to any of the 8 display channels. Channel 1 and 2 are still special since they're the input to the math functions. v1.4: DONE? ProbeScope is "hard-wired" to Z and displayed on Channel 3 by default. 18 signal input from files (twitham@pcocd2.intel.com) Read input signal from a file and loop over it. You could generate perfect test signals in software, save them to files, then use oscope to see them or do math on them. v1.3: DONE? You could now write an oscope data file with the signals stored as columns (save one to see the format). Then just recall the columns to channel 1 and/or 2 to show them and do math on them. v1.4: See also #26. 19 serial "Probe Scope" input (twitham@pcocd2.intel.com) Radio Shack now has an affordable 20 MHz "Probe Scope" that can send samples out a serial cable to PC software. Unfortunately, it is only 6 bit. It would still be fun and useful to support it as an input device, assuming I could figure out its' protocol. Oscope would just multiply by 4 to get to the 1:1 scale. Of course the time scaling would also need to be reworked. Then oscope would be able to do 20 MHz! v1.3: I bought a Probe Scope. The protocol is documented and and I'm making progress on this. Most of this version's code rearranging was to make it easier to add Probe Scope support. Hopefully this will be done by next release. v1.4: DONE. ProbeScope is connected to Z and displayed on Channel 3 by default. You may recall it to Channel 1 to do math on it. The 6-bit resolution is multiplied by 5 to result in 0.1, 1, or 10 V/div. 20 external command OSCOPEPATH (twitham@pcocd2.intel.com) Maybe oscope should look for external commands in known directories so they don't have to be on the users' $PATH. There could be a default that the user can override with an environment variable. This would simply modify the PATH environment variable for the subprocesses. v1.1: DONE. It is the LIBPATH in the Makefile. 21 increase "horizontal resolution" (twitham@pcocd2.intel.com) When "zoomed in" on a high frequency signal, display pixels are skipped, resulting in a lousy horizontal resolution of roughly 25 micro seconds. For repetitive signals, this could be improved by "estimating" where the trigger really was and shifting the signal an appropriate amount horizontally before plotting. In conjunction with dot accumulate, this would plot more of the horizontal pixels and produce a cleaner picture. v1.1: DONE. Oscope now remembers one sample before trigger and then internally "connects the dots" with a line to guess where the trigger really was. Then the samples are shifted horizontally to place this time at the trigger point. v1.3: This shifting no longer applies to channels displaying memory buffers. Since they are a single snapshot of samples, accumulation can't make them any more clear; it just "blurs" the display if they're shifted. The shifting still applies to math since it can enhance the result if the math is being performed on one or both input signals. v1.4: Shifting also doesn't apply to ProbeScope since we don't get the necessary sample before trigger. 22 increase time/div range (twitham@pcocd2.intel.com) Currently, the slowest sweep speed is 1 sample per pixel for one screen full. Slower sweeps could be done by skipping samples, averaging, etc. Will need to plot a fraction of the screen then sample and plot more beyond the first, instead of the current gather all, plot all loop. v1.3: Oscope can now skip samples but nothing fancier. v1.4: If we don't have enough sample depth for the screen, then only part of the screen is plotted. This feature would never be useful for ProbeScope since we'll never have more than 128 samples past trigger. v1.8: DONE. 24 port to other OSs (twitham@pcocd2.intel.com) Yack! Might already work on other unixes. I need to pull the soundcard specifics out to a separate file like Philip did for freq. Display stuff is already fairly modular; just write a new file like gr_sx.c or gr_vga.c. v1.3: The OS specifics are now in separate files. sc_* is the sound card connection and gr_* is the display. gr_grx.c is a working display port to DOS using DJGPP with GRX. If you know how make a sound card record in stereo under DOS, feel free to finish sc_sb.c and let me know how you did it (I'd give you the credit of course). Please let me know if you port it to any OS; I have no time or incentive to do any further porting myself. v1.4: The serial connection to ProbeScope is implemented in ser_*.c. DOS port works but in mono only (Left == Right) due to my lack of ability to figure out how to do stereo recording. But it demonstrates the portability of the code. v1.5: GTK+ port works great. Apparently GTK+ is being ported to non-unix's so someday this may simplify ports to other OSs. 26 sound pipe input device (james@albion.glarp.com) James Feeney suggested a variation to #18: the ability to send an audio file or command output into a running oscope process. This may be doable through /dev/dsp if it could be opened non-exclusively. Oscope or the player process would need to work with the current sample rate instead of each trying to set it. Or this could be done through a named pipe (FIFO) in the filesystem. It can already sort of be done through the external command interface. A command could just disregard the input and send a new signal in to one of Channel 3 - 8. v1.6: this is best done via ESD which lets many processes share the sound device. Just esdplay (or whatever) a file through esd while xoscope is monitoring the sound. 27 time/frequency and amplitude cursors (twitham@pcocd2.intel.com) Cursors similar to Radio Shack's ProbeScope software would be useful. A key could toggle them on/off like freq does, then the keyboard would have an alternate layout to move them. Of course mouse support, #4, would be nicest. The display could replace the auto-measurements in this mode. v1.7: DONE. Even with mouse support under GTK+! They're positioned with Ctrl-keys, and ' turns them on/off, " resets them. 28 Fix voltage measurements for ProbeScope (twitham@pcocd2.intel.com) Since I don't know the GND level of ProbeScope input, I didn't bother to turn amplitude measurements into voltages. The peaks could be referenced to a level other than the center. But, at least the peak-to-peak could read in literal volts. v1.8: DONE. 29 Port to the GTK+ user interface on X. (twitham@quiknet.com) v1.5: DONE. Supports GTK+ 1.0 or higher. Future releases will require GTK+ 1.2 or higher so that fancier things can be done in the menubar. GTK+ versions less than 1.2 will no longer be supported after this release. v1.6: GTK+ 1.2 or better now required. The drawing area is now context-sensitive to mouse clicks. 31 Parallel port support (several people) Use the parallel port as a digital input device. This would be nice with the new logic analyzer display of version 1.7. http://www.circlemud.org/~jelson/software/parapin should make this easier. Polling from user space would not guarantee a consistent sample rate. More ideally, there would be a kernel module device driver to do the sampling regularly and make the bytes available through a file similar to /dev/dsp. v1.10: DONE. RTAI required. 35 Completely convert to GTK Currently, we're only using GTK a little bit, and still have a bunch of nuisance problems in the display handling code. Having to support VGA basically defeats the purpose of having a GUI library, so probably ditch svgalib compeletely, implement the center display window as a widget, and everything else is done with Glade. Probably call this "xoscope 2", because not only would it look at lot different, it'd now be built around a widget, that should be put in a shared library, that could be used in other applications. What signals/methods should the widget have? setgraticulemode(int); /* OFF, IN FRONT / IN BACK, MAJOR / MINOR */ setgraticulecolor(Color); setplotmode(int mode); /* POINT, STEP, LINE, ACCUMLATE ON/OFF */ assign(int channel, struct Signal *); setcolor(int channel, Color); setdigital(int channel, int bits); /* 0=analog; non-0=num of bits */ ADJUSTMENTS - per channel - vscale, hscale, voffset, hoffset ADJUSTMENTS - global - vscale, hscale, voffset, hoffset update(); CURSOR FUNCTIONS cursor1_setpos(GtkWidget *, GdkEvent *, data); cursor2_setpos(GtkWidget *, GdkEvent *, data); cursor1_increment(); cursor2_increment(); QUERY CURSOR Timebase - we want a uniform timebase; so we should set an hscale for each signal, and also have a global hscale, that could be continuously adjusted - like turning the red timebase knob on my scope. This seems to imply SAMPLE VALUES <---> "TIME" <---> DISPLAY PIXELS local adj global adj Likewise, a real scope has continuous vertical scale and position adjustments for each channel. So we have to have at least local hscale settings, a global hscale adjustment, local vscale adjustments, local vposition adjustments, a global hposition adjustment. The simplest and most general way to deal with all these is to have both local and global adjustments for all of hscale, vscale, hpos, and vpos. The scale settings work like above - there's an intermediate "time" that acts as a bridge between the local and global scales. What units do we want the position adjustments in? Cursors, too, seem like they should be adjustments. What units do we want the cursors in? Need to make sure we can map keyboard accelerators to any of: reset adjustment(s) to zero; incr/decr adjustment by small/large step v2.0: DONE. Don't have all of the little tidbits I envisioned, though. 36 Scroll left/right across a signal too big to fit on the screen This was requested on the sourceforge features request page. v2.0: DONE. 37 Reduce size of executable! As I right this, xoscope-1.11 clocks in at 5452 KB on my Intel Linux system. The "bloat", I'm convinced, comes from the statically allocated data[] array in the Signal structure. v2.0: DONE. Executable is now 531 KB. xoscope-2.0/xoscope.rc.h0000644000175000017500000000617411221066612012215 00000000000000char * xoscope_rc[] = { "#style \"violet_help_label\" { fg[NORMAL] = \"Violet\" fg[INSENSITIVE] = \"Black\" fg[PRELIGHT] = \"Black\" fg[ACTIVE] = \"Black\" fg[SELECTED] = \"Black\" bg[NORMAL] = \"Violet\" bg[INSENSITIVE] = \"Black\" bg[PRELIGHT] = \"Black\" bg[ACTIVE] = \"Black\" bg[SELECTED] = \"Black\" text[NORMAL] = \"Violet\" text[INSENSITIVE] = \"Black\" text[PRELIGHT] = \"Black\" text[ACTIVE] = \"Black\" text[SELECTED] = \"Black\" base[NORMAL] = \"Violet\" base[INSENSITIVE] = \"Black\" base[PRELIGHT] = \"Black\" base[ACTIVE] = \"Black\" base[SELECTED] = \"Black\" }", "", "style \"black_bg\" { bg[NORMAL] = \"Black\" }", "style \"red_bg\" { bg[NORMAL] = \"Red\"}", "", "style \"label_font\" { font_name = \"Helvetica 16\" }", "", "style \"white\" { fg[NORMAL] = \"White\" }", "style \"green\" { fg[NORMAL] = \"Green\" }", "style \"cyan\" { fg[NORMAL] = \"Cyan\" }", "style \"yellow\" { fg[NORMAL] = \"Yellow\" }", "style \"orange\" { fg[NORMAL] = \"Orange\" }", "style \"violet\" { fg[NORMAL] = \"Violet\" }", "style \"blue\" { fg[NORMAL] = \"Blue\" }", "style \"red\" { fg[NORMAL] = \"Red\" }", "", "style \"red_scrollbar\" { fg[NORMAL] = \"White\" fg[PRELIGHT] = \"White\" fg[ACTIVE] = \"White\" bg[NORMAL] = \"#a00000\" bg[PRELIGHT] = \"Red\" bg[ACTIVE] = \"#600000\" }", "", "widget \"main_window\" style \"black_bg\"", "widget \"main_window.*.databox\" style \"black_bg\"", "widget \"main_window.*.databox_frame\" style \"red_bg\"", "widget \"main_window.*.databox_hscrollbar\" style \"red_scrollbar\"", "", "# This has the effect of not only setting color and font for labels", "# not specified below, but also of setting font for all the labels", "# because the fonts aren't specified below", "", "#widget \"main_window.*_label\" style \"label_font\"", "widget \"main_window.*_label\" style \"white\"", "", "widget \"*.sample_rate_label\" style \"green\"", "widget \"*.samples_per_frame_label\" style \"green\"", "widget \"*.period_label\" style \"green\"", "widget \"*.min_max_label\" style \"green\"", "", "widget \"*.Ch1*\" style \"green\"", "widget \"*.Ch2*\" style \"cyan\"", "widget \"*.Ch3*\" style \"yellow\"", "widget \"*.Ch4*\" style \"orange\"", "widget \"*.Ch5*\" style \"violet\"", "widget \"*.Ch6*\" style \"blue\"", "widget \"*.Ch7*\" style \"red\"", "widget \"*.Ch8*\" style \"white\"", "", "widget \"*.*_key_label\" style \"violet\"", "widget \"*.*_help_label\" style \"green\"", "", "widget \"*.quit_help_label\" style \"white\"", "widget \"*.load_help_label\" style \"white\"", "widget \"*.load_help_label\" style \"white\"", "widget \"*.save_help_label\" style \"white\"", "widget \"*.xoscope_help_label\" style \"white\"", "widget \"*.version_help_label\" style \"white\"", "widget \"*.help_label\" style \"white\"", "widget \"*.refresh_help_label\" style \"white\"", "widget \"*.graticule_help_label\" style \"white\"", "widget \"*.graticule_position_help_label\" style \"white\"", "widget \"*.color_help_label\" style \"white\"", "", "# This one's a bit special - it's a key label, but not a \"*_key_label\"", "# so it doesn't appear and disappear and therefore has to be set explicitly", "", "widget \"*.question_mark_label\" style \"violet\"", NULL }; xoscope-2.0/fft.h0000644000175000017500000000024311122235346010702 00000000000000/* * Prototypes for the routines in realfft.c and realffta.asm */ void InitializeFFT(int); void EndFFT(void); void RealFFT(short *); extern int *BitReversed; xoscope-2.0/AUTHORS0000644000175000017500000000351211221216760011023 00000000000000 Recent work (since release 1.10) by Brent Baccala Oscope/Xoscope was written by Tim Witham , known as back in 1995 when development began. Oscope was originally based on "scope" by Jeff Tranter . Oscope is released under the conditions of the GNU General Public License. See the files README and COPYING in the distribution for details. CREDITS: Thanks to: Jeff Tranter for writing the original scope-0.1 that inspired all this. Philip VanBaren for the realfft.c code from his freq program. If you want a Spectrum Analyzer, you should get Philip's freq program and read README.f51. The many folks working on the way cool GTK+. The Cthugha-L program (Torps Productions, Harald Deischinger ) for inspiring the X11 client and some coding ideas. Dominic Giamapolo for libsx which made the original X11 client possible. Mitch D'Souza for libvgamisc which makes the 16-color console text possible (from his "g3vga"). For the DOS port, DJ Delorie (dj@delorie.com) for DJGPP and to Charles W Sandmann (sandmann@clio.rice.edu) for CWSDPMI which together allow the 32 bit code to work on DOS. To Gerhard Kordmann (kordmann@ldv01.Uni-Trier.de) for sb02.zip which made the sound card work. And to Sam Vincent (svincent@cs.sonoma.edu) for svasync.zip which made the serial connection to ProbeScope possible. Dave J. Andruczyk for the initial tweaks to make a connection to EsounD. Bruce Tulloch and Norman Jackson for the way cool open BitScope hardware and the wonderful Programmer's guide. Ingo Cyliax for initial code to work with the bitscope. xoscope-2.0/oscope.h0000644000175000017500000001751611133560127011426 00000000000000/* * @(#)$Id: oscope.h,v 2.7 2009/01/15 07:05:59 baccala Exp $ * * Copyright (C) 1996 - 2001 Tim Witham * * (see the files README and COPYING for more details) * * This file defines the program's global variables and structures * */ #include /* need GdkPoint below */ #include #include "config.h" /* global program variables */ extern char *progname; extern char version[]; extern char error[256]; extern int quit_key_pressed; extern int clip; extern char *filename; extern int in_progress; typedef struct Scope { /* The oscilloscope */ int mode; int run; int scale; int div; int grat; int behind; int select; int trigch; int trige; int verbose; int trig; int curs; int cursa; int cursb; int min_interval; } Scope; extern Scope scope; /* Signal - the input/memory/math signals * * sc_linux.c depends on the order of these fields in a static initializer */ typedef struct Signal { char name[16]; /* Textual name of this signal (for display) */ char savestr[256]; /* String used in save files */ int rate; /* sampling rate in samples/sec */ int volts; /* millivolts per 320 sample values */ int frame; /* Current frame number, for comparisons */ int num; /* number of samples read from current frame */ int delay; /* Delay, in ten-thousandths of samples */ int listeners; /* Number of things 'listening' to this Sig */ int bits; /* number of valid bits - 0 for analog sig */ int width; /* size of data[] in samples */ short *data; /* the data samples */ } Signal; extern Signal mem[26]; /* Memory channels */ typedef struct DataSrc { /* A source of data samples */ char * name; /* returns number of data channels available. Return value can * change around pretty much at will. Zero indicates device unavailable */ int (* nchans)(void); /* returns a pointer to the Signal structure for a numbered channel */ Signal * (* chan)(int chan); /* mode is 1 (rising trigger) or 2 (falling trigger) returns TRUE if * trigger could be set; otherwise (it couldn't be set) return FALSE * and leave trigger cleared 'level' is a pointer to the trigger * level in signed raw sample values If a trigger can be set near, * but not exactly on, the requested level, the function returns * TRUE, sets the trigger, and modifies 'level' to the adjusted * value. */ int (* set_trigger)(int chan, int *levelp, int mode); void (* clear_trigger)(void); /* dir is 1 for faster; -1 for slower; returns TRUE if rate changed */ int (* change_rate)(int dir); /* sets the frame width (number of samples to capture per sweep) for * all channels in the DataSrc. Success is indicated by the 'width' * field changing in the DataSrc's Signal structures. Can be NULL * to indicate device does not support multiple frame widths. */ void (* set_width)(int width); /* reset() gets called whenever we want to start a new capture sweep. * It should get called after any of the above channel, trigger, or rate * functions have been used to change the data source capturing * parameters, or after the capturing channels have been changed. * Only after reset() has been called are the rate and volts * fields in the Signal structures guaranteed valid. */ void (* reset)(void); /* returns a file descriptor to poll on (for read) to indicate that * the data source has data available for read, via get_data() below. * return -1 to indicate no active signal capturing. Always gets * called after a reset() */ int (* fd)(void); /* get_data() is called when poll(2) on the file descriptor returned * by fd() indicates data is available to read. It is responsible * for filling in the Signal arrays returned by the chan() function, * and returns TRUE if the trigger condition was hit (currently used * only in single-shot mode to stop the scope after a single trace). * It also must set the global variable 'in_progress' TRUE if it * returns in the middle of a trace, and FALSE at the end of a * trace. get_data() must always return at the end of every trace, * as the display code assumes that a trace is completely drawn * before moving on the next trace. */ int (* get_data)(void); /* This function allows the data source to display various status * information on the screen. i ranges from 0 to 7, and corresponds * to 8 information fields near the bottom of the display. Fields * 0 through 3 have room for about 16 chars, fields 4 and 5 have * room for about 20, and fields 6 and 7 can hold about 12. * Function pointer can be NULL if there's no status info to display. */ char * (* status_str)(int i); /* These functions are called when the option1 (*) or option2 (^) * keys are pressed and should return 1 to do a datasrc->reset. * Their corresponding string functions should return a short string * to be displayed on the screen, which can be NULL. If the * option function returns TRUE, a clear() is done. Any of these * pointers can be NULL. If the 'str' function is NULL, no help * will be displayed for that option key, but this doesn't preclude * the corresponding option function from doing something! */ int (* option1)(void); char * (* option1str)(void); int (* option2)(void); char * (* option2str)(void); /* set_option()/save_option() * * These functions are used to set and save data source specific * options, either from the command line or from a savefile, * including but not limited to the keyboard options corresponding * to option1/option2. To generate the savefile, save_option() will * be called repeatedly with arguments starting at zero and * increasing until it returns NULL. Each string returned will * later trigger a call to set_option() when the savefile is * loaded. Returning an empty string will skip to the next * integer without outputing anything. * * set_option() should return TRUE if it was able to parse and * process the option; FALSE otherwise. The options can also be * specified on the command line, so should be human readable. * * Both function pointers can be NULL. */ int (* set_option)(char *); char * (* save_option)(int); /* This function is only used if the X Windows GTK interface is * in use. If non-NULL, it causes the "Device Options..." item * on the File menu to be made sensitive, and the function itself * is called whenever that item is clicked. It should trigger * a popup menu with device-specific options. */ void (* gtk_options)(void); } DataSrc; extern DataSrc *datasrc; extern DataSrc *datasrcs[]; extern int ndatasrcs; typedef GdkPoint Point; typedef struct SignalLine { int next_point; struct SignalLine *next; /* keep a linked list */ GtkDataboxGraph *graph; gfloat *X; gfloat *Y; } SignalLine; typedef struct Channel { /* The display channels */ Signal *signal; SignalLine *signalline[16]; /* 16 - could have up to 16 bits per sample, * thus, up to 16 signal lines per channel * in digital mode */ int old_frame; /* last frame number plotted */ int mult; /* A scaling ratio we multiply samples by */ int div; int target_mult; /* The target scaling ratio */ int target_div; gfloat pos; /* Location of zero line on scope display; * 0 is center; 1 is top; -1 is bottom */ int color; int show; int bits; } Channel; extern Channel ch[CHANNELS]; /* functions that are called by files other than oscope.c */ void usage(); void handle_key(unsigned char); void cleanup(); void init_scope(); void init_channels(); int samples(); void loadfile(); void savefile(); void startcommand(); char * split_field(char *, int, int); int datasrc_byname(char *); extern char serial_error[]; /* Functions defined in display library specific files */ void setinputfd(int); void settimeout(int); xoscope-2.0/config.h.in0000644000175000017500000001427111220611623011776 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* * @(#)$Id: acconfig.h,v 2.3 2009/01/14 18:21:06 baccala Exp $ * * Copyright (C) 1996 - 2001 Tim Witham * * (see the files README and COPYING for more details) * * This file simply sets the program's compile-time options. * Original shipped values are in (parentheses). * */ /* I think these came from glade, not used much yet */ #undef ENABLE_NLS #undef HAVE_CATGETS #undef HAVE_GETTEXT #undef HAVE_LC_MESSAGES #undef HAVE_STPCPY #undef HAVE_LIBSM #undef PACKAGE_LOCALE_DIR /* for glade pixmaps, if any */ #undef PACKAGE_DATA_DIR #undef PACKAGE_SOURCE_DIR /* for xoscope external math commands */ #undef PACKAGE_LIBEXEC_DIR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `comedi' library (-lcomedi). */ #undef HAVE_LIBCOMEDI /* Define to 1 if you have the `esd' library (-lesd). */ #undef HAVE_LIBESD /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t /* program defaults for the command-line options (original values) */ #define DEF_A 1 /* 1-8 (1) */ #define DEF_R 44100 /* 8000,11025,22050,44100 (44100) */ #define DEF_S 10 /* 1,2,5,10,20,50,100,200,500,1000 (10) */ #define DEF_T "0:0:x" /* -128-127:0,1,2:x,y ("0:0:x") */ #define DEF_L "1:1:0" /* 1-MAXWID:1-MAXWID:0,1 ("1:1:0") */ #define DEF_D 4 /* 1,2,4 (4) */ #define DEF_F "" /* console font, "" = default ("") */ #define DEF_FX "8x16" /* X11 font ("8x16") */ #define DEF_P 2 /* 0,1,2 (2) */ #define DEF_G 2 /* 0,1,2 (2) */ #define DEF_B 0 /* 0,1 (0) */ #define DEF_V 0 /* 0,1 (0) */ #define DEF_X 0 /* 0,1 (0) don't use sound card? */ #define DEF_Z 0 /* 0,1 (0) don't search for Serial Scope? */ /* maximum number of samples stored in memories (1024 * 256) */ #define MAXWID 1024 * 256 /* The first few samples after a reset seem invalid. If you see strange "glitches" at the left edge of the screen, increase this (32) */ #define SAMPLESKIP 32 /* maximum samples to discard at each pass if we have too many (16384) */ #define DISCARDBUF 16384 /* max number of channels, up to 8 (8) */ #define CHANNELS 8 /* minimum number of milliseconds between refresh on libsx version (30) */ #define MSECREFRESH 30 /* a lower number here can increase refresh rate but at the expense of interactive response time as the X server becomes too busy */ /* bourne shell command for X11 Help ("man -Tutf8 xoscope 2>&1") */ #define HELPCOMMAND "man -Tutf8 xoscope 2>&1" /* default file name ("oscope.dat") */ #define FILENAME "oscope.dat" /* default external command pipe to run ("operl '$x + $y'") */ #define COMMAND "operl '$x + $y'" /* FFT length, shorter than minimum screen width and multiple of 2 (512) */ #define FFTLEN 512 /* preferred path to probescope serial device ("/dev/probescope") */ #define PROBESCOPE "/dev/probescope" /* preferred path to bitscope serial device ("/dev/bitscope") */ #define BITSCOPE "/dev/bitscope" xoscope-2.0/ChangeLog0000644000175000017500000012021411122235347011526 000000000000002005-06-28 Brent Baccala * Makefile.in, config.h.in: getting configure to work for 1.12 * Makefile.in, configure, configure.in: version number change * comedi-glade-src/callbacks.c, comedi.c, config.h.in, display.c, display.h, func.h, oscope.h, sc_linux.c, sc_linux_gtk.c, xy.c, Makefile.in: little patches to eliminate compiler warning messages 2005-06-24 Brent Baccala * configure: auto generated files from the last configure.in update * configure.in: still trying to fix configure! think I got the autoconf tests to propagate into automake correctly now 2005-06-23 Brent Baccala * comedi.c: fix to figure out zero values correctly for unipolar COMEDI cards * oscope.h, proscope.c, sc_linux.c, INTERNALS, TODO, bitscope.c, comedi.c, display.c: added set_width() function to data sources * comedi.c: changes COMEDI command handling instead of trying to use the library's generic_timed routine, we try three different commands setups of our own 2004-11-04 Brent Baccala * comedi-glade-src/Makefile.in, bitscope-glade-src/Makefile.in, sc_linux.c, sc_linux_gtk.c, aclocal.m4, config.h.in, configure, configure.in, display.c, file.c, oscope.c, Makefile.in: xoscope-1.11 release really just applying a bunch of patches (a bug-fix release) 2003-06-30 Brent Baccala * README.parport, comedi-parport.patch: updated info on using COMEDI with parport * TODO: updated todo list - mini-TODO * Makefile.in, comedi.c, config.h.in: bug fix in comedi.c - get channel ordering right 2003-06-25 Brent Baccala * display.c, comedi.c: Fixed little bug that could cause analog signals to display as digital when using COMEDI 2003-06-20 Brent Baccala * display.c: bug fix 2003-06-19 Brent Baccala * INTERNALS, Makefile.in, aclocal.m4, bitscope.c, comedi.c, config.h.in, configure, oscope.c, oscope.h, proscope.c, sc_linux.c: removed open and close functions from the data sources also, added split_field helper function for displaying error messages 2003-06-17 Brent Baccala * INTERNALS, README.parport: New files for 1.10: internals documentation readme for how to use parallel port with xoscope * TODO, TODO.old: updated TODO files for xoscope 1.10 * Makefile.in, acconfig.h, bitscope-glade-src/Makefile.in, bitscope.c, bitscope.h, com_gtk.c, com_gtk.h, comedi-glade-src/Makefile.am, comedi-glade-src/Makefile.in, comedi-glade-src/README, comedi-glade-src/callbacks.c, comedi-glade-src/callbacks.h, comedi-glade-src/interface.c, comedi-glade-src/interface.h, comedi-glade-src/support.c, comedi-glade-src/support.h, comedi.c, comedi.glade, config.h.in, configure, configure.in, display.c, display.h, fft.c, file.c, func.c, func.h, gr_com.c, gr_gtk.c, gr_vga.c, oscope.c, oscope.h, proscope.c, proscope.h, sc_linux.c, sc_linux_gtk.c, ser_dos.c, ser_unix.c, xy.c, xy_gtk.c, Makefile.am: Biiiig update - baccala's changes 1.8 -> 1.10 Main things - COMEDI support Display code rewrite (improved X performance) New modular data sources * bitscope-glade-src/Makefile.in, bitscope-glade-src/interface.c, bitscope-glade-src/support.c, Makefile.am, bitscope.glade: updated various files to reflect new location of bitscope glade subdir (now bitscope-glade-src instead of src) new bitscope glade file has a 'connection' panel and no 'time' panel 2002-06-15 Timothy Witham * bitscope-glade-src/Makefile.in, Makefile.am, Makefile.in, README, acconfig.h, aclocal.m4, bitscope.c, config.h.in, configure, configure.in, gr_vga.c, oscope.c, sc_linux.c: fixed vga detection and other build-time problems 2001-05-25 Timothy Witham * configure, configure.in: Fixed bug that it tried to build oscope even if you didn't have svgalib. 2001-05-22 Timothy Witham * bitscope-glade-src/Makefile.am, bitscope-glade-src/Makefile.in, bitscope-glade-src/callbacks.c, bitscope-glade-src/callbacks.h, bitscope-glade-src/interface.c, bitscope-glade-src/main.c, Makefile.am, Makefile.in, bitscope.glade, config.h.in, configure, configure.in, gr_gtk.c, oscope.1: Connected the new bitscope dialog to the main menubar. 2001-05-20 Timothy Witham * oscope.c: Fixed bug: C-w didn't work right. * Makefile.am, Makefile.in, bitscope-glade-src/Makefile.am, bitscope-glade-src/Makefile.in, bitscope-glade-src/callbacks.c, bitscope-glade-src/callbacks.h, bitscope-glade-src/interface.c, bitscope-glade-src/interface.h, bitscope-glade-src/main.c, bitscope-glade-src/support.c, bitscope-glade-src/support.h, bitscope.glade, config.h.in, configure, configure.in: Added bitscope dialog that was generated by glade. So far it's a standalone program, not yet connected to xoscope. * ChangeLog, Makefile.in, config.h.in: For 1.8. 2001-05-19 Timothy Witham * ChangeLog, Makefile.in, NEWS, bitscope.c, config.h.in: For 1.8. 2001-05-09 Timothy D. Witham * acconfig.h, AUTHORS, ChangeLog, config.h.in, configure, configure.in, Makefile.am, Makefile.dos, Makefile.in, NEWS, oscope.1, oscope.lsm, README, TODO, TODO.old: Updated the documentation. 2001-05-06 Timothy D. Witham * INSTALL, install-sh, missing, mkinstalldirs, acconfig.h, aclocal.m4, audio.dat, AUTHORS, bitscope.c, bitscope.dat, config.h, config.h.in, configure, configure.in, COPYING, dirlist.c, display.c, freq.c, func.c, gr_com.c, gr_grx.c, gr_gtk.c, gr_sx.c, gr_vga.c, Makefile, Makefile.am, Makefile.dos, Makefile.in, NEWS, operl, operl.in, oscope.c, oscope.h, sc_linux.c, ser_unix.c, stamp-h.in, xy_sx.c: Used autoconf and automake to switch to a GNU-style fully-automated `./configure; make' build and distribution process. 2000-12-06 Timothy D. Witham * sc_linux.c: ESD was wrapping and overwriting the samples before we could get them read, causing discontinuities in the display. So now we flush all samples before looking for trigger to start with a free buffer that we can read before it wraps. 2000-08-31 Timothy D. Witham * bitscope.c, bitscope.dat, bitscope.h, file.c, oscope.c: Added -o for saving bitscope registers in the file. Now using mode 1 alt which refreshes slower because it always has to read at least half the sample memory to get to the second channel. 2000-07-18 Timothy D. Witham * gr_gtk.c: Left mouse button now decreases scale, position, bits, mode while middle button increases. Right button still pops-up the menu. * gr_gtk.c: Mouse cursors are now draggable which simplifies usage. * bitscope.c, bitscope.h: Generalized bs_read_async so it can be used for triggering in addition to sample gathering. Now neither block the interface! * bitscope.c, bitscope.h, oscope.c: Can now interactively change mode 4 sample rate: 1582 - 50000 S/s. 2000-07-17 Timothy D. Witham * bitscope.c: Mode 4 support that pretty much works. 2000-07-14 Timothy D. Witham * bitscope.c: Added M command support for BC > 110. This is much faster than S. * bitscope.c, bitscope.dat, bitscope.h, display.c, oscope.c: Added x1/x10 probe support and corresponding channel labels. 2000-07-11 Timothy D. Witham * bitscope.c, bitscope.h, display.c, file.c, func.c, oscope.c, oscope.h, proscope.c, proscope.h: Added voltages to the signals in units of millivolts per +/- 160 (default screen height and max deflection of any scope (ProbeScope)). Added real voltage labels to the channels and measurements. 2000-07-10 Timothy D. Witham * display.c, file.c, func.c, gr_gtk.c, gr_sx.c, oscope.c: Added step display modes. Speed up display by remembering only the samples currently displayed, for erasing next time. 2000-07-07 Timothy D. Witham * bitscope.c, oscope.c: Switch to free-running don't care trigger. Better BitScope recognition by making sure the serial read queue is clear before sending ?. Faster cursor movements from the keyboard. * bitscope.c, bitscope.dat, ChangeLog, display.c, oscope.c, proscope.c, ser_dos.c: Give the ser_dos.c a hope of working by actually implementing read *and* write. Lacking a DOS machine, I have no idea if it works or not. But it cross-compiles OK under Linux. 2000-07-06 Tim Witham * bitscope.c, config.h, display.c, file.c, func.c, oscope.c, oscope.h, sc_linux.c: Allow up to 2 sec/div time scale! This is most useful with 8000 S/s audio sampling to see lots of time. All buffers increased to 256K to handle this. Memories now store time zero to current display point. File length is now as long as the longest sample stored in memory. * oscope.h, sc_linux.c, audio.dat, bitscope.c, bitscope.h, display.c, oscope.c: Allow soundcard to collect enough samples to fill any display length by letting it collect parallel to disply like bitscope does. * bitscope.c, display.c, func.c, oscope.c, oscope.h: Enhanced math to work on the number of samples displayed instead h_points. External math is still a constant though. Enhanced some display strings. 2000-07-05 Tim Witham * bitscope.c, bitscope.dat, bitscope.h: BitScope serial data is now grabbed and processed in parallel with display refreshing, greatly improving interactive response time. You can actually see the data being read in real-time. * bitscope.c, config.h, display.c, file.c, func.c, oscope.h, sc_linux.c: Snag only enough samples to fill the display. 2000-07-03 Tim Witham * bitscope.c, bitscope.dat, display.c, Makefile, oscope.c: First attempt at ALT dual trace to get both A & B. * bitscope.c, bitscope.h, config.h, display.c, file.c, gr_gtk.c, Makefile, oscope.c, proscope.c, proscope.h, ser_dos.c, ser_unix.c: First connection of BitScope, partly based on code submitted by Ingo Cyliax. If a BitScope is identified, it is used exclusively, turning off sound and ProbeScope input devices. It connects BitScope Channel A, B and LA to X, Y and Z respectively. 2000-07-01 Tim Witham * x11.h, xdisplay.c: Tossed obsolete files. 2000-06-28 Tim Witham * ChangeLog oscope.lsm, README, Makefile, TODO, TODO.old: For 1.7. * count.dat: New file. * display.c: Draw screen before opening sound device to give user a clue what's going on if it blocks waiting for ESD sound (? TRIGGER ?). * gr_gtk.c: Fixed bug: mouse click context (e.g. memory selection) was wrong for arbitrary window sizes due to integer division rounding errors. 2000-05-20 Tim Witham * oscope.1, oscope.c, file.c: Added manually-positioned measuring cursors. * config.h: *** empty log message *** * gr_gtk.c, display.c, func.c, oscope.h: Added manually-positioned measuring cursors. 2000-04-21 Tim Witham * display.c: Scaled LA down so all 16 bits fit on the display at 1/1 default scale. 2000-04-08 Tim Witham * gr_gtk.c, oscope.1, file.c, oscope.h, oscope.c, display.c: Added logic analyzer display. The least significant bits of a channel can be displayed as ditial lines. The number of bits shown can be increased and decreased with the ~/` key. Zero bits draws the signal as one analog line as before. 2000-03-24 Tim Witham * sc_linux.c: Fixed off-by-one error so silence has level 0 instead of -1. 2000-03-05 Tim Witham * ChangeLog, README, oscope.lsm, oscope.1, oscope.h, Makefile, config.h, file.c, audio.dat, proscope.dat: For 1.6. * com_gtk.h: Eliminate compiler warning caused by dimensionless arrays. * oscope.c: Fix command halting and a few minor enhancements. * func.c: Fixed bug: switching from external to memory didn't halt external. * gr_gtk.c: Added way-cool context-sensitive pop-up menus. Also added DMA menu. 2000-03-04 Tim Witham * func.c: Added EXTSTOP for shutting down external commands. * gr_gtk.c: Enhanced external math dialog with combo box of pre-defined commands. 2000-03-03 Tim Witham * com_gtk.c: Added fixing_widgets boolean which prevents infinite event loops. * display.c: Draw text above and below the graticule once a second in case it got scribbled through by the signals. 2000-03-01 Tim Witham * sc_linux.c: Use the otherwise useless DMA to control whether the esd is opened to block (4) or not (2 or 1). Also, copy only the samples that were successfully read, leaving the rest of the buffer from last run. Should probably warn the user when such underruns are happening. 2000-02-26 Tim Witham * gr_gtk.c: Invented finditem to eliminate redundant menu string code and make it possible to loop over sequences of menu items. Used this to check correct radio buttons and check buttons in memory and math menus. * gr_gtk.c: Put radio buttons and check boxes in the menus and wrote fix_widgets to update them, like when the keyboard interface changes things. * oscope.c: Fixed bug: stdout was getting closed accidentally. * sc_linux.c: Don't try the ioctl's when using ESD!. * sc_linux.c: Enhanced ESD support to fall back to /dev/dsp if the esd connect fails. * oscope.c: Fixed warnings: suggest explicit braces to avoid ambiguous `else' * Makefile, sc_linux.c: Added compile-time option to support ESD instead of /dev/dsp. 1999-09-01 Tim Witham * sc_sb.c, sc_linux.c, oscope.c: Linux 2.2's sound driver apparently can't be reset multiple times. So, to adjust the sound rate, we now close and reopen the device. This does away with set_sound_card and reset_sound_card is enhanced to do the close and open and reset all the settings. 1999-08-28 Tim Witham * ser_unix.c: Can now detect a WAITING! ProbeScope or one sending any acceptable verions of the synchronization byte, from 0x7c to 0x7f. * xy_gtk.c, gr_gtk.c: Switched from 1.0 menu factory to 1.2 item factory. Made the menus tear-off-able. * xy.c, com_gtk.c: Changed from a timeout to idle function to maximize refresh rate while interactive load changes. * display.c: Replaced data_good flag with smarter erase_data one. This gets rid of the bogus "blip" that it was seeing when changing sample rates. * sc_linux.c: Fixed 2 bugs: Changing the sample rate on the sound card wasn't working. Turns out it needs a reset after changing the rate, at least on my 2.0.36 drivers. Also, the delay position was not working on falling edge trigger. 1999-08-26 Tim Witham * ChangeLog: 1.5 released. * oscope.lsm, README: For 1.5. * proscope.dat, audio.dat, oscope.dat, com_gtk.h: New file. * Makefile, oscope.1, config.h, TODO, TODO.old, file.c, display.h, oscope.h, ofreq.ini: For 1.5. * oscope.c: Changed file load/save and external command calls to support UIs like GTK+. Moving signals off the screen now wraps them around to the other side so you don't accidentally lose them. * gr_gtk.c: Moved SoundCard and ProbeScope switches into the Scope menu. * display.c: Fixed bug: SyncDisplay() call was being done out of order such that Graticule In Front didn't work. Corrected the order so it does. * sc_linux.c: Bruce Jerrick reported the DSP_RESET was causing nearly a 4 second block on newer hardware and drivers. Its purpose was to flush excess samples to keep the display in real-time. Upon looking at the sound driver source, I discovered a smarter way: use DSP_GETISPACE to find out how many bytes are available. Then read and discard just the right amount of excess so we display the latest snapshot of time. This results in a much better screen refresh rate and less sound recording overruns. Excellent! Thanks Bruce! 1999-08-25 Tim Witham * display.c: Added frames per second refresh rate display. 1999-08-24 Tim Witham * xy_sx.c, xy_gtk.c, com_gtk.c: New file. * gr_gtk.c, xy.c: Major rearranging so xy can be built under GTK+ or libsx. * gr_com.c: New file. 1999-08-23 Tim Witham * gr_gtk.c: Added man page in a window to the help menubar button. 1999-08-21 Tim Witham * gr_gtk.c: Commented out the libsx-like interface and moved everything into the menubar. This is because the buttons steal keyboard focus and I can't figure out how to color code them to make them useful like in libsx. The menubar-only interface looks cleaner too. 1999-08-21 Tim Witham * gr_gtk.c: Commented out the libsx-like interface and moved everything into the menubar. This is because the buttons steal keyboard focus and I can't figure out how to color code them to make them useful like in libsx. The menubar-only interface looks cleaner too. 1999-08-20 Tim Witham * gr_gtk.c: Added ExternCommand which replaces GetString as the new UI-independent way to ask for and launch an external command. 1999-08-19 Tim Witham * gr_gtk.c: Moved file overwrite confirmation from file.c to here since it is UI dependent. This replaces GetYesNo which was used only for this. * gr_gtk.c: Added LoadSaveFile. 1998-09-23 Tim Witham * sc_sb.c, func.c, fft.c: Fixed sample rate. 1998-08-22 Tim Witham * gr_gtk.c: Added button table to the right side of the screen. * gr_gtk.c: Added button table at the bottom of the screen. * gr_gtk.c: Added basic menubar. 1998-08-21 Tim Witham * gr_gtk.c: New file. Fri Aug 29 04:57:48 1997 Tim Witham * oscope.c, file.c: Changed to more "standard" sound card sample rates. Wed Jun 11 02:46:05 1997 Tim Witham * ChangeLog: 1.4 released. * oscope.lsm, oscope.1, README: For 1.4. * gr_sx.c, display.c, oscope.c: Changed % key to ^, to be next to &. Tue Jun 10 04:14:47 1997 Tim Witham * TODO: Added #27, #28. * TODO: Updated for 1.4. Moved done TODOs to TODO.old. * TODO.old: Initial revision * config.h: Changed default trigger to Auto which is a nicer startup mode for unknown signals and is consistent with ProbeScope's power up. * display.c: ProbeScope and math on ProbeScope signals now show real V/div in place of vertical scale. * oscope.c: Clear before entering the main loop. To clean PS text for example. Sun Jun 8 07:28:53 1997 Tim Witham * README.f51, patch.f51: Changes to support ProbeScope. Allow up to 20MHz sample rate. Scale 320 peak-to-peak (10 divisions) down to fit in an 8-bit byte. Sat Jun 7 21:41:23 1997 Tim Witham * oscope.c: usage now takes an exit status. The message is printed on stdout if the exit status is zero, stderr otherwise. Fixed sample rate changer to work when the actual sample rate is different than that requested. * file.c: Changed calls to usage to pass exit status. * Makefile: Changes to support the new working DOS port. * sb.h: Changed sb_set_sample_rate to return an int; the actual rate. * sb.c: Cut all playing stuff and tweaked recording stuff for my application. * sc_sb.c: Finally works! Mono only. Thanks to code from sb02.zip. * gr_grx.c: getch() blocks; call it only if kbhit(). * ser_dos.c: Initial revision * display.c: Improved horizontal scale key labeling. Sat May 31 21:23:49 1997 Tim Witham * config.h, oscope.c, file.c: Added -x and -z command line and file options for turning sound card and ProbeScope devices off. * gr_sx.c, display.c, oscope.c, sc_sb.c, sc_linux.c: Sound card is now optional. You may turn it on/off with & key. Since this feature needs to close and re-open the device, dynamic DMA factor setting is also back, now it's on the * key. * oscope.h: Added snd file descripter and/or whether sound is running or not. * operl: Improved efficiency and performance by remembering only the signals the users' function needs, if any. Fri May 30 04:44:18 1997 Tim Witham * proscope.c: Fixed bug: in SINGLE shot mode, a 0x7f after the aquisition was sometimes getting used as byte 1 (switch setting). Oops. * proscope.c: If probescope() doesn't reach the end of the serial FIFO during the reading, it now does a flush_serial() to get caught up. This is to prevent data corruption when the scope gets too slow, like when doing external math commands. * proscope.h, ser_unix.c: Added flush_serial which discards all bytes from the serial FIFO input. This is used before detecting to get rid of outstanding bytes that could mislead the detection. * display.c: Fixed bug: the first sample wasn't being plotted. Wed May 28 05:55:52 1997 Tim Witham * display.c: Added text and rearranged to show ProbeScope status. * proscope.h, proscope.c: Added ps structure and all the code needed to transfer ProbeScope status to display.c. Fixed WAITING! code; it was causing the software to hang. The trick here was to suck all sync/waiting bytes in a new loop with no sleep, to keep the serial queue cleared. * gr_sx.c: Fixes for the new function indexing of func.h/func.c. Added PS button for ProbeScope Toggle/Re-scan for device. * oscope.c: Fixed init_channels for the new function indexing of func.h/func.c. Added % key to toggle ProbeScope On/Off (& do a re-scan of the ports). * ser_unix.c: init_serial can now be called multiple times, setting ps.sound directly if a ProbeScope is found. This enables re-scanning. Tue May 27 05:56:00 1997 Tim Witham * sc_sb.c, sc_linux.c: Moved clip reset to display.c to support ProbeScope. * file.c: Fixes for the new function indexing of func.h/func.c. * func.h, func.c: Added ProbeScope, swapped MEMORY and EXTERN order to simplify. Mon May 26 16:27:21 1997 Tim Witham * ser_unix.c: Initial revision Sat May 24 23:36:40 1997 Tim Witham * Makefile, config.h, display.c, oscope.c: Initial changes to support ProbeScope input. * proscope.h, proscope.c: Initial revision Sun May 4 21:34:37 1997 Tim Witham * ChangeLog: 1.3 released. * sc_linux.c: Fixed bug that caused sound to fail to open. * TODO, oscope.lsm, README, config.h, sc_sb.c: For 1.3. * display.h: Exported the init_widgets function to oscope.c * oscope.h: Exported some init functions for file.c. * oscope.1, sc_linux.c, display.c, file.c: Removed the ability to change DMA on the fly since it requires closing and reopening the device; I want to open once and keep it open. * gr_sx.c: Tossed loadfile and savefile; just hit_keys instead. * func.c: Set signal colors to 0 on initialization. * file.c: Reinitialize everything before loading a file. This is to clear all memories and functions so they're not still around after the load. Sat May 3 16:15:57 1997 Tim Witham * func.h, func.c, oscope.h, oscope.c, file.c, gr_sx.c: Moved command and pid into the channel structure. Removed some unused variables from header files. * sc_sb.c: Updated for 1.3 again. * oscope.1: Fixed -s docs. * sc_linux.c, oscope.h: Moved buffer and junk into sc_linux.c, the only place they're used. * oscope.c, sc_linux.c: Improved the way the sound card gets reset. Eliminated the `actual' global var; scope.rate now holds the actual sample rate correctly. * file.c: Enhanced -s to allow fractional values, using new scope.div. * display.c: Fixed bug in the bounds limit of the delay calculation. Fri May 2 06:01:11 1997 Tim Witham * gr_sx.c: Added an XY button to make xy easier to start. * display.c: Added a bogus math warning message when Channel 1 and 2 are at different sample rates. * oscope.h, display.c, oscope.c: Added scope.div. This allows skipping of samples to see more time. Thu May 1 04:49:25 1997 Tim Witham * sc_linux.c, oscope.1, func.h, oscope.h, gr_sx.c, func.c, display.c, file.c, oscope.c: Major internal changes: Left and Right sound inputs are no longer "hard-wired" to the 1st and 2nd displays. This was implemented as follows: The 8 displays were changed to new Channel stuctures. There are now 34 static Signal structures: 23 memories, left input, right input, one reserved, and 8 functions. One element of the Channel structure points to the Signal structure being displayed by that Channel. Some appropriate display, control, and file I/O tweaks were made to support all this. Several former limitations are now lifted. * Makefile: Added some DJGPP lines, renamed some files. Tue Apr 29 05:08:18 1997 Tim Witham * sc_sb.c: Tossed commented junk. Updated for 1.3. Still doesn't work. Sat Apr 26 01:55:03 1997 Tim Witham * display.c: Enhanced draw_data to work with arbitrary sample rates. It does this by determining which sample, if any, should be plotted at each time position on the display. * sc_sb.c: Initial revision Sun Feb 23 05:24:40 1997 Tim Witham * gr_grx.c: Initial revision * file.c: Fixed b and v option initializations to use #defines from config.h Sun Nov 17 22:34:21 1996 Tim Witham * oscope.c: Moved sound-card specifics to sc_linux.c to make porting easier. * sc_linux.c: Initial revision Sat Oct 12 16:12:05 1996 Tim Witham * ChangeLog: 1.2 released. * oscope.lsm, README, README.freq51, Makefile: For 1.2. * display.c: Turned the Channel headers back on. Sun Oct 6 06:43:50 1996 Tim Witham * xy.c: Added quit button and plot mode menu. * TODO, Makefile, oscope.1, config.h, oscope.h, x11.c, file.c, oscope.c, display.c: Made the display less verbose by default. All non-essential text is suppressed. Hitting '?' toggles the extra text on/off. -v command line / file option will make the display verbose at startup. * oscope.h, oscope.c, x11.c: Enhanced to support the new display-independent display.c. * display.h, display.c: Pulled VGA specific code out into new vga.c for easier maintenance. Now this file is completely display independent, leaving it up to the final link to provide all the display-specific functions. * vga.c: Initial revision Sat Oct 5 21:12:45 1996 Tim Witham * file.c: Overwriting an existing file now requires confirmation. * display.c: Added GetYesNo for svgalib. * x11.c: Added Run, Wait, Stop buttons to support new single-shot mode. * HARDWARE: Added references to and descriptions of new buff2 and pcb files. * oscope.1, oscope.c, display.c: Added wait (single-shot) mode. Fri Oct 4 05:14:02 1996 Tim Witham * xy.c: Initial revision * display.c: Optimized draw_data for at least 2x performance improvement. The problem was the color was being toggled for each sample in one erase/plot loop. Now we set color, erase all, set color, plot all. * x11.c, func.c: Fixed bug: cleanup could call free on a NULL pointer (seg fault). Fri Sep 6 03:53:59 1996 Tim Witham * pcb.ps, pcb.fig, buff2.ps, buff2.fig: Initial revision Tue Aug 6 04:56:42 1996 Tim Witham * func.c: Fixed a bug: average didn't work! Sat Aug 3 23:14:57 1996 Tim Witham * ChangeLog: 1.1 released. * oscope.lsm: For 1.1. * HARDWARE, TODO, README.freq51, freq51.patch, buff.ps, buff.fig: Initial revision * README: Updated for 1.1 release. * Makefile: Updates for the new external command path and other changes. * oscope.1: Updated for 1.1 release. * offt.c: Renamed oscope.fft to offt for easier typing (comment change only). * config.h: Renamed oscope.perl to operl for easier typing. * oscope.c, func.h, func.c: Added new invert functions and OSCOPEPATH for external commands. * ofreq.ini: Initial revision * operl: Fixed bug in the delay example; it was being delayed by $x instead of $t. Tue Jul 30 05:42:58 1996 Tim Witham * display.c: Fixed bug: in accumulate modes, the current set of data would be drawn incorrectly just after a S/s change. Optimized the draw_data loops. Sat Jul 27 05:43:18 1996 Tim Witham * fft.c: Synched with freq51. Fri Jul 12 03:02:27 1996 Tim Witham * oscope.c, display.c: First sample is now the one just before trigger, second the one after. We "connect" these samples with a straight line to more accurately guess where the trigger really was. All samples are then shifted horizontally to position the trigger at time zero. This greatly improves the horizontal resolution of high frequency signals in either of the accumulate modes. This is best used by placing the trigger at 0 where the linear approximation is most correct. Sat Apr 27 17:47:21 1996 Tim Witham * ChangeLog: 1.0 released. * ChangeLog: Initial revision Sun Apr 21 03:11:51 1996 Tim Witham * oscopefft.c: Fixed bug in the documentation. * oscope.lsm: For 1.0. * oscope.1: Fixed date. * Makefile: Added external command examples, version bump to 1.0. * config.h: Added COMMAND and FFTLEN. * file.c: Rearranged to support new external math commands. * x11.c: Rearranged, got widgets to disable themselves appropriately. * func.h, func.c: Moved FFT out to fft.c so it can also be used externally by oscopefft.c. Cleaned up. * oscope.h, oscope.c: Added new external math command interface ($ key). * oscope.1: Updated for 1.0, documenting new external command interface ($). * fft.c: Removed main() and tweaked so this one file can be used for both internal (func.c) and external (oscopefft.c) FFT functions. * README: For 1.0. * display.c: Rearranged. Fixed an off-by-one error in col(). * oscope.perl: Error checking so it will exit when the pipe closes. Better docs. * oscopefft.c: Initial revision Tue Apr 16 04:16:51 1996 Tim Witham * func.c: Added external command pipe, optimized some others. * fft.c: Initial revision Tue Apr 9 07:13:51 1996 Tim Witham * oscope.perl: Initial revision Sun Mar 10 03:22:07 1996 Tim Witham * file.c: Fixed bug in the trigger limiter. * Makefile: Added new file.c, freq.c, dirlist.c for file load/save. * oscope.1: Updated to document the new file load/save features. * README: Updated credits. * config.h: Added new config options for new file I/O features. * x11.h, x11.c: Load and Save now call GetFile of freq.c. * freq.c, dirlist.c: Added some #includes to suppress compiler warnings. * func.c: Channels displaying a memory buffer are now automatically updated (recalled) when a new save happens to that buffer. This is less confusing. Also fixed some malloc problems. * display.h, display.c: Added GetFile, message, and file Load/Save key text. * oscope.h, oscope.c: Moved handle_opt to new file.c, added -a and file save/load keys. * file.h, file.c: Initial revision Sat Mar 9 21:47:14 1996 Tim Witham * dirlist.c, freq.c: Initial revision Sat Mar 2 07:24:04 1996 Tim Witham * oscope.lsm: For 0.5. * Makefile: Added x11.c * xdisplay.c: Fixed comments. * func.h, func.c: Only do math on visible and selected channels for max speed. * oscope.1: Massive changes to document all the new features. * config.h: Added (default) to the comments for documentation. * x11.h: Initial revision * oscope.c, oscope.h: Added memory controls and improved usage to match new features. * display.c, display.h: Many X11 specifics moved to x11.c. * x11.c: Added memory buttons, optimized many things. Fri Mar 1 04:27:08 1996 Tim Witham * x11.c: Turned math button into a menu with current function checked. Wed Feb 28 06:09:06 1996 Tim Witham * x11.c: Initial revision Sat Feb 24 04:30:11 1996 Tim Witham * func.h, func.c: Improved measurements. Thu Feb 22 06:25:53 1996 Tim Witham * display.h, display.c: Added clip detection (flash graticule in color of clipped channel). * oscope.h, oscope.c: Removed -v, added -1 through -8, simplified triggering scaling code. * config.h: Initial revision Sat Feb 17 21:24:02 1996 Tim Witham * fft.h, realfft.c: Initial revision * Makefile, oscope.h, func.h, func.c, display.c, oscope.c: Added Fast Fourier Transform. Sun Feb 4 22:11:19 1996 Tim Witham * COPYING: Initial revision * oscope.lsm: For 0.3. * Makefile: Added func.c, fixed some bugs. * README: Added installation instructions, updated for 0.3. * oscope.c: Improved signal scaling, more like real scope. * display.c: Improved text positioning. * oscope.c, display.c, oscope.h: Improved triggering: channel 1 or 2, rising or falling. Sat Feb 3 21:37:31 1996 Tim Witham * oscope.lsm: Initial revision * oscope.c, func.h, func.c, oscope.h, display.c: Added 4 more channels to display on right side of graticule. * func.h, func.c, oscope.h, display.c: Memory indicators now have color of recorded signal. * func.h, func.c, oscope.c, display.c: Added 26 signal memory buffers, one for each letter of the alphabet! * display.c, oscope.c, oscope.h: Time scaling a STOP'd display is now only allowed at 44000 Hz sampling since anything else would need a new acquire. * oscope.h, oscope.c, display.c: Fixed the vertical scaling bug, moved more globals in to Scope struct. Fri Feb 2 07:11:15 1996 Tim Witham * oscope.c, oscope.h, display.c: Moved signal math to new func.c so it can be easily extended. * func.h, func.c: Initial revision * oscope.h, oscope.c, display.c: Added way cool channel selector to greatly improve the interface. Removed channels; sampling is now always in stereo mode for simplicity. * oscope.c: Added auto-measurements. * display.c: Added min/max, period/frequency readout. Wed Jan 31 07:55:06 1996 Tim Witham * Makefile: Added xoscope man page. * xoscope.1: Initial revision * Makefile, README, display.c, display.h, oscope.1, oscope.c, oscope.h, xdisplay.c: changed filenames from scope to oscope * README: Added enhancement blurbs. * README: Initial revision * display.c, scope.c, Makefile, scope.h: Code cleanup. * scope.c: Signals now scalable. Keyboard control rearranged to support this. * display.c: Added much text to the display, including keyboard key descriptors. Tue Jan 30 06:45:42 1996 Tim Witham * scope.h, display.c, scope.c: Moved some globals in to the scope structure. * display.c: Graticule now resizes vertically. Mon Jan 29 04:38:17 1996 Tim Witham * scope.c, display.c: Added text channel displays to right side of screen. Sun Jan 28 23:41:31 1996 Tim Witham * scope.h, display.c, scope.c: Converted to signed data to simplify math and positioning. * display.c, display.h: Improved text positioning; X VGA_WRITE now honors alignments like vgalib. * scope.h, display.c, display.h, scope.c: Added display-independent color; X uses 16 colors similar to console. 640x480 is now minumum supported size. X display is resizable. * scope.c, display.c: Channels are now defined in a structure so we can easily extend. Fri Jan 26 07:52:45 1996 Tim Witham * display.c, scope.c: Converted to more realistic 1/2/5 scaling with fixed graticule. Thu Jan 25 05:28:56 1996 Tim Witham * scope.c: Ignore unknown keypresses. * display.c: Rearranged to eliminate forward reference. Tue Jan 23 08:00:10 1996 Tim Witham * Makefile: Major changes to support new multi-file source. * display.h: Initial revision * scope.h: Moved all display-specific code to new "display.h" file. * scope.c: Moved all display-specific code to new "display.c" file. This greatly modularizes the program for easier simultaneous console / X11 support. * display.c, xdisplay.c: Initial revision * Makefile: Added rules to make new xscope X client. Mon Jan 22 07:00:19 1996 Tim Witham * scope.c: Now available as an X client via libsx! Just #define XSCOPE. Sat Jan 20 08:31:03 1996 Tim Witham * scope.h: Added many #defines. * scope.c: Added optional (#define in scope.h) screen text via libvgamisc from g3fax. * scope.c: Tiny tweaks for more stable display around keypresses. Fri Jan 19 07:12:34 1996 Tim Witham * scope.c: Reset the sound card after each read. This greatly improves response time since only the first "screenful" of the FIFO is read. The rest is discarded and we start over from zero for the next screen. This prevents the samples from getting backed up and overflowing the FIFO. Wed Jan 3 06:18:57 1996 Tim Witham * Makefile: Added PREFIX (for install) and VER (for dist) variables. * scope.1: Grammatical tweaks. * scope.c: Minor tweaks to improve readibility. * scope.1: Updated to reflect my changes (I hope). * scope.1: Initial revision Tue Jan 2 07:25:28 1996 Tim Witham * scope.c: Converted R/r to use integer math like everything else. * scope.h: Changed default scale to 4, the middle of the 5 possible values. * scope.c: Fixed some off-by-one errors in dual channel mode. Tweaked graph_data loop for efficiency (added k). Cleaned up usage. * scope.h: Added DEF_12 for new dual channel mode. * scope.c: First working stereo (dual channel) mode! Added -1/-2 options, 1/2 keys. * Makefile: Bumped dist version from 0.1 to 1.0. * Makefile: Added new scope.h dependency. * Makefile, scope.h: Initial revision * scope.c: Added M/m and D/d for completeness, moved defaults to new scope.h. Mon Jan 1 20:45:12 1996 Tim Witham * scope.c: Improved triggering by forcing it to be at the trigger point. Converted several keys to toggles, added V/v verbose toggle. Rearranged usage to display interactive runtime keys. Sat Dec 30 10:30:39 1995 Tim Witham * scope.c: Added -b and B/b keys to swap the signal and graticle front/back. * scope.c: Keys are now handled during trigger wait. The key forces a trigger. Also added a horizontal time scale to the center of the graticule. * scope.c: T and t keys now turn disabled trigger on at 128. Using the keys to push trigger off scale disables it again. Changed functions in the loop to static inline. Added range forcing to -s since 0 was a fatal error. Fri Dec 29 08:42:14 1995 Tim Witham * scope.c: Enhanced -v to show each keypress; rearranged for readibility. * scope.c: Added new check_status function to eliminate some redundant code. * scope.c: Rearranged initialization so graticule is correct on startup. Thu Dec 28 06:50:33 1995 Tim Witham * scope.c: Keys are now handled while waiting on trigger. Most won't have much effect until trigger is actually detected, but at least you can hit t/T to get the trigger back into range instead of locking up! Wed Dec 27 08:52:01 1995 Tim Witham * scope.c: Switched time scale to 5msec major divisions, added 0.5msec mini-ticks. * scope.c: Simplified verbose output to fit all parameters on one line. * scope.c: Improved triggering to see only the rising or the falling edge, not both. * scope.c: Added -s time axis Scaling (1,2,4,8,16,32) so you can zoom in/out. 'S' key doubles it (zoom in) while the 's' key halves it (zoom out). Tue Dec 26 13:59:25 1995 Tim Witham * scope.c: Converted time scale to use integer math instead of floating point. * scope.c: Added time scale: 1 msec tick marks and 10 msec vertical lines. * scope.c: Initial revision xoscope-2.0/xoscope.10000644000175000017500000003620111221217132011510 00000000000000.\" @(#)$Id: xoscope.1,v 2.4 2009/06/26 19:15:38 baccala Exp $ .\" .\" Copyright (C) 1996 - 2000 Tim Witham .\" .\" (see the files README and COPYING for more details) .TH XOSCOPE 1 "May 6 2001" "Linux" "User Commands" .SH NAME xoscope \- Digital Oscilloscope .SH SYNOPSIS xoscope [X toolkit options] [xoscope options] [file] .SH DESCRIPTION .B Xoscope is a digital real-time oscilloscope. It graphically displays signal amplitude or bit logic as a function of time. Signals may be displayed, saved, recalled, and manipulated by math functions. Signal input devices currently include: .P .TP 0.5i .B /dev/dsp Audio sound recording via /dev/dsp. Two 8-bit analog channels at 8000 S/s to 44100 S/s. Left and right audio is connected to A and B inputs respectively. Use an external mixer program to select which sound inputs to record. AC coupled, voltages unknown, 256K sample memory. .TP 0.5i .B EsounD Shared audio sound via the Enlightened Sound Daemon. This is great for watching music but support for it is an option at compile-time. EsounD is auto-detected and preferred over /dev/dsp. .TP 0.5i .B ProbeScope / OsziFOX Radio Shack ProbeScope, Cat. No. 22-310 is also known as an osziFOX. This handheld probe sends its data through a serial port. It samples one channel at 6-bits up to 20 MS/s with 128 samples of memory. Real voltages are labeled in sample ranges from 1 volt to 100 volts. If a ProbeScope is detected, it is connected to the A input. .TP 0.5i .B Bitscope Bitscope (www.bitscope.com) is a mixed-signal capture engine which is accessed through a serial port. It simultaneously samples a digital 8-bit port and two analog channels at 8 bit resolution at up to 25 MS/s or more. If detected, Channel A and B are connected to X and Y while the Logic Analyzer is connected to C. Bitscope support is currently under development and not yet fully functional. .P .TP 0.5i .B COMEDI The COMEDI project (www.comedi.org) develops Linux drivers, tools, and libraries for data acquisition. Many commercially available ADC cards are supported by COMEDI, and .B Xoscope can receive signals from them via the COMEDI library. See the .B -x and .B -z options and the .B ENVIRONMENT section below for more details on how the above devices are detected. Some of the controls below apply only to the sound card and are labeled as such. .B Xoscope has no physical control over the ProbeScope/osziFOX which is controlled by its own switches and built-in menus. Please refer to your ProbeScope or osziFOX Owner's Manual for operating instructions. Bitscope will eventually be controlled through a separate dialog window. .P .PP .SH "RUN\-TIME KEYBOARD CONTROLS" .B Xoscope is an interactive program and can be completely controlled from the keyboard at run-time. In verbose key help mode, each available key is shown on the screen in (parentheses). The following single key commands are available: .TP 0.5i .B ? Toggle verbose key help display mode. .TP 0.5i .B Escape Immediately quit the program. .TP 0.5i .B @ Load a previously saved file. You are prompted for the filename. .TP 0.5i .B # Save current settings and memory buffers to a file that can be loaded later. You are prompted for the filename and asked for confirmation to overwrite if it already exists. .TP 0.5i .B Enter Clear and refresh the entire screen. .TP 0.5i .B & Cycle between the various input devices. Note that this key will not toggle to an unresponsive input device, so if only one device is present, it will appear to have no effect. .TP 0.5i .B * Different behavior for different input devices Under EsounD, this value instead determines whether the connection to EsounD will block or not. Blocking mode is nicest to CPU usage but the .B xoscope interface will not respond when the there is no sound stream coming from EsounD. Nonblocking mode will let .B xoscope be responsive whether sound is available or not, but will consume all available CPU cycles. Under COMEDI, this key toggles between different analog reference points (ground, differential, or common). .TP 0.5i .B ^ Different behavior for different input devices .TP 0.5i .B (/) Decrease/increase the sampling rate. .TP 0.5i .B 9/0 Increase/decrease the Sec/Div horizontal time scale (zoom out/in on time). .TP 0.5i .B -/= Decrease/increase the trigger level. .TP 0.5i .B _ Cycle the trigger channel. .TP 0.5i .B + Cycle the trigger type: none, rising edge, or falling edge. .TP 0.5i .B Space Cycle the trigger mode: run, wait, stop. Run mode continuously acquires and displays samples after trigger events. Wait mode waits for the first trigger event and displays only the first set of samples; this is "single-shot" mode. Stop mode suspends the data acquisition and displays the current samples. .TP 0.5i .B ! Cycle the plotting mode: point, point accumulate, line, or line accumulate. In the accumulate modes, all samples stay on the screen; use .B Enter to clear them. .TP 0.5i .B , Cycle the graticule style: none, minor divisions only, or minor and major divisions. .TP 0.5i .B . Toggle the graticule position: behind or in front of the signals. .TP 0.5i .B ' Toggle the manual cursors on/off. When manual cursors are displayed, the measurements between the cursor positions are shown. When cursors are not displayed, automatic measurements are shown. .TP 0.5i .B """ Reset both manual cursor positions to the sample just after trigger. .\" " .TP 0.5i .B Ctrl-q/w/e/r The Control key held down in combination with q/w/e/r moves the first cursor back or forward by 10 samples or back or forward by 1 sample respectively. .TP 0.5i .B Ctrl-a/s/d/f The Control key held down in combination with a/s/d/f moves the second cursor back or forward by 10 samples or back or forward by 1 sample respectively. .TP 0.5i .B 1\-8 Select the corresponding display channel. Measurements are displayed for the channel. Channel 1 and 2 are used as input to the math functions so they can't be used to do math. By default, they are connected to the A and B input channels. Channel 1 and 2 can also be used to display memory buffers or for doing math on memory or the alternate input. Channel 3 through 8 are not restricted and can be used for any purpose. The remaining single key commands operate on the currently selected channel: .TP 0.5i .B Tab Toggle visibility: Hide or show the selected channel. .TP 0.5i .B {/} Decrease/Increase vertical scale of the selected channel. .TP 0.5i .B [/] Decrease/Increase vertical position of the selected channel. .TP 0.5i .B `/~ Decrease/Increase number of logic analyzer bits displayed. The default of zero bits plots the signal as one analog line of varying amplitude. Any other value plots multiple digital lines representing the least significant bits from bottom to top. .TP 0.5i .B ;/: Increase/Decrease the math function of the selected channel. This is not available on channel 1 & 2. .TP 0.5i .B $ Show the result of an external math command on the selected channel. You are prompted for the command. The command must accept samples of channel 1 & 2 on stdin and write a new signal to stdout. See operl, offt.c and xy.c in the distribution for examples of external math filter commands. Not available on channel 1 & 2. .TP 0.5i .B a-z Recall the corresponding memory buffer or input device to the currently selected channel. Input device channels are mapped to the earliest letters of the alphabet; the rest of the buffers are available for signal memory. .TP 0.5i .B A-Z Store the currently selected channel into the corresponding memory buffer. Early letters of the alphabet can not be used because they're reserved as the signal inputs, so the exact number of available buffers is dependant on the input device. Memories are stored from time zero to the current display update position. So it is best to STOP the display before storing to a memory buffer. .PP .SH "MOUSE CONTROLS" .B Xoscope adds mouse controls to menus or around the edges of the scope area. These should be nearly self-explanatory. They perform the same functions as the equivalent keyboard commands above. If built with GTK+, a context-sensitive pop-up menu is available with right-click to select channels, change scale and position, recall and store signals and so on. Left click decreases a variable while right click increases. The manual measurement cursors can also be positioned with the mouse. .PP .SH "COMMAND\-LINE OPTIONS" The command-line options define the startup state of .B xoscope and have reasonable defaults. All options may be capitalized in case they conflict with an X toolkit option. These options are also recorded in text files saved by .B xoscope. .TP 0.5i .B -h Help usage message showing these startup options with their default values, then exit. .TP 0.5i .B -# Startup conditions of each channel. # is a channel number from 1 to 8. Code can have up to three fields, separated by colons: position[.bits][:scale[:function #, memory letter, or external command]]. Position is the number of pixels above (positive) or below (negative) the center of the display. Bits is the number of logic analyzer bits to display. Scale is a valid scaling factor from 1/50 to 50, expressed as a fraction. The third field may contain a built-in math function number, memory letter, or external math command to run on the channel. Using these options makes the channel visible unless position begins with a '+', in which case the channel is hidden. .TP 0.5i .B -a Active, or selected, channel. .TP 0.5i .B -r Sampling Rate in samples per second. For the sound card, current valid values are 8000, 11025, 22050, or 44100. .TP 0.5i .B -s Time Scale factor from 1/20 to 1000 expressed as a fraction where 1/1 is 1 ms/div. .TP 0.5i .B -t Trigger conditions. Trigger can have up to three fields, separated by colons: position[:type[:channel]]. Position is the number of pixels above (positive) or below (negative) the center of the display. Type is a number indicating the kind of trigger, 0 = automatic, 1 = rising edge, 2 = falling edge. Channel should be x or y. .TP 0.5i .B -l Manual cursor Line positions. Cursors can have up to three fields, separated by colons: first[:second[:on?]]. First is the sample position of the first cursor. Second is the sample position of the second cursor. The final field is weather the manual cursors are displayed (1) or the not displayed (0). .TP 0.5i .B -p Plot type. 0 = point, 1 = point accumulate, 2 = line, 3 = line accumulate, 4 = step, 5 = step accumulate. .TP 0.5i .B -g