Initial Commit
parent
0f9bf421d5
commit
9594523a2d
@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- You may freely edit this file. See commented blocks below for -->
|
||||||
|
<!-- some examples of how to customize the build. -->
|
||||||
|
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||||
|
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||||
|
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||||
|
<!-- the Compile on Save feature is turned off for the project. -->
|
||||||
|
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||||
|
<!-- in the project's Project Properties dialog box.-->
|
||||||
|
<project name="Dahua-x64" default="default" basedir=".">
|
||||||
|
<description>Builds, tests, and runs the project Dahua-x64.</description>
|
||||||
|
<import file="nbproject/build-impl.xml"/>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
There exist several targets which are by default empty and which can be
|
||||||
|
used for execution of your tasks. These targets are usually executed
|
||||||
|
before and after some main targets. They are:
|
||||||
|
|
||||||
|
-pre-init: called before initialization of project properties
|
||||||
|
-post-init: called after initialization of project properties
|
||||||
|
-pre-compile: called before javac compilation
|
||||||
|
-post-compile: called after javac compilation
|
||||||
|
-pre-compile-single: called before javac compilation of single file
|
||||||
|
-post-compile-single: called after javac compilation of single file
|
||||||
|
-pre-compile-test: called before javac compilation of JUnit tests
|
||||||
|
-post-compile-test: called after javac compilation of JUnit tests
|
||||||
|
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||||
|
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||||
|
-pre-jar: called before JAR building
|
||||||
|
-post-jar: called after JAR building
|
||||||
|
-post-clean: called after cleaning build products
|
||||||
|
|
||||||
|
(Targets beginning with '-' are not intended to be called on their own.)
|
||||||
|
|
||||||
|
Example of inserting an obfuscator after compilation could look like this:
|
||||||
|
|
||||||
|
<target name="-post-compile">
|
||||||
|
<obfuscate>
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
</obfuscate>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
For list of available properties check the imported
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
|
||||||
|
Another way to customize the build is by overriding existing main targets.
|
||||||
|
The targets of interest are:
|
||||||
|
|
||||||
|
-init-macrodef-javac: defines macro for javac compilation
|
||||||
|
-init-macrodef-junit: defines macro for junit execution
|
||||||
|
-init-macrodef-debug: defines macro for class debugging
|
||||||
|
-init-macrodef-java: defines macro for class execution
|
||||||
|
-do-jar: JAR building
|
||||||
|
run: execution of project
|
||||||
|
-javadoc-build: Javadoc generation
|
||||||
|
test-report: JUnit report generation
|
||||||
|
|
||||||
|
An example of overriding the target for project execution could look like this:
|
||||||
|
|
||||||
|
<target name="run" depends="Dahua-x64-impl.jar">
|
||||||
|
<exec dir="bin" executable="launcher.exe">
|
||||||
|
<arg file="${dist.jar}"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
Notice that the overridden target depends on the jar target and not only on
|
||||||
|
the compile target as the regular run target does. Again, for a list of available
|
||||||
|
properties which you can use, check the target you are overriding in the
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
-->
|
||||||
|
</project>
|
@ -0,0 +1,4 @@
|
|||||||
|
#Mon, 03 Jul 2023 11:20:10 +0800
|
||||||
|
|
||||||
|
|
||||||
|
/home/htdev/newcac/sourceproj/Dahua=
|
@ -0,0 +1,32 @@
|
|||||||
|
========================
|
||||||
|
BUILD OUTPUT DESCRIPTION
|
||||||
|
========================
|
||||||
|
|
||||||
|
When you build an Java application project that has a main class, the IDE
|
||||||
|
automatically copies all of the JAR
|
||||||
|
files on the projects classpath to your projects dist/lib folder. The IDE
|
||||||
|
also adds each of the JAR files to the Class-Path element in the application
|
||||||
|
JAR files manifest file (MANIFEST.MF).
|
||||||
|
|
||||||
|
To run the project from the command line, go to the dist folder and
|
||||||
|
type the following:
|
||||||
|
|
||||||
|
java -jar "Dahua-x64.jar"
|
||||||
|
|
||||||
|
To distribute this project, zip up the dist folder (including the lib folder)
|
||||||
|
and distribute the ZIP file.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* If two JAR files on the project classpath have the same name, only the first
|
||||||
|
JAR file is copied to the lib folder.
|
||||||
|
* Only JAR files are copied to the lib folder.
|
||||||
|
If the classpath contains other types of files or folders, these files (folders)
|
||||||
|
are not copied.
|
||||||
|
* If a library on the projects classpath also has a Class-Path element
|
||||||
|
specified in the manifest,the content of the Class-Path element has to be on
|
||||||
|
the projects runtime path.
|
||||||
|
* To set a main class in a standard Java project, right-click the project node
|
||||||
|
in the Projects window and choose Properties. Then click Run and enter the
|
||||||
|
class name in the Main Class field. Alternatively, you can manually type the
|
||||||
|
class name in the manifest Main-Class element.
|
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 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.
@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
X-COMMENT: Main-Class will be added automatically by build
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
|||||||
|
build.xml.data.CRC32=a6c0abce
|
||||||
|
build.xml.script.CRC32=576cfaf9
|
||||||
|
build.xml.stylesheet.CRC32=8064a381@1.80.1.48
|
||||||
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
|
nbproject/build-impl.xml.data.CRC32=a6c0abce
|
||||||
|
nbproject/build-impl.xml.script.CRC32=a5911d2b
|
||||||
|
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
|
@ -0,0 +1,6 @@
|
|||||||
|
compile.on.save=true
|
||||||
|
do.depend=false
|
||||||
|
do.jar=true
|
||||||
|
javac.debug=true
|
||||||
|
javadoc.preview=true
|
||||||
|
user.properties.file=/home/htdev/.netbeans/8.2/build.properties
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
|
<group/>
|
||||||
|
</open-files>
|
||||||
|
</project-private>
|
@ -0,0 +1,81 @@
|
|||||||
|
annotation.processing.enabled=true
|
||||||
|
annotation.processing.enabled.in.editor=false
|
||||||
|
annotation.processing.processors.list=
|
||||||
|
annotation.processing.run.all.processors=true
|
||||||
|
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||||
|
application.title=Dahua-x64
|
||||||
|
application.vendor=LENOVO
|
||||||
|
build.classes.dir=${build.dir}/classes
|
||||||
|
build.classes.excludes=**/*.java,**/*.form
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
build.dir=build
|
||||||
|
build.generated.dir=${build.dir}/generated
|
||||||
|
build.generated.sources.dir=${build.dir}/generated-sources
|
||||||
|
# Only compile against the classpath explicitly listed here:
|
||||||
|
build.sysclasspath=ignore
|
||||||
|
build.test.classes.dir=${build.dir}/test/classes
|
||||||
|
build.test.results.dir=${build.dir}/test/results
|
||||||
|
# Uncomment to specify the preferred debugger connection transport:
|
||||||
|
#debug.transport=dt_socket
|
||||||
|
debug.classpath=\
|
||||||
|
${run.classpath}
|
||||||
|
debug.test.classpath=\
|
||||||
|
${run.test.classpath}
|
||||||
|
# build.classes.dir \u4e2d\u5e94\u4ece\u5206\u53d1 jar \u4e2d\u6392\u9664\u7684\u6587\u4ef6
|
||||||
|
dist.archive.excludes=
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
dist.dir=dist
|
||||||
|
dist.jar=${dist.dir}/Dahua-x64.jar
|
||||||
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
|
endorsed.classpath=
|
||||||
|
excludes=
|
||||||
|
file.reference.examples.jar=examples.jar
|
||||||
|
file.reference.jna.jar=jna.jar
|
||||||
|
includes=**
|
||||||
|
jar.compress=true
|
||||||
|
javac.classpath=\
|
||||||
|
${file.reference.examples.jar}:\
|
||||||
|
${libs.MySQLDriver.classpath}:\
|
||||||
|
${file.reference.jna.jar}
|
||||||
|
# Space-separated list of extra javac options
|
||||||
|
javac.compilerargs=
|
||||||
|
javac.deprecation=false
|
||||||
|
javac.external.vm=true
|
||||||
|
javac.processorpath=\
|
||||||
|
${javac.classpath}
|
||||||
|
javac.source=1.8
|
||||||
|
javac.target=1.8
|
||||||
|
javac.test.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}
|
||||||
|
javac.test.processorpath=\
|
||||||
|
${javac.test.classpath}
|
||||||
|
javadoc.additionalparam=
|
||||||
|
javadoc.author=false
|
||||||
|
javadoc.encoding=${source.encoding}
|
||||||
|
javadoc.noindex=false
|
||||||
|
javadoc.nonavbar=false
|
||||||
|
javadoc.notree=false
|
||||||
|
javadoc.private=false
|
||||||
|
javadoc.splitindex=true
|
||||||
|
javadoc.use=true
|
||||||
|
javadoc.version=false
|
||||||
|
javadoc.windowtitle=
|
||||||
|
main.class=dahua.Hot
|
||||||
|
manifest.file=manifest.mf
|
||||||
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
|
mkdist.disabled=false
|
||||||
|
platform.active=default_platform
|
||||||
|
run.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}
|
||||||
|
# Space-separated list of JVM arguments used when running the project.
|
||||||
|
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||||
|
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||||
|
run.jvmargs=-Xss1024k
|
||||||
|
run.test.classpath=\
|
||||||
|
${javac.test.classpath}:\
|
||||||
|
${build.test.classes.dir}
|
||||||
|
source.encoding=UTF-8
|
||||||
|
src.dir=src
|
||||||
|
test.src.dir=test
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.java.j2seproject</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<name>Dahua-x64</name>
|
||||||
|
<source-roots>
|
||||||
|
<root id="src.dir"/>
|
||||||
|
</source-roots>
|
||||||
|
<test-roots>
|
||||||
|
<root id="test.src.dir"/>
|
||||||
|
</test-roots>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
@ -0,0 +1,88 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import dahua.NetSDKLib;
|
||||||
|
import dahua.NetSDKLib.LLong;
|
||||||
|
import dahua.ToolKits;
|
||||||
|
|
||||||
|
import com.sun.jna.ptr.IntByReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Capture Picture Interface
|
||||||
|
* contains:local、remote、timer and stop capture picture
|
||||||
|
* \else
|
||||||
|
* 抓图接口实现
|
||||||
|
* 包含: 本地、远程、定时和停止抓图
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public class CapturePictureModule {
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Remote Capture Picture
|
||||||
|
* \else
|
||||||
|
* 远程抓图
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public static boolean remoteCapturePicture(int chn) {
|
||||||
|
return snapPicture(chn, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Timer Capture Picture
|
||||||
|
* \else
|
||||||
|
* 定时抓图
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public static boolean timerCapturePicture(int chn) {
|
||||||
|
return snapPicture(chn, 1, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Stop Timer Capture Picture
|
||||||
|
* \else
|
||||||
|
* 停止定时抓图
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public static boolean stopCapturePicture(int chn) {
|
||||||
|
return snapPicture(chn, -1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Capture Picture (except local capture picture, others all call this interface)
|
||||||
|
* \else
|
||||||
|
* 抓图 (除本地抓图外, 其他全部调用此接口)
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
private static boolean snapPicture(int chn, int mode, int interval) {
|
||||||
|
// send caputre picture command to device
|
||||||
|
NetSDKLib.SNAP_PARAMS stuSnapParams = new NetSDKLib.SNAP_PARAMS();
|
||||||
|
stuSnapParams.Channel = chn; // channel
|
||||||
|
stuSnapParams.mode = mode; // capture picture mode
|
||||||
|
stuSnapParams.Quality = 3; // picture quality
|
||||||
|
stuSnapParams.InterSnap = interval; // timer capture picture time interval
|
||||||
|
stuSnapParams.CmdSerial = 0; // request serial
|
||||||
|
|
||||||
|
IntByReference reserved = new IntByReference(0);
|
||||||
|
if (!INetSDK.netsdk.CLIENT_SnapPictureEx(INetSDK.m_hLoginHandle, stuSnapParams, reserved)) {
|
||||||
|
System.err.printf("CLIENT_SnapPictureEx Failed!" + INetSDK.netsdk.CLIENT_GetLastError());
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
System.out.println("CLIENT_SnapPictureEx success");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Set Capture Picture Callback
|
||||||
|
* \else
|
||||||
|
* 设置抓图回调函数
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public static void setSnapRevCallBack(NetSDKLib.fSnapRev cbSnapReceive){
|
||||||
|
INetSDK.netsdk.CLIENT_SetSnapRevCallBack(cbSnapReceive, null);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,576 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Container class="javax.swing.JFrame" name="jFrame1">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JFrame" name="jFrame2">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="TypeGroup">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||||
|
<Property name="title" type="java.lang.String" value="ClientDemo"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="宋体" size="10" style="0"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jSplitPaneHorizontal" alignment="0" pref="16050" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jSplitPaneHorizontal" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JSplitPane" name="jSplitPaneHorizontal">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||||
|
<EmptyBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="dividerLocation" type="int" value="155"/>
|
||||||
|
<Property name="dividerSize" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanelUserInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||||
|
<EtchetBorder>
|
||||||
|
<Color PropertyName="highlight" blue="ff" green="ff" red="cc" type="rgb"/>
|
||||||
|
</EtchetBorder>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[500, 878]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="left"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabelIPAddress1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldPwd" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jButtonRealPlay" min="-2" pref="87" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonLogin" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabelPortNumber1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldPortNumber" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPaneTree" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabelPortNumber4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
<Component id="nPresetIdTxt" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabelPortNumber2" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabelPortNumber3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="26" pref="26" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Component id="nRuleId" max="32767" attributes="0"/>
|
||||||
|
<Component id="nMeterType1" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Component id="jButton2" alignment="0" min="-2" pref="87" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabelIPAddress" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabelPortNumber" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jTextFieldIPAddress" max="32767" attributes="0"/>
|
||||||
|
<Component id="jTextFieldUser" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace pref="20" max="32767" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabelIPAddress" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldIPAddress" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabelPortNumber" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldUser" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabelIPAddress1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldPwd" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabelPortNumber1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldPortNumber" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jButtonLogin" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonRealPlay" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="nPresetIdTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabelPortNumber4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabelPortNumber3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="nMeterType1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="nRuleId" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabelPortNumber2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPaneTree" min="-2" pref="167" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="349" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonRealPlay">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="预览"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonRealPlayActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonLogin">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="退出预览"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonLoginActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelIPAddress">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="IP地址:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTextFieldUser">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="admin"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTextFieldIPAddress">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="192.168.1.108"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelPortNumber">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="用户名:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPaneTree">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTree" name="jTreeDevice">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.tree.TreeModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||||
|
<Connection code="this.initialTreeModel()" type="code"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="jButton2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="获取温度"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTextFieldPortNumber">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="37777"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelPortNumber1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="端口:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelIPAddress1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="密码:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTextFieldPwd">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="admin12345"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextFieldPwdActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelPortNumber2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="规则编号:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="nRuleId">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="0"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelPortNumber3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="测温项类型:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabelPortNumber4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="预置点编号:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="nPresetIdTxt">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="0"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="nMeterType1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="1">
|
||||||
|
<StringItem index="0" value="请选择类型"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JSplitPane" name="jSplitPaneVertical">
|
||||||
|
<Properties>
|
||||||
|
<Property name="dividerLocation" type="int" value="579"/>
|
||||||
|
<Property name="dividerSize" type="int" value="2"/>
|
||||||
|
<Property name="orientation" type="int" value="0"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanelRealplayArea">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||||
|
<LineBorder>
|
||||||
|
<Color PropertyName="color" blue="66" green="ff" red="99" type="rgb"/>
|
||||||
|
</LineBorder>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="top"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
|
<Component id="Realplay" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="15366" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
|
||||||
|
<Component id="Realplay" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="49" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="java.awt.Panel" name="Realplay">
|
||||||
|
<Properties>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[500, 500]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="RealplayMousePressed"/>
|
||||||
|
</Events>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="500" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="500" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="jLabel1"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Container class="java.awt.Panel" name="panel1">
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperStdTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMidTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMinTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMaxTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperAverTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="nTemperUnitTxt" min="-2" pref="118" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="15659" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="nTemperUnitTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperAverTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMaxTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMinTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperMidTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="fTemperStdTxt" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="52" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="测温单位:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="nTemperUnitTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="平均温度:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fTemperAverTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="中间值:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fTemperMidTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fTemperMinTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="最小温度:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="最高温度:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fTemperMaxTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="fTemperStdTxt">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="标准方差值:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
</Form>
|
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package dahua;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LENOVO
|
||||||
|
*/
|
||||||
|
public class Login extends javax.swing.JPanel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new form Login
|
||||||
|
*/
|
||||||
|
public Login() {
|
||||||
|
initComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called from within the constructor to initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
* regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
|
this.setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGap(0, 400, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGap(0, 300, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.CharBuffer;
|
||||||
|
|
||||||
|
import com.sun.jna.Memory;
|
||||||
|
import com.sun.jna.Native;
|
||||||
|
import com.sun.jna.Pointer;
|
||||||
|
|
||||||
|
|
||||||
|
/** Provides a temporary allocation of an immutable C string
|
||||||
|
* (<code>const char*</code> or <code>const wchar_t*</code>) for use when
|
||||||
|
* converting a Java String into a native memory function argument.
|
||||||
|
*
|
||||||
|
* @author Todd Fast, todd.fast@sun.com
|
||||||
|
* @author twall@users.sf.net
|
||||||
|
*/
|
||||||
|
public class NativeString implements CharSequence, Comparable<Object> {
|
||||||
|
|
||||||
|
private Pointer pointer;
|
||||||
|
private boolean wide;
|
||||||
|
|
||||||
|
/** Create a native string (NUL-terminated array of <code>char</code>).<p>
|
||||||
|
* If the system property <code>jna.encoding</code> is set, its value will
|
||||||
|
* be used to encode the native string. If not set or if the encoding
|
||||||
|
* is unavailable, the default platform encoding will be used.
|
||||||
|
*/
|
||||||
|
public NativeString(String string) {
|
||||||
|
this(string, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Create a native string as a NUL-terminated array of <code>wchar_t</code>
|
||||||
|
* (if <code>wide</code> is true) or <code>char</code>.<p>
|
||||||
|
* If the system property <code>jna.encoding</code> is set, its value will
|
||||||
|
* be used to encode the native <code>char</code>string.
|
||||||
|
* If not set or if the encoding is unavailable, the default platform
|
||||||
|
* encoding will be used.
|
||||||
|
*
|
||||||
|
* @param string value to write to native memory
|
||||||
|
* @param wide whether to store the String as <code>wchar_t</code>
|
||||||
|
*/
|
||||||
|
public NativeString(String string, boolean wide) {
|
||||||
|
if (string == null) {
|
||||||
|
throw new NullPointerException("String must not be null");
|
||||||
|
}
|
||||||
|
// Allocate the memory to hold the string. Note, we have to
|
||||||
|
// make this 1 element longer in order to accommodate the terminating
|
||||||
|
// NUL (which is generated in Pointer.setString()).
|
||||||
|
this.wide = wide;
|
||||||
|
if (wide) {
|
||||||
|
int len = (string.length() + 1 ) * Native.WCHAR_SIZE;
|
||||||
|
pointer = new Memory(len);
|
||||||
|
pointer.setString(0, string, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
byte[] data = getBytes(string);
|
||||||
|
pointer = new Memory(data.length + 1);
|
||||||
|
pointer.write(0, data, 0, data.length);
|
||||||
|
pointer.setByte(data.length, (byte)0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static byte[] getBytes(String s) {
|
||||||
|
try {
|
||||||
|
return getBytes(s, System.getProperty("jna.encoding"));
|
||||||
|
}
|
||||||
|
catch (UnsupportedEncodingException e) {
|
||||||
|
return s.getBytes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Return a byte array corresponding to the given String, using the given
|
||||||
|
encoding.
|
||||||
|
*/
|
||||||
|
static byte[] getBytes(String s, String encoding) throws UnsupportedEncodingException {
|
||||||
|
if (encoding != null) {
|
||||||
|
return s.getBytes(encoding);
|
||||||
|
}
|
||||||
|
return s.getBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode() {
|
||||||
|
return toString().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
|
||||||
|
if (other instanceof CharSequence) {
|
||||||
|
return compareTo(other) == 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String s = wide ? "const wchar_t*" : "const char*";
|
||||||
|
s += "(" + pointer.getString(0, wide) + ")";
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pointer getPointer() {
|
||||||
|
return pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public char charAt(int index) {
|
||||||
|
return toString().charAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int length() {
|
||||||
|
return toString().length();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CharSequence subSequence(int start, int end) {
|
||||||
|
return CharBuffer.wrap(toString()).subSequence(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int compareTo(Object other) {
|
||||||
|
|
||||||
|
if (other == null)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return toString().compareTo(other.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,725 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import dahua.NetSDKLib;
|
||||||
|
|
||||||
|
public final class Res {
|
||||||
|
|
||||||
|
private ResourceBundle bundle;
|
||||||
|
|
||||||
|
private Res() {
|
||||||
|
switchLanguage(LanguageType.Chinese);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class StringBundleHolder {
|
||||||
|
private static Res instance = new Res();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Res string() {
|
||||||
|
return StringBundleHolder.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static enum LanguageType {
|
||||||
|
English,
|
||||||
|
Chinese
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResourceBundle getBundle() {
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \if ENGLISH_LANG
|
||||||
|
* Switch between Chinese and English
|
||||||
|
* \else
|
||||||
|
* 中英文切换
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
public void switchLanguage(LanguageType type) {
|
||||||
|
switch(type) {
|
||||||
|
case Chinese:
|
||||||
|
bundle = ResourceBundle.getBundle("res", new Locale("zh", "CN"));
|
||||||
|
break;
|
||||||
|
case English:
|
||||||
|
bundle = ResourceBundle.getBundle("res", new Locale("en", "US"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSwitchLanguage() {
|
||||||
|
return bundle.getString("SWITCH_LANGUAGE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRealplay() {
|
||||||
|
return bundle.getString("REALPLAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadRecord() {
|
||||||
|
return bundle.getString("DOWNLOAD_RECORD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getITSEvent() {
|
||||||
|
return bundle.getString("ITS_EVENT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOnline() {
|
||||||
|
return bundle.getString("ONLINE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisConnectReconnecting() {
|
||||||
|
return bundle.getString("DISCONNECT_RECONNECTING");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisconnectLoginAgain() {
|
||||||
|
return bundle.getString("DISCONNECT_LOGIN_AGAIN");
|
||||||
|
}
|
||||||
|
public String getPromptMessage() {
|
||||||
|
return bundle.getString("PROMPT_MESSAGE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return bundle.getString("ERROR_MESSAGE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReconnectSucceed() {
|
||||||
|
return bundle.getString("RECONNECT_SUCCEED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSucceed() {
|
||||||
|
return bundle.getString("SUCCEED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFailed() {
|
||||||
|
return bundle.getString("Failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getYear() {
|
||||||
|
return bundle.getString("YEAR");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMonth() {
|
||||||
|
return bundle.getString("MONTH");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDay() {
|
||||||
|
return bundle.getString("DAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHour() {
|
||||||
|
return bundle.getString("HOUR");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMinute() {
|
||||||
|
return bundle.getString("MINUTE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecond() {
|
||||||
|
return bundle.getString("SECOND");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSunday() {
|
||||||
|
return bundle.getString("SUNDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMonday() {
|
||||||
|
return bundle.getString("MONDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTuesday() {
|
||||||
|
return bundle.getString("TUESDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWednesday() {
|
||||||
|
return bundle.getString("WEDNESDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThursday() {
|
||||||
|
return bundle.getString("THURSDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFriday() {
|
||||||
|
return bundle.getString("FRIDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSaturday() {
|
||||||
|
return bundle.getString("SATURDAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getWeek() {
|
||||||
|
String[] weekdays = {getSunday(),
|
||||||
|
getMonday(),
|
||||||
|
getTuesday(),
|
||||||
|
getWednesday(),
|
||||||
|
getThursday(),
|
||||||
|
getFriday(),
|
||||||
|
getSaturday()
|
||||||
|
};
|
||||||
|
|
||||||
|
return weekdays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConfirm() {
|
||||||
|
return bundle.getString("CONFIRM");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCancel() {
|
||||||
|
return bundle.getString("CANCEL");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDateChooser() {
|
||||||
|
return bundle.getString("DATE_CHOOSER");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFunctionList() {
|
||||||
|
return bundle.getString("FUNCTIONLIST");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录设备设备错误状态
|
||||||
|
*/
|
||||||
|
public String getErrorCode(int err) {
|
||||||
|
String msg = "";
|
||||||
|
switch(err) {
|
||||||
|
case NetSDKLib.NET_INVALID_HANDLE:
|
||||||
|
msg = bundle.getString("NET_INVALID_HANDLE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_USER_FLASEPWD_TRYTIME:
|
||||||
|
msg = bundle.getString("NET_USER_FLASEPWD_TRYTIME");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_PASSWORD:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_PASSWORD");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_USER:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_USER");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_TIMEOUT:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_TIMEOUT");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_RELOGGIN:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_RELOGGIN");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_LOCKED:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_LOCKED");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_BLACKLIST:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_BLACKLIST");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_BUSY:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_BUSY");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_CONNECT:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_CONNECT");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_NETWORK:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_NETWORK");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_NO_RECORD_FOUND:
|
||||||
|
msg = bundle.getString("NET_NO_RECORD_FOUND");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_OPEN_FILE_ERROR:
|
||||||
|
msg = bundle.getString("NET_OPEN_FILE_ERROR");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_ERROR:
|
||||||
|
msg = bundle.getString("NET_ERROR");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_RETURN_DATA_ERROR:
|
||||||
|
msg = bundle.getString("NET_RETURN_DATA_ERROR");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.NET_LOGIN_ERROR_USER_OR_PASSOWRD:
|
||||||
|
msg = bundle.getString("NET_LOGIN_ERROR_USER_OR_PASSOWRD");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
msg = bundle.getString("NET_ERROR");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogin() {
|
||||||
|
return bundle.getString("LOGIN");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogout() {
|
||||||
|
return bundle.getString("LOGOUT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceIp() {
|
||||||
|
return bundle.getString("DEVICE_IP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPort() {
|
||||||
|
return bundle.getString("DEVICE_PORT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return bundle.getString("USERNAME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return bundle.getString("PASSWORD");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getLoginFailed() {
|
||||||
|
return bundle.getString("LOGIN_FAILED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInputDeviceIP() {
|
||||||
|
return bundle.getString("PLEASE_INPUT_DEVICE_IP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInputDevicePort() {
|
||||||
|
return bundle.getString("PLEASE_INPUT_DEVICE_PORT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInputUsername() {
|
||||||
|
return bundle.getString("PLEASE_INPUT_DEVICE_USERNAME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInputPassword() {
|
||||||
|
return bundle.getString("PLEASE_INPUT_DEVICE_PASSWORD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartRealPlay() {
|
||||||
|
return bundle.getString("START_REALPLAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStopRealPlay() {
|
||||||
|
return bundle.getString("STOP_REALPLAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChannel() {
|
||||||
|
return bundle.getString("CHANNEL");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreamType() {
|
||||||
|
return bundle.getString("STREAM_TYPE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMasterAndSub() {
|
||||||
|
return bundle.getString("MASTER_AND_SUB_STREAM");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMasterStream() {
|
||||||
|
return bundle.getString("MASTER_STREAM");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubStream() {
|
||||||
|
return bundle.getString("SUB_STREAM");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSnap() {
|
||||||
|
return bundle.getString("SNAP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSnapPicture() {
|
||||||
|
return bundle.getString("SNAP_PICTURE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPTZControl() {
|
||||||
|
return bundle.getString("PTZ_CONTROL");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLeftUp() {
|
||||||
|
return bundle.getString("LEFT_UP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUp() {
|
||||||
|
return bundle.getString("UP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRightUp() {
|
||||||
|
return bundle.getString("RIGHT_UP");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLeft() {
|
||||||
|
return bundle.getString("LEFT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRight() {
|
||||||
|
return bundle.getString("RIGHT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLeftDown() {
|
||||||
|
return bundle.getString("LEFT_DOWN");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDown() {
|
||||||
|
return bundle.getString("DOWN");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRightDown() {
|
||||||
|
return bundle.getString("RIGHT_DOWN");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpeed() {
|
||||||
|
return bundle.getString("SPEED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZoomAdd() {
|
||||||
|
return bundle.getString("ZOOM_ADD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZoomDec() {
|
||||||
|
return bundle.getString("ZOOM_DEC");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFocusAdd() {
|
||||||
|
return bundle.getString("FOCUS_ADD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFocusDec() {
|
||||||
|
return bundle.getString("FOCUS_DEC");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIrisAdd() {
|
||||||
|
return bundle.getString("IRIS_ADD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIrisDec() {
|
||||||
|
return bundle.getString("IRIS_DEC");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndex() {
|
||||||
|
return bundle.getString("INDEX");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEventPicture() {
|
||||||
|
return bundle.getString("EVENT_PICTURE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlatePicture() {
|
||||||
|
return bundle.getString("PLATE_PICTURE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEventName() {
|
||||||
|
return bundle.getString("EVENT_NAME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLicensePlate() {
|
||||||
|
return bundle.getString("LICENSE_PLATE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEventTime() {
|
||||||
|
return bundle.getString("EVENT_TIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlateType() {
|
||||||
|
return bundle.getString("PLATE_TYPE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlateColor() {
|
||||||
|
return bundle.getString("PLATE_COLOR");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleColor() {
|
||||||
|
return bundle.getString("VEHICLE_COLOR");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleType() {
|
||||||
|
return bundle.getString("VEHICLE_TYPE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleSize() {
|
||||||
|
return bundle.getString("VEHICLE_SIZE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileCount() {
|
||||||
|
return bundle.getString("FILE_COUNT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileIndex() {
|
||||||
|
return bundle.getString("FILE_INDEX");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupId() {
|
||||||
|
return bundle.getString("GROUP_ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIllegalPlace() {
|
||||||
|
return bundle.getString("ILLEGAL_PLACE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLaneNumber() {
|
||||||
|
return bundle.getString("LANE_NUMBER");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEventInfo() {
|
||||||
|
return bundle.getString("EVENT_INFO");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoPlate() {
|
||||||
|
return bundle.getString("NO_PLATENUMBER");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getTrafficTableName() {
|
||||||
|
String[] name = {getIndex(),
|
||||||
|
getEventName(),
|
||||||
|
getLicensePlate(),
|
||||||
|
getEventTime(),
|
||||||
|
getPlateType(),
|
||||||
|
getPlateColor(),
|
||||||
|
getVehicleColor(),
|
||||||
|
getVehicleType(),
|
||||||
|
getVehicleSize(),
|
||||||
|
getFileCount(),
|
||||||
|
getFileIndex(),
|
||||||
|
getGroupId(),
|
||||||
|
getIllegalPlace(),
|
||||||
|
getLaneNumber()};
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOperate() {
|
||||||
|
return bundle.getString("OPERATE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttach() {
|
||||||
|
return bundle.getString("ATTACH");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetach() {
|
||||||
|
return bundle.getString("DETACH");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenStrobe() {
|
||||||
|
return bundle.getString("OPEN_STROBE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCloseStrobe() {
|
||||||
|
return bundle.getString("CLOSE_STROBE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenStrobeFailed() {
|
||||||
|
return bundle.getString("OPEN_STROBE_FAILED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManualCapture() {
|
||||||
|
return bundle.getString("MANUAL_CAPTURE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManualCaptureSucceed() {
|
||||||
|
return bundle.getString("MANUALSNAP_SUCCEED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManualCaptureFailed() {
|
||||||
|
return bundle.getString("MANUALSNAP_FAILED");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 车辆大小对照表
|
||||||
|
*/
|
||||||
|
public String getTrafficSize(int nVehicleSize) {
|
||||||
|
String vehicleClass = "";
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
if( ((byte)nVehicleSize & (1 << i)) > 0 ) {
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
vehicleClass = bundle.getString("LIGHT_DUTY");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
vehicleClass = bundle.getString("MEDIUM");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
vehicleClass = bundle.getString("OVER_SIZE");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
vehicleClass = bundle.getString("MINI_SIZE");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
vehicleClass = bundle.getString("LARGE_SIZE");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vehicleClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 获取事件名称
|
||||||
|
*/
|
||||||
|
public String getEventName(int type) {
|
||||||
|
String name = "";
|
||||||
|
switch (type) {
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFICJUNCTION: ///< 交通路口事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFICJUNCTION");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_RUNREDLIGHT: ///< 闯红灯事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_RUNREDLIGHT");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_OVERLINE: ///< 压车道线事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_OVERLINE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_RETROGRADE: ///< 逆行事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_RETROGRADE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_TURNLEFT: ///< 违章左转
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_TURNLEFT");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_TURNRIGHT: ///< 违章右转
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_TURNRIGHT");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_UTURN: ///< 违章掉头
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_UTURN");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_OVERSPEED: ///< 超速
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_OVERSPEED");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_UNDERSPEED: ///< 低速
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_UNDERSPEED");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_PARKING: ///< 违章停车
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_PARKING");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_WRONGROUTE: ///< 不按车道行驶
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_WRONGROUTE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_CROSSLANE: ///< 违章变道
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_CROSSLANE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_OVERYELLOWLINE: ///< 压黄线
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_OVERYELLOWLINE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_YELLOWPLATEINLANE: ///< 黄牌车占道事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_YELLOWPLATEINLANE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_PEDESTRAINPRIORITY: ///< 斑马线行人优先事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_PEDESTRAINPRIORITY");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_MANUALSNAP: ///< 交通手动抓拍事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_MANUALSNAP");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_VEHICLEINROUTE: ///< 有车占道事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_VEHICLEINROUTE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_VEHICLEINBUSROUTE: ///< 占用公交车道事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_VEHICLEINBUSROUTE");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_BACKING: ///< 违章倒车事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_BACKING");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_PARKINGSPACEPARKING: ///< 车位有车事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_PARKINGSPACEPARKING");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_PARKINGSPACENOPARKING: ///< 车位无车事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_PARKINGSPACENOPARKING");
|
||||||
|
break;
|
||||||
|
case NetSDKLib.EVENT_IVS_TRAFFIC_WITHOUT_SAFEBELT: ///< 交通未系安全带事件
|
||||||
|
name = bundle.getString("EVENT_IVS_TRAFFIC_WITHOUT_SAFEBELT");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRecordType() {
|
||||||
|
return bundle.getString("RECORD_TYPE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return bundle.getString("START_TIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
return bundle.getString("END_TIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getDownloadTableName() {
|
||||||
|
String[] name = {getIndex(),
|
||||||
|
getChannel(),
|
||||||
|
getRecordType(),
|
||||||
|
getStartTime(),
|
||||||
|
getEndTime()};
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadByFile() {
|
||||||
|
return bundle.getString("DOWNLOAD_RECORD_BYFILE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuery() {
|
||||||
|
return bundle.getString("QUERY");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownload() {
|
||||||
|
return bundle.getString("DOWNLOAD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStopDownload() {
|
||||||
|
return bundle.getString("STOP_DOWNLOAD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadByTime() {
|
||||||
|
return bundle.getString("DOWNLOAD_RECORD_BYTIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectTimeAgain() {
|
||||||
|
return bundle.getString("PLEASE_SELECT_TIME_AGAIN");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectRowWithData() {
|
||||||
|
return bundle.getString("PLEASE_FIRST_SELECT_ROW_WITH_DATA");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQueryRecord() {
|
||||||
|
return bundle.getString("PLEASE_FIRST_QUERY_RECORD");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadCompleted() {
|
||||||
|
return bundle.getString("DOWNLOAD_COMPLETED");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取录像类型
|
||||||
|
*/
|
||||||
|
public String getRecordTypeStr(int nRecordFileType) {
|
||||||
|
String recordTypeStr = "";
|
||||||
|
switch(nRecordFileType) {
|
||||||
|
case 0:
|
||||||
|
recordTypeStr = bundle.getString("GENERAL_RECORD");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
recordTypeStr = bundle.getString("ALARM_RECORD");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
recordTypeStr = bundle.getString("MOTION_DETECTION");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
recordTypeStr = bundle.getString("CARD_NUMBER_RECORD");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return recordTypeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRecordTypeInt(String recordFileStr) {
|
||||||
|
int recordType = -1;
|
||||||
|
if(recordFileStr.equals(bundle.getString("GENERAL_RECORD"))) {
|
||||||
|
recordType = 0;
|
||||||
|
} else if(recordFileStr.equals(bundle.getString("ALARM_RECORD"))) {
|
||||||
|
recordType = 1;
|
||||||
|
} else if(recordFileStr.equals(bundle.getString("MOTION_DETECTION"))) {
|
||||||
|
recordType = 2;
|
||||||
|
} else if(recordFileStr.equals(bundle.getString("CARD_NUMBER_RECORD"))) {
|
||||||
|
recordType = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return recordType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import dahua.ToolKits;
|
||||||
|
|
||||||
|
public class SavePath {
|
||||||
|
private SavePath() {}
|
||||||
|
|
||||||
|
private static class SavePathHolder {
|
||||||
|
private static SavePath instance = new SavePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SavePath getSavePath() {
|
||||||
|
return SavePathHolder.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
String s_captureSavePath = "./Capture/" + ToolKits.getDate() + "/"; // 抓拍图片保存路径
|
||||||
|
String s_imageSavePath = "./Image/" + ToolKits.getDate() + "/"; // 图片保存路径
|
||||||
|
String s_recordFileSavePath = "./RecordFile/" + ToolKits.getDate() + "/"; // 录像保存路径
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 设置抓图保存路径
|
||||||
|
*/
|
||||||
|
public String getSaveSnapPath() {
|
||||||
|
File path1 = new File("./Capture/");
|
||||||
|
if (!path1.exists()) {
|
||||||
|
path1.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
File path2 = new File(s_captureSavePath);
|
||||||
|
if (!path2.exists()) {
|
||||||
|
path2.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
String strFileName = s_captureSavePath + ToolKits.getDate() + ".jpg";
|
||||||
|
|
||||||
|
return strFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 设置智能交通图片保存路径
|
||||||
|
*/
|
||||||
|
public String getSaveTrafficImagePath() {
|
||||||
|
File path1 = new File("./Image/");
|
||||||
|
if (!path1.exists()) {
|
||||||
|
path1.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
File path = new File(s_imageSavePath);
|
||||||
|
if (!path.exists()) {
|
||||||
|
path.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
return s_imageSavePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 设置录像保存路径
|
||||||
|
*/
|
||||||
|
public String getSaveRecordFilePath() {
|
||||||
|
File path1 = new File("./RecordFile/");
|
||||||
|
if (!path1.exists()) {
|
||||||
|
path1.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
File path2 = new File(s_recordFileSavePath);
|
||||||
|
if (!path2.exists()) {
|
||||||
|
path2.mkdir();
|
||||||
|
}
|
||||||
|
String SavedFileName = s_recordFileSavePath + ToolKits.getDate() + ".dav"; // 默认保存路径
|
||||||
|
return SavedFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,194 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.awt.event.KeyListener;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
import com.sun.jna.Pointer;
|
||||||
|
import com.sun.jna.Structure;
|
||||||
|
|
||||||
|
public class ToolKits {
|
||||||
|
/***************************************************************************************************
|
||||||
|
* 工具方法 *
|
||||||
|
***************************************************************************************************/
|
||||||
|
public static void GetPointerData(Pointer pNativeData, Structure pJavaStu) {
|
||||||
|
GetPointerDataToStruct(pNativeData, 0, pJavaStu);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GetPointerDataToStruct(Pointer pNativeData, long OffsetOfpNativeData, Structure pJavaStu) {
|
||||||
|
pJavaStu.write();
|
||||||
|
Pointer pJavaMem = pJavaStu.getPointer();
|
||||||
|
pJavaMem.write(0, pNativeData.getByteArray(OffsetOfpNativeData, pJavaStu.size()), 0, pJavaStu.size());
|
||||||
|
pJavaStu.read();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GetPointerDataToStructArr(Pointer pNativeData, Structure[] pJavaStuArr) {
|
||||||
|
long offset = 0;
|
||||||
|
for (int i = 0; i < pJavaStuArr.length; ++i) {
|
||||||
|
GetPointerDataToStruct(pNativeData, offset, pJavaStuArr[i]);
|
||||||
|
offset += pJavaStuArr[i].size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将结构体数组拷贝到内存
|
||||||
|
*
|
||||||
|
* @param pNativeData
|
||||||
|
* @param pJavaStuArr
|
||||||
|
*/
|
||||||
|
public static void SetStructArrToPointerData(Structure[] pJavaStuArr, Pointer pNativeData) {
|
||||||
|
long offset = 0;
|
||||||
|
for (int i = 0; i < pJavaStuArr.length; ++i) {
|
||||||
|
SetStructDataToPointer(pJavaStuArr[i], pNativeData, offset);
|
||||||
|
offset += pJavaStuArr[i].size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetStructDataToPointer(Structure pJavaStu, Pointer pNativeData, long OffsetOfpNativeData) {
|
||||||
|
pJavaStu.write();
|
||||||
|
Pointer pJavaMem = pJavaStu.getPointer();
|
||||||
|
pNativeData.write(OffsetOfpNativeData, pJavaMem.getByteArray(0, pJavaStu.size()), 0, pJavaStu.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void savePicture(byte[] pBuf, String sDstFile) {
|
||||||
|
try {
|
||||||
|
FileOutputStream fos = new FileOutputStream(sDstFile);
|
||||||
|
fos.write(pBuf);
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void savePicture(byte[] pBuf, int dwBufOffset, int dwBufSize, String sDstFile) {
|
||||||
|
try {
|
||||||
|
FileOutputStream fos = new FileOutputStream(sDstFile);
|
||||||
|
fos.write(pBuf, dwBufOffset, dwBufSize);
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void savePicture(Pointer pBuf, int dwBufSize, String sDstFile) {
|
||||||
|
try {
|
||||||
|
FileOutputStream fos = new FileOutputStream(sDstFile);
|
||||||
|
fos.write(pBuf.getByteArray(0, dwBufSize), 0, dwBufSize);
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void savePicture(Pointer pBuf, int dwBufOffset, int dwBufSize, String sDstFile) {
|
||||||
|
try {
|
||||||
|
FileOutputStream fos = new FileOutputStream(sDstFile);
|
||||||
|
fos.write(pBuf.getByteArray(dwBufOffset, dwBufSize), 0, dwBufSize);
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将Pointer值转为byte[]
|
||||||
|
public static String GetPointerDataToByteArr(Pointer pointer) {
|
||||||
|
String str = "";
|
||||||
|
if (pointer == null) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
int length = 0;
|
||||||
|
byte[] bufferPlace = new byte[1];
|
||||||
|
|
||||||
|
for (int i = 0; i < 2048; i++) {
|
||||||
|
pointer.read(i, bufferPlace, 0, 1);
|
||||||
|
if (bufferPlace[0] == '\0') {
|
||||||
|
length = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length > 0) {
|
||||||
|
byte[] buffer = new byte[length];
|
||||||
|
pointer.read(0, buffer, 0, length);
|
||||||
|
try {
|
||||||
|
str = new String(buffer, "GBK").trim();
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前时间
|
||||||
|
public static String getDate() {
|
||||||
|
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String date = simpleDate.format(new java.util.Date()).replace(" ", "_").replace(":", "-");
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制JTextField 长度,以及内容
|
||||||
|
public static void limitTextFieldLength(final JTextField jTextField, final int size) {
|
||||||
|
jTextField.addKeyListener(new KeyListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyTyped(KeyEvent e) {
|
||||||
|
String number = "0123456789" + (char) 8;
|
||||||
|
if (number.indexOf(e.getKeyChar()) < 0 || jTextField.getText().trim().length() >= size) {
|
||||||
|
e.consume();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyReleased(KeyEvent e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前窗口
|
||||||
|
public static JFrame getFrame(ActionEvent e) {
|
||||||
|
JButton btn = (JButton) e.getSource();
|
||||||
|
JFrame frame = (JFrame) btn.getRootPane().getParent();
|
||||||
|
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取操作平台信息
|
||||||
|
public static String getLoadLibrary(String library) {
|
||||||
|
String path = "";
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
if (os.toLowerCase().startsWith("win")) {
|
||||||
|
path = "./libs/";
|
||||||
|
} else if (os.toLowerCase().startsWith("linux")) {
|
||||||
|
path = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (path + library);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getOsName() {
|
||||||
|
String osName = "";
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
if (os.toLowerCase().startsWith("win")) {
|
||||||
|
osName = "win";
|
||||||
|
} else if (os.toLowerCase().startsWith("linux")) {
|
||||||
|
osName = "linux";
|
||||||
|
}
|
||||||
|
|
||||||
|
return osName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package dahua;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import com.sun.jna.Platform;
|
||||||
|
|
||||||
|
public class Utils {
|
||||||
|
public Utils() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 读取当前目录下的路径配置文件
|
||||||
|
public static String readConfigProperties(String key) {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
String rootPath = System.getProperty("user.dir").replace("\\", "/"); // 获取当前目录
|
||||||
|
FileInputStream inputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = new FileInputStream(rootPath + "/config.properties");
|
||||||
|
properties.load(inputStream);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return properties.getProperty(key);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue