Aggiunta cambio piano su gui
This commit is contained in:
+7
-3
@@ -3,7 +3,7 @@ Pos=60,60
|
|||||||
Size=400,400
|
Size=400,400
|
||||||
|
|
||||||
[Window][Dear ImGui Demo]
|
[Window][Dear ImGui Demo]
|
||||||
Pos=754,26
|
Pos=473,13
|
||||||
Size=936,873
|
Size=936,873
|
||||||
|
|
||||||
[Window][Hello, world!]
|
[Window][Hello, world!]
|
||||||
@@ -23,8 +23,8 @@ Pos=68,96
|
|||||||
Size=740,472
|
Size=740,472
|
||||||
|
|
||||||
[Window][Set data position]
|
[Window][Set data position]
|
||||||
Pos=19,485
|
Pos=0,765
|
||||||
Size=597,78
|
Size=856,50
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
||||||
IsChild=1
|
IsChild=1
|
||||||
@@ -38,3 +38,7 @@ Size=200,100
|
|||||||
Pos=60,60
|
Pos=60,60
|
||||||
Size=353,1005
|
Size=353,1005
|
||||||
|
|
||||||
|
[Window][Set visualization plane]
|
||||||
|
Pos=418,11
|
||||||
|
Size=347,56
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -45,6 +45,8 @@ void Sensore::initCSV(std::vector<std::vector<float>> data){
|
|||||||
void Sensore::update(sf::Clock cl){
|
void Sensore::update(sf::Clock cl){
|
||||||
|
|
||||||
//calcolo la posizione e velocità
|
//calcolo la posizione e velocità
|
||||||
|
if (*dataPos >= gData.size()) *dataPos = gData.size()-1;
|
||||||
|
|
||||||
calcRotWithG(*dataPos);
|
calcRotWithG(*dataPos);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-4
@@ -209,9 +209,17 @@ void doGUI(State &gs)
|
|||||||
|
|
||||||
ImGui::SFML::Update(gs.window, elapsed);
|
ImGui::SFML::Update(gs.window, elapsed);
|
||||||
ImGui::ShowDemoWindow();
|
ImGui::ShowDemoWindow();
|
||||||
ImGui::Begin("Set data position");
|
|
||||||
|
//Finestra gestione posizione nei dati
|
||||||
|
ImGuiWindowFlags sdp_flags = ImGuiWindowFlags_NoMove|
|
||||||
|
ImGuiWindowFlags_NoResize|
|
||||||
|
ImGuiWindowFlags_NoScrollbar|
|
||||||
|
ImGuiWindowFlags_NoCollapse|
|
||||||
|
ImGuiWindowFlags_NoTitleBar;
|
||||||
|
|
||||||
|
ImGui::Begin("Set data position", 0,sdp_flags);
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.3);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.3);
|
||||||
ImGui::SliderScalar("Min", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit);
|
ImGui::SliderScalar("Start", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5);
|
||||||
if (ImGui::SliderScalar("Pos", ImGuiDataType_U32 ,gs.pos,gs.intervalMinLimit,gs.intervalMajLimit)){
|
if (ImGui::SliderScalar("Pos", ImGuiDataType_U32 ,gs.pos,gs.intervalMinLimit,gs.intervalMajLimit)){
|
||||||
@@ -219,19 +227,33 @@ void doGUI(State &gs)
|
|||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.8);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.8);
|
||||||
ImGui::SliderScalar("Max", ImGuiDataType_U32 ,gs.intervalMajLimit,gs.intervalMinLimit,&gs.maxEntries);
|
ImGui::SliderScalar("End", ImGuiDataType_U32 ,gs.intervalMajLimit,gs.intervalMinLimit,&gs.maxEntries);
|
||||||
|
|
||||||
bool red = false;
|
bool red = false;
|
||||||
if (!gs.play){
|
if (!gs.play){
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1,0,0,1));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1,0,0,1));
|
||||||
red = true;
|
red = true;
|
||||||
}
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
if (ImGui::ArrowButton("Play", ImGuiDir_Right)){
|
if (ImGui::ArrowButton("Play", ImGuiDir_Right)){
|
||||||
gs.play = !gs.play;
|
gs.play = !gs.play;
|
||||||
}
|
}
|
||||||
if (red) ImGui::PopStyleColor();
|
if (red) ImGui::PopStyleColor();
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
|
|
||||||
|
//Finestra gestione piano visualizzazione
|
||||||
|
ImGui::Begin("Set visualization plane");
|
||||||
|
const char* MyEnumNames[] = { "Basso", "Medio", "Alto" };
|
||||||
|
int currentPlane = (int)gs.selectedPlane;
|
||||||
|
ImGui::SliderInt("Selected Plane", ¤tPlane,0,2,MyEnumNames[currentPlane]);
|
||||||
|
gs.selectedPlane = (ReferencePlane)currentPlane;
|
||||||
|
ImGui::End();
|
||||||
|
|
||||||
|
|
||||||
|
sf::Vector2u wsize = gs.window.getSize();
|
||||||
|
ImGui::SetWindowPos("Set data position",ImVec2(0,wsize.y - 50));
|
||||||
|
ImGui::SetWindowSize("Set data position",ImVec2(wsize.x,50));
|
||||||
|
|
||||||
ImGui::SFML::Render(gs.window);
|
ImGui::SFML::Render(gs.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ int main() {
|
|||||||
{
|
{
|
||||||
curTime += mainClock.restart().asMilliseconds();
|
curTime += mainClock.restart().asMilliseconds();
|
||||||
if (curTime > T){
|
if (curTime > T){
|
||||||
if (gs.play && pos < maj) pos += curTime / T;
|
if (gs.play && pos+curTime/T < maj) pos += curTime / T;
|
||||||
curTime = 0;
|
curTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user