pslab-android
pslab-android copied to clipboard
Wave Generator: triangle wave is not triangular, but cut off
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.
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.
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.
I fixed the wave, but I have not done any refactoring in io.pslab.communication.ScienceLab
. This should be done in a second step.