mirror of
https://github.com/luoyan35714/OPC_Client.git
synced 2026-05-06 00:00:04 +08:00
Separate the perfermance project to two
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="lib/j-interop.jar"/>
|
||||
<classpathentry kind="lib" path="lib/j-interopdeps.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jcifs-1.2.19.jar"/>
|
||||
<classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/>
|
||||
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/org.openscada.opc.dcom_1.1.0.v20130529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/org.openscada.opc.lib_1.1.0.v20130529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
||||
@@ -10,8 +10,14 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
2014-12-03 16:22:54,739 INFO com.freud.dcom.utgard.cases.DCOMTest5.main:67 - test
|
||||
2014-12-04 11:46:45,336 INFO org.openscada.opc.lib.da.Server.connect:109 - Socket timeout: 0
|
||||
2014-12-04 11:46:47,516 INFO org.openscada.opc.lib.da.Server.cleanup:160 - Destroying DCOM session...
|
||||
2014-12-04 11:46:47,518 INFO org.openscada.opc.lib.da.Server.cleanup:187 - Destroying DCOM session... forked
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.freud.opc</groupId>
|
||||
<artifactId>OPC_Client_Utgard</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kohsuke.jinterop</groupId>
|
||||
<artifactId>j-interop</artifactId>
|
||||
<version>2.0.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -34,7 +34,7 @@ import org.openscada.opc.dcom.da.impl.OPCServer;
|
||||
import org.openscada.opc.dcom.da.impl.OPCSyncIO;
|
||||
|
||||
/**
|
||||
* 通过Scope遍历OPC连接下的所有Group信息
|
||||
* 同步读取Item
|
||||
*
|
||||
* @author Freud
|
||||
*
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.openscada.opc.dcom.da.impl.OPCItemMgt;
|
||||
import org.openscada.opc.dcom.da.impl.OPCServer;
|
||||
|
||||
/**
|
||||
* 通过Scope遍历OPC连接下的所有Group信息
|
||||
* 异步读取Item
|
||||
*
|
||||
* @author Freud
|
||||
*
|
||||
@@ -42,6 +42,7 @@ import org.openscada.opc.dcom.da.impl.OPCServer;
|
||||
public class DCOMTest7 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
JISystem.setAutoRegisteration(true);
|
||||
|
||||
/**
|
||||
@@ -69,6 +70,7 @@ public class DCOMTest7 {
|
||||
|
||||
// clean up
|
||||
server.removeGroup(group, true);
|
||||
|
||||
}
|
||||
|
||||
public static void testItems(final OPCServer server,
|
||||
|
||||
@@ -27,7 +27,7 @@ public class OPCTest1 {
|
||||
getEntryValue(CONFIG_USERNAME), getEntryValue(CONFIG_PASSWORD),
|
||||
getEntryValue(CONFIG_DOMAIN));
|
||||
|
||||
/** 通过ProgId获得ClsId,然后获得ClassDetai */
|
||||
/** 通过ProgId获得ClsId,然后获得ClassDetail */
|
||||
// final String cls = serverList
|
||||
// .getClsIdFromProgId("Matrikon.OPC.Simulation.1");
|
||||
//
|
||||
|
||||
@@ -37,7 +37,7 @@ public class OPCTest7 {
|
||||
|
||||
/** 同步写入 */
|
||||
item.write(value);
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(2000);
|
||||
|
||||
/** Dump出item的值 */
|
||||
dumpItem(item);
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.concurrent.Executors;
|
||||
import org.jinterop.dcom.common.JIException;
|
||||
import org.jinterop.dcom.core.JIArray;
|
||||
import org.jinterop.dcom.core.JIVariant;
|
||||
import org.openscada.opc.lib.da.Group;
|
||||
import org.openscada.opc.lib.da.Item;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
|
||||
@@ -17,32 +16,33 @@ import com.freud.opc.utgard.BaseConfiguration;
|
||||
* @author Freud
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class OPCTest8 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
Server server = new Server(
|
||||
final Server server = new Server(
|
||||
BaseConfiguration.getCLSIDConnectionInfomation(),
|
||||
Executors.newSingleThreadScheduledExecutor());
|
||||
|
||||
server.connect();
|
||||
|
||||
Group group = server.addGroup();
|
||||
Item item = group.addItem("Square Waves.Real4");
|
||||
|
||||
/** 构造写入数据 */
|
||||
final Float[] integerData = new Float[] { 1202f, 1203f, 1204f };
|
||||
final JIArray array = new JIArray(integerData, false);
|
||||
final JIVariant value = new JIVariant(array);
|
||||
|
||||
final Item item = server.addGroup().addItem("Square Waves.Real4");
|
||||
|
||||
/** 同步写入 */
|
||||
item.write(value);
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(2000);
|
||||
|
||||
/** Dump出item的值 */
|
||||
dumpItem(item);
|
||||
|
||||
server.dispose();
|
||||
|
||||
}
|
||||
|
||||
private static void dumpItem(Item item) throws JIException {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- specify the logging level for loggers from other libraries -->
|
||||
<logger name="com.freud.dcom.utgard.cases.*" additivity="false">
|
||||
<priority value="info"/>
|
||||
<appender-ref ref="FILE_OUT" />
|
||||
|
||||
Reference in New Issue
Block a user