Commit Graph

5235 Commits

Author SHA1 Message Date
Uwe Hermann b4066aa80e Doxyfile_internal: Fix various settings and paths. 2020-03-25 19:38:48 +01:00
Uwe Hermann 4e9e767be0 Doxyfile: Predefine HAVE_SERIAL_COMM for serial docs.
Without this, src/serial.c API docs won't be generated.
2020-03-25 19:38:19 +01:00
Uwe Hermann b07a07fec2 Doxyfile: Fix/update path and file references. 2020-03-25 19:35:20 +01:00
Uwe Hermann 2faa1db033 Doxyfile: Bring back the workaround for bug #1422. 2020-03-24 21:15:15 +01:00
Uwe Hermann e2bd01f4a7 All Doxyfile files: Update file template to doxygen 1.8.16.
This is done semi-automatically by running "doxygen -u Doxyfile".
2020-03-24 21:15:15 +01:00
Uwe Hermann d7357ebbb6 All Doxyfile files: Set CREATE_SUBDIRS to NO. 2020-03-24 21:15:15 +01:00
Uwe Hermann 20680f58ff manson-hcs-3xxx: Support device IDs with and without "HCS-" prefix.
Since we've now seen lots of devices in the wild that come with the
"HCS-" prefix in the ID, it's probably safe to assume all of them
could have it.

This fixes bug #1530.
2020-03-24 21:10:27 +01:00
Uwe Hermann bfa79fbdb6 asix-sigma: Drop duplicate error message prefixes.
The sr_err() call automatically adds a prefix to all messages, in
this specific case "asix-sigma: " will be added.
2020-03-24 19:22:11 +01:00
Daniel Trnka 440810958c asix-sigma: move DRAM line buffer allocation closer to its use
Move the allocation of the DRAM line buffer in the sample download code
path closer to the location where that buffer is used and gets released.
2020-03-24 19:20:40 +01:00
Daniel Trnka f73b00b647 asix-sigma: check for successful register access in sample download
The previous implementation got stuck in an infinite loop when data
acquisition started, but the device got disconnected before the data
acquisition terminates. An implementation detail ignored communication
errors, and never saw the expected condition that was required to
continue in the sample download sequence. Unbreak that code path.
2020-03-24 19:20:40 +01:00
Uwe Hermann f5c863e572 korad-kaxxxxp: Fix max. possible current for all devices.
Even though the devices/websites/manuals usually say 0..30V, the
hardware actually accepts up to 31V, both via serial as well as by
simply rotating the knob on the device (and our driver already
reflects that).

The same is true for current, it's usually 0..5A as per docs, but many
(probably all) devices accept 5.1A via serial and knob.

Thus, set the max current of all devices to 5.1A (or 3.1A for 3A
devices). We're assuming they all have this property, and we've seen
this in practice on at least three different versions of the device.
2020-03-22 16:58:54 +01:00
David Sastre Medina 7415217ede korad-kaxxxxp: Add a new ID for KORAD KA3005P V4.2 power supply
On a recently acquired Korad KA3005P power supply, the ID supplied by the
device is not known by libsigrok.

$ sigrok-cli --driver=korad-kaxxxxp:conn=/dev/ttyACM0 --scan
sr: korad-kaxxxxp: Unknown model ID 'KORAD KA3005P V4.2' detected, aborting.

This fixes bug #1522.

Thanks to bitaround@gmail.com for the amperage fix.
2020-03-22 15:52:16 +01:00
jirjirjir c4a46475a6 rigol-ds: Rigol DS1152E-EDU support fix 2020-03-16 23:44:25 +01:00
Soeren Apel 781ae4484d Fix #1509 by providing alternate sample format scales 2020-02-28 23:26:20 +01:00
Martin Ling 8491cf7cad python: Apply typemap for VariantBase to VariantContainerBase.
Fixes #1480.
2020-01-05 18:25:13 +00:00
Uwe Hermann f0362f595a agilent-dmm: Add Agilent U1237AX (completely untested). 2019-12-27 22:08:41 +01:00
Uwe Hermann e47e23355f agilent-dmm: U127x: Fix mode switch event handling.
The DMMs report as an event to which mode the user switched (by turning the
rotary switch): "*0", "*1", etc.

Most other DMMs have few modes, but the U127x DMMs have up to 11 different
modes (i.e., "*10" is a valid event).
2019-12-27 20:59:04 +01:00
Uwe Hermann 4c660b46c1 Makefile.am: Add missing src/serial_hid.h. 2019-12-24 16:39:01 +01:00
Uwe Hermann f0901a5050 src/serial_hid.h: Include guard consistency fix. 2019-12-24 16:38:56 +01:00
Uwe Hermann 31b4a9a236 input/csv: Set default "header" option value to true.
This makes re-opening files that were saved via the libsigrok CSV
output module slightly more convenient.
2019-12-22 23:50:22 +01:00
Uwe Hermann 5a27356705 output/csv: Set default "time" option value to false. 2019-12-22 23:50:11 +01:00
Uwe Hermann d649ff2290 manson-hcs-3xxx: support new HCS-3200 / PPS-13610 model string.
This fixes bug #1441.
2019-12-22 23:19:47 +01:00
Uwe Hermann c810ad60b4 mastech-ms6514: Add missing string.h #include. 2019-12-22 21:06:46 +01:00
Uwe Hermann aca2b460cc README.devices: Document MASTECH MS6514 interface enabling. 2019-12-22 15:52:46 +01:00
Uwe Hermann 9b1101d621 configure.ac: mastech-ms6514: Add serial_comm flag. 2019-12-22 15:33:45 +01:00
Dave Buechi 23669c3df3 Initial support for MASTECH MS6514 thermometer 2019-12-22 15:32:51 +01:00
Uwe Hermann 212769c3b8 input/csv: Consistently use a newline before the last return statement. 2019-12-22 14:42:34 +01:00
Gerhard Sittig 51e60cde09 input/csv: style nits, drop @brief and DIAG in debug output
The @brief keyword is not needed since JAVADOC_AUTOBRIEF is enabled in the
Doxygen configuration. Remove a remaining "DIAG" prefix in a debug
message, the output already is filtered according to the log level, and
prefixed by the module name.
2019-12-22 14:35:41 +01:00
Gerhard Sittig 811dcf7ea9 input/csv: re-calculate samplerate after file re-import
Don't clobber the user provided samplerate (specified by input module
options). This allows to re-determine the samplerate from a potentially
changed file on disk upon reload.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 307b239390 input/csv: expand cleanup (resource release) and unbreak file reload
The list of previously created channels is kept across file reloads. We
also need to keep (or re-create) the list of channels that are used for
datafeed submission of analog data.

Release more allocated resources in the .cleanup() routine, and do reset
internal state such that a .reset() thus .cleanup() then .receive() call
sequence will work. This code path is taken for re-import of files (see
bug #1241, CSV was affected).
2019-12-21 18:20:04 +01:00
Gerhard Sittig fbefa03f58 input/csv: improve reliabilty of text line isolation
Slightly unobfuscate the "end of current input chunk" marker in the data
processing loop. Make the variable's identifier reflect that it's not a
temporary, but instead something worth keeping around until needed again.

Unbreak the calculation of line numbers in those situations where input
chunks (including previously accumulated unprocessed data) happens to
start with a line termination. This covers input files which start with
empty lines, as well as environments with mutli-byte line termination
sequences (CR/LF) and arbitrary distribution of bytes across chunks.

This fixes bug #968.

Accept when there is no line termination in the current input chunk. We
cannot assume that calling applications always provide file content in
large enough chunks to span complete lines. And any arbitrary chunk size
which applications happen to use can get exceeded by input files (e.g.
for generated files with wide data or long comments).
2019-12-21 18:20:04 +01:00
Gerhard Sittig cb3b80512e input/csv: update developer comments and TODO list
Mention the required synchronization of default option values and format
match logic in a prominent location where options are discussed.

Update the TODO list for the CSV input module. Mixed signal handling got
fixed by rearranging channel creation. Samplerate can get determined
from timestamp columns already. The double data type for analog data
remains.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 05719d75aa input/csv: move channel creation to after format parsing
The previous implementation incompletely handled arbitrary data type
oders in mixed signal input files. Rearrange the logic such that all
format specs get parsed first, then all channel creation details get
determined, then all channels get created. It appears to be essential
that all logic channels get created first, resulting in index numbers
starting at 0 and addressing the correct position in bitfields. The
analog channels get created after all logic channels exist. Adjacent
number ranges for channel types also results in more readable logic in
other locations.

This was tested with -I csv:column_formats=t,2a,l,a,x4,a,-,b3 example
data, and works as expected.
2019-12-21 18:20:04 +01:00
Gerhard Sittig cd7c5f9655 input/csv: add automatic format match support
Implement .format_match() support in the CSV input module. Simple
multi-column files will automatically load without an "-I csv" spec.
Non-default option values still do require the module selection before
options can get passed to the module.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 43e1e23a11 input/csv: another stab at option help texts
Try to balance a compact format and completeness/accuracy of content for
builtin help texts for the CSV input module's options. Assume a technical
audience (this is signal analysis software after all).

Rename a few internal identifiers which help organize the list of options
and their help texts. Too short names became obscure.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 7e4e65bf65 input/csv: add support for timestamp columns, auto detect samplerate
Accept 't' format specs for timestamp columns. Automatically derive the
samplerate from input data when timestamps are available and the user
did not provide a rate. Stick with a simple approach for robustness
since automatic detection is easy to override when it fails. This
feature is mostly about convenience.
2019-12-21 18:20:04 +01:00
Gerhard Sittig fc3b42e93a input/csv: robustness nits in column format dispatching
The previous implementation open coded type checks by comparing an enum
value against specific constants. Which was especially ugly since there
are multiple types which all are logic, and future column types neither
get ignored nor have channels associated with them.

Improve readability and robustness by adding helpers which check classes
(ignore, logic, analog) instead of the multitude of -/x/o/b|l/a variants
within the classes.

Also comment on the order of channel creation, and how to improve it.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 08eb955a69 input/csv: update comments/helptext for analog input data
Expand the developer comment that's inline in the source file. There is
enough room to explain things. Try to come up with a "one-line" help text
that is precise yet compact, and does inform the user of available format
choices including modifiers. Chances are that longer descriptions start
reducing the usefulness of the help or the visibility of options when
users are in a hurry. Those who care can access the manual.

Mark more options as obsolete, and mention more default values in the
builtin help text. Also tweak a comment on getting channel names from
header lines.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 3f1f63f007 input/csv: work around undesired logic/analog group "bleeding"
Support for mixed signal CSV input data is desirable and should be
possible. The current implementation just happens to not fully cope with
arbitrary mixes of data types in columns yet. Add a quick workaround,
but also a TODO item to properly address the topic later.
2019-12-21 18:20:04 +01:00
Gerhard Sittig a267bf450c input/csv: accept user provided analog resolution in column formats
Stick with the (arbitrary) default of 3 digits for analog data. Accept
user specified digit counts in the column_formats= option, like "a4".
2019-12-21 18:20:04 +01:00
Gerhard Sittig 43bdef2634 input/csv: add support for analog input data
Extend the CSV input module which was strictly limited to logic data so
far. Add support for analog data types. Implement the 'a' column format,
and feed analog data to the session bus.

This implementation feeds data of individual analog channels to the
session bus in separate packets each. This approach was found to work
most reliably, not all recipients support the submission of multiple
samples for multiple channels in a single packet.

A fixed 'digits' value is used. This needs to get addressed later.

Local experiments suggest that the 'double' data type for analog data
can result in erroneous visual presentation (observed with sigrok-cli).
Use 'float' for now, until the issue is understood and got fixed.
Support for double is prepared internally and is easily enabled.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 5ada72fc0a input/csv: address unassorted nits
Address several minor nits. Eliminate unneeded variables. Update text to
number conversion comments including wildcard handling. Remove empty
lines in init() which used to spill out a set of lines which all do the
same thing (evaluate a set of options) and shall belong together.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 9e7af34eaf input/csv: move channel creation to column processing details creation
Move the creation of logic channels to the location where formats fields
get iterated, and column processing details get derived. This reduces a
lot of redundancy, and simplifies the addition of more data formats.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 5a9711764d input/csv: update TODO comments
Update the list of TODO items at the top of the CSV input module's
source. Text line handling (counting line numbers) got fixed. Adding
support for analog channels was prepared, as are timestamp columns.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 72903e9d55 input/csv: rework user accessible options for consistency
Rename the CSV input module's option keywords. To better reflect their
purpose, and for consistency across the rather complex set of options
and how they interact. Rearrange the list of options (not that the order
matters from the outside, but it's good to have during maintenance).

Update builtin help texts which will show up in applications, as well as
the source code comments which discuss these options in greater detail.
Would be nice to have a "general" help text for input modules which is
not tied to one single option, to provide an overview or use examples.
Arrange the option keys, short and long help texts such that the source
better reflects the applications' screen layout. To better support
future maintenance, again.

Consistently separate multi-work keywords for improved readability.
Prefer underscores over dashes for consistency with common keys in
shared infrastructure in other project sources (device options, MQ
items, etc).
2019-12-21 18:20:04 +01:00
Gerhard Sittig 1a920e33fe input/csv: extend column-formats support for backwards compatibility
Extend the "column-formats" option support in the CSV input module to
also support wildcards and automatic channel count detection. Move the
format string interpretation to the location where the first data line
or the optional header line are seen. Map the simple options (single
column number and channel count, or first column number and optional
channel count) to a format string, to unify internal code paths. Remove
code paths for the previous specific yet limited scenarios.

Rephrase the condition which keeps executing the "initial receive"
phase. The text line termination sequence gets derived from the first
complete text line, but other essential information is only gathered
later, potentially after skipping a large (user specified) amount of
input data. Keep checking for this essential setup data until data or
the header actually were seen, before regular processing of input data
starts.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 2142a79b53 input/csv: introduce column-formats option (flexible logic import)
Extend the CSV input module, introduce support for the "column-formats="
option. This syntax can express the previous single- and multi-column
semantics, as well as any arbitrary order of to-get-ignored, and single-
and multi-bit columns in several formats.

The previous "simple" keywords for single and multi column modes still
are in place, it's yet to get determined whether to axe them. Depends on
whether users can handle the format strings for these simple cases.
2019-12-21 18:20:04 +01:00
Gerhard Sittig ef0b9935cf input/csv: fixup input file line number handling
The previous implementation allowed CSV input files to use any line
termination in either CR only, LF only, or CR/LF format. The first EOL
was searched for and was recorded, but then was not used. Instead any of
CR or LF were considered a line termination. "Raw data processing" still
was correct, but line numbers in diagnostics were way off, and optional
features like skipping first N lines were not effective. Fix that.

Source code inspection suggests the "startline" feature did not work at
all. The user provided number was used in the initial optional search
for the header line (to get signal names) or auto-determination of the
number of columns. But then was not used when the file actually got
processed.
2019-12-21 18:20:04 +01:00
Gerhard Sittig 836fac9cf6 input/csv: unassorted adjustment, mostly "column processing" related
Reduce "state" in the CSV input module's context. Stick with variables
that are local to routines when knowledge of details need not be global.
Really base the processing of a column's input text on the column's
processing information which was gathered in the setup phase.

Rename few identifiers, to explicitly refer to logic channels (the only
currently supported data type of the CSV input module). Cease feeding
logic data to the session bus when there are no logic channels at all
(currently not really an option). Prepare for simpler dispatching of
parse routines should more data types get added in a future version.

Reduce some "clutter" (overly fragmented stuff that should go together
since it forms logical groups and is not really standalone). Address a
few more minor style nits (sizeof() redundancy, "seemingly inverse"
string comparison phrases).
2019-12-21 18:20:04 +01:00
Gerhard Sittig f6dcb3200d input/csv: improve "channel name from header line" logic
Improve the code paths which determine logic channels' names from an
optional CSV file header line. Strip optional quotes from the column's
input text (re-use a SCPI helper routine for that). Also use the channel
name for multi-bit fields, append [0] etc suffixes in that case. Comment
on the manipulation of input data, which is acceptable since that very
data won't get processed another time in another code path.
2019-12-21 18:20:04 +01:00