pslab-android icon indicating copy to clipboard operation
pslab-android copied to clipboard

Wave Generator: triangle wave is not triangular, but cut off

Open mariobehling opened this issue 5 years ago • 1 comments

Wave Generator: This issue was reported by several users. The Triangle wave is not as it is supposed to be. The triangle wave is not triangular, but cut off.

mariobehling avatar Feb 03 '20 13:02 mariobehling

I think this is the same issue as https://github.com/fossasia/pslab-hardware/issues/111 which I opened in the hardware repo since I assumed it to be a hardware issue.

marcnause avatar Feb 04 '20 08:02 marcnause

After plotting the values which are calculated in the loadEquation(String channel, String function) method of io.pslab.communication.ScienceLab, I am pretty confident that this is software issue.

The method includes a comment that the creation of different waveforms should be handled differently anyway. I think that using the "strategy" design pattern here could improve the code and also make the waveform creation testable in a unit test.

marcnause avatar Feb 06 '23 13:02 marcnause

I fixed the wave, but I have not done any refactoring in io.pslab.communication.ScienceLab. This should be done in a second step.

marcnause avatar Feb 06 '23 22:02 marcnause