cdelker / schemdraw

MIT License
103 stars 20 forks source link

SchemDraw Timing Diagram only displays the first five waveforms #5

Closed Galac-hpw closed 1 year ago

Galac-hpw commented 1 year ago

I am using the SchemDraw library to draw a timing diagram with three signals. The issue I am experiencing is that the diagram only displays the first five waveforms for each signal. Here is the code I am using:

with schemdraw.Drawing() as d:
    d.config(fontsize=12)
    d += logic.TimingDiagram(
        {'signal': [
            {'name': r'$\Phi1$', 'wave': '01010', 'async': [0, 1, 9, 17, 25, 32], 'risetime': .06},
            {'name': r'$\Phi2$', 'wave': '01010', 'async': [0, 2, 10, 18, 26, 32], 'risetime': .06},
            {'name': 'S', 'wave': 'x0101', 'async': [0, 1, 15.8, 16.2, 31.8, 32], 'risetime': .06},
        ],
        'config': {'hscale': 0.6},
    }, ygap=.5, grid=True)

The timing diagram only shows the first five waveforms for each signal. I tried to fix the issue by adding waveform , and the code is as follows, but this is not ideal enough.

with schemdraw.Drawing() as d:
    d.config(fontsize=12)
    d += logic.TimingDiagram( {'signal': [

        {'name': r'$\Phi1$', 'wave': '01010','async': [0,1,9,17,25,32],'risetime':.06},
        {'name': r'$\Phi2$', 'wave': '01010','async': [0,2,10,18,26,32],'risetime':.06},
        {'name': 'S', 'wave': 'x0101', 'async': [0,1, 15.8, 16.2,31.8,32],'risetime':.06},
        {'name': r'test', 'wave': 'p...............................','phase':0},],
    'config': {'hscale': 0.6},
    }, ygap=.5, grid=True)

I believe this could be a bug in the library. Could you please help me identify the cause of the issue and provide a solution?

cdelker commented 1 year ago

Should be fixed by 94769b9. It was looking at the longest wave parameter, not the highest value in the async lists.