-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2e7f4d
commit ac758d7
Showing
507 changed files
with
32,193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry exported="true" kind="lib" path="mysql-connector-java-6.0.5.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>EnvController</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.59 KB
EnvController/bin/com/troyforever/env/controller/HumiController.class
Binary file not shown.
Binary file added
BIN
+1.59 KB
EnvController/bin/com/troyforever/env/controller/LightController.class
Binary file not shown.
Binary file added
BIN
+1.59 KB
EnvController/bin/com/troyforever/env/controller/TempController.class
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) | ||
-- | ||
-- Host: localhost Database: environment | ||
-- ------------------------------------------------------ | ||
-- Server version 5.7.13-log | ||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
||
-- | ||
-- Table structure for table `env_base` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `env_base`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!40101 SET character_set_client = utf8 */; | ||
CREATE TABLE `env_base` ( | ||
`id` smallint(6) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(100) NOT NULL, | ||
`address` varchar(100) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
|
||
-- | ||
-- Dumping data for table `env_base` | ||
-- | ||
|
||
LOCK TABLES `env_base` WRITE; | ||
/*!40000 ALTER TABLE `env_base` DISABLE KEYS */; | ||
INSERT INTO `env_base` VALUES (1,'一号基地','江苏大学计算机学院'),(2,'二号基地','江苏大学电气学院'),(3,'三号基地','江苏大学农机学院'); | ||
/*!40000 ALTER TABLE `env_base` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
-- Dump completed on 2017-01-06 15:58:59 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) | ||
-- | ||
-- Host: localhost Database: environment | ||
-- ------------------------------------------------------ | ||
-- Server version 5.7.13-log | ||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
||
-- | ||
-- Table structure for table `env_shed` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `env_shed`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!40101 SET character_set_client = utf8 */; | ||
CREATE TABLE `env_shed` ( | ||
`id` smallint(6) NOT NULL AUTO_INCREMENT, | ||
`code` varchar(20) NOT NULL, | ||
`temp` double(6,2) NOT NULL, | ||
`light` double(6,2) NOT NULL, | ||
`humi` double(6,2) NOT NULL, | ||
`gas` double(6,2) NOT NULL, | ||
`outtemp` double(6,2) NOT NULL, | ||
`baseId` smallint(6) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `baseId` (`baseId`), | ||
CONSTRAINT `env_shed_ibfk_1` FOREIGN KEY (`baseId`) REFERENCES `env_base` (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
|
||
-- | ||
-- Dumping data for table `env_shed` | ||
-- | ||
|
||
LOCK TABLES `env_shed` WRITE; | ||
/*!40000 ALTER TABLE `env_shed` DISABLE KEYS */; | ||
INSERT INTO `env_shed` VALUES (1,'SKT1',9.10,2.20,3.30,4.40,5.50,1),(2,'LGD',1.10,2.20,3.30,4.40,5.50,1),(3,'OMG',1.10,2.20,3.30,4.40,5.50,1),(4,'RNG',1.10,2.20,3.30,4.40,5.50,2),(5,'EDG',1.10,2.20,3.30,4.40,5.50,2),(6,'ROX',1.10,2.20,3.30,4.40,5.50,2),(7,'haha',1.10,2.20,3.30,4.50,5.50,2); | ||
/*!40000 ALTER TABLE `env_shed` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
-- Dump completed on 2017-01-06 15:58:59 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.troyforever.env.bean; | ||
|
||
import java.util.Set; | ||
|
||
//基地信息类 | ||
public class Base { | ||
|
||
//基地ID | ||
private Integer id ; | ||
|
||
//基地编码 | ||
private String name ; | ||
|
||
//基地地址 | ||
private String address ; | ||
|
||
private Set sheds ; | ||
|
||
public Set getSheds() { | ||
return sheds; | ||
} | ||
|
||
public void setSheds(Set sheds) { | ||
this.sheds = sheds; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(String address) { | ||
this.address = address; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.troyforever.env.bean; | ||
|
||
//大棚信息类 | ||
public class Shed { | ||
|
||
//大棚ID | ||
private Integer id ; | ||
|
||
//大棚编码 | ||
private String code ; | ||
|
||
//大棚内温度信息 | ||
private Double temp ; | ||
|
||
//大棚内光照信息 | ||
private Double light ; | ||
|
||
//大棚内湿度信息 | ||
private Double humi ; | ||
|
||
//大棚内CO2气体浓度 | ||
private Double gas ; | ||
|
||
//大棚室外的温度 | ||
private Double outtemp ; | ||
|
||
private Base base ; | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public void setCode(String code) { | ||
this.code = code; | ||
} | ||
|
||
public Double getTemp() { | ||
return temp; | ||
} | ||
|
||
public void setTemp(Double temp) { | ||
this.temp = temp; | ||
} | ||
|
||
public Double getLight() { | ||
return light; | ||
} | ||
|
||
public void setLight(Double light) { | ||
this.light = light; | ||
} | ||
|
||
public Double getHumi() { | ||
return humi; | ||
} | ||
|
||
public void setHumi(Double humi) { | ||
this.humi = humi; | ||
} | ||
|
||
public Double getGas() { | ||
return gas; | ||
} | ||
|
||
public void setGas(Double gas) { | ||
this.gas = gas; | ||
} | ||
|
||
public Double getOuttemp() { | ||
return outtemp; | ||
} | ||
|
||
public void setOuttemp(Double outtemp) { | ||
this.outtemp = outtemp; | ||
} | ||
|
||
public Base getBase() { | ||
return base; | ||
} | ||
|
||
public void setBase(Base base) { | ||
this.base = base; | ||
} | ||
|
||
|
||
} |
53 changes: 53 additions & 0 deletions
53
EnvController/src/com/troyforever/env/controller/GasController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.troyforever.env.controller; | ||
|
||
import com.troyforever.env.bean.Shed; | ||
import com.troyforever.env.dao.Factory; | ||
|
||
public class GasController { | ||
|
||
public static double setGas ( Integer id, Integer level ) | ||
{ | ||
Shed shed = Factory.getShedDao().findById(id) ; | ||
|
||
double gas = shed.getGas() ; | ||
|
||
switch (level) { | ||
case 2: | ||
gas += 2 ; | ||
break; | ||
case 1: | ||
gas += 1 ; | ||
break; | ||
case 0: | ||
gas += 0 ; | ||
break; | ||
case -1: | ||
gas -= 1 ; | ||
break; | ||
case -2: | ||
gas -= 2 ; | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
shed.setGas(gas); | ||
|
||
Factory.getShedDao().update(shed) ; | ||
|
||
return gas ; | ||
} | ||
|
||
public static Double putGas ( Integer id, Double value ) | ||
{ | ||
Shed shed = Factory.getShedDao().findById(id) ; | ||
|
||
shed.setGas(value); | ||
|
||
if ( Factory.getShedDao().update(shed) ) | ||
return value ; | ||
else | ||
return (double) -999 ; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
EnvController/src/com/troyforever/env/controller/HumiController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.troyforever.env.controller; | ||
|
||
import com.troyforever.env.bean.Shed; | ||
import com.troyforever.env.dao.Factory; | ||
|
||
public class HumiController { | ||
|
||
public static double setHumi ( Integer id, Integer level ) | ||
{ | ||
Shed shed = Factory.getShedDao().findById(id) ; | ||
|
||
double humi = shed.getHumi() ; | ||
|
||
switch (level) { | ||
case 2: | ||
humi += 2 ; | ||
break; | ||
case 1: | ||
humi += 1 ; | ||
break; | ||
case 0: | ||
humi += 0 ; | ||
break; | ||
case -1: | ||
humi -= 1 ; | ||
break; | ||
case -2: | ||
humi -= 2 ; | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
shed.setHumi(humi); | ||
|
||
Factory.getShedDao().update(shed) ; | ||
|
||
return humi ; | ||
} | ||
|
||
public static Double putHumi ( Integer id, Double value ) | ||
{ | ||
Shed shed = Factory.getShedDao().findById(id) ; | ||
|
||
shed.setHumi(value); | ||
|
||
if ( Factory.getShedDao().update(shed) ) | ||
return value ; | ||
else | ||
return (double) -999 ; | ||
} | ||
} |
Oops, something went wrong.