|
@ -54,20 +54,21 @@ namespace Signal_Generator |
|
|
private void drawSignalAtCanvas() |
|
|
private void drawSignalAtCanvas() |
|
|
{ |
|
|
{ |
|
|
double lastX = 0, lastY = 0; |
|
|
double lastX = 0, lastY = 0; |
|
|
double w = canvas.ActualWidth; |
|
|
double W = canvas.ActualWidth; |
|
|
for (int i = 0; i != (int)w; i++) |
|
|
double mod = (procedureModel.Duration / 1000) / W; |
|
|
|
|
|
for (int X = 0; X != (int)W; X++) |
|
|
{ |
|
|
{ |
|
|
updateTextBoxProps(multiSignal.currentAmplitude(i / 5.0), i / 5.0); |
|
|
double Y = multiSignal.currentAmplitude(X * mod); |
|
|
double y = multiSignal.currentAmplitude(i / 5.0); |
|
|
updateTextBoxProps(Y, X * mod); |
|
|
drawLine(lastX, lastY, i, y); |
|
|
drawLine(lastX, lastY, X, Y); |
|
|
lastX = i; |
|
|
lastX = X; |
|
|
lastY = y; |
|
|
lastY = Y; |
|
|
Thread.Sleep(10); |
|
|
Thread.Sleep(10); |
|
|
switch (state) |
|
|
switch (state) |
|
|
{ |
|
|
{ |
|
|
case State.Paused: |
|
|
case State.Paused: |
|
|
while (state == State.Paused) |
|
|
while (state == State.Paused) |
|
|
Thread.Sleep(10); |
|
|
Thread.Sleep(50); |
|
|
break; |
|
|
break; |
|
|
case State.Canceled: return; |
|
|
case State.Canceled: return; |
|
|
} |
|
|
} |
|
|