Updated the interfaces and renamed some methods.

This commit is contained in:
2014-04-10 17:57:31 -04:30
parent 06d74a6474
commit e93d227b62
6 changed files with 10 additions and 27 deletions

View File

@@ -18,7 +18,7 @@ package ve.ucv.ciens.ccg.nxtar;
import ve.ucv.ciens.ccg.nxtar.interfaces.CVProcessor;
import ve.ucv.ciens.ccg.nxtar.interfaces.MulticastEnabler;
import ve.ucv.ciens.ccg.nxtar.interfaces.NetworkConnectionListener;
import ve.ucv.ciens.ccg.nxtar.interfaces.Toaster;
import ve.ucv.ciens.ccg.nxtar.interfaces.OSFunctionalityProvider;
import ve.ucv.ciens.ccg.nxtar.network.RobotControlThread;
import ve.ucv.ciens.ccg.nxtar.network.SensorReportThread;
import ve.ucv.ciens.ccg.nxtar.network.ServiceDiscoveryThread;
@@ -95,7 +95,7 @@ public class NxtARCore extends Game implements NetworkConnectionListener{
// Assorted fields.
public SpriteBatch batch;
public CVProcessor cvProc;
private Toaster toaster;
private OSFunctionalityProvider toaster;
// Networking related fields.
private int connections;
@@ -124,7 +124,7 @@ public class NxtARCore extends Game implements NetworkConnectionListener{
super();
connections = 0;
try{
this.toaster = (Toaster)concreteApp;
this.toaster = (OSFunctionalityProvider)concreteApp;
}catch(ClassCastException cc){
Gdx.app.debug(TAG, CLASS_NAME + ".Main() :: concreteApp does not implement the Toaster interface. Toasting disabled.");
this.toaster = null;

View File

@@ -22,5 +22,5 @@ public interface CVProcessor {
// TODO: Add marker location data.
}
public CVData processFrame(byte[] frame, int w, int h);
public CVData findMarkersInFrame(byte[] frame, int w, int h);
}

View File

@@ -1,21 +0,0 @@
/*
* Copyright (C) 2013 Miguel Angel Astor Romero
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ve.ucv.ciens.ccg.nxtar.interfaces;
public interface MulticastEnabler {
public void enableMulticast();
public void disableMulticast();
}

View File

@@ -15,7 +15,9 @@
*/
package ve.ucv.ciens.ccg.nxtar.interfaces;
public interface Toaster {
public interface OSFunctionalityProvider{
public void showShortToast(String msg);
public void showLongToast(String msg);
public void enableMulticast();
public void disableMulticast();
}

View File

@@ -179,7 +179,7 @@ public class InGameState extends BaseState{
fW = frameMonitor.getFrameDimensions().getWidth();
fH = frameMonitor.getFrameDimensions().getHeight();
data = core.cvProc.processFrame(frame, fW, fH);
data = core.cvProc.findMarkersInFrame(frame, fW, fH);
Gdx.app.log(TAG, CLASS_NAME + ".render(): Frame processed.");
/*if(data != null){

View File

@@ -37,6 +37,8 @@ public abstract class ProjectConstants{
public static final String FONT_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
public static final int CALIBRATION_PATTERN_POINTS = 54;
static{
OVERSCAN = Ouya.runningOnOuya ? 0.9f : 1.0f;
}