Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
merge mentorsandbox->master
Browse files Browse the repository at this point in the history
Former-commit-id: 07d3d95e9209ad8ac845e4d3ca4b8c020840c7a0
Former-commit-id: 02abcb6
  • Loading branch information
rgatkinson committed Oct 3, 2015
2 parents 3b1dc79 + fc43714 commit 98971a1
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 92 deletions.
2 changes: 1 addition & 1 deletion FtcRobotController/FtcRobotController.iml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
Expand Down Expand Up @@ -95,7 +96,6 @@
<orderEntry type="library" exported="" name="android-support-v4" level="project" />
<orderEntry type="library" exported="" name="Hardware-release-" level="project" />
<orderEntry type="library" exported="" name="FtcCommon-release-" level="project" />
<orderEntry type="module" module-name="YourCodeHere" exported="" />
<orderEntry type="module" module-name="SwerveRoboticsLibrary" exported="" />
</component>
</module>
3 changes: 1 addition & 2 deletions FtcRobotController/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'

android {
compileSdkVersion = 'Google Inc.:Google APIs:19'
Expand Down Expand Up @@ -46,5 +46,4 @@ dependencies {
compile (name:'Analytics-release', ext:'aar')
compile (name:'WirelessP2p-release', ext:'aar')
compile project(':SwerveRoboticsLibrary')
compile project(':YourCodeHere')
}
30 changes: 0 additions & 30 deletions FtcRobotController/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,46 +45,16 @@
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>

<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
</activity>
<activity
android:name="com.qualcomm.ftccommon.FtcRobotControllerSettingsActivity"
android:label="@string/settings_activity" >
</activity>
<service
android:name="com.qualcomm.ftccommon.FtcRobotControllerService"
android:enabled="true" />
<activity
android:name="com.qualcomm.ftccommon.configuration.FtcLoadFileActivity"
android:label="@string/configure_activity"
tools:replace="android:label">
</activity>
<activity
android:name="com.qualcomm.ftccommon.FtcWifiChannelSelectorActivity"
android:label="@string/title_activity_wifi_channel_selector"
tools:replace="android:label">
</activity>
<activity
android:name="com.qualcomm.ftccommon.ConfigWifiDirectActivity"
android:label="@string/title_activity_config_wifi_direct" />
<activity
android:name="com.qualcomm.ftccommon.ViewLogsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_view_logs"
tools:replace="android:label">
<intent-filter>
<action android:name="com.qualcomm.ftcrobotcontroller.VIEW_LOGS"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ public class FtcRobotControllerActivity extends Activity {
protected TextView textDeviceName;
protected TextView textWifiDirectStatus;
protected TextView textRobotStatus;
protected TextView textWifiDirectPassphrase;
protected TextView[] textGamepad = new TextView[NUM_GAMEPADS];
protected TextView textOpMode;
protected TextView textErrorMessage;
protected ImmersiveMode immersion;

protected UpdateUI updateUI;
protected UpdateUIHook updateUI;
protected Dimmer dimmer;
protected LinearLayout entireScreenLayout;

Expand Down Expand Up @@ -156,18 +157,19 @@ public void onClick(View v) {
textRobotStatus = (TextView) findViewById(R.id.textRobotStatus);
textOpMode = (TextView) findViewById(R.id.textOpMode);
textErrorMessage = (TextView) findViewById(R.id.textErrorMessage);
textWifiDirectPassphrase = (TextView) findViewById(R.id.textWifiDirectPassphrase);
textGamepad[0] = (TextView) findViewById(R.id.textGamepad1);
textGamepad[1] = (TextView) findViewById(R.id.textGamepad2);
immersion = new ImmersiveMode(getWindow().getDecorView());
dimmer = new Dimmer(this);
dimmer.longBright();
Restarter restarter = new RobotRestarter();

updateUI = new UpdateUI(this, dimmer);
updateUI = new UpdateUIHook(this, dimmer);
updateUI.setRestarter(restarter);
updateUI.setTextViews(textWifiDirectStatus, textRobotStatus,
textGamepad, textOpMode, textErrorMessage, textDeviceName);
callback = updateUI.new Callback();
textGamepad, textOpMode, textErrorMessage, textDeviceName);
callback = updateUI.new CallbackHook();

PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
Expand Down Expand Up @@ -386,4 +388,75 @@ public void run() {
}
});
}
}

class UpdateUIHook extends UpdateUI
{
//------------------------------------------------------------------------------------------------
// State
//------------------------------------------------------------------------------------------------

FtcRobotControllerActivity activity;
FtcRobotControllerService controllerService;

//------------------------------------------------------------------------------------------------
// Construction
//------------------------------------------------------------------------------------------------

UpdateUIHook(FtcRobotControllerActivity activity, Dimmer dimmer)
{
super(activity, dimmer);
this.activity = activity;
this.controllerService = null;
}

@Override public void setControllerService(FtcRobotControllerService controllerService)
{
super.setControllerService(controllerService);
this.controllerService = controllerService;
}

//------------------------------------------------------------------------------------------------
// Operations
//------------------------------------------------------------------------------------------------

class CallbackHook extends UpdateUI.Callback
{
@Override public void wifiDirectUpdate(WifiDirectAssistant.Event event)
{
super.wifiDirectUpdate(event);

final String message = controllerService == null
? "" :
String.format("Wifi Direct passphrase: %s", controllerService.getWifiDirectAssistant().getPassphrase());

UpdateUIHook.this.activity.runOnUiThread(new Runnable()
{
@Override public void run()
{
activity.textWifiDirectPassphrase.setText(message);
}
});
}
}
}
}




















Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@
android:text="" />

<TextView
android:id="@+id/textRobotStatus"
android:id="@+id/textWifiDirectPassphrase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@+id/textWifiDirectStatus"
android:text="" />

<TextView
android:id="@+id/textRobotStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textWifiDirectPassphrase"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="" />

Expand Down
2 changes: 1 addition & 1 deletion SwerveRoboticsLibrary/doc/javadoc/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ <h2 class="title">I</h2>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="org/swerverobotics/library/interfaces/II2cDeviceClient.ReadWindow.html#isOkToRead--">isOkToRead()</a></span> - Method in class <a href="org/swerverobotics/library/interfaces/II2cDeviceClient.ReadWindow.html" title="class in org.swerverobotics.library.interfaces">II2cDeviceClient.ReadWindow</a></dt>
<dd>
<div class="block">Answers as to whether we're allowed to read using this window</div>
<div class="block">Answers as to whether we're allowed to read using this window.</div>
</dd>
<dt><span class="memberNameLink"><a href="org/swerverobotics/library/SynchronousOpMode.html#isStarted--">isStarted()</a></span> - Method in class <a href="org/swerverobotics/library/SynchronousOpMode.html" title="class in org.swerverobotics.library">SynchronousOpMode</a></dt>
<dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ <h4>group</h4>
<div class="block">Optionally indicates a group of other OpModes with which the annotated
OpMode should be sorted on the driver station OpMode list.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the group into which the annotated OpMode is to be categorized</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h3>Method Summary</h3>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.ReadWindow.html#isOkToRead--">isOkToRead</a></span>()</code>
<div class="block">Answers as to whether we're allowed to read using this window</div>
<div class="block">Answers as to whether we're allowed to read using this window.</div>
</td>
</tr>
<tr id="i10" class="altColor">
Expand Down Expand Up @@ -325,6 +325,10 @@ <h3>Method Detail</h3>
<h4>getIregFirst</h4>
<pre>public&nbsp;int&nbsp;getIregFirst()</pre>
<div class="block">Returns the first register in the window</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the first register in the window</dd>
</dl>
</li>
</ul>
<a name="getIregMax--">
Expand All @@ -335,6 +339,10 @@ <h4>getIregFirst</h4>
<h4>getIregMax</h4>
<pre>public&nbsp;int&nbsp;getIregMax()</pre>
<div class="block">Returns the first register NOT in the window</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the first register NOT in the window</dd>
</dl>
</li>
</ul>
<a name="getCreg--">
Expand All @@ -345,6 +353,10 @@ <h4>getIregMax</h4>
<h4>getCreg</h4>
<pre>public&nbsp;int&nbsp;getCreg()</pre>
<div class="block">Returns the number of registers in the window</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of registers in the window</dd>
</dl>
</li>
</ul>
<a name="getReadMode--">
Expand All @@ -355,6 +367,10 @@ <h4>getCreg</h4>
<h4>getReadMode</h4>
<pre>public&nbsp;<a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.READ_MODE.html" title="enum in org.swerverobotics.library.interfaces">II2cDeviceClient.READ_MODE</a>&nbsp;getReadMode()</pre>
<div class="block">Returns the mode of the window</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the mode of the window</dd>
</dl>
</li>
</ul>
<a name="getReadIssued--">
Expand All @@ -365,6 +381,10 @@ <h4>getReadMode</h4>
<h4>getReadIssued</h4>
<pre>public&nbsp;boolean&nbsp;getReadIssued()</pre>
<div class="block">Returns whether a read has ever been issued for this window or not</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether a read has ever been issued for this window or not</dd>
</dl>
</li>
</ul>
<a name="setReadIssued--">
Expand All @@ -384,7 +404,12 @@ <h4>setReadIssued</h4>
<li class="blockList">
<h4>isOkToRead</h4>
<pre>public&nbsp;boolean&nbsp;isOkToRead()</pre>
<div class="block">Answers as to whether we're allowed to read using this window</div>
<div class="block">Answers as to whether we're allowed to read using this window. This will return
false for ONLY_ONCE windows after <a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.ReadWindow.html#setReadIssued--"><code>setReadIssued()</code></a> has been called on them.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether it is permitted to perform a read for this window.</dd>
</dl>
</li>
</ul>
<a name="freshCopy--">
Expand All @@ -406,6 +431,12 @@ <h4>sameAsIncludingMode</h4>
<pre>public&nbsp;boolean&nbsp;sameAsIncludingMode(<a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.ReadWindow.html" title="class in org.swerverobotics.library.interfaces">II2cDeviceClient.ReadWindow</a>&nbsp;him)</pre>
<div class="block">Do the receiver and the indicated register window cover exactly the
same set of registers and have the same modality?</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>him</code> - the other window to compare to</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the result of the comparison</dd>
</dl>
</li>
</ul>
<a name="contains-org.swerverobotics.library.interfaces.II2cDeviceClient.ReadWindow-">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ <h4>group</h4>
<div class="block">Optionally indicates a group of other OpModes with which the annotated
OpMode should be sorted on the driver station OpMode list.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the group into which the annotated OpMode is to be categorized</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,24 @@ <h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<h2 title="Annotation Type Hierarchy">Annotation Type Hierarchy</h2>
<ul>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/Autonomous.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">Autonomous</span></a> (implements java.lang.annotation.Annotation)</li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/Disabled.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">Disabled</span></a> (implements java.lang.annotation.Annotation)</li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/OpModeRegistrar.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">OpModeRegistrar</span></a> (implements java.lang.annotation.Annotation)</li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/TeleOp.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">TeleOp</span></a> (implements java.lang.annotation.Annotation)</li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/OpModeRegistrar.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">OpModeRegistrar</span></a> (implements java.lang.annotation.Annotation)</li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/Disabled.html" title="annotation in org.swerverobotics.library.interfaces"><span class="typeNameLink">Disabled</span></a> (implements java.lang.annotation.Annotation)</li>
</ul>
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">java.lang.Enum&lt;E&gt; (implements java.lang.Comparable&lt;T&gt;, java.io.Serializable)
<ul>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.REGISTER.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.REGISTER</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.ANGLEUNIT.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.ANGLEUNIT</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.PITCHMODE.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.PITCHMODE</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.READ_MODE.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">II2cDeviceClient.READ_MODE</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.I2CADDR.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.I2CADDR</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.ACCELUNIT.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.ACCELUNIT</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.REGISTER.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.REGISTER</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.SENSOR_MODE.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.SENSOR_MODE</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.ACCELUNIT.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.ACCELUNIT</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/II2cDeviceClient.READ_MODE.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">II2cDeviceClient.READ_MODE</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.ANGLEUNIT.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.ANGLEUNIT</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.TEMPUNIT.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.TEMPUNIT</span></a></li>
<li type="circle"><a href="../../../../org/swerverobotics/library/interfaces/IBNO055IMU.PITCHMODE.html" title="enum in org.swerverobotics.library.interfaces"><span class="typeNameLink">IBNO055IMU.PITCHMODE</span></a></li>
</ul>
</li>
</ul>
Expand Down
Loading

0 comments on commit 98971a1

Please sign in to comment.