différence M1 - M2
This commit is contained in:
16
main.c
16
main.c
@ -377,20 +377,24 @@ void DrawControlPanel(Michelson *mic) {
|
|||||||
int rows = (mic->lambdasCount + cols - 1) / cols;
|
int rows = (mic->lambdasCount + cols - 1) / cols;
|
||||||
startY += (rows * (btnH + 5)) + 20;
|
startY += (rows * (btnH + 5)) + 20;
|
||||||
|
|
||||||
|
// Pos M1 M2 (d1 - d2)
|
||||||
// Pos M1
|
|
||||||
startY += 0;
|
startY += 0;
|
||||||
DrawText(TextFormat("Position M1 : %.2f um", mic->d1), startX, startY, 20, ORANGE);
|
float currentDiff = mic->d1 - mic->d2;
|
||||||
|
DrawText(TextFormat("Distance M1 - M2: %.2f um", currentDiff), startX, startY, 20, ORANGE);
|
||||||
|
|
||||||
// Pas des + et -
|
// Pas des + et -
|
||||||
float stepD1 = speedMode ? 0.05f : 0.006f;
|
float stepD1 = speedMode ? 0.05f : 0.006f;
|
||||||
|
|
||||||
if (GuiButtonRepeat((Rectangle){startX, startY + 30, btnSize, 25}, "-", shouldRepeat)) mic->d1 -= stepD1;
|
if (GuiButtonRepeat((Rectangle){startX, startY + 30, btnSize, 25}, "-", shouldRepeat)) mic->d1 -= stepD1;
|
||||||
GuiSlider((Rectangle){startX + btnSize + 5, startY + 30, sliderWidth - 75, 25}, NULL, NULL, &mic->d1, 100, 600);
|
|
||||||
|
float sliderVal = currentDiff;
|
||||||
|
GuiSlider((Rectangle){startX + btnSize + 5, startY + 30, sliderWidth - 75, 25}, NULL, NULL, &sliderVal, -100.0f, 100.0f);
|
||||||
|
mic->d1 = mic->d2 + sliderVal;
|
||||||
|
|
||||||
|
if (GuiButtonRepeat((Rectangle){startX, startY + 30, btnSize, 25}, "-", shouldRepeat)) mic->d1 -= stepD1;
|
||||||
if (GuiButtonRepeat((Rectangle){startX + btnSize + sliderWidth - 65, startY + 30, btnSize, 25}, "+", shouldRepeat)) mic->d1 += stepD1;
|
if (GuiButtonRepeat((Rectangle){startX + btnSize + sliderWidth - 65, startY + 30, btnSize, 25}, "+", shouldRepeat)) mic->d1 += stepD1;
|
||||||
if (GuiButton((Rectangle){startX + contentWidth - 60, startY + 30, 60, 25}, "Egal")) mic->d1 = mic->d2;
|
if (GuiButton((Rectangle){startX + contentWidth - 60, startY + 30, 60, 25}, "Egal")) mic->d1 = mic->d2;
|
||||||
|
|
||||||
|
|
||||||
// Angle M1 X
|
// Angle M1 X
|
||||||
startY += 90;
|
startY += 90;
|
||||||
DrawText(TextFormat("Inclinaison M1: %.3f deg", mic->angleM1), startX, startY, 20, ORANGE);
|
DrawText(TextFormat("Inclinaison M1: %.3f deg", mic->angleM1), startX, startY, 20, ORANGE);
|
||||||
@ -571,7 +575,7 @@ int main () {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
mic.center = (Vector2){ UI_WIDTH + (1920 - UI_WIDTH) / 2.0f - 100, 1080 / 2.0f };
|
mic.center = (Vector2){ UI_WIDTH + (1920 - UI_WIDTH) / 2.0f - 100, 1080 / 2.0f };
|
||||||
mic.d1 = 300.0f;
|
mic.d1 = 265.0f;
|
||||||
mic.d2 = 250.0f;
|
mic.d2 = 250.0f;
|
||||||
mic.lambdas[0] = 550.0f;
|
mic.lambdas[0] = 550.0f;
|
||||||
mic.lambdasCount = 1;
|
mic.lambdasCount = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user