Skip to content

Commit 740d81c

Browse files
committed
simple refactor for quick_debug variables. cleaned comments
1 parent e2c5cd3 commit 740d81c

File tree

3 files changed

+34
-35
lines changed

3 files changed

+34
-35
lines changed

app/src/main/java/cmu/xprize/robotutor/RoboTutor.java

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282
*/
8383
public class RoboTutor extends Activity implements IReadyListener, IRoboTutor {
8484

85-
private static final boolean QUICK_DEBUG = true; // LEBRON
85+
// VARIABLES FOR QUICK DEBUG LAUNCH
86+
private static final boolean QUICK_DEBUG = true;
87+
private static final String debugTutorVariant = "countingx";
88+
private static final String debugTutorId = "countingx:1_10";
89+
private static final String debugTutorFile = "[file]countingx_1_10.json";
90+
8691
private CTutorEngine tutorEngine;
8792
private CMediaController mMediaController;
8893

@@ -499,7 +504,7 @@ private void startEngine() {
499504
startView.startTapTutor();
500505
setFullScreen();
501506
}
502-
// LEBRON
507+
// QUICK DEBUG LAUNCH
503508
else if (QUICK_DEBUG) {
504509

505510
startQuickLaunch();
@@ -522,17 +527,24 @@ else if (QUICK_DEBUG) {
522527

523528
}
524529

525-
/**
526-
* LEBRON new method
527-
* This launches a new tutor immediately at startup. Used for quick debugging.
528-
*/
529-
private void startQuickLaunch() {
530+
531+
// TODO: This is a temporary log update mechanism - see below
532+
//
533+
static public void setGUIDCallBack(IGuidView callBack) {
534+
535+
guidCallBack = callBack;
536+
}
537+
538+
539+
// TODO: This is a temporary log update mechanism - see below
540+
//
541+
public void onStartTutor() {
542+
530543
logManager.postEvent_V(TAG, "LOG_GUID:" + LOG_ID );
531544
LOG_ID = CPreferenceCache.initLogPreference(this);
532545

533546
Log.d(TCONST.DEBUG_GRAY_SCREEN_TAG, "xx: startSessionManager in 'onStartTutor'");
534-
//tutorEngine.startSessionManager(); // LEBRON don't startSessionManager
535-
tutorEngine.quickLaunch();
547+
tutorEngine.startSessionManager();
536548

537549
startView.stopTapTutor();
538550
masterContainer.removeView(startView);
@@ -543,24 +555,16 @@ private void startQuickLaunch() {
543555
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
544556
}
545557

546-
547-
// TODO: This is a temporary log update mechanism - see below
548-
//
549-
static public void setGUIDCallBack(IGuidView callBack) {
550-
551-
guidCallBack = callBack;
552-
}
553-
554-
555-
// TODO: This is a temporary log update mechanism - see below
556-
//
557-
public void onStartTutor() {
558-
558+
/**
559+
*
560+
* This launches a new tutor immediately at startup. Useful for quick debugging.
561+
*/
562+
private void startQuickLaunch() {
559563
logManager.postEvent_V(TAG, "LOG_GUID:" + LOG_ID );
560564
LOG_ID = CPreferenceCache.initLogPreference(this);
561565

562566
Log.d(TCONST.DEBUG_GRAY_SCREEN_TAG, "xx: startSessionManager in 'onStartTutor'");
563-
tutorEngine.startSessionManager(); // LEBRON don't startSessionManager
567+
tutorEngine.quickLaunch(debugTutorVariant, debugTutorId, debugTutorFile);
564568

565569
startView.stopTapTutor();
566570
masterContainer.removeView(startView);

app/src/main/java/cmu/xprize/robotutor/tutorengine/CTutorEngine.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -243,24 +243,21 @@ static public void startSessionManager() {
243243
return;
244244
}
245245

246-
createTutor(defTutor, featureString, null); // LEBRON mimic this
246+
createTutor(defTutor, featureString, null);
247247
launchTutor(tutorBindings);
248248
}
249249

250250
/**
251-
* LEBRON new method
251+
*
252252
* This launches a new tutor immediately at startup. Used for quick debugging.
253253
*/
254-
public void quickLaunch() {
254+
public void quickLaunch(String tutorVariant, String tutorId, String tutorFile) {
255255

256-
// LEBRON TODO make hard-coding better
257-
String tutorVariant = "bpop.num"; // LEBRON what is tutorVariant?
258-
String tutorId = "bpop.num:0..9.by.1.asc.q2q.AV.rise.12__it_2"; // LEBRON what is tutorId?
259256

260257
defvar_tutor tutorDescriptor = tutorVariants.get(tutorVariant);
261258
defdata_tutor tutorBinding = bindingPatterns.get(tutorDescriptor.tutorName);
262259

263-
initializeBindingPattern(tutorBinding, "[file]bpop.num_0..9.by.1.asc.q2q.AV.rise.12.json");
260+
initializeBindingPattern(tutorBinding, tutorFile);
264261

265262
createTutor(tutorDescriptor.tutorName , tutorDescriptor.features, tutorId);
266263
launchTutor(tutorBinding);
@@ -336,7 +333,6 @@ static public void killActiveTutor() {
336333
* @param tutorName
337334
* @param features
338335
*/
339-
// LEBRON this is the method we'll be calling!
340336
static private void createTutor(String tutorName, String features, String tutorId) {
341337

342338
Log.d(TCONST.DEBUG_GRAY_SCREEN_TAG, "r4: killActiveTutor called from createTutor(" + tutorName + ")");
@@ -357,7 +353,7 @@ static private void createTutor(String tutorName, String features, String tutorI
357353

358354
// GRAY_SCREEN_BUG CTutor created --> Media Manager created --> added to map
359355
Log.d(TCONST.DEBUG_GRAY_SCREEN_TAG, "p2: Initializing tutor: " + tutorName);
360-
// LEBRON tutor first created here
356+
361357
activeTutor = new CTutor(Activity, tutorName, tutorId, (ITutorManager)tutorContainer, TutorLogManager, mRootScope, language, features);
362358
}
363359

@@ -553,8 +549,7 @@ static public void launch(String intentType, String tutorVariant, String dataSou
553549
case "native":
554550

555551
Log.d(TCONST.DEBUG_GRAY_SCREEN_TAG, "p3b: Creating Tutor in 'CTutor.launch': " + tutorDescriptor.tutorName);
556-
// LEBRON AAA copy this... tutor created here...
557-
createTutor(tutorDescriptor.tutorName, tutorDescriptor.features, tutorId); // LEBRON where does tutorDescriptor come from? what about tutorBinding?
552+
createTutor(tutorDescriptor.tutorName, tutorDescriptor.features, tutorId);
558553
launchTutor(tutorBinding);
559554
break;
560555

app/src/main/java/cmu/xprize/robotutor/tutorengine/graph/type_action.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public String applyNode() {
167167

168168
// Resolve any variables in the parameters.
169169
// Session manager uses TScope variables to store intents
170-
// LEBRON TODO where does this come from???
170+
//
171171
String intent = getScope().parseTemplate(parmList.get(0));
172172
String intentData = getScope().parseTemplate(parmList.get(2));
173173
String dataSource = getScope().parseTemplate(parmList.get(4));

0 commit comments

Comments
 (0)