]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Update gen for gnuplot example code with entries
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 20 Jan 2022 21:42:55 +0000 (22:42 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 20 Jan 2022 21:42:55 +0000 (22:42 +0100)
src/gen_for_gnuplot.cc

index 491b42cc05ae2e2bd7f04bb42940356714604938..29731adae96dbdefe58db3df19a05795de426ffc 100644 (file)
@@ -65,7 +65,7 @@ public:
 };
 
 void
-gpl_slot(bcar::ParkingSlot& s, std::string fn)
+gpl_slot(bcar::ParkingSlot& s, std::string fn = "")
 {
        if (fn.compare("") == 0) {
                return;
@@ -85,13 +85,14 @@ gen_pl_script(std::vector<M>& ms, std::string with_slot)
        f.open("plot.pl");
        f << "#!/usr/bin/gnuplot" << endl;
        f << "set size ratio -1" << endl;
-       f << "plot";
+       if (with_slot.compare("") != 0) {
+               f << "plot '" << with_slot << "' w l,";
+       } else {
+               f << "plot";
+       }
        for (auto& m: ms) {
                f << " '" << m.fn << "'" << " w l,";
        }
-       if (with_slot.compare("") != 0) {
-               f << " '" << with_slot << "' w l";
-       }
        f << endl;
        f << "pause -1" << endl;
        f.close();
@@ -109,6 +110,7 @@ main()
        gpl_slot(s, sn);
 
        s.fe(bcar::BicycleCar());
+       s.compute_entries();
 
        INIT_V
        P(RF_POINT)
@@ -117,8 +119,7 @@ main()
        P(RR_POINT)
 
        for (auto& m: V) {
-               m.c = s._ispaths.front().front();
-               m.c.sp(m.c.sp() * -1.0);
+               m.c = s._entries.front();
                m.c.st(m.c.st() * -1.0);
        }
        for (unsigned int i = 0; i < STEPS; i++) {