On Fri, Jul 28, 2017 at 1:06 AM, Soeren Apel <soe...@apelpie.net> wrote:

>
> Would it help you if the little arrow on the ruler would be the same
> across all windows? Also, would it help if in such a setup there
> wouldn't be just an arrow but a complete vertical line?
>
>
Yeah, I think that would be helpful.  Maybe a vertical rule could follow
the mouse cursor.


>
> > I'll try the approach you mentioned of manually splicing the two
> > files together.
>
> If you need assistance, please let us know. In my last mail, I
> forgot to mention that you also need to adjust the metadata file
> and add 8 more logic channels - the number of logic channels
> determines the number of bits sigrok expects per sample, so if
> you increase the number of bits from 8 to 16, it'll read two
> bytes per sample instead of one.
> Then, all you need to do is to mux those binary "logic-1" files.
>

I gave this a shot, but something went wrong (Pulseview gives a "generic /
unspecified" error when I try to open up the resulting zip file).

I threw together a quick python script to mux the binary files.  I think I
got it right -- the resulting logic-1-1 file is exactly twice the size of
the two source files.  I've attached the two source srzip files and the
resulting output srzip file.

So I'm guessing I made some sort of mistake in the metadata file.  I've
attached that as a text file as well.

I'd be super grateful if you could take a glance at it!

Maybe there is a way I can make Pulseview spit out some debugging info or a
more detailed error?

Thanks,
Jason
[global]
sigrok version=0.6.0-git-58ffcf9

[device 1]
capturefile=logic-1
total probes=16
samplerate=1 MHz
total analog=0
probe1=D0
probe2=D1
probe3=D2
probe4=D3
probe5=D4
probe6=D5
probe7=D6
probe8=D7
probe9=DAV
probe10=NRFD
probe11=NDAC
probe12=D3
probe13=D4
probe14=D5
probe15=D6
probe16=D7
unitsize=1
#!/usr/bin/env python

import sys
import os

if len(sys.argv) < 4:
    sys.stderr.write("Usage: %s <input dir 1> <input dir 2> <output dir>\n" % sys.argv[0])
    sys.exit(1)

dirA = sys.argv[1]
dirB = sys.argv[2]
outdir = sys.argv[3]

probe_countA = -1
unit_sizeA = -1

probe_countB = -1
unit_sizeB = -1

with open("%s/metadata" % dirA) as f:
    for line in f.readlines():
        if "total probes" in line:
            probe_countA = int(line.split('=')[1].rstrip())
        if "unitsize" in line:
            unit_sizeA = int(line.split('=')[1].rstrip())

with open("%s/metadata" % dirB) as f:
    for line in f.readlines():
        if "total probes" in line:
            probe_countB = int(line.split('=')[1].rstrip())
        if "unitsize" in line:
            unit_sizeB = int(line.split('=')[1].rstrip())

if probe_countA == -1 or unit_sizeA == -1 or probe_countA == -1 or unit_sizeB == -1:
    sys.stderr.write("Error: bad metadata\n")
    sys.exit(2)

os.system("mkdir -p %s" % outdir)

with open("%s/logic-1-1" % dirA) as fA:
    with open("%s/logic-1-1" % dirB) as fB:
        with open("%s/logic-1-1" % outdir, "w") as fOut:
            while True:
                sampleA = fA.read(unit_sizeA)
                sampleB = fB.read(unit_sizeB)
                if len(sampleA) == 0 or len(sampleB) == 0:
                    break
                fOut.write(sampleA)
                fOut.write(sampleB)

Attachment: A.srzip
Description: Binary data

Attachment: B.srzip
Description: Binary data

Attachment: muxed.srzip
Description: Binary data

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to