added authors
This commit is contained in:
parent
de91af9717
commit
2309315715
@ -42,6 +42,10 @@ import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||
|
||||
/**
|
||||
* The {@link MainActivity} of the application.
|
||||
* @author Marius Brölemann & Paul Lödige
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
/** permission code for the storage permisson.*/
|
||||
private static final int STORAGE_PERMISSION_CODE = 42;
|
||||
|
@ -29,6 +29,7 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Class that handles communication with the raspberry pi.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public class Communicator {
|
||||
|
||||
|
@ -20,6 +20,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Custom {@link Request} to send xml files to the raspberry pi.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public class FileOutputVolleyRequest extends Request<JSONObject> {
|
||||
|
||||
|
@ -10,6 +10,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Custom {@link Request} to enable recieving files from the raspberry pi.
|
||||
* Credit: https://mobikul.com/downloading-files-using-volley/
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public class InputStreamVolleyRequest extends Request<byte[]> {
|
||||
|
||||
|
@ -12,7 +12,10 @@ import com.example.aped.R;
|
||||
import com.example.aped.ui.visualization.MainListViewAdapter;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Fragment for displaying all the current data available.
|
||||
* @author Marius Brölemann
|
||||
*/
|
||||
public class AllIOsFragment extends Fragment {
|
||||
/** Include the MainActivity.*/
|
||||
private MainActivity mainActivity;
|
||||
|
@ -13,6 +13,10 @@ import com.example.aped.MainActivity;
|
||||
import com.example.aped.R;
|
||||
import com.example.aped.ui.visualization.MainListViewAdapter;
|
||||
|
||||
/**
|
||||
* Fragment for displaying the data chosen by the user.
|
||||
* @author Marius Brölemann
|
||||
*/
|
||||
public class FavoriteIOsFragment extends Fragment {
|
||||
/** Include the MainActivity.*/
|
||||
private MainActivity mainActivity;
|
||||
|
@ -22,6 +22,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Fragment for displaying the buffered data.
|
||||
* @author Marius Brölemann & Paul Lödige
|
||||
*/
|
||||
public class PlotFragment extends Fragment {
|
||||
|
||||
/** Include the MainActivity.*/
|
||||
|
@ -12,7 +12,10 @@ import com.example.aped.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* List View Adapter for the Main List View.
|
||||
* @author Marius Brölemann
|
||||
*/
|
||||
public class MainListViewAdapter extends BaseAdapter {
|
||||
/** Include the MainActivity.*/
|
||||
private MainActivity mainActivity;
|
||||
|
@ -15,6 +15,10 @@ import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Linear Layout for displaying single GPIO pin information.
|
||||
* @author Marius Brölemann
|
||||
*/
|
||||
public class PinView {
|
||||
/** Include the MainActivity.*/
|
||||
private MainActivity mainActivity;
|
||||
|
@ -18,6 +18,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* handles the read and write operations for the configuration file.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public class ConfigurationHandler implements IFAVORITES {
|
||||
|
||||
|
@ -8,6 +8,7 @@ import java.io.FileNotFoundException;
|
||||
|
||||
/**
|
||||
* Utility for getting information related to the external storage.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public final class ExternalStorageHandler {
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface for managing the favorites.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public interface IFAVORITES {
|
||||
|
||||
|
@ -3,6 +3,10 @@ package com.example.aped.utils;
|
||||
import java.util.Dictionary;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface for accessing the configurations from the XML files.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public interface IXML {
|
||||
|
||||
/**
|
||||
|
@ -14,10 +14,17 @@ import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit Test for the {@link XMLHandler}.
|
||||
* @author Paul Lödige
|
||||
*/
|
||||
public class XMLHandlerUnitTest {
|
||||
private String xmlPath="src/main/assets/XML/Test.xml";
|
||||
private File xmlFile = new File(xmlPath);
|
||||
|
||||
/**
|
||||
* Test to test the test xml file for validity.
|
||||
*/
|
||||
@Test
|
||||
public void TestFiles_AreValid(){
|
||||
try{
|
||||
@ -28,6 +35,9 @@ public class XMLHandlerUnitTest {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for reading the device names from the test xml file.
|
||||
*/
|
||||
@Test
|
||||
public void Test_getDeviceNames(){
|
||||
XMLHandler xmlHandler = new XMLHandler(xmlFile);
|
||||
@ -35,6 +45,9 @@ public class XMLHandlerUnitTest {
|
||||
assertArrayEquals(new String[]{"example","PWM_example","sensorarray"},deviceNames.toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for reading the port info for the example device.
|
||||
*/
|
||||
@Test
|
||||
public void TestInput_SimplePort(){
|
||||
XMLHandler xmlHandler = new XMLHandler(xmlFile);
|
||||
@ -42,6 +55,9 @@ public class XMLHandlerUnitTest {
|
||||
assertEquals("{pins=[GPIO_2], frequency=, protocol=DI}",port.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for reading the port info for the sensorarray device.
|
||||
*/
|
||||
@Test
|
||||
public void TestInput_ComplexPort(){
|
||||
XMLHandler xmlHandler = new XMLHandler(xmlFile);
|
||||
@ -49,6 +65,9 @@ public class XMLHandlerUnitTest {
|
||||
assertEquals("{pins=[GPIO_3, GPIO_4, GPIO_5, GPIO_6], frequency=, protocol=DI}",port.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for reading the buffer size for the PWM_example device.
|
||||
*/
|
||||
@Test
|
||||
public void TestInput_BufferSize(){
|
||||
XMLHandler xmlHandler = new XMLHandler(xmlFile);
|
||||
@ -56,6 +75,9 @@ public class XMLHandlerUnitTest {
|
||||
assertEquals(1000,bufferSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for reading the buffer size for the example device.
|
||||
*/
|
||||
@Test
|
||||
public void TestInput_NoBufferSize(){
|
||||
XMLHandler xmlHandler = new XMLHandler(xmlFile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user