Browse Source

Add Some comments on header of the class to help someone to know the

purpose of them
tags/release-v1.0
Schoumi 3 years ago
parent
commit
41d60365ec
22 changed files with 70 additions and 6 deletions
  1. 5
    0
      app/src/main/java/fr/mobdev/lpcprog/activity/MainActivity.java
  2. 4
    1
      app/src/main/java/fr/mobdev/lpcprog/adapters/BinariesAdapter.java
  3. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/adapters/DeviceAdapter.java
  4. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/adapters/PartsAdapter.java
  5. 4
    0
      app/src/main/java/fr/mobdev/lpcprog/adapters/ServerAdapter.java
  6. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/fragment/AddPartFragment.java
  7. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/fragment/DeviceFragment.java
  8. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/fragment/PartsFragment.java
  9. 2
    2
      app/src/main/java/fr/mobdev/lpcprog/fragment/ServersFragment.java
  10. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/fragment/USBListFragment.java
  11. 4
    0
      app/src/main/java/fr/mobdev/lpcprog/listener/DownloadListener.java
  12. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/listener/FlashListener.java
  13. 3
    1
      app/src/main/java/fr/mobdev/lpcprog/listener/NetworkListener.java
  14. 3
    1
      app/src/main/java/fr/mobdev/lpcprog/listener/ServerListener.java
  15. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/managers/DatabaseManager.java
  16. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/managers/IspManager.java
  17. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/managers/NetworkManager.java
  18. 3
    1
      app/src/main/java/fr/mobdev/lpcprog/managers/UsbCommManager.java
  19. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/objects/Binary.java
  20. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/objects/Part.java
  21. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/objects/Server.java
  22. 3
    0
      app/src/main/java/fr/mobdev/lpcprog/objects/USBDevice.java

+ 5
- 0
app/src/main/java/fr/mobdev/lpcprog/activity/MainActivity.java View File

@@ -46,6 +46,11 @@ import fr.mobdev.lpcprog.fragment.USBListFragment;
import fr.mobdev.lpcprog.listener.ServerListener;
import fr.mobdev.lpcprog.objects.USBDevice;

/*
The only activity of the app. It Handle all change of fragment depending on user actions
the Menu change with fragment
*/

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener,
USBListFragment.USBInteractionListener,
AddPartFragment.OnAddInteractionListener

+ 4
- 1
app/src/main/java/fr/mobdev/lpcprog/adapters/BinariesAdapter.java View File

@@ -43,7 +43,10 @@ import fr.mobdev.lpcprog.managers.IspManager;
import fr.mobdev.lpcprog.managers.NetworkManager;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;

/*
Adapter that handle Binaries List. Binaries are in sections depending on servers. There's only
one list, the class handle sections and items in the adapter
*/
public class BinariesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private static final int SECTION = 0;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/adapters/DeviceAdapter.java View File

@@ -30,6 +30,9 @@ import java.util.List;
import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.objects.USBDevice;

/*
Adapter use to display devices pluggued on the device through OTG
*/
public class DeviceAdapter extends RecyclerView.Adapter<DeviceHolder> {

private List<USBDevice> devices;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/adapters/PartsAdapter.java View File

@@ -34,6 +34,9 @@ import fr.mobdev.lpcprog.fragment.PartsFragment;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;

/*
Adapter use to display list of µc definitions
*/
public class PartsAdapter extends RecyclerView.Adapter<PartHolder>{

private List<Part> parts;

+ 4
- 0
app/src/main/java/fr/mobdev/lpcprog/adapters/ServerAdapter.java View File

@@ -34,6 +34,10 @@ import fr.mobdev.lpcprog.listener.ServerListener;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Server;

/*
Adapter use to display servers in different sections
*/

public class ServerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private static final int SECTION = 0;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/fragment/AddPartFragment.java View File

@@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;

/*
Fragment that Handle add µC definitions to the Database
*/
public class AddPartFragment extends Fragment {

private Part part;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/fragment/DeviceFragment.java View File

@@ -48,6 +48,9 @@ import fr.mobdev.lpcprog.objects.Server;
import fr.mobdev.lpcprog.objects.USBDevice;
import fr.mobdev.lpcprog.managers.UsbCommManager;

/*
Fragment that handle action on a specific device that can be flash with some Binaries
*/
public class DeviceFragment extends Fragment {

private UsbCommManager comm;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/fragment/PartsFragment.java View File

@@ -33,6 +33,9 @@ import fr.mobdev.lpcprog.adapters.PartsAdapter;
import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Part;

/*
Fragment that display list of different µC definitions
*/
public class PartsFragment extends Fragment {

private OnEditPressListener onEditListener;

+ 2
- 2
app/src/main/java/fr/mobdev/lpcprog/fragment/ServersFragment.java View File

@@ -36,8 +36,8 @@ import fr.mobdev.lpcprog.managers.DatabaseManager;
import fr.mobdev.lpcprog.objects.Server;

/*
* Activity that allow user to manage the server where he want to upload his images. Server must contains a Binaries file to work with the app
*/
Fragment that allow user to manage the server where he want to upload his images. Server must contains a Binaries file to work with the app
*/
public class ServersFragment extends Fragment {

private ServerListener serverListener;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/fragment/USBListFragment.java View File

@@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.R;
import fr.mobdev.lpcprog.objects.USBDevice;
import fr.mobdev.lpcprog.managers.UsbCommManager;

/*
Fragment use to display USB device plugged through OTG port
*/
public class USBListFragment extends Fragment {

private List<USBDevice> devices;

+ 4
- 0
app/src/main/java/fr/mobdev/lpcprog/listener/DownloadListener.java View File

@@ -23,6 +23,10 @@ import java.util.EventListener;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;

/*
Listener that handle events during download Binary
*/

public interface DownloadListener extends EventListener {
void downloadCanceled(Server server, Binary binary);
void downloadSuccessful(Server server, Binary binary);

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/listener/FlashListener.java View File

@@ -22,6 +22,9 @@ import android.widget.ImageView;

import java.util.EventListener;

/*
Listener that handle ISPManager events
*/
public interface FlashListener extends EventListener{
void onStartFlash();
void onSuccess();

+ 3
- 1
app/src/main/java/fr/mobdev/lpcprog/listener/NetworkListener.java View File

@@ -21,7 +21,9 @@ package fr.mobdev.lpcprog.listener;
import java.util.EventListener;

import fr.mobdev.lpcprog.objects.Server;

/*
Listener working with the NetworkManager to handle events
*/
public interface NetworkListener extends EventListener{
void startBinaries();
void startServer(Server server);

+ 3
- 1
app/src/main/java/fr/mobdev/lpcprog/listener/ServerListener.java View File

@@ -19,7 +19,9 @@
package fr.mobdev.lpcprog.listener;

import java.util.EventListener;

/*
Listener that handle server add/delete
*/
public interface ServerListener extends EventListener {
void updateServerList();
}

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/managers/DatabaseManager.java View File

@@ -32,6 +32,9 @@ import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Part;
import fr.mobdev.lpcprog.objects.Server;

/*
Singleton use to manage all database access
*/
public class DatabaseManager extends SQLiteOpenHelper {

private static DatabaseManager instance;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/managers/IspManager.java View File

@@ -36,6 +36,9 @@ import fr.mobdev.lpcprog.objects.Part;
import fr.mobdev.lpcprog.objects.Server;
import fr.mobdev.lpcprog.objects.USBDevice;

/*
Singleton that handle all ISP functions
*/
public class IspManager {

//defines

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/managers/NetworkManager.java View File

@@ -41,6 +41,9 @@ import fr.mobdev.lpcprog.listener.NetworkListener;
import fr.mobdev.lpcprog.objects.Binary;
import fr.mobdev.lpcprog.objects.Server;

/*
Singleton that handle all network connection
*/
public class NetworkManager {

private NetworkListener listener;

+ 3
- 1
app/src/main/java/fr/mobdev/lpcprog/managers/UsbCommManager.java View File

@@ -26,7 +26,9 @@ import java.util.ArrayList;
import java.util.List;

import fr.mobdev.lpcprog.objects.USBDevice;

/*
Manager use to manage usb devices
*/
public class UsbCommManager {

private static UsbCommManager instance = null;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/objects/Binary.java View File

@@ -18,6 +18,9 @@

package fr.mobdev.lpcprog.objects;

/*
Object that represent a binary for the app
*/
public class Binary {
public long id;
public String name;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/objects/Part.java View File

@@ -18,6 +18,9 @@

package fr.mobdev.lpcprog.objects;

/*
Object that represent µC definition for the app
*/
public class Part {
public long id;
public long part_id;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/objects/Server.java View File

@@ -22,6 +22,9 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;

/*
Object that represent Server for the app
*/
public class Server {
public long id;
public URL url;

+ 3
- 0
app/src/main/java/fr/mobdev/lpcprog/objects/USBDevice.java View File

@@ -20,6 +20,9 @@ package fr.mobdev.lpcprog.objects;

import com.ftdi.j2xx.FT_Device;

/*
Object that represent USBDevice as seen by the app
*/
public class USBDevice {
public int PID;
public int VID;

Loading…
Cancel
Save