Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ssc1999 committed Jan 12, 2020
2 parents 2cf21cc + a7d3735 commit 8954b83
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ drones/target/drones-0.4-SNAPSHOT-jar-with-dependencies.jar
drones/target/drones-0.4-SNAPSHOT.jar
logs
dronLoader.json
dronesDataBase.sqlite
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ public void eliminarDatos(int id){

> Jon Ibarreche

- [ ] Investigación
- [X] Investigación

> Jon Ibarreche & Aitor Ruiz

<img aling="center" src="./drones/src/main/resources/login.PNG" width="430px"/>

> Aitor Ruiz

Expand Down Expand Up @@ -249,14 +253,20 @@ public static byte[] getSHA(String input) throws NoSuchAlgorithmException {

> Jon Ibarreche

- [ ] Investigación
- [X] Investigación

> Jon Ibarreche & Aitor Ruiz

<img aling="center" src="./drones/src/main/resources/contro.PNG" width="430px"/>

## Ventana de mapa

> Sergio Salgado

- [ ] Investigación

<img aling="center" src="./drones/src/main/resources/mapaGUI.PNG" width="430px"/>


## Javadoc

Expand Down
42 changes: 25 additions & 17 deletions drones/src/main/java/com/administracion/Login.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public void mouseDragged(MouseEvent e) {
JLabel lblNewLabel_4 = new JLabel("Administracion de drones");
lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_4.setFont(new Font("Tahoma", Font.PLAIN, 18));
lblNewLabel_4.setForeground(new Color(255, 255, 255));
//lblNewLabel_4.setForeground(new Color(255, 255, 255));
lblNewLabel_4.setBounds(63, 295, 260, 16);
panel.add(lblNewLabel_4);

JLabel lblnete = new JLabel("...A la vanguardia a través de la tecnología...");
lblnete.setHorizontalAlignment(SwingConstants.CENTER);
lblnete.setForeground(Color.WHITE);
//lblnete.setForeground(Color.WHITE);
lblnete.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblnete.setBounds(63, 337, 260, 16);
panel.add(lblnete);
Expand Down Expand Up @@ -174,11 +174,15 @@ public void mouseClicked(MouseEvent e) {
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton1ActionPerformed
String usuario = textField_1.getText();
String usuario = textField.getText();
char[] paswdCH = passwordField.getPassword();
char[] paswdCH2 = passwordField_1.getPassword();
String paswd = "";
for (int i = 0; i < paswdCH.length; i++){
paswd = paswd + paswdCH[i];
}String paswd2 = "";
for (int i = 0; i < paswdCH2.length; i++){
paswd2 = paswd2 + paswdCH2[i];
}
UserDB u = new UserDB();
Crypto c = new Crypto();
Expand All @@ -187,20 +191,24 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIR
JOptionPane.showMessageDialog(null, "Algun campo esta vacio");

} else {
ArrayList<HashMap<String, String>> listaUsuarios = u.leerBD();
for (int i = 0; i < listaUsuarios.size(); i++) {
HashMap<String, String> temp = listaUsuarios.get(i);
if (temp.get("user").equals(usuario)) {
//Creado Login con base de datos.
if (temp.get("password").equals(c.StringToCrypto(paswd))) {
// temp.get("idUsuario"); // Recogida de id de usuario para muestra especifia de drones
PanelControl.userOnBoard = temp.get("idUsuario");
JOptionPane.showMessageDialog(null, "Bienvenido");
PanelControl pc = new PanelControl();
pc.setVisible(true);
this.dispose();
} else {
JOptionPane.showConfirmDialog(null, "Su usuario o contraseña es incorrecta");
if(!paswd.equals(paswd2)){
JOptionPane.showMessageDialog(null, "Las contraseñas no coinciden");
}else{
ArrayList<HashMap<String, String>> listaUsuarios = u.leerBD();
for (int i = 0; i < listaUsuarios.size(); i++) {
HashMap<String, String> temp = listaUsuarios.get(i);
if (temp.get("user").equals(usuario)) {
//Creado Login con base de datos.
if (temp.get("password").equals(c.StringToCrypto(paswd))) {
// temp.get("idUsuario"); // Recogida de id de usuario para muestra especifia de drones
PanelControl.userOnBoard = temp.get("idUsuario");
JOptionPane.showMessageDialog(null, "Bienvenido");
PanelControl pc = new PanelControl();
pc.setVisible(true);
this.dispose();
} else {
JOptionPane.showConfirmDialog(null, "Su usuario o contraseña es incorrecta");
}
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion drones/src/main/java/com/administracion/PanelControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import javax.swing.JMenuBar;
import javax.swing.JButton;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

import java.awt.List;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand Down Expand Up @@ -197,6 +199,15 @@ public PanelControl() {
JComboBox<String> dronCombo = new JComboBox<String>();
panel.add(dronCombo);

BackEndAdmin bd = new BackEndAdmin();
ArrayList<HashMap<String, String>> aa = bd.leerBD();
System.out.println(aa.toString());
dronCombo.removeAllItems();
for (int i = 0; i < aa.size(); i++) {
HashMap<String, String> m = aa.get(i);
dronCombo.addItem("dron " + m.get("id") + " " + m.get("cargaDescripcion"));
}

cargarJsoButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Expand All @@ -216,6 +227,7 @@ public void run() {
HashMap<String, String> m = aa.get(i);
dronCombo.addItem("dron " + m.get("id") + " " + m.get("cargaDescripcion"));
}
JOptionPane.showMessageDialog(null, "Exito");
}
}.run();
;
Expand Down Expand Up @@ -260,7 +272,7 @@ public void run() {
HashMap<String, String> mm = a.get(i);
dronCombo.addItem("dron " + mm.get("id") + " " + mm.get("cargaDescripcion"));
}

JOptionPane.showMessageDialog(null, "Exito");
}
}.run();
;
Expand All @@ -284,6 +296,7 @@ public void run() {
HashMap<String, String> m = aa.get(i);
dronCombo.addItem("dron " + m.get("id") + " " + m.get("cargaDescripcion"));
}
JOptionPane.showMessageDialog(null, "Exito");
}
}.run();
;
Expand All @@ -303,6 +316,7 @@ public void run() {
HashMap<String, String> m = aa.get(i);
dronCombo.addItem("dron " + m.get("id") + " " + m.get("cargaDescripcion"));
}
JOptionPane.showMessageDialog(null, "Exito");
}
}.run();
;
Expand Down
Binary file added drones/src/main/resources/contro.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drones/src/main/resources/login.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drones/src/main/resources/mapaGUI.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drones/target/classes/contro.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drones/target/classes/login.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drones/target/classes/mapaGUI.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dronesDataBase.sqlite
Binary file not shown.

0 comments on commit 8954b83

Please sign in to comment.