Skip to content

Commit 6563035

Browse files
committed
Cherrypick 3 fixes from master.
1 parent cb359aa commit 6563035

File tree

5 files changed

+50
-8
lines changed

5 files changed

+50
-8
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = false;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 56;
29-
const int PROGRAM_VERSION_PATCH = 5;
29+
const int PROGRAM_VERSION_PATCH = 6;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +
@@ -212,4 +212,3 @@ const std::string& ML_MODEL_CACHE_PATH(){
212212

213213
}
214214

215-

SerialPrograms/Source/CommonFramework/VideoPipeline/Stats/MemoryUtilizationStats.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ void MemoryUtilizationStats::update(){
4949
memory.process_virtual_memory,
5050
memory.process_physical_memory
5151
)){
52-
if (usage < 0.50){
52+
if (usage < 0.10){
5353
process.color = COLOR_RED;
54-
}else if (usage < 0.75){
54+
}else if (usage < 0.25){
5555
process.color = COLOR_ORANGE;
56-
}else if (usage < 0.90){
56+
}else if (usage < 0.50){
5757
process.color = COLOR_YELLOW;
5858
}
5959
}

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
#include "PokemonSV/Inference/Boxes/PokemonSV_BoxShinyDetector.h"
143143
#include "PokemonSwSh/Inference/PokemonSwSh_DialogBoxDetector.h"
144144
#include "CommonTools/Images/SolidColorTest.h"
145+
#include "CommonTools/Async/InterruptableCommands.h"
145146

146147

147148
#include <QPixmap>
@@ -241,6 +242,9 @@ void TestProgram::on_press(){
241242

242243

243244

245+
246+
247+
244248
void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope& scope){
245249
using namespace Kernels;
246250
using namespace Kernels::Waterfill;
@@ -260,16 +264,55 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
260264
ProControllerContext context(scope, console.pro_controller());
261265
VideoOverlaySet overlays(overlay);
262266

267+
AsyncCommandSession<ProController> session(
268+
scope, logger, env.realtime_dispatcher(),
269+
console.pro_controller()
270+
);
271+
272+
Milliseconds delay = 500ms;
273+
274+
for (int c = 0; c < 100; c++){
275+
session.dispatch([](ProControllerContext& context){
276+
pbf_mash_button(context, BUTTON_A, 360000ms);
277+
});
278+
279+
delay = 552ms;
280+
281+
cout << "delay = " << delay.count() << endl;
282+
283+
context.wait_for(delay);
284+
285+
session.stop_command();
286+
287+
pbf_press_button(context, BUTTON_B, 5000ms, 800ms);
288+
context.wait_for_all_requests();
289+
290+
delay += 1ms;
291+
}
292+
263293

264294

295+
296+
297+
#if 0
265298
auto screenshot = feed.snapshot();
266299

300+
301+
302+
PokemonSV::OverworldDetector detector;
303+
detector.make_overlays(overlays);
304+
cout << detector.detect(screenshot) << endl;
305+
#endif
306+
307+
308+
309+
#if 0
267310
TeraCardReader detector;
268311
detector.make_overlays(overlays);
269312

270313
cout << detector.detect(screenshot) << endl;
271314
detector.pokemon_slug(logger, env.program_info(), screenshot);
272-
315+
#endif
273316

274317
#if 0
275318
NewsDetector detector;

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_HomeMenuDetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bool HomeMenuDetector::detect_only(const ImageViewRGB32& screen){
8888

8989
ImageStats stats_bottom_icons = image_stats(extract_box_reference(screen, m_bottom_icons));
9090
// cout << stats_bottom_icons.average << stats_bottom_icons.stddev << endl;
91-
if (stats_bottom_icons.stddev.sum() < 50){
91+
if (stats_bottom_icons.stddev.sum() < 10){
9292
return false;
9393
}
9494

SerialPrograms/Source/PokemonSV/Inference/Picnics/PokemonSV_SandwichIngredientDetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class SandwichCondimentMatcher : public ImageMatch::CroppedImageDictionaryMatche
133133

134134
class SandwichFillingOCR : public OCR::SmallDictionaryMatcher{
135135
public:
136-
static constexpr double MAX_LOG10P = -1.5;
136+
static constexpr double MAX_LOG10P = -2.0;
137137
static constexpr double MAX_LOG10P_SPREAD = 0.5;
138138

139139
public:

0 commit comments

Comments
 (0)