Include typefaces and updated jar and updated filepaths to the
typefaces.
This commit is contained in:
parent
87138d8b06
commit
789c13d9af
Binary file not shown.
@ -26,6 +26,7 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
|
|||||||
import org.apache.http.client.methods.HttpPost;
|
import org.apache.http.client.methods.HttpPost;
|
||||||
import org.apache.http.impl.client.HttpClients;
|
import org.apache.http.impl.client.HttpClients;
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import sig.utils.FileUtils;
|
import sig.utils.FileUtils;
|
||||||
@ -41,6 +42,8 @@ public class Guardian {
|
|||||||
public static Point LOWERRIGHTCORNER = null;
|
public static Point LOWERRIGHTCORNER = null;
|
||||||
public static boolean RESULTSSCREEN = false;
|
public static boolean RESULTSSCREEN = false;
|
||||||
|
|
||||||
|
public static TypeFace2 typeface;
|
||||||
|
|
||||||
enum STAGE{
|
enum STAGE{
|
||||||
STARTING,
|
STARTING,
|
||||||
CALIBRATING,
|
CALIBRATING,
|
||||||
@ -62,13 +65,12 @@ public class Guardian {
|
|||||||
while (col.getRed()+col.getGreen()+col.getBlue()>30||(col.getRed()+col.getGreen()+col.getBlue()>10&&(col.getRed()!=col.getGreen()||col.getGreen()!=col.getBlue()||col.getRed()!=col.getBlue()))) {
|
while (col.getRed()+col.getGreen()+col.getBlue()>30||(col.getRed()+col.getGreen()+col.getBlue()>10&&(col.getRed()!=col.getGreen()||col.getGreen()!=col.getBlue()||col.getRed()!=col.getBlue()))) {
|
||||||
lastcol = col;
|
lastcol = col;
|
||||||
y--;
|
y--;
|
||||||
col = new Color(img.getRGB(x, y));
|
if (y>=0) {
|
||||||
}
|
col = new Color(img.getRGB(x, y));
|
||||||
if (y>=0) {
|
} else {
|
||||||
col = new Color(img.getRGB(x, y));
|
y++;
|
||||||
} else {
|
break;
|
||||||
y++;
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
crop1 = new Point(x,y);
|
crop1 = new Point(x,y);
|
||||||
done=true;
|
done=true;
|
||||||
@ -133,6 +135,12 @@ public class Guardian {
|
|||||||
tempf[i] = new File("streams","tempoutput"+i+"_"+USERID+".png");
|
tempf[i] = new File("streams","tempoutput"+i+"_"+USERID+".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typeface = new TypeFace2(ImageIO.read(new File("DivaBotGuardian/DivaBotGuardian/typeface.png")),
|
||||||
|
ImageIO.read(new File("DivaBotGuardian/DivaBotGuardian/typeface2.png")),
|
||||||
|
ImageIO.read(new File("DivaBotGuardian/DivaBotGuardian/typeface3.png")),
|
||||||
|
ImageIO.read(new File("DivaBotGuardian/DivaBotGuardian/typeface4.png")),
|
||||||
|
ImageIO.read(new File("DivaBotGuardian/DivaBotGuardian/typeface5.png")));
|
||||||
|
|
||||||
program:
|
program:
|
||||||
while (true) {
|
while (true) {
|
||||||
switch (currentStage) {
|
switch (currentStage) {
|
||||||
@ -175,16 +183,21 @@ public class Guardian {
|
|||||||
if (!RESULTSSCREEN) {
|
if (!RESULTSSCREEN) {
|
||||||
if (OnResultsScreen(img)) {
|
if (OnResultsScreen(img)) {
|
||||||
if (ReadytoSubmit(img)) {
|
if (ReadytoSubmit(img)) {
|
||||||
Thread.sleep(500);
|
//Thread.sleep(500);
|
||||||
currentStage=STAGE.SUBMIT;
|
MyRobot.FUTURETONE=true;
|
||||||
RESULTSSCREEN=true;
|
Result r = typeface.getAllData(CropFutureToneImage(img));
|
||||||
|
if (!(r.cool==-1 || r.fine==-1 || r.safe==-1 || r.sad==-1 || r.worst==-1 || r.percent<0f || r.percent>110f || r.combo==-1 || r.score==-1)) {
|
||||||
|
currentStage=STAGE.SUBMIT;
|
||||||
|
} else {
|
||||||
|
System.out.println("Waiting for results to populate... "+r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//System.out.println(UPPERLEFTCORNER+","+LOWERRIGHTCORNER+"///"+"Is Song select? "+cr.getAllRange(160,200,0,15,170,200)+" "+cr+" ("+(System.currentTimeMillis()-startTime)+"ms)");
|
//System.out.println(UPPERLEFTCORNER+","+LOWERRIGHTCORNER+"///"+"Is Song select? "+cr.getAllRange(160,200,0,15,170,200)+" "+cr+" ("+(System.currentTimeMillis()-startTime)+"ms)");
|
||||||
} catch (IOException | InvocationTargetException | NullPointerException e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Skip error frame.("+(System.currentTimeMillis()-startTime)+"ms)");
|
System.out.println("Skip error frame. " +e.getMessage()+ " ("+(System.currentTimeMillis()-startTime)+"ms)");
|
||||||
}
|
}
|
||||||
FRAMECOUNT=(FRAMECOUNT+1)%10;
|
FRAMECOUNT=(FRAMECOUNT+1)%10;
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
@ -294,10 +307,12 @@ public class Guardian {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RESULTSSCREEN=true;
|
||||||
System.out.println(report);
|
System.out.println(report);
|
||||||
|
|
||||||
currentStage=STAGE.RUNNING;
|
currentStage=STAGE.RUNNING;
|
||||||
} catch (IOException | NullPointerException | InvocationTargetException e) {
|
} catch (IOException | NullPointerException | InvocationTargetException | JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.out.println("Skip error frame.("+(System.currentTimeMillis()-startTime)+"ms)");
|
System.out.println("Skip error frame.("+(System.currentTimeMillis()-startTime)+"ms)");
|
||||||
}
|
}
|
||||||
@ -325,11 +340,11 @@ public class Guardian {
|
|||||||
System.out.println(" "+cr3);
|
System.out.println(" "+cr3);
|
||||||
System.out.println(" "+cr4);
|
System.out.println(" "+cr4);
|
||||||
System.out.println(" "+cr5);
|
System.out.println(" "+cr5);
|
||||||
return cr.getAllRange(120,170,75,130,150,210)&&
|
return cr.getAllRange(115,170,60,130,150,210)&&
|
||||||
cr2.getAllRange(50,150,75,150,100,200)&&
|
cr2.getAllRange(40,150,75,150,100,200)&&
|
||||||
cr3.getAllRange(50,170,150,240,100,170)&&
|
cr3.getAllRange(50,170,150,240,60,170)&&
|
||||||
cr4.getAllRange(100,160,140,200,140,200)&&
|
cr4.getAllRange(95,160,135,200,140,200)&&
|
||||||
cr5.getAllRange(150,220,150,220,100,180);
|
cr5.getAllRange(150,220,150,220,80,180);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean OnResultsScreen(BufferedImage img) {
|
private static boolean OnResultsScreen(BufferedImage img) {
|
||||||
|
BIN
DivaBotGuardian/typeface.png
Normal file
BIN
DivaBotGuardian/typeface.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
DivaBotGuardian/typeface2.png
Normal file
BIN
DivaBotGuardian/typeface2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
DivaBotGuardian/typeface3.png
Normal file
BIN
DivaBotGuardian/typeface3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
DivaBotGuardian/typeface4.png
Normal file
BIN
DivaBotGuardian/typeface4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
DivaBotGuardian/typeface5.png
Normal file
BIN
DivaBotGuardian/typeface5.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user