Skip to content

Commit

Permalink
dataAjustada
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSirtoriCorrea committed Jun 20, 2020
1 parent d8d914d commit 0ba00ea
Show file tree
Hide file tree
Showing 39 changed files with 50 additions and 48 deletions.
16 changes: 11 additions & 5 deletions Dump Banco de Dados/DumpSextaFeiraDataBase.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CREATE DATABASE IF NOT EXISTS `sextafeiradatabase` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `sextafeiradatabase`;
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: localhost Database: sextafeiradatabase
Expand Down Expand Up @@ -28,7 +30,7 @@ CREATE TABLE `device` (
`DeviceDescription` text,
`DeviceJson` text,
PRIMARY KEY (`DeviceID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand All @@ -37,6 +39,7 @@ CREATE TABLE `device` (

LOCK TABLES `device` WRITE;
/*!40000 ALTER TABLE `device` DISABLE KEYS */;
INSERT INTO `device` VALUES (1,'Device','Description','Json'),(2,'newDevice','newDevice','newDevice'),(3,'newDevice','newDevice','newDevice');
/*!40000 ALTER TABLE `device` ENABLE KEYS */;
UNLOCK TABLES;

Expand All @@ -55,7 +58,7 @@ CREATE TABLE `homeworkmanagement` (
`HomeWorkDelivery` date DEFAULT NULL,
`HomeWorkDescription` text,
PRIMARY KEY (`HomeWorkID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand All @@ -64,6 +67,7 @@ CREATE TABLE `homeworkmanagement` (

LOCK TABLES `homeworkmanagement` WRITE;
/*!40000 ALTER TABLE `homeworkmanagement` DISABLE KEYS */;
INSERT INTO `homeworkmanagement` VALUES (1,'Type','subject','homework','2020-06-02','desc'),(2,'newHomeWork','newHomeWork','newHomeWork','2020-06-02','newHomeWork');
/*!40000 ALTER TABLE `homeworkmanagement` ENABLE KEYS */;
UNLOCK TABLES;

Expand All @@ -84,7 +88,7 @@ CREATE TABLE `interactions` (
`Response3` text,
`Command` varchar(30) DEFAULT NULL,
PRIMARY KEY (`InteractionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand All @@ -93,6 +97,7 @@ CREATE TABLE `interactions` (

LOCK TABLES `interactions` WRITE;
/*!40000 ALTER TABLE `interactions` DISABLE KEYS */;
INSERT INTO `interactions` VALUES (1,'ola','ola','ola','olá chefe','olá chefe','olá chefe',''),(2,'horas','sao','sao','','','','dateTime'),(3,'fech','tabela','tabela','','','','sendCloseToInterface'),(4,'mostr','interacoes','interacoes','Atualmente essas são as interações contidas no meu banco de dados','Essas são todas as interações contidas no meu banco de dados','Aqui estão as interações contidas no meu banco de dados','sendInteractionsToInterface'),(5,'mostr','tarefa','tarefa','Essas são todas as suas tarefas pendentes','Aqui estão as suas tarefas pendentes','Atualmente essas são suas tarefas pendentes','sendHomeWorksToInterface'),(6,'mostr','projeto','projeto','Esses são todos os projetos em andamento','Aqui estão os projetos em desenvolvimento','Atualmente esse são os projetos em desenvolvimento','sendProjectsToInterface'),(7,'mostr','device','device','Esses são os devices sincronizados','Aqui estão os devices sincronizados','Atualmente esse são os devices sincronizados com o meu sistema','sendDevicesToInterface'),(8,'fech','image','image','','','','sendCloseToInterface'),(9,'mostr','tabela','periodica','tabela periodica aberta','tabela periodica aberta','tabela periodica aberta','sendPeriodicTableToInterface'),(10,'mostr','mapa','brasil politico','Esse é o mapa político do Brasil','Esse é o mapa político do Brasil','Esse é o mapa político do Brasil','sendPoliticalBrazilToInterface');
/*!40000 ALTER TABLE `interactions` ENABLE KEYS */;
UNLOCK TABLES;

Expand All @@ -108,7 +113,7 @@ CREATE TABLE `projects` (
`ProjectName` varchar(60) DEFAULT NULL,
`ProjectLanguages` varchar(30) DEFAULT NULL,
PRIMARY KEY (`ProjectID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand All @@ -117,6 +122,7 @@ CREATE TABLE `projects` (

LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
INSERT INTO `projects` VALUES (1,'Project','language'),(2,'NewProject','Python');
/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
Expand All @@ -129,4 +135,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2020-05-31 21:53:52
-- Dump completed on 2020-06-19 21:00:51
Binary file added Images/BackgroundFriday.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 Images/Brasil Político.jpg
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 Images/Equações Dinamica.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 Images/Mapa Mundi vegetação.jpg
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 Images/Mapa Mundi.jpg
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 Images/TabelaSenoCossenoTangente.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 Images/diagrama-de-pauling.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,7 @@ private void connectionLoop() {
case 1:

if (!tableView.getColumns().contains(commandColumn)) {

/*for (int c = 0; c < response.size(); c++) {
arrayResponse = (JSONArray) response.get(Integer.toString(c));
tableViewData.add(arrayResponse);
}
System.out.println(tableViewData.getClass().getName());
tableView.setItems(tableViewData);*/
imageView.setVisible(false);
setTableData("getInteractions");

addInteractionsColumns();
Expand All @@ -145,22 +139,15 @@ private void connectionLoop() {

case 2:
if (!tableView.getColumns().contains(homeWorkColumn)) {
imageView.setVisible(false);
setTableData("getHomeWorks");
addHomeWorksColumns();
}
break;

case 3:
if (!tableView.getColumns().contains(projectColumn)) {
/*response = (JSONObject) connection.receive("getDevicesJsons");
for (int c = 0; c < response.size(); c++) {
arrayResponse = (JSONArray) response.get(Integer.toString(c));
tableViewData.add(arrayResponse);
System.out.println(arrayResponse);
}
tableView.setItems(tableViewData);
System.out.println("TableView dados >>> " + tableView.getItems());*/
imageView.setVisible(false);
setTableData("getProjects");
addProjectsColumns();
}
Expand All @@ -169,15 +156,7 @@ private void connectionLoop() {
case 4:

if (!tableView.getColumns().contains(DeviceColumn)) {
/*response = (JSONObject) connection.receive("getDevicesJsons");
for (int c = 0; c < response.size(); c++) {
arrayResponse = (JSONArray) response.get(Integer.toString(c));
tableViewData.add(arrayResponse);
System.out.println(arrayResponse);
}
tableView.setItems(tableViewData);
System.out.println("TableView dados >>> " + tableView.getItems());*/
imageView.setVisible(false);
setTableData("getDevicesJsons");

addDevicesColumns();
Expand All @@ -187,14 +166,16 @@ private void connectionLoop() {
break;

case 5:
tableView.setVisible(false);

imagePath = response.get("url").toString();
System.out.println(imagePath);
imageFile = new File(imagePath);
image = new Image(imageFile.toURI().toString());
imageView.setImage(image);

imageView.setVisible(true);


default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ public class MainApp extends Application {

@Override
public void start(Stage stage) throws Exception {

Runtime.getRuntime().exec("cmd.exe /c start E:\\Sexta-Feira-Mark_6\\Sexta-Feira(A.I.)\\Sexta-Feira(A.I.).py");

Parent root = FXMLLoader.load(getClass().getResource("/fxml/Scene.fxml"));

Scene scene = new Scene(root);
scene.getStylesheets().add("/styles/Styles.css");

stage.setTitle("Sexta-Feira");
stage.setScene(scene);

//Runtime.getRuntime().exec("cmd.exe /c start E:\\Sexta-Feira-Mark_6\\Sexta-Feira(A.I.)\\Sexta-Feira(A.I.).py");

stage.show();
stage.setFullScreen(true);

Expand Down
4 changes: 2 additions & 2 deletions Interface/Interface/src/main/resources/fxml/Scene.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<Font name="Impact" size="55.0" />
</font>
</Label>
<TableView fx:id="tableView" editable="true" layoutX="72.0" layoutY="163.0" prefHeight="518.0" prefWidth="1139.0" visible="false" AnchorPane.leftAnchor="72.0" AnchorPane.topAnchor="163.0">
<TableView fx:id="tableView" editable="true" layoutX="72.0" layoutY="163.0" prefHeight="586.0" prefWidth="1141.0" visible="false" AnchorPane.bottomAnchor="-66.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="-11.0" AnchorPane.topAnchor="200.0">
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy></TableView>
<ImageView fx:id="imageView" fitHeight="529.0" fitWidth="819.0" layoutX="223.0" layoutY="147.0" pickOnBounds="true" preserveRatio="true" visible="false" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="223.0" AnchorPane.rightAnchor="238.0" AnchorPane.topAnchor="147.0" />
<ImageView fx:id="imageView" fitHeight="529.0" fitWidth="819.0" layoutX="223.0" layoutY="147.0" nodeOrientation="INHERIT" pickOnBounds="true" visible="false" AnchorPane.bottomAnchor="-66.0" AnchorPane.leftAnchor="290.0" AnchorPane.rightAnchor="-11.0" AnchorPane.topAnchor="200.0" />
</children>
</AnchorPane>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Interface/Interface/target/classes/FridayInterface/MainApp.class
Binary file not shown.
4 changes: 2 additions & 2 deletions Interface/Interface/target/classes/fxml/Scene.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<Font name="Impact" size="55.0" />
</font>
</Label>
<TableView fx:id="tableView" editable="true" layoutX="72.0" layoutY="163.0" prefHeight="518.0" prefWidth="1139.0" visible="false" AnchorPane.leftAnchor="72.0" AnchorPane.topAnchor="163.0">
<TableView fx:id="tableView" editable="true" layoutX="72.0" layoutY="163.0" prefHeight="586.0" prefWidth="1141.0" visible="false" AnchorPane.bottomAnchor="-66.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="-11.0" AnchorPane.topAnchor="200.0">
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy></TableView>
<ImageView fx:id="imageView" fitHeight="529.0" fitWidth="819.0" layoutX="223.0" layoutY="147.0" pickOnBounds="true" preserveRatio="true" visible="false" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="223.0" AnchorPane.rightAnchor="238.0" AnchorPane.topAnchor="147.0" />
<ImageView fx:id="imageView" fitHeight="529.0" fitWidth="819.0" layoutX="223.0" layoutY="147.0" nodeOrientation="INHERIT" pickOnBounds="true" visible="false" AnchorPane.bottomAnchor="-66.0" AnchorPane.leftAnchor="290.0" AnchorPane.rightAnchor="-11.0" AnchorPane.topAnchor="200.0" />
</children>
</AnchorPane>
4 changes: 2 additions & 2 deletions Server/DevicesStatus.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Interface": {
"action": 2,
"url": ".com"
"action": 5,
"url": "E:\\Sexta-Feira-Mark_6\\Images\\Equa\u00e7\u00f5es Dinamica.png"
},
"Friday": {
"action": 0,
Expand Down
18 changes: 11 additions & 7 deletions Server/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

print('---SERVER STARTED---')

def convertList(dataBaseList):
def convertList(dataBaseList):
indexes = list()

for deviceIndex in range(0, len(dataBaseList)):
Expand Down Expand Up @@ -80,15 +80,19 @@ def handle(self):
self.request.send(json.dumps(projects).encode())

elif clientRequest['request'] == 'getHomeWorks':
homeWork = convertList(dataBaseConnection.getHomeWorks())
listHomeWorks = list()
dataBaseHomeWorks = dataBaseConnection.getHomeWorks()

#for date in range(0, len(homeWork) - 1):
# homeWork[date][4] = datetime.strftime(homeWork[date][4])

for homeWork in dataBaseHomeWorks:
homeWork = list(homeWork)
date = datetime.strftime(homeWork[4], '%d/%m/%Y')
homeWork[4] = date

print(homeWork)
listHomeWorks.append(homeWork)

self.request.send(json.dumps(homeWork).encode())
homeWorkconverted = convertList(listHomeWorks)

self.request.send(json.dumps(homeWorkconverted).encode())

elif clientRequest['request'] == 'getInteractionsHeader':
header = convertHeader(dataBaseConnection.getInteractionsHeader())
Expand Down
12 changes: 12 additions & 0 deletions Sexta-Feira(A.I.)/Commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ def sendDevicesToInterface(speech, connection):
def sendPeriodicTableToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 5, 'E:\\Sexta-Feira-Mark_6\\Images\\TabelaPeriodica.jpg'))

def sendPoliticalBrazilToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 5, 'E:\\Sexta-Feira-Mark_6\\Images\\Brasil Político.jpg'))

def sendEletronicDestToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 5, 'E:\\Sexta-Feira-Mark_6\\Images\\diagrama-de-pauling.jpg'))

def sendAnglesTableToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 5, 'E:\\Sexta-Feira-Mark_6\\Images\\TabelaSenoCossenoTangente.png'))

def sendFisicEquationsToInterface(speech, connection):
connection.send(Functions.setRequestJson('setDevicesStatus', 'Interface', 5, 'E:\\Sexta-Feira-Mark_6\\Images\\Equações Dinamica.png'))

Binary file modified Sexta-Feira(A.I.)/__pycache__/Commands.cpython-36.pyc
Binary file not shown.

0 comments on commit 0ba00ea

Please sign in to comment.