Adding velocity to test function
This commit is contained in:
@@ -255,6 +255,7 @@ int tester(SimDevice* devices, int numdevices)
|
|||||||
|
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
simdata->gear = 0;
|
simdata->gear = 0;
|
||||||
|
simdata->velocity = 16;
|
||||||
simdata->rpms = 100;
|
simdata->rpms = 100;
|
||||||
simdata->maxrpm = 8000;
|
simdata->maxrpm = 8000;
|
||||||
sleep(3);
|
sleep(3);
|
||||||
@@ -275,6 +276,14 @@ int tester(SimDevice* devices, int numdevices)
|
|||||||
}
|
}
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
fprintf(stdout, "Setting speed to 100\n");
|
||||||
|
simdata->velocity = 100;
|
||||||
|
for (int x = 0; x < numdevices; x++)
|
||||||
|
{
|
||||||
|
devices[x].update(&devices[x], simdata);
|
||||||
|
}
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
fprintf(stdout, "Shifting into second gear\n");
|
fprintf(stdout, "Shifting into second gear\n");
|
||||||
simdata->gear = 2;
|
simdata->gear = 2;
|
||||||
for (int x = 0; x < numdevices; x++)
|
for (int x = 0; x < numdevices; x++)
|
||||||
@@ -283,6 +292,14 @@ int tester(SimDevice* devices, int numdevices)
|
|||||||
}
|
}
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
fprintf(stdout, "Setting speed to 200\n");
|
||||||
|
simdata->velocity = 200;
|
||||||
|
for (int x = 0; x < numdevices; x++)
|
||||||
|
{
|
||||||
|
devices[x].update(&devices[x], simdata);
|
||||||
|
}
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
fprintf(stdout, "Shifting into third gear\n");
|
fprintf(stdout, "Shifting into third gear\n");
|
||||||
simdata->gear = 3;
|
simdata->gear = 3;
|
||||||
for (int x = 0; x < numdevices; x++)
|
for (int x = 0; x < numdevices; x++)
|
||||||
@@ -315,6 +332,14 @@ int tester(SimDevice* devices, int numdevices)
|
|||||||
}
|
}
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
fprintf(stdout, "Setting speed to 300\n");
|
||||||
|
simdata->velocity = 300;
|
||||||
|
for (int x = 0; x < numdevices; x++)
|
||||||
|
{
|
||||||
|
devices[x].update(&devices[x], simdata);
|
||||||
|
}
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
fprintf(stdout, "Setting rpms to 8000\n");
|
fprintf(stdout, "Setting rpms to 8000\n");
|
||||||
simdata->rpms = 8000;
|
simdata->rpms = 8000;
|
||||||
for (int x = 0; x < numdevices; x++)
|
for (int x = 0; x < numdevices; x++)
|
||||||
@@ -323,6 +348,7 @@ int tester(SimDevice* devices, int numdevices)
|
|||||||
}
|
}
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
simdata->velocity = 0;
|
||||||
simdata->rpms = 100;
|
simdata->rpms = 100;
|
||||||
for (int x = 0; x < numdevices; x++)
|
for (int x = 0; x < numdevices; x++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user