Commit c91f620a c91f620a165f7f048ad1d1a1cfb281d284b91e76 by root

save

1 parent 5413c059
1 eb96f0d7c6eb16bba3a80585ade26f46
...\ No newline at end of file ...\ No newline at end of file
1 fcf9ad831694a6eb9ccec60ad06c6d4b2996fc9e
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.emercit</groupId>
6 <artifactId>pckutils</artifactId>
7 <version>1.5</version>
8 </project>
1 9261a56b4a8d86ad7e6991a8f9a2822a
...\ No newline at end of file ...\ No newline at end of file
1 805dff1560e8a224309fea2b92ac167d61a87d54
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <metadata>
3 <groupId>org.emercit</groupId>
4 <artifactId>pckutils</artifactId>
5 <versioning>
6 <release>1.5</release>
7 <versions>
8 <version>1.5</version>
9 </versions>
10 <lastUpdated>20150727180908</lastUpdated>
11 </versioning>
12 </metadata>
1 08d8c6f6e4526506253777d406715c4d
...\ No newline at end of file ...\ No newline at end of file
1 074ac5995190869a9ce6821c47809f2aba60d959
...\ No newline at end of file ...\ No newline at end of file
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
12 <attribute name="maven.pomderived" value="true"/> 12 <attribute name="maven.pomderived" value="true"/>
13 </attributes> 13 </attributes>
14 </classpathentry> 14 </classpathentry>
15 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> 15 <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
16 <attributes> 16 <attributes>
17 <attribute name="maven.pomderived" value="true"/> 17 <attribute name="maven.pomderived" value="true"/>
18 </attributes> 18 </attributes>
19 </classpathentry> 19 </classpathentry>
20 <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> 20 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
21 <attributes> 21 <attributes>
22 <attribute name="maven.pomderived" value="true"/> 22 <attribute name="maven.pomderived" value="true"/>
23 </attributes> 23 </attributes>
......
1 eclipse.preferences.version=1 1 eclipse.preferences.version=1
2 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 2 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
3 org.eclipse.jdt.core.compiler.compliance=1.5 3 org.eclipse.jdt.core.compiler.compliance=1.7
4 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 4 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5 org.eclipse.jdt.core.compiler.source=1.5 5 org.eclipse.jdt.core.compiler.source=1.7
......
...@@ -14,6 +14,24 @@ ...@@ -14,6 +14,24 @@
14 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 14 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15 </properties> 15 </properties>
16 16
17
18 <build>
19 <plugins>
20 <plugin>
21 <groupId>org.apache.maven.plugins</groupId>
22 <artifactId>maven-compiler-plugin</artifactId>
23 <configuration>
24 <source>1.7</source>
25 <target>1.7</target>
26 <showDeprecation>true</showDeprecation>
27 <showWarnings>true</showWarnings>
28 <executable>${env.JAVA_HOME_7}/bin/javac</executable>
29 <fork>true</fork>
30 </configuration>
31 </plugin>
32 </plugins>
33 </build>
34
17 <dependencies> 35 <dependencies>
18 <dependency> 36 <dependency>
19 <groupId>junit</groupId> 37 <groupId>junit</groupId>
...@@ -21,5 +39,25 @@ ...@@ -21,5 +39,25 @@
21 <version>3.8.1</version> 39 <version>3.8.1</version>
22 <scope>test</scope> 40 <scope>test</scope>
23 </dependency> 41 </dependency>
42
43 <dependency>
44 <groupId>org.emercit</groupId>
45 <artifactId>pckutils</artifactId>
46 <version>1.5</version>
47 </dependency>
48
24 </dependencies> 49 </dependencies>
50
51
52 <repositories>
53 <!--other repositories if any-->
54 <repository>
55 <id>project.local</id>
56 <name>project</name>
57 <url>file:/root/git/hardwareconfig/DevTools/repo</url>
58 </repository>
59 </repositories>
60
61
62
25 </project> 63 </project>
......
...@@ -7,18 +7,16 @@ import java.io.FileWriter; ...@@ -7,18 +7,16 @@ import java.io.FileWriter;
7 import java.io.InputStreamReader; 7 import java.io.InputStreamReader;
8 import java.util.Vector; 8 import java.util.Vector;
9 9
10 10 import org.emercit.pckutils.cmd.CmdExec;
11 public class DCalibratorBB implements DCalibrator {
12
13 11
14 12
13 public class DCalibratorBB implements DCalibrator {
15 14
15 private CmdExec cmdExec=new CmdExec();
16 16
17 public void Run(String cmd) { 17 public void Run(String cmd) {
18 try { 18 try {
19 Vector<String> params=ExcecCmd(cmd); 19 Vector<String> params=cmdExec.Run(cmd);
20
21
22 20
23 File file = new File("/etc/X11/xorg.conf.d/99-calibration.conf"); 21 File file = new File("/etc/X11/xorg.conf.d/99-calibration.conf");
24 22
...@@ -45,23 +43,4 @@ public class DCalibratorBB implements DCalibrator { ...@@ -45,23 +43,4 @@ public class DCalibratorBB implements DCalibrator {
45 } 43 }
46 44
47 45
48
49
50
51 private Vector<String> ExcecCmd(String cmd) throws Exception {
52
53 Vector<String> v=new Vector<String>();
54
55 Runtime run = Runtime.getRuntime();
56
57 Process proc = run.exec(new String[]{"/bin/sh", "-c",cmd});
58 proc.waitFor();
59 BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
60 while(br.ready()) {
61 v.add(br.readLine());
62 }
63
64 return v;
65 }
66
67 } 46 }
......
...@@ -69,10 +69,18 @@ ...@@ -69,10 +69,18 @@
69 <dependency> 69 <dependency>
70 <groupId>org.emercit</groupId> 70 <groupId>org.emercit</groupId>
71 <artifactId>xmldbmanager</artifactId> 71 <artifactId>xmldbmanager</artifactId>
72 <version>1.4</version> 72 <version>1.5</version>
73 </dependency> 73 </dependency>
74 74
75 75
76 <dependency>
77 <groupId>org.emercit</groupId>
78 <artifactId>projecttools</artifactId>
79 <version>1.5</version>
80 </dependency>
81
82
83
76 </dependencies> 84 </dependencies>
77 85
78 86
......
...@@ -16,6 +16,8 @@ import org.emercit.ethmanager.model.CommandExecutor; ...@@ -16,6 +16,8 @@ import org.emercit.ethmanager.model.CommandExecutor;
16 16
17 import org.emercit.xmldbmanager.service.Db; 17 import org.emercit.xmldbmanager.service.Db;
18 18
19 import org.emercit.projecttools.constants.Paths;
20
19 21
20 public class EthLinux implements IEth { 22 public class EthLinux implements IEth {
21 23
...@@ -27,7 +29,7 @@ public class EthLinux implements IEth { ...@@ -27,7 +29,7 @@ public class EthLinux implements IEth {
27 29
28 private Vector<EthBean> ebs=new Vector<EthBean>(); 30 private Vector<EthBean> ebs=new Vector<EthBean>();
29 31
30 private Db ethStore; 32 private Db db=new Db(Paths.BEAN_ETH);
31 33
32 private Vector<String> extinfo; 34 private Vector<String> extinfo;
33 35
...@@ -40,16 +42,11 @@ public class EthLinux implements IEth { ...@@ -40,16 +42,11 @@ public class EthLinux implements IEth {
40 private EthBean emp; 42 private EthBean emp;
41 43
42 public EthLinux() { 44 public EthLinux() {
43
44 ethStore=new Db((Object)ebs);
45 } 45 }
46 46
47
48 public void ApplyConfig (String eth, String p, Object v) { 47 public void ApplyConfig (String eth, String p, Object v) {
49 48
50 49 ebs=(Vector<EthBean>)db.select();
51
52 ebs=(Vector<EthBean>)ethStore.select();
53 50
54 if (!p.equals("object")) { 51 if (!p.equals("object")) {
55 52
...@@ -82,9 +79,7 @@ public class EthLinux implements IEth { ...@@ -82,9 +79,7 @@ public class EthLinux implements IEth {
82 break; 79 break;
83 } 80 }
84 } 81 }
85 82 Config(ebs);
86
87 Config(ebs);
88 } 83 }
89 84
90 /* 85 /*
...@@ -98,7 +93,7 @@ public class EthLinux implements IEth { ...@@ -98,7 +93,7 @@ public class EthLinux implements IEth {
98 try { 93 try {
99 Vector<String> buff=ce.Run("ifconfig | grep eth | awk '{print $1}'"); 94 Vector<String> buff=ce.Run("ifconfig | grep eth | awk '{print $1}'");
100 95
101 ebs=ethStore.select(); 96 ebs=(Vector<EthBean>)db.select();
102 97
103 for (EthBean eb:ebs) { 98 for (EthBean eb:ebs) {
104 99
...@@ -121,9 +116,7 @@ public class EthLinux implements IEth { ...@@ -121,9 +116,7 @@ public class EthLinux implements IEth {
121 116
122 public void PrintInfoByName(String name) { 117 public void PrintInfoByName(String name) {
123 118
124 ebs=ethStore.select(); 119 ebs=(Vector<EthBean>)db.select();
125
126
127 120
128 for(EthBean eb : ebs) { 121 for(EthBean eb : ebs) {
129 122
...@@ -156,8 +149,6 @@ public class EthLinux implements IEth { ...@@ -156,8 +149,6 @@ public class EthLinux implements IEth {
156 log.error(e.getMessage()); 149 log.error(e.getMessage());
157 } 150 }
158 151
159
160
161 } 152 }
162 } 153 }
163 154
......