@@ -1139,12 +1139,14 @@ void run_sandwich_maker(ProgramEnvironment& env, VideoStream& stream, ProControl
11391139 // Find fillings and add them in order
11401140 for (const std::string& i : fillings_sorted){
11411141 // cout << "Placing " << i << endl;
1142+ stream.log (" Placing " + i, COLOR_WHITE);
11421143 stream.overlay ().add_log (" Placing " + i, COLOR_WHITE);
11431144
11441145 int times_to_place = (int )(FillingsCoordinates::instance ().get_filling_information (i).piecesPerServing ) * (fillings.find (i)->second );
11451146 int placement_number = 0 ;
11461147
11471148 // cout << "Times to place: " << times_to_place << endl;
1149+ stream.log (" Times to place: " + std::to_string (times_to_place), COLOR_WHITE);
11481150 stream.overlay ().add_log (" Times to place: " + std::to_string (times_to_place), COLOR_WHITE);
11491151
11501152 std::vector<int > plate_index;
@@ -1159,6 +1161,7 @@ void run_sandwich_maker(ProgramEnvironment& env, VideoStream& stream, ProControl
11591161 for (int j = 0 ; j < (int )plate_index.size (); j++){
11601162 // Navigate to plate and set target plate
11611163 // cout << "Target plate: " << plate_index.at(j) << endl;
1164+ stream.log (" Target plate: " + std::to_string (plate_index.at (j)), COLOR_WHITE);
11621165 stream.overlay ().add_log (" Target plate: " + std::to_string (plate_index.at (j)), COLOR_WHITE);
11631166 switch (plate_index.at (j)){
11641167 case 0 :
@@ -1184,7 +1187,7 @@ void run_sandwich_maker(ProgramEnvironment& env, VideoStream& stream, ProControl
11841187 // Place the fillings until label does not light up yellow on grab/the piece count is not hit
11851188 while (true ){
11861189 // Break out after placing all pieces of the filling
1187- if (placement_number == times_to_place){
1190+ if (placement_number == times_to_place){ // todo: maybe swap to piecesPerServing?
11881191 break ;
11891192 }
11901193
@@ -1219,9 +1222,12 @@ void run_sandwich_maker(ProgramEnvironment& env, VideoStream& stream, ProControl
12191222 if (!left_plate_detector.is_label_yellow (screen) && !middle_plate_detector.is_label_yellow (screen)
12201223 && !right_plate_detector.is_label_yellow (screen)){
12211224 context.wait_for_all_requests ();
1225+ stream.log (" None of the labels are yellow, so we assume our current plate is empty and move on to the next plate." , COLOR_WHITE);
12221226 break ;
12231227 }
12241228
1229+ stream.log (" One of the labels are yellow, so we assume our current plate is not empty and we continue the current plate." , COLOR_WHITE);
1230+
12251231 // If the plate is empty the increment is skipped using the above break
12261232 placement_number++;
12271233 }
0 commit comments