bprocessor-commit Mailing List for B-processor (Page 8)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2010-12-07 14:43:39
|
Update of /cvsroot/bprocessor/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4359 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 3 Dec 2010 10:12:11 -0000 1.1 --- build.xml 7 Dec 2010 14:43:30 -0000 1.2 *************** *** 94,97 **** --- 94,102 ---- </fileset> </copy> + <copy todir="${lib.dir}"> + <fileset dir="${tools.dir}/jaxb"> + <include name="**/jaxb.jar"/> + </fileset> + </copy> </target> *************** *** 115,118 **** --- 120,134 ---- <metainf dir="${conf.dir}" includes="*.xml"/> </jar> + <copy todir="${dist.dir}"> + <fileset dir="${lib.dir}"> + <include name="log4j.jar"/> + </fileset> + <fileset dir="${lib.dir}"> + <include name="jaxb.jar"/> + </fileset> + <fileset dir="${conf.dir}"> + <include name="log4j.properties"/> + </fileset> + </copy> </target> *************** *** 132,136 **** --- 148,156 ---- <include name="**/*"/> </fileset> + <fileset dir="${conf.dir}"> + <include name="log4j.properties"/> + </fileset> </copy> + </target> |
From: Michael L. <he...@us...> - 2010-12-07 14:43:39
|
Update of /cvsroot/bprocessor/bprocessor/src/etc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4359/src/etc Modified Files: manifest.mf Added Files: log4j.properties Log Message: Index: manifest.mf =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/etc/manifest.mf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** manifest.mf 3 Dec 2010 10:12:11 -0000 1.1 --- manifest.mf 7 Dec 2010 14:43:30 -0000 1.2 *************** *** 1,2 **** Main-Class: net.sourceforge.bprocessor.Application ! Class-Path: log4j.jar jaxb.jar library/antlr.jar library/asm-attrs.jar library/asm.jar library/bscript.jar library/cglib.jar library/commons-collections.jar library/commons-logging.jar library/dom4j.jar library/ehcache.jar library/gluegen-rt.jar core/gui.jar library/hibernate3.jar library/hsqldb.jar library/jogl.jar library/jta.jar library/model.jar library/oscache.jar library/postgresql-8.0-312.jdbc3.jar library/routefinding.jar log4j.jar plugin/facade.jar plugin/gl.jar --- 1,2 ---- Main-Class: net.sourceforge.bprocessor.Application ! Class-Path: log4j.jar jaxb.jar library/antlr.jar library/asm-attrs.jar library/asm.jar library/bscript.jar library/cglib.jar library/commons-collections.jar library/commons-logging.jar library/dom4j.jar library/ehcache.jar library/gluegen-rt.jar core/gui.jar library/hibernate3.jar library/hsqldb.jar library/jogl.jar library/jta.jar library/model.jar library/oscache.jar library/postgresql-8.0-312.jdbc3.jar library/routefinding.jar log4j.jar plugin/gl.jar --- NEW FILE: log4j.properties --- # Setup the root category log4j.rootCategory=INFO, Console #log4j.category.net.sourceforge.bprocessor=INFO #log4j.category.net.sourceforge.bprocessor.gl=DEBUG ### The server.log file appender log4j.appender.Default=org.apache.log4j.RollingFileAppender log4j.appender.Default.File=kernel.log log4j.appender.Default.MaxFileSize=20000KB log4j.appender.Default.MaxBackupIndex=1 log4j.appender.Default.layout=org.apache.log4j.PatternLayout # Truncate if it aleady exists. log4j.appender.Default.Append=false # Console log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.Threshold=DEBUG log4j.appender.Console.layout=org.apache.log4j.PatternLayout # The pattern: Date Priority [Category] (Thread) Message\n log4j.appender.Default.layout.ConversionPattern=%d %-5p [%c] (%t) %m%n log4j.appender.Console.layout.ConversionPattern=%d %-5p [%c] (%t) %m%n |
From: Michael L. <he...@us...> - 2010-12-07 14:43:39
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4359/src/net/sourceforge/bprocessor Modified Files: Main.java Shell.java Loader.java Removed Files: Plugin.java Log Message: Index: Main.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Main.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.java 3 Dec 2010 11:40:54 -0000 1.1 --- Main.java 7 Dec 2010 14:43:30 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package net.sourceforge.bprocessor; + import net.sourceforge.bprocessor.facade.FacadeMain; + import org.apache.log4j.PropertyConfigurator; *************** *** 11,14 **** --- 13,17 ---- public void run() { + shell.add(new FacadeMain()); shell.prepare(); shell.start(); --- Plugin.java DELETED --- Index: Shell.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Shell.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Shell.java 3 Dec 2010 11:40:54 -0000 1.1 --- Shell.java 7 Dec 2010 14:43:30 -0000 1.2 *************** *** 4,9 **** import java.util.List; - import net.sourceforge.bprocessor.facade.FacadeMain; import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.GUI; --- 4,9 ---- import java.util.List; import net.sourceforge.bprocessor.gl.Editor; + import net.sourceforge.bprocessor.gl.Plugin; import net.sourceforge.bprocessor.gui.GUI; *************** *** 15,19 **** new GUI(); new Editor(); - new FacadeMain(); } --- 15,18 ---- Index: Loader.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Loader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Loader.java 3 Dec 2010 11:40:54 -0000 1.1 --- Loader.java 7 Dec 2010 14:43:30 -0000 1.2 *************** *** 10,13 **** --- 10,15 ---- import java.util.jar.Manifest; + import net.sourceforge.bprocessor.gl.Plugin; + public class Loader { private Shell shell; *************** *** 34,41 **** } ! URL[] urla = new URL[urls.size()]; ! urla = urls.toArray(urla); ! URLClassLoader loader = new URLClassLoader(urla); ! for (String name : names) { Class clazz = Class.forName(name, true, loader); --- 36,41 ---- } ! URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()])); ! for (String name : names) { Class clazz = Class.forName(name, true, loader); |
From: Michael L. <he...@us...> - 2010-12-07 14:43:38
|
Update of /cvsroot/bprocessor/bprocessor/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4359/lib Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- *.jar *.zip |
From: Michael L. <he...@us...> - 2010-12-03 11:41:02
|
Update of /cvsroot/bprocessor/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8723 Modified Files: b-processor (mac).launch Log Message: Index: b-processor (mac).launch =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/b-processor (mac).launch,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** b-processor (mac).launch 1 Sep 2009 06:43:45 -0000 1.1 --- b-processor (mac).launch 3 Dec 2010 11:40:53 -0000 1.2 *************** *** 3,12 **** <stringAttribute key="bad_container_name" value="/bprocessor/s"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> ! <listEntry value="/bprocessor/src/net/sourceforge/bprocessor/Application.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> ! <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.sourceforge.bprocessor.Application"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:kernel}/src/etc/log4j.properties"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bprocessor"/> --- 3,12 ---- <stringAttribute key="bad_container_name" value="/bprocessor/s"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> ! <listEntry value="/bprocessor/src/net/sourceforge/bprocessor/Main.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> ! <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.sourceforge.bprocessor.Main"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:kernel}/src/etc/log4j.properties"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bprocessor"/> |
From: Michael L. <he...@us...> - 2010-12-03 11:41:02
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8723/src/net/sourceforge/bprocessor Modified Files: Application.java Added Files: Main.java Shell.java Plugin.java Loader.java Log Message: Index: Application.java =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor/Application.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Application.java 25 Jun 2009 20:29:20 -0000 1.10 --- Application.java 3 Dec 2010 11:40:54 -0000 1.11 *************** *** 1,16 **** package net.sourceforge.bprocessor; ! import net.sourceforge.bprocessor.facade.FacadeMain; ! import net.sourceforge.bprocessor.gl.Editor; ! import net.sourceforge.bprocessor.gui.GUI; ! import org.apache.log4j.PropertyConfigurator; public class Application { ! public Application() { super(); } /** * @param args --- 1,51 ---- package net.sourceforge.bprocessor; ! import java.io.File; ! import java.net.URL; import org.apache.log4j.PropertyConfigurator; public class Application { ! private Shell shell; ! private Loader loader; ! public Application() { super(); + shell = new Shell(); + loader = new Loader(shell); + } + + public String applicationPath() { + URL url = Application.class.getProtectionDomain().getCodeSource().getLocation(); + return url.getFile(); + } + public String pluginsPath() { + String current = applicationPath(); + while (current != null) { + File tester = new File(current, "plugins"); + if (tester.isDirectory()) { + return tester.getAbsolutePath(); + } + File directory = new File(current); + current = directory.getParent(); + } + return "."; } + public void load() throws Exception { + String path = pluginsPath(); + System.out.println("plugins-path: " + path); + loader.load(path); + } + + public void run() { + try { + load(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** * @param args *************** *** 21,27 **** PropertyConfigurator.configure(args[0]); } ! new GUI(); ! new Editor(); ! new FacadeMain(); } } --- 56,61 ---- PropertyConfigurator.configure(args[0]); } ! ! new Application().run(); } } --- NEW FILE: Main.java --- package net.sourceforge.bprocessor; import org.apache.log4j.PropertyConfigurator; public class Main { private Shell shell; public Main() { shell = new Shell(); } public void run() { shell.prepare(); shell.start(); } /** * @param args */ public static void main(String[] args) { System.out.println("os = " + System.getProperty("os.name")); if (args.length > 0) { PropertyConfigurator.configure(args[0]); } new Main().run(); } } --- NEW FILE: Plugin.java --- package net.sourceforge.bprocessor; public interface Plugin { public String name(); public void prepare(); public void start(); } --- NEW FILE: Shell.java --- package net.sourceforge.bprocessor; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.facade.FacadeMain; import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.GUI; public class Shell { private List<Plugin> plugins; public Shell() { plugins = new LinkedList<Plugin>(); new GUI(); new Editor(); new FacadeMain(); } public void add(Plugin plugin) { plugins.add(plugin); } public void prepare() { for (Plugin current : plugins) { current.prepare(); } } public void start() { for (Plugin current : plugins) { current.start(); } } } --- NEW FILE: Loader.java --- package net.sourceforge.bprocessor; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.util.LinkedList; import java.util.List; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; public class Loader { private Shell shell; public Loader(Shell shell) { this.shell = shell; } public void load(List<String> paths) throws Exception { List<String> names = new LinkedList<String>(); List<URL> urls = new LinkedList<URL>(); for (String path : paths) { File file = new File(path); URL url = file.toURI().toURL(); System.out.println("loading: " + url); JarFile jarfile = new JarFile(path); Manifest manifest = jarfile.getManifest(); Attributes attributes = manifest.getMainAttributes(); String name = attributes.getValue("Plugin"); if (name != null) { names.add(name); } urls.add(url); } URL[] urla = new URL[urls.size()]; urla = urls.toArray(urla); URLClassLoader loader = new URLClassLoader(urla); for (String name : names) { Class clazz = Class.forName(name, true, loader); if (clazz != null) { System.out.println("located clazz " + name); Plugin plugin = (Plugin) clazz.newInstance(); shell.add(plugin); } } shell.prepare(); shell.start(); } public void load(String path) throws Exception { File file = new File(path); List<String> paths = new LinkedList<String>(); for (File current : file.listFiles()) { String name = current.getName(); if (name.endsWith(".jar")) { paths.add(current.getAbsolutePath()); } } load(paths); } } |
From: Michael L. <he...@us...> - 2010-12-03 10:12:21
|
Update of /cvsroot/bprocessor/build/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16868/bin Modified Files: bprocessor.sh bprocessor.bat Added Files: kernel.sh kernel.bat Log Message: Index: bprocessor.sh =================================================================== RCS file: /cvsroot/bprocessor/build/bin/bprocessor.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bprocessor.sh 26 Oct 2005 09:13:02 -0000 1.4 --- bprocessor.sh 3 Dec 2010 10:12:14 -0000 1.5 *************** *** 21,23 **** fi ! "$JAVA_HOME/bin/java" -Djava.library.path=$LIBDIR $PLATFORM_DEFS -jar kernel.jar --- 21,24 ---- fi ! "$JAVA_HOME/bin/java" -Djava.library.path=$LIBDIR $PLATFORM_DEFS -jar bprocessor.jar log4j.properties ! Index: bprocessor.bat =================================================================== RCS file: /cvsroot/bprocessor/build/bin/bprocessor.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bprocessor.bat 9 Aug 2007 16:08:45 -0000 1.3 --- bprocessor.bat 3 Dec 2010 10:12:14 -0000 1.4 *************** *** 2,6 **** if "%JAVA_HOME%" == "" goto error ! "%JAVA_HOME%\bin\java" -Djava.library.path=library/win32 -jar kernel.jar goto end --- 2,6 ---- if "%JAVA_HOME%" == "" goto error ! "%JAVA_HOME%\bin\java" -Djava.library.path=library/win32 -jar bprocessor.jar log4j.properties goto end --- NEW FILE: kernel.bat --- @echo off if "%JAVA_HOME%" == "" goto error "%JAVA_HOME%\bin\java" -Djava.library.path=library/win32 -jar kernel.jar goto end :error echo "You'll need to set the JAVA_HOME variable to point to your Java installation" echo "F.ex: set JAVA_HOME=c:\j2sdk1.5.0" :end --- NEW FILE: kernel.sh --- #!/bin/sh if [ -z "$JAVA_HOME" ]; then echo "You'll need to set the JAVA_HOME variable to point to your Java installation" echo "F.ex: export JAVA_HOME=/usr/local/j2sdk1.4.2_08" exit 1 fi echo $OSTYPE OS=$OSTYPE LIBDIR=library/linux PLATFORM_DEFS= if [ $OS != "linux" ]; then if [ $OS == "cygwin" ]; then LIBDIR=library/win32 else LIBDIR=library/macosx PLATFORM_DEFS='-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=B-Processor' fi fi "$JAVA_HOME/bin/java" -Djava.library.path=$LIBDIR $PLATFORM_DEFS -jar kernel.jar |
From: Michael L. <he...@us...> - 2010-12-03 10:12:21
|
Update of /cvsroot/bprocessor/build In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16868 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** build.xml 7 May 2010 13:36:02 -0000 1.36 --- build.xml 3 Dec 2010 10:12:14 -0000 1.37 *************** *** 16,19 **** --- 16,20 ---- <property name="gl.dir" value="${basedir}/../gl"/> <property name="facade.dir" value="${basedir}/../facade"/> + <property name="bprocessor.dir" value="${basedir}/../bprocessor"/> <property name="bproc.dir" value="${basedir}/../bprocessor"/> <property name="release.dir" value="${basedir}/dist"/> *************** *** 36,39 **** --- 37,41 ---- <ant dir="${gl.dir}" target="clean"/> <ant dir="${facade.dir}" target="clean"/> + <ant dir="${bprocessor.dir}" target="clean"/> </target> *************** *** 51,54 **** --- 53,57 ---- <ant dir="${gl.dir}" target="dist"/> <ant dir="${facade.dir}" target="dist"/> + <ant dir="${bprocessor.dir}" target="dist"/> <copy todir="${release.dir}"> <fileset dir="${bproc.dir}"> |
From: Michael L. <he...@us...> - 2010-12-03 10:12:19
|
Update of /cvsroot/bprocessor/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16847 Added Files: build.sh build.xml Log Message: --- NEW FILE: build.sh --- #!/bin/sh if [ -z $ANT_HOME ]; then echo "Please set the ANT_HOME variable." exit 1 fi if [ -z $JAVA_HOME ]; then echo "Please set the JAVA_HOME variable." exit 1 fi export PATH=$ANT_HOME/bin:$JAVA_HOME/bin:$PATH ant $* --- NEW FILE: build.xml --- <project name="bprocessor" default="compile" basedir="."> <target name="init"> <property name="name" value="bprocessor"/> <property name="version" value="0.1"/> <property name="kernel.dir" value="${basedir}/../kernel"/> <property name="model.dir" value="${basedir}/../model"/> <property name="bscript.dir" value="${basedir}/../bscript"/> <property name="tools.dir" value="${basedir}/../tools"/> <property name="gui.dir" value="${basedir}/../gui"/> <property name="facade.dir" value="${basedir}/../facade"/> <property name="gl.dir" value="${basedir}/../gl"/> <property name="build.dir" value="${basedir}/build"/> <property name="src.dir" value="${basedir}/src"/> <property name="conf.dir" value="${src.dir}/etc"/> <property name="gfx.dir" value="${src.dir}/gfx"/> <property name="doc.dir" value="${basedir}/doc"/> <property name="doc.api.dir" value="${doc.dir}/api"/> <property name="lib.dir" value="${basedir}/lib"/> <property name="dist.dir" value="${basedir}/dist"/> <property name="checkstyle-results" value="${build.dir}/checkstyle-results.txt" /> <property name="build.compiler" value="modern"/> </target> <target name="clean" depends="init"> <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> <delete dir="${doc.api.dir}"/> <delete> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> </delete> <delete> <fileset dir="${basedir}" defaultexcludes="no"> <include name="**/*~"/> </fileset> </delete> </target> <target name="prepare" depends="init"> <echo message="build.compiler = ${build.compiler}"/> <echo message="java.home = ${java.home}"/> <echo message="user.home = ${user.home}"/> <echo message="java.class.path = ${java.class.path}"/> <echo message=""/> <echo message="build.dir = ${build.dir}"/> <mkdir dir="${build.dir}"/> </target> <target name="copylib" depends="prepare"> <copy todir="${lib.dir}"> <fileset dir="${tools.dir}/log4j"> <include name="**/*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${tools.dir}/jogl"> <include name="**/*.jar"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${kernel.dir}/dist"> <include name="**/kernel*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${model.dir}/dist"> <include name="**/model*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${bscript.dir}/dist"> <include name="**/bscript*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${facade.dir}/dist"> <include name="**/facade*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${gl.dir}/dist"> <include name="**/gl*"/> </fileset> </copy> <copy todir="${lib.dir}"> <fileset dir="${gui.dir}/dist"> <include name="**/gui*"/> </fileset> </copy> </target> <target name="compile" depends="copylib"> <ant dir="src" target="compile"/> </target> <target name="doc" depends="copylib"> <delete dir="${doc.api.dir}"/> <ant dir="src" target="doc"/> </target> <target name="jar" depends="compile"> <mkdir dir="${dist.dir}"/> <jar jarfile="${dist.dir}/${name}.jar" basedir="${build.dir}" compress="true" includes="**/*" manifest="${conf.dir}/manifest.mf" excludes="depcache/**"> <metainf dir="${conf.dir}" includes="*.xml"/> </jar> </target> <target name="fix" depends="init"> <fixcrlf srcdir="${src.dir}" tab="remove" tablength="2" eol="lf" javafiles="yes" includes="**/*.java" /> </target> <target name="dist" depends="jar"> <copy todir="${basedir}/../build/dist/"> <fileset dir="${dist.dir}"> <include name="**/*"/> </fileset> </copy> </target> <target name="release" depends="clean,dist"> <move todir="${basedir}/archive/${name}-${version}"> <fileset dir="${dist.dir}"/> </move> <copy todir="${basedir}/archive/${name}-${version}"> <fileset dir="${doc.dir}"> <include name="**/*"/> <exclude name="*~, ${doc.api.dir}/*"/> </fileset> </copy> <tar tarfile="${basedir}/${name}-${version}.tar" basedir="${basedir}/archive"/> <gzip zipfile="${basedir}/${name}-${version}.tar.gz" src="${basedir}/${name}-${version}.tar"/> <bzip2 zipfile="${basedir}/${name}-${version}.tar.bz2" src="${basedir}/${name}-${version}.tar"/> <zip zipfile="${basedir}/${name}-${version}.zip" basedir="${basedir}/archive"/> <delete dir="${basedir}/archive"/> <delete file="${basedir}/${name}-${version}.tar"/> </target> </project> |
From: Michael L. <he...@us...> - 2010-12-03 10:12:19
|
Update of /cvsroot/bprocessor/bprocessor/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16847/src Added Files: build.xml Log Message: --- NEW FILE: build.xml --- <project name="src" default="compile" basedir="."> <path id="build.path"> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> <pathelement location="."/> <pathelement location="${tools.dir}/antlr/antlr.jar"/> </path> <target name="init"> <mkdir dir="${build.dir}"/> </target> <target name="compile"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" debug="yes" target="1.5" source="1.5" includes="net/**"> <classpath refid="build.path"/> </javac> </target> <target name="dep" depends="init"> <depend srcdir="${src.dir}" destdir="${build.dir}" cache="${build.dir}/depcache" closure="yes" /> </target> </project> |
From: Michael L. <he...@us...> - 2010-12-03 10:12:18
|
Update of /cvsroot/bprocessor/bprocessor/src/etc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16847/src/etc Added Files: manifest.mf Log Message: --- NEW FILE: manifest.mf --- Main-Class: net.sourceforge.bprocessor.Application Class-Path: log4j.jar jaxb.jar library/antlr.jar library/asm-attrs.jar library/asm.jar library/bscript.jar library/cglib.jar library/commons-collections.jar library/commons-logging.jar library/dom4j.jar library/ehcache.jar library/gluegen-rt.jar core/gui.jar library/hibernate3.jar library/hsqldb.jar library/jogl.jar library/jta.jar library/model.jar library/oscache.jar library/postgresql-8.0-312.jdbc3.jar library/routefinding.jar log4j.jar plugin/facade.jar plugin/gl.jar |
From: Michael L. <he...@us...> - 2010-12-03 10:12:14
|
Update of /cvsroot/bprocessor/bprocessor/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16836/lib Log Message: Directory /cvsroot/bprocessor/bprocessor/lib added to the repository |
From: Michael L. <he...@us...> - 2010-12-01 11:52:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28529/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Tool.java Log Message: Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** ToolFactory.java 1 Dec 2010 10:28:04 -0000 1.110 --- ToolFactory.java 1 Dec 2010 11:52:26 -0000 1.111 *************** *** 168,172 **** "Biconselecttool2.gif", "Sensor Select")); ! viewingset.add(registerTool(Tool.FOUR, four, "four.png", "Mold ~ Four Weeks")); --- 168,172 ---- "Biconselecttool2.gif", "Sensor Select")); ! viewingset.add(registerTool("four", four, "four.png", "Mold ~ Four Weeks")); *************** *** 187,191 **** modellingset.add(addSeparator(2)); ! modellingset.add(registerTool(Tool.FINAL_MOVE_TOOL, moving, "Biconmovetool.gif", "Move")); modellingset.add(registerTool(Tool.ROTATION_TOOL, rotation, "rotation-icon.png", "Rotate")); --- 187,191 ---- modellingset.add(addSeparator(2)); ! modellingset.add(registerTool(Tool.MOVE_TOOL, moving, "Biconmovetool.gif", "Move")); modellingset.add(registerTool(Tool.ROTATION_TOOL, rotation, "rotation-icon.png", "Rotate")); *************** *** 197,201 **** modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.ALT_RECT_TOOL, rectangle, "Biconaltrect.gif", "Rectangle")); modellingset.add(registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc")); --- 197,201 ---- modellingset.add(addSeparator(10)); ! modellingset.add(registerTool(Tool.RECT_TOOL, rectangle, "Biconaltrect.gif", "Rectangle")); modellingset.add(registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc")); *************** *** 223,227 **** modellingset.add(addSeparator(10)); ! Action orthoAction = new ToolAction(editor, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); --- 223,227 ---- modellingset.add(addSeparator(10)); ! Action orthoAction = new ToolAction(editor, "orthographic", "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); *************** *** 237,241 **** }; ! Action perspAction = new ToolAction(editor, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); --- 237,241 ---- }; ! Action perspAction = new ToolAction(editor, "perspective", "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); *************** *** 249,253 **** }; ! Action topAction = new ToolAction(editor, 0, "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); --- 249,253 ---- }; ! Action topAction = new ToolAction(editor, "top", "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); *************** *** 257,261 **** }; modellingset.add(Toolbar.getInstance().registerPushButtonAction(topAction, "Top")); ! Action zoomAction = new ToolAction(editor, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { double aspect = editor.getView().getAspect(); --- 257,261 ---- }; modellingset.add(Toolbar.getInstance().registerPushButtonAction(topAction, "Top")); ! Action zoomAction = new ToolAction(editor, "zoom", "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { double aspect = editor.getView().getAspect(); *************** *** 291,295 **** { { ! Action action = new ToolAction(editor, 0, "backwardicon.gif") { public void actionPerformed(ActionEvent arg0) { Project.getInstance().backward(); --- 291,295 ---- { { ! Action action = new ToolAction(editor, "backward", "backwardicon.gif") { public void actionPerformed(ActionEvent arg0) { Project.getInstance().backward(); *************** *** 300,304 **** { ! Action action = new ToolAction(editor, 0, "forwardicon.gif") { public void actionPerformed(ActionEvent arg0) { Project.getInstance().forward(); --- 300,304 ---- { ! Action action = new ToolAction(editor, "forward", "forwardicon.gif") { public void actionPerformed(ActionEvent arg0) { Project.getInstance().forward(); *************** *** 314,318 **** JToggleButton viewing; { ! Action action = new ToolAction(editor, 0, "modellingicon.gif") { public void actionPerformed(ActionEvent event) { modelling(); --- 314,318 ---- JToggleButton viewing; { ! Action action = new ToolAction(editor, "modelling", "modellingicon.gif") { public void actionPerformed(ActionEvent event) { modelling(); *************** *** 325,329 **** } { ! Action action = new ToolAction(editor, 0, "viewingicon.gif") { public void actionPerformed(ActionEvent event) { viewing(); --- 325,329 ---- } { ! Action action = new ToolAction(editor, "viewing", "viewingicon.gif") { public void actionPerformed(ActionEvent event) { viewing(); *************** *** 390,395 **** return get(Tool.SELECT_TOOL); } - - /** --- 390,393 ---- *************** *** 402,407 **** */ public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { tools.put(String.valueOf(key), tool); ! ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); --- 400,417 ---- */ public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { + return registerTool(String.valueOf(key), tool, iconname, tooltip); + } + + /** + * Register Tool + * @param key Key + * @param tool Tool + * @param iconname Icon name + * @param tooltip Tool tip + * @return Button + */ + public JToggleButton registerTool(String key, Tool tool, String iconname, String tooltip) { tools.put(String.valueOf(key), tool); ! ToolAction action = new ToolAction(editor, String.valueOf(key), iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); *************** *** 411,414 **** --- 421,425 ---- } + /** * *************** *** 422,431 **** /** ! * Get the tool i if it is a legal tool ! * @param i The tool number ! * @return The tool */ ! public Tool get(int i) { ! Tool next = (Tool) tools.get(String.valueOf(i)); applyTool(next); return next; --- 433,442 ---- /** ! * ! * @param key String ! * @return Tool */ ! public Tool get(String key) { ! Tool next = (Tool) tools.get(key); applyTool(next); return next; *************** *** 444,453 **** private void applyTool(Tool next) { ! if (next != null) { ! previousTool = currentTool; ! currentTool = next; ! if (currentTool != null) { ! JToggleButton button = (JToggleButton)buttons.get(currentTool); ! button.setSelected(true); } } --- 455,466 ---- private void applyTool(Tool next) { ! if (next != currentTool) { ! if (next != null) { ! previousTool = currentTool; ! currentTool = next; ! if (currentTool != null) { ! JToggleButton button = (JToggleButton)buttons.get(currentTool); ! button.setSelected(true); ! } } } *************** *** 468,472 **** /** key */ ! private int key; /** --- 481,485 ---- /** key */ ! private String key; /** *************** *** 476,480 **** * @param iconname Iconname */ ! public ToolAction(Editor editor, int key, String iconname) { this.editor = editor; this.key = key; --- 489,493 ---- * @param iconname Iconname */ ! public ToolAction(Editor editor, String key, String iconname) { this.editor = editor; this.key = key; Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Tool.java 26 Nov 2010 14:20:27 -0000 1.43 --- Tool.java 1 Dec 2010 11:52:26 -0000 1.44 *************** *** 21,88 **** */ public interface Tool extends MouseListener, MouseMotionListener, KeyListener, MouseWheelListener { - /** The prevoius tool (the tool used before this one) */ - public static final int PREVIOUS_TOOL = -1; /** The select tool */ ! public static final int SELECT_TOOL = 0; /** The move tool */ ! public static final int MOVE_TOOL = 1; ! /** The extrude tool */ ! public static final int EXTRUSION_TOOL = 2; /** The pencil tool */ ! public static final int PENCIL_TOOL = 3; /** The Clipping tool */ ! public static final int CLIP_TOOL = 4; /** The Camera tool */ ! public static final int CAMERA_TOOL = 5; /** The Tape Measure tool */ ! public static final int TAPE_MEASURE_TOOL = 6; ! /** The Fly tool */ ! public static final int FLY_TOOL = 7; ! /** The walk tool */ ! public static final int WALK_TOOL = 8; /** The Rotation tool */ ! public static final int ROTATION_TOOL = 9; /** The Eraser tool */ ! public static final int ERASER_TOOL = 10; /** The Arc tool */ ! public static final int ARC_TOOL = 11; /** The Rect tool */ ! public static final int RECT_TOOL = 12; /** The Protractor tool */ ! public static final int PROTRACTOR_TOOL = 13; /** The Constructor tool */ ! public static final int CONSTRUCTOR_TOOL = 14; /** The controlled extrude tool */ ! public static final int EXTEND_TOOL = 15; /** The Offset tool */ ! public static final int OFFSET_TOOL = 16; ! /** The Alternative Rect tool */ ! public static final int ALT_RECT_TOOL = 17; ! /** The controlled move tool */ ! public static final int CONTROLLED_MOVE_TOOL = 18; ! /** the alternative pecnil tool */ ! public static final int ALT_PENCIL_TOOL = 19; /** the tool for creating relation between elements */ ! public static final int RELATION_TOOL = 20; /** the tool for focusing on objects */ ! public static final int FOCUS_TOOL = 21; ! /** the tool for alternative moving of objects */ ! public static final int ALT_MOVE_TOOL = 22; ! /** the tool for alternative moving of edges */ ! public static final int EDGE_MOVE_TOOL = 23; ! /** the final tool to move them all */ ! public static final int FINAL_MOVE_TOOL = 24; /** the drag tool */ ! public static final int PAN_TOOL = 25; /** the zoom tool */ ! public static final int ZOOM_TOOL = 26; /** the zoom tool */ ! public static final int ASSIGN_TOOL = 27; /** the zoom tool */ ! public static final int SPACE_SELECT = 28; ! ! /** the FOUR tool */ ! public static final int FOUR = 29; /** --- 21,70 ---- */ public interface Tool extends MouseListener, MouseMotionListener, KeyListener, MouseWheelListener { /** The select tool */ ! public static final String SELECT_TOOL = "select"; /** The move tool */ ! public static final String MOVE_TOOL = "move"; ! /** The extrusion tool */ ! public static final String EXTRUSION_TOOL = "extrusion"; ! /** The pencil tool */ ! public static final String PENCIL_TOOL = "pencil"; /** The Clipping tool */ ! public static final String CLIP_TOOL = "clip"; /** The Camera tool */ ! public static final String CAMERA_TOOL = "camera"; ! /** The Tape Measure tool */ ! public static final String TAPE_MEASURE_TOOL = "tapemeasure"; ! /** The Rotation tool */ ! public static final String ROTATION_TOOL = "rotation"; /** The Eraser tool */ ! public static final String ERASER_TOOL = "eraser"; /** The Arc tool */ ! public static final String ARC_TOOL = "arc"; /** The Rect tool */ ! public static final String RECT_TOOL = "rect"; /** The Protractor tool */ ! public static final String PROTRACTOR_TOOL = "protractor"; /** The Constructor tool */ ! public static final String CONSTRUCTOR_TOOL = "constructor"; /** The controlled extrude tool */ ! public static final String EXTEND_TOOL = "extend"; /** The Offset tool */ ! public static final String OFFSET_TOOL = "offset"; /** the tool for creating relation between elements */ ! public static final String RELATION_TOOL = "relation"; /** the tool for focusing on objects */ ! public static final String FOCUS_TOOL = "focus"; /** the drag tool */ ! public static final String PAN_TOOL = "pan"; /** the zoom tool */ ! public static final String ZOOM_TOOL = "zooming"; /** the zoom tool */ ! public static final String ASSIGN_TOOL = "assign"; /** the zoom tool */ ! public static final String SPACE_SELECT = "space-select"; /** |
From: Michael L. <he...@us...> - 2010-12-01 11:52:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28529/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** PopupMenu.java 6 Sep 2010 13:08:40 -0000 1.49 --- PopupMenu.java 1 Dec 2010 11:52:26 -0000 1.50 *************** *** 1008,1012 **** world.add(instance); Selection.primary().set(instance); ! FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.FINAL_MOVE_TOOL); tool.activate(instance); } --- 1008,1012 ---- world.add(instance); Selection.primary().set(instance); ! FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.MOVE_TOOL); tool.activate(instance); } *************** *** 1025,1029 **** world.add(space); Selection.primary().set(space); ! FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.FINAL_MOVE_TOOL); tool.activate(space); } --- 1025,1029 ---- world.add(space); Selection.primary().set(space); ! FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.MOVE_TOOL); tool.activate(space); } |
From: Michael L. <he...@us...> - 2010-12-01 11:52:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28529/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Editor.java 1 Dec 2010 10:28:04 -0000 1.17 --- Editor.java 1 Dec 2010 11:52:26 -0000 1.18 *************** *** 399,402 **** --- 399,411 ---- */ public Tool changeTool(int mode) { + return changeTool(String.valueOf(mode)); + } + + /** + * Change the tool used by gl + * @param key The new tool + * @return The chosen tool + */ + public Tool changeTool(String key) { tool.cleanUp(); this.repaint(true); *************** *** 404,408 **** glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! tool = ToolFactory.getFactory(this).get(mode); if (tool != null) { glc.addMouseListener(tool); --- 413,417 ---- glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! tool = ToolFactory.getFactory(this).get(key); if (tool != null) { glc.addMouseListener(tool); |
From: Michael L. <he...@us...> - 2010-12-01 10:28:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7710/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** GenericTreeView.java 26 Nov 2010 14:20:34 -0000 1.153 --- GenericTreeView.java 1 Dec 2010 10:28:07 -0000 1.154 *************** *** 1675,1679 **** */ public void update(Object object) { - System.out.println("updated: " + object); updated = object; changed(); --- 1675,1678 ---- |
From: Michael L. <he...@us...> - 2010-12-01 10:28:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7658/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Editor.java 22 Dec 2009 13:51:52 -0000 1.16 --- Editor.java 1 Dec 2010 10:28:04 -0000 1.17 *************** *** 404,412 **** glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! if (mode == Tool.PREVIOUS_TOOL) { ! tool = ToolFactory.getFactory(this).get(Tool.PREVIOUS_TOOL); ! } else { ! tool = ToolFactory.getFactory(this).get(mode); ! } if (tool != null) { glc.addMouseListener(tool); --- 404,408 ---- glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! tool = ToolFactory.getFactory(this).get(mode); if (tool != null) { glc.addMouseListener(tool); |
From: Michael L. <he...@us...> - 2010-12-01 10:28:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7658/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java AbstractTool.java OffsetTool.java Log Message: Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** ToolFactory.java 26 Nov 2010 14:20:27 -0000 1.109 --- ToolFactory.java 1 Dec 2010 10:28:04 -0000 1.110 *************** *** 391,408 **** } ! /** ! * Get the previous tool ! * @return The tool ! */ ! private Tool getPrevious() { ! Tool temp = previousTool; ! previousTool = currentTool; ! currentTool = temp; ! if (currentTool != null) { ! JToggleButton button = (JToggleButton)buttons.get(currentTool); ! button.setSelected(true); ! } ! return temp; ! } /** --- 391,395 ---- } ! /** *************** *** 415,419 **** */ public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { ! tools.put(new Integer(key), tool); ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); --- 402,406 ---- */ public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { ! tools.put(String.valueOf(key), tool); ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); *************** *** 440,462 **** */ public Tool get(int i) { ! Tool temp = currentTool; ! Tool next = (Tool) tools.get(new Integer(i)); if (next != null) { ! JToggleButton button = (JToggleButton) buttons.get(next); ! button.setSelected(true); currentTool = next; ! if (currentTool != temp) { ! previousTool = temp; ! } ! return currentTool; ! } else { ! if (i == -1) { ! return getPrevious(); } - log.error("[get] No such tool " + i); - return null; } } /** * ToolAction --- 427,458 ---- */ public Tool get(int i) { ! Tool next = (Tool) tools.get(String.valueOf(i)); ! applyTool(next); ! return next; ! } ! ! /** ! * Get the previous tool ! * @return The tool ! */ ! public Tool getPrevious() { ! Tool next = previousTool; ! applyTool(next); ! return next; ! } ! ! ! private void applyTool(Tool next) { if (next != null) { ! previousTool = currentTool; currentTool = next; ! if (currentTool != null) { ! JToggleButton button = (JToggleButton)buttons.get(currentTool); ! button.setSelected(true); } } } + /** * ToolAction Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** OffsetTool.java 20 May 2010 10:58:51 -0000 1.29 --- OffsetTool.java 1 Dec 2010 10:28:04 -0000 1.30 *************** *** 371,397 **** Map<Vertex, Collection<Edge>> vertex2edges = new HashMap<Vertex, Collection<Edge>>(); Edge first = null; ! for (Geometric g : selection) { ! if (g instanceof Edge) { ! Edge e = (Edge)g; ! edges.add(e); ! Collection<Edge> fromlist = vertex2edges.get(e.getFrom()); ! if (fromlist != null) { ! fromlist.add(e); ! } else { ! fromlist = new ArrayList<Edge>(); ! fromlist.add(e); ! vertex2edges.put(e.getFrom(), fromlist); ! } ! Collection<Edge> tolist = vertex2edges.get(e.getTo()); ! if (tolist != null) { ! tolist.add(e); } else { ! tolist = new ArrayList<Edge>(); ! tolist.add(e); ! vertex2edges.put(e.getTo(), tolist); } - } else { - edges.clear(); - selection.clear(); } } --- 371,401 ---- Map<Vertex, Collection<Edge>> vertex2edges = new HashMap<Vertex, Collection<Edge>>(); Edge first = null; ! checking: ! { ! for (Geometric g : selection) { ! if (g instanceof Edge) { ! Edge e = (Edge)g; ! edges.add(e); ! Collection<Edge> fromlist = vertex2edges.get(e.getFrom()); ! if (fromlist != null) { ! fromlist.add(e); ! } else { ! fromlist = new ArrayList<Edge>(); ! fromlist.add(e); ! vertex2edges.put(e.getFrom(), fromlist); ! } ! Collection<Edge> tolist = vertex2edges.get(e.getTo()); ! if (tolist != null) { ! tolist.add(e); ! } else { ! tolist = new ArrayList<Edge>(); ! tolist.add(e); ! vertex2edges.put(e.getTo(), tolist); ! } } else { ! edges.clear(); ! selection.clear(); ! break checking; } } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** AbstractTool.java 20 May 2010 10:58:51 -0000 1.154 --- AbstractTool.java 1 Dec 2010 10:28:04 -0000 1.155 *************** *** 185,191 **** */ protected void setActiveStrategy(Strategy which) { - Tool tool = null; ToolFactory factory = ToolFactory.getFactory(editor); ! if (which != null) { which.prepare(); --- 185,191 ---- */ protected void setActiveStrategy(Strategy which) { ToolFactory factory = ToolFactory.getFactory(editor); ! Tool tool = null; ! if (which != null) { which.prepare(); *************** *** 194,207 **** } else if (which == AbstractTool.orbit) { tool = factory.get(Tool.CAMERA_TOOL); - } else if (which == AbstractTool.select) { - tool = factory.get(Tool.SELECT_TOOL); } } else { ! if (activeStrategy == AbstractTool.select) { ! this.prepare(); ! } ! Tool prev = factory.get(Tool.PREVIOUS_TOOL); if (prev != this) { ! factory.get(Tool.PREVIOUS_TOOL); } tool = this; --- 194,203 ---- } else if (which == AbstractTool.orbit) { tool = factory.get(Tool.CAMERA_TOOL); } + } else { ! Tool prev = factory.getPrevious(); if (prev != this) { ! factory.getPrevious(); } tool = this; *************** *** 305,320 **** up.scaleIt(2 / up.length()); - - if (e.getKeyCode() == KeyEvent.VK_ALT) { - metaPressed = true; - editor.setCursor(metaCursor); - return; - } - if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_META) { - setActiveStrategy(AbstractTool.select); - editor.getView().makeTarget(null); - editor.repaint(); - return; - } if (e.getKeyCode() == KeyEvent.VK_SPACE) { if (!typing) { --- 301,304 ---- *************** *** 365,372 **** setActiveStrategy(null); } - if (e.getKeyCode() == KeyEvent.VK_ALT) { - metaPressed = false; - editor.setCursor(cursor); - } if (e.getKeyCode() == KeyEvent.VK_S) { editor.getView().removeGlObjects3D(glCams); --- 349,352 ---- |
From: Michael L. <he...@us...> - 2010-11-26 14:20:42
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26399/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** GUI.java 6 Sep 2010 13:08:43 -0000 1.121 --- GUI.java 26 Nov 2010 14:20:34 -0000 1.122 *************** *** 957,961 **** Project.getInstance().checkpoint(); Project.getInstance().changed(); ! Timer timer = new Timer (2000, new ActionListener() { public void actionPerformed(ActionEvent e) { Project.getInstance().updateSensors(); --- 957,961 ---- Project.getInstance().checkpoint(); Project.getInstance().changed(); ! Timer timer = new Timer (1000, new ActionListener() { public void actionPerformed(ActionEvent e) { Project.getInstance().updateSensors(); |
From: Michael L. <he...@us...> - 2010-11-26 14:20:42
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26399/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** GenericTreeView.java 31 Aug 2010 13:48:06 -0000 1.152 --- GenericTreeView.java 26 Nov 2010 14:20:34 -0000 1.153 *************** *** 664,673 **** --- 664,688 ---- private class TargetMonitorNode extends EntityNode { + private TargetMonitor monitor; public TargetMonitorNode(TargetMonitor monitor) { super(monitor); + this.monitor = monitor; for (SensorMonitor current : monitor.getMonitors()) { add(new SensorMonitorNode(current)); } } + + + public void update(Object object) { + removeAllChildren(); + for (SensorMonitor current : monitor.getMonitors()) { + add(new SensorMonitorNode(current)); + } + model.nodeStructureChanged(this); + } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 677,680 **** --- 692,699 ---- add(new SensorHistoryNode(monitor.getSensorHistory())); } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 684,687 **** --- 703,709 ---- add(new DataSetNode(sensorHistory.getData())); } + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 693,696 **** --- 715,722 ---- } } + + public ImageIcon icon() { + return genericgroupicon; + } } *************** *** 699,702 **** --- 725,732 ---- super(item); } + + public ImageIcon icon() { + return vertexicon; + } } *************** *** 719,736 **** */ protected void makeInstanceContent(Instance space) { ! Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Envelope", surfaces, false)); ! CoordinateSystem cs = space.getAnchor(); ! if (cs != null) { ! add(new ConstructorNode(cs)); ! } ! Object obj = space.getParameters().get("target"); ! if (obj instanceof String) { ! Target target = TargetManager.instance().getTarget((String) obj); ! TargetMonitor monitor = MonitorManager.instance().get(target); add(new TargetMonitorNode(monitor)); } } /** * Update the node with the given object --- 749,769 ---- */ protected void makeInstanceContent(Instance space) { ! TargetMonitor monitor = getTarget(space); ! if (monitor != null) { add(new TargetMonitorNode(monitor)); } } + private TargetMonitor getTarget(Instance instance) { + if (instance.getParameters() != null) { + Object obj = instance.getParameters().get("moteid"); + if (obj instanceof String) { + Target target = TargetManager.instance().getTarget((String) obj); + return MonitorManager.instance().get(target); + } + } + return null; + } + /** * Update the node with the given object *************** *** 740,748 **** if (o instanceof Instance) { Instance instance = (Instance) o; ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); ! userObject = instance; ! model.nodeChanged(this); } } --- 773,783 ---- if (o instanceof Instance) { Instance instance = (Instance) o; ! TargetMonitor monitor = getTarget(instance); ! if (monitor != null) { ! if (this.getChildCount() > 0) { ! TargetMonitorNode node = (TargetMonitorNode) getChildAt(0); ! node.update(monitor); ! } ! } } } *************** *** 1640,1643 **** --- 1675,1679 ---- */ public void update(Object object) { + System.out.println("updated: " + object); updated = object; changed(); |
From: Michael L. <he...@us...> - 2010-11-26 14:20:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26351/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Item.java Instance.java Project.java Camera.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Item.java 26 Oct 2010 06:44:20 -0000 1.9 --- Item.java 26 Nov 2010 14:20:31 -0000 1.10 *************** *** 36,39 **** --- 36,41 ---- private static Logger log = Logger.getLogger(Item.class); + public static boolean DEMO = true; + /** Construction Type */ public static final int CONSTRUCTION = 0; *************** *** 607,621 **** res.add(new Attribute("Material", new Reference(material(), materials))); } ! res.add(new Attribute("Description", getDescription())); ! if (getModellor() != null) { ! res.add(new Attribute("Modellor", getModellor())); ! } ! res.add(new Attribute("Edit " + getKindName(), new Operation() { ! @Override ! public void perform() { ! Space self = (Space) Item.this; ! self.edit(); } ! })); return res; } --- 609,625 ---- res.add(new Attribute("Material", new Reference(material(), materials))); } ! if (!DEMO) { ! res.add(new Attribute("Description", getDescription())); ! if (getModellor() != null) { ! res.add(new Attribute("Modellor", getModellor())); } ! res.add(new Attribute("Edit " + getKindName(), new Operation() { ! @Override ! public void perform() { ! Space self = (Space) Item.this; ! self.edit(); ! } ! })); ! } return res; } Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Persistence.java 20 May 2010 14:20:04 -0000 1.90 --- Persistence.java 26 Nov 2010 14:20:31 -0000 1.91 *************** *** 201,204 **** --- 201,205 ---- CameraType current = (CameraType) iter.next(); Camera camera = internalizeCamera(current); + internalizeReferences(camera, current, mapper); cameras.add(camera); } *************** *** 928,931 **** --- 929,933 ---- Camera current = (Camera) iter.next(); CameraType cam = externalizeCamera(current); + externalizeReferences(current, cam, mapper); cams.add(cam); } Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Camera.java 22 Apr 2010 08:13:47 -0000 1.63 --- Camera.java 26 Nov 2010 14:20:31 -0000 1.64 *************** *** 122,125 **** --- 122,126 ---- this.addClipplane(clip.copy()); } + hiddenGeometrics = new HashSet(c.getHiddenGeometrics()); } Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Instance.java 7 May 2010 13:35:58 -0000 1.15 --- Instance.java 26 Nov 2010 14:20:31 -0000 1.16 *************** *** 16,19 **** --- 16,24 ---- import java.util.Set; + import net.sourceforge.bprocessor.model.sense.brunata.TargetManager; + import net.sourceforge.bprocessor.model.sense.core.Target; + import net.sourceforge.bprocessor.model.sense.monitor.MonitorManager; + import net.sourceforge.bprocessor.model.sense.monitor.TargetMonitor; + /** * *************** *** 198,200 **** --- 203,227 ---- return proto.getName(); } + + + private TargetMonitor getTarget(Instance instance) { + if (instance.getParameters() != null) { + Object obj = instance.getParameters().get("moteid"); + if (obj instanceof String) { + Target target = TargetManager.instance().getTarget((String) obj); + return MonitorManager.instance().get(target); + } + } + return null; + } + + public List<Attribute> getAttributes() { + List<Attribute> res = super.getAttributes(); + TargetMonitor monitor = getTarget(this); + if (monitor != null) { + res.addAll(monitor.getAttributes()); + } + return res; + } + } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** Project.java 8 Sep 2010 07:34:15 -0000 1.198 --- Project.java 26 Nov 2010 14:20:31 -0000 1.199 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.plugin.FacadePackage; import net.sourceforge.bprocessor.model.sense.brunata.TargetManager; + import net.sourceforge.bprocessor.model.sense.core.MoldTable; import net.sourceforge.bprocessor.model.sense.core.Target; import net.sourceforge.bprocessor.model.sense.monitor.DataSet; *************** *** 75,78 **** --- 76,86 ---- private static long stamp; + private static boolean liveUpdate = false; + public static boolean enableAlarms = false; + public static double temperatureThreshold = 26.0; + public static double humidityThreshold = 70.0; + public static boolean historic; + public static MoldTable moldtable; + private Tesselator tesselator; *************** *** 100,104 **** private static boolean doDisplayGeometry; ! private static boolean useDisplayLists; private static boolean doExport; --- 108,112 ---- private static boolean doDisplayGeometry; ! private static boolean useDisplayLists = false; private static boolean doExport; *************** *** 262,265 **** --- 270,274 ---- functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; + moldtable = new MoldTable("skimmel.csv"); } catch (Exception e) { log.error("Error loading classification " + e); *************** *** 981,985 **** } else if (a.getName().equals("Initial Date")) { setInitialDate((String)a.getValue()); ! } } changed(); --- 990,1002 ---- } else if (a.getName().equals("Initial Date")) { setInitialDate((String)a.getValue()); ! } else if (a.getName().equals("Live Update")) { ! liveUpdate = ((Boolean) a.getValue()).booleanValue(); ! } else if (a.getName().equals("Enable Alarms")) { ! enableAlarms = ((Boolean) a.getValue()).booleanValue(); ! } else if (a.getName().equals("Temperature Threshold")) { ! temperatureThreshold = ((Double)a.getValue()).doubleValue(); ! } else if (a.getName().equals("Humidity Threshold")) { ! humidityThreshold = ((Double)a.getValue()).doubleValue(); ! } } changed(); *************** *** 993,1009 **** ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName())); ! res.add(new Attribute("Heated area", new Double(EnergyCalc.heatedArea()), false)); ! res.add(new Attribute("Display Geometry", Boolean.valueOf(doDisplayGeometry))); ! res.add(new Attribute("Use display lists", Boolean.valueOf(useDisplayLists))); ! res.add(new Attribute("Export", Boolean.valueOf(doExport))); ! res.add(new Attribute("Export Path", getExportPath())); if (SENSE) { List<DataSet> lst = new LinkedList<DataSet>(); for (Instance current : world.collectInstances()) { ! Object obj = current.getParameters().get("target"); ! if (obj instanceof String) { ! Target target = TargetManager.instance().getTarget((String) obj); ! TargetMonitor monitor = MonitorManager.instance().get(target); ! monitor.collect(lst); } } --- 1010,1033 ---- ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName())); ! //res.add(new Attribute("Heated area", new Double(EnergyCalc.heatedArea()), false)); ! //res.add(new Attribute("Display Geometry", Boolean.valueOf(doDisplayGeometry))); ! //res.add(new Attribute("Use display lists", Boolean.valueOf(useDisplayLists))); ! // res.add(new Attribute("Export", Boolean.valueOf(doExport))); ! // res.add(new Attribute("Export Path", getExportPath())); if (SENSE) { + res.add(new Attribute("Live Update", Boolean.valueOf(liveUpdate))); + res.add(new Attribute("Enable Alarms", Boolean.valueOf(enableAlarms))); + res.add(new Attribute("Temperature Threshold", new Double(temperatureThreshold), true)); + res.add(new Attribute("Humidity Threshold", new Double(humidityThreshold), true)); + List<DataSet> lst = new LinkedList<DataSet>(); for (Instance current : world.collectInstances()) { ! if (current.getParameters() != null) { ! Object obj = current.getParameters().get("target"); ! if (obj instanceof String) { ! Target target = TargetManager.instance().getTarget((String) obj); ! TargetMonitor monitor = MonitorManager.instance().get(target); ! monitor.collect(lst); ! } } } *************** *** 1013,1017 **** } } ! res.add(new Attribute("Script", script)); return res; } --- 1037,1041 ---- } } ! //res.add(new Attribute("Script", script)); return res; } *************** *** 1986,1989 **** --- 2010,2024 ---- fetch(); } + + if (liveUpdate) { + TargetManager.instance().fill(); + } + if (enableAlarms) { + if (historic) { + MonitorManager.instance().checkMold(); + } else { + MonitorManager.instance().check(); + } + } } *************** *** 2023,2026 **** --- 2058,2074 ---- Project.getInstance().changed(); } + + public void fetchHistoric() { + MonitorManager.instance().fetchHistoric(); + historic = true; + Project.getInstance().changed(); + + } + + public void clearHistoriuc() { + MonitorManager.instance().clearHistoric(); + historic = false; + Project.getInstance().changed(); + } } |
From: Michael L. <he...@us...> - 2010-11-26 14:20:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/ti In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26351/src/net/sourceforge/bprocessor/model/sense/ti Added Files: Adapter.java CoreMeasurement.java TIHistory.java Log Message: --- NEW FILE: TIHistory.java --- package net.sourceforge.bprocessor.model.sense.ti; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.Socket; import java.net.UnknownHostException; import java.util.Date; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.sense.core.History; import net.sourceforge.bprocessor.model.sense.core.Measurement; import net.sourceforge.bprocessor.model.sense.core.Sensor; import net.sourceforge.bprocessor.model.sense.core.Target; public class TIHistory extends History { int port = 15343; String host = "localhost"; List<CoreMeasurement> buffer; public TIHistory() { buffer = new LinkedList<CoreMeasurement>(); } long stamp; public void fill(long time) throws Exception { if (time > stamp) { Socket server = new Socket(host, port); BufferedReader reader = new BufferedReader(new InputStreamReader(server.getInputStream())); PrintStream printer = new PrintStream(server.getOutputStream()); printer.println("fetch " + time); String line = reader.readLine(); while (line != null && !line.equals("done")) { CoreMeasurement core = new CoreMeasurement(line); buffer.add(core); } stamp = time; } } public List<Measurement> fetch(Target target, Sensor sensor, Date from) { return null; } @Override public List<Measurement> fetch(Target target, Sensor sensor, Date from, Date to) { // TODO Auto-generated method stub return null; } } --- NEW FILE: Adapter.java --- package net.sourceforge.bprocessor.model.sense.ti; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.Socket; import java.util.LinkedList; import net.sourceforge.bprocessor.model.sense.core.Producer; public class Adapter extends Producer{ String host = "camel15.cs.au.dk"; int port = 15343; public void fill() throws Exception { Socket server = new Socket(host, port); BufferedReader reader = new BufferedReader(new InputStreamReader(server.getInputStream())); PrintStream printer = new PrintStream(server.getOutputStream()); printer.println("fetch"); LinkedList<CoreMeasurement> buffer = new LinkedList<CoreMeasurement>(); String line = reader.readLine(); while (line != null && !line.equals("done")) { CoreMeasurement core = new CoreMeasurement(line); buffer.add(core); line = reader.readLine(); } server.close(); for (CoreMeasurement current : buffer) { consume(current); } } } --- NEW FILE: CoreMeasurement.java --- package net.sourceforge.bprocessor.model.sense.ti; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class CoreMeasurement { public long id; public long time; public double temperature; public double humidity; public CoreMeasurement(String line) { String s[] = line.split(";"); id = Long.valueOf(s[0]); time = Long.valueOf(s[1]); temperature = Double.valueOf(s[2]); humidity = Double.valueOf(s[3]); } public CoreMeasurement(long id, long time, double temperature, double humidity) { this.id = id; this.time = time; this.temperature = temperature; this.humidity = humidity; } public String toString() { DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return "[" + id + " | " + format.format(new Date(time)) + " | " + temperature + " | " + humidity + "]"; } } |
From: Michael L. <he...@us...> - 2010-11-26 14:20:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26351/src/net/sourceforge/bprocessor/model/sense/brunata Modified Files: BrunataHistory.java TargetManager.java Log Message: Index: TargetManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata/TargetManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TargetManager.java 31 Aug 2010 13:48:02 -0000 1.1 --- TargetManager.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 4,12 **** import java.util.Map; import net.sourceforge.bprocessor.model.sense.core.History; import net.sourceforge.bprocessor.model.sense.core.Sensor; import net.sourceforge.bprocessor.model.sense.core.Target; ! public class TargetManager { private static TargetManager instance; --- 4,16 ---- import java.util.Map; + import net.sourceforge.bprocessor.model.sense.core.Consumer; import net.sourceforge.bprocessor.model.sense.core.History; + import net.sourceforge.bprocessor.model.sense.core.Measurement; import net.sourceforge.bprocessor.model.sense.core.Sensor; import net.sourceforge.bprocessor.model.sense.core.Target; + import net.sourceforge.bprocessor.model.sense.ti.Adapter; + import net.sourceforge.bprocessor.model.sense.ti.CoreMeasurement; ! public class TargetManager extends Consumer { private static TargetManager instance; *************** *** 20,28 **** private Map<String, Target> targets; ! private BrunataHistory history; public TargetManager() { targets = new HashMap<String, Target>(); ! history = new BrunataHistory(); } --- 24,46 ---- private Map<String, Target> targets; ! private BrunataHistory brunata; ! private Adapter adapter; ! ! public TargetManager() { targets = new HashMap<String, Target>(); ! brunata = new BrunataHistory(); ! adapter = new Adapter(); ! adapter.add(this); ! } ! ! public void fill() { ! try { ! adapter.fill(); ! } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } } *************** *** 36,39 **** --- 54,59 ---- target.getSensors().add(humidity); targets.put(id, target); + + } return target; *************** *** 41,45 **** public History getHistory() { ! return history; } } --- 61,78 ---- public History getHistory() { ! return brunata; ! } ! ! public void consume(Object value) { ! if (value instanceof CoreMeasurement) { ! CoreMeasurement core = (CoreMeasurement) value; ! System.out.println(core); ! String id = String.valueOf(core.id); ! Target target = getTarget(id); ! Measurement temperature = new Measurement(core.time, String.valueOf(core.temperature)); ! target.newTemperature(temperature); ! Measurement humidity = new Measurement(core.time, String.valueOf(core.humidity)); ! target.newHumidity(humidity); ! } } } Index: BrunataHistory.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata/BrunataHistory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BrunataHistory.java 31 Aug 2010 13:48:02 -0000 1.1 --- BrunataHistory.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 14,19 **** import net.sourceforge.bprocessor.model.sense.brunata.xml.Document; import net.sourceforge.bprocessor.model.sense.brunata.xml.DocumentParser; - import net.sourceforge.bprocessor.model.sense.brunata.xml.Element; - import net.sourceforge.bprocessor.model.sense.brunata.xml.Atom; import net.sourceforge.bprocessor.model.sense.brunata.xml.Persistence; import net.sourceforge.bprocessor.model.sense.brunata.xml.Persistence.Serie; --- 14,17 ---- *************** *** 34,37 **** --- 32,40 ---- map.put("3138", "2501864"); map.put("3127", "2501865"); + + map.put("3890735184", "2501861"); + map.put("3890735106", "2501858"); + map.put("3890735107", "2501865"); + } |
From: Michael L. <he...@us...> - 2010-11-26 14:20:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26351/src/net/sourceforge/bprocessor/model/sense/monitor Modified Files: TargetMonitor.java SensorMonitor.java MonitorManager.java SensorHistory.java Log Message: Index: MonitorManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor/MonitorManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MonitorManager.java 31 Aug 2010 13:48:03 -0000 1.1 --- MonitorManager.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 30,32 **** --- 30,56 ---- return monitor; } + + public void check() { + for (TargetMonitor current : targetMap.values()) { + current.check(); + } + } + + public void fetchHistoric() { + for (TargetMonitor current : targetMap.values()) { + current.fetchHistoric(); + } + } + + public void clearHistoric() { + for (TargetMonitor current : targetMap.values()) { + current.clearHistoric(); + } + } + + public void checkMold() { + for (TargetMonitor current : targetMap.values()) { + current.checkMold(); + } + } } Index: TargetMonitor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor/TargetMonitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TargetMonitor.java 31 Aug 2010 13:48:03 -0000 1.1 --- TargetMonitor.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 7,15 **** --- 7,20 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Operation; import net.sourceforge.bprocessor.model.Parametric; + import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.sense.core.Measurement; import net.sourceforge.bprocessor.model.sense.core.Sensor; import net.sourceforge.bprocessor.model.sense.core.Target; public class TargetMonitor extends Entity implements Parametric { + + private Target target; private List<SensorMonitor> monitors; *************** *** 32,35 **** --- 37,64 ---- List<Attribute> attributes = new LinkedList<Attribute>(); attributes.add(new Attribute("Name", target.getId(), false)); + attributes.add(new Attribute("Temperature", target.getTemperature(), false)); + attributes.add(new Attribute("Humidity", target.getHumidity(), false)); + if (target.humidityAlarm) { + attributes.add(new Attribute("Clear Humidity Alarm", new Operation() { + public void perform() { + target.humidityAlarm = false; + } + })); + } + if (target.temperatureAlarm) { + attributes.add(new Attribute("Clear Temperature Alarm", new Operation() { + public void perform() { + target.temperatureAlarm = false; + } + })); + } + if (target.skimmelAlarm) { + attributes.add(new Attribute("Clear Mold Alarm", new Operation() { + public void perform() { + target.skimmelAlarm = false; + } + })); + } + // attributes.add(new Attribute("Name", target.getId(), false)); return attributes; } *************** *** 39,47 **** public String title() { ! return "Target"; } public String getName() { ! return "Target " + target.getId(); } --- 68,76 ---- public String title() { ! return "Mote"; } public String getName() { ! return "Mote " + target.getId(); } *************** *** 51,53 **** --- 80,178 ---- } } + + public void check() { + target.check(); + } + + public List<Measurement> getTemperatures() { + Sensor sensor = target.find("temperature"); + if (sensor != null) { + SensorMonitor monitor = get(sensor); + if (monitor != null) { + List<DataSet> lst = new LinkedList(); + List<Measurement> meas = new LinkedList<Measurement>(); + monitor.collect(lst); + for (DataSet current : lst) { + for (DataItem item : current.getItems()) { + meas.add(item.getMeasureMent()); + } + } + if (!meas.isEmpty()) { + return meas; + } + } + } + return target.getTemperatures(); + } + + private SensorMonitor get(Sensor sensor) { + for (SensorMonitor current : monitors) { + if (current.getSensor() == sensor) { + return current; + } + } + return null; + } + + public List<Measurement> getHumidities() { + System.out.println("find humidity sensor"); + Sensor sensor = target.find("humidity"); + + if (sensor != null) { + System.out.println("find monitor in " + sensor.getType()); + SensorMonitor monitor = get(sensor); + if (monitor != null) { + System.out.println("collect measurements"); + List<DataSet> lst = new LinkedList(); + List<Measurement> meas = new LinkedList<Measurement>(); + monitor.collect(lst); + for (DataSet current : lst) { + for (DataItem item : current.getItems()) { + meas.add(item.getMeasureMent()); + } + } + if (!meas.isEmpty()) { + System.out.println("returning measurements"); + return meas; + } + } + } + return target.getHumdiities(); + } + + public void fetchHistoric() { + for (SensorMonitor current: monitors) { + current.fetchHistoric(); + } + } + + public void clearHistoric() { + target.skimmelAlarm = false; + for (SensorMonitor current: monitors) { + current.clearHistoric(); + } + } + + public void checkMold() { + List<Measurement> temps = getTemperatures(); + List<Measurement> hums = getHumidities(); + + double t = 0; + for (Measurement current : temps) { + t = t + Double.valueOf(current.getValue()); + } + t = t / temps.size(); + target.average = t; + target.limit = Project.moldtable.get(t); + boolean alarm = true; + for (Measurement current : hums) { + double h = Double.valueOf(current.getValue()); + if (h < target.limit) { + alarm = false; + } + } + target.skimmelAlarm = alarm; + target.temperatureAlarm = false; + target.humidityAlarm = false; + } } Index: SensorHistory.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor/SensorHistory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensorHistory.java 31 Aug 2010 13:48:03 -0000 1.1 --- SensorHistory.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 52,55 **** --- 52,92 ---- } + public void fetchHistoric(boolean adjust) { + try { + DateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); + Date f = format.parse("2010.05.01 08:00:00"); + Date t = format.parse("2010.06.01 08:00:00"); + System.out.println("fetch " + from + " => " + to); + History history = TargetManager.instance().getHistory(); + List<Measurement> result = history.fetch(target, sensor, f, t); + if (adjust) { + if (sensor.getType().equals("temperature")) { + for (Measurement current : result) { + double temperature = Double.valueOf(current.getValue()); + temperature = temperature + 5; + current.setValue(String.valueOf(temperature)); + } + } else { + for (Measurement current : result) { + double humidity = Double.valueOf(current.getValue()); + humidity = humidity + 10; + while (humidity < 89) { + humidity = humidity + 10; + } + current.setValue(String.valueOf(humidity)); + } + } + } + data = new DataSet(sensor, result); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void clearHistoric() { + data = new DataSet(sensor, new LinkedList<Measurement>()); + } + public void delete() { } Index: SensorMonitor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor/SensorMonitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensorMonitor.java 31 Aug 2010 13:48:03 -0000 1.1 --- SensorMonitor.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 45,47 **** --- 45,65 ---- sensorHistory.collect(lst); } + + public Sensor getSensor() { + return sensor; + } + + public void fetchHistoric() { + if (target.getId().equals("3890735107")) { + sensorHistory.fetchHistoric(true); + } else { + sensorHistory.fetchHistoric(false); + } + } + + public void clearHistoric() { + sensorHistory.clearHistoric(); + } + + } |
From: Michael L. <he...@us...> - 2010-11-26 14:20:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26351/src/net/sourceforge/bprocessor/model/sense/core Modified Files: Producer.java Target.java Consumer.java Added Files: MoldEntry.java MoldTable.java Log Message: Index: Producer.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core/Producer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Producer.java 31 Aug 2010 13:48:02 -0000 1.1 --- Producer.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 18,22 **** } ! public void consume(Measurement value) { for (Consumer current : consumers) { current.consume(value); --- 18,22 ---- } ! public void consume(Object value) { for (Consumer current : consumers) { current.consume(value); Index: Target.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core/Target.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Target.java 31 Aug 2010 13:48:02 -0000 1.1 --- Target.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 4,12 **** --- 4,29 ---- import java.util.List; + import net.sourceforge.bprocessor.model.Project; + public class Target { private String id; List<Sensor> sensors; + double temperature; + double humidity; + + public double average; + public double limit; + + + public boolean temperatureAlarm; + public boolean humidityAlarm; + public boolean skimmelAlarm; + + + public List<Measurement> temperatures; + public List<Measurement> humidities; public Target() { + } *************** *** 14,17 **** --- 31,38 ---- this.id = id; sensors = new LinkedList<Sensor>(); + temperatures = new LinkedList<Measurement>(); + humidities = new LinkedList<Measurement>(); + temperature = 20; + humidity = 50; } *************** *** 29,31 **** --- 50,97 ---- return sensors; } + + public void newTemperature(Measurement value) { + temperatures.add(value); + temperature = Double.valueOf(value.getValue()); + } + public void newHumidity(Measurement value) { + humidities.add(value); + humidity = Double.valueOf(value.getValue()); + } + + public double getTemperature() { + return temperature; + } + + public double getHumidity() { + return humidity; + } + + public List<Measurement> getTemperatures() { + return temperatures; + } + + public List<Measurement> getHumdiities() { + return humidities; + } + + public void check() { + System.out.println("check target"); + if (temperature > Project.temperatureThreshold) { + System.out.println("temperature alarm"); + temperatureAlarm = true; + } + if (humidity > Project.humidityThreshold) { + humidityAlarm = true; + } + } + + public Sensor find(String string) { + for (Sensor current : sensors) { + if (current.getType().equals(string)) { + return current; + } + } + return null; + } } --- NEW FILE: MoldEntry.java --- package net.sourceforge.bprocessor.model.sense.core; public class MoldEntry { public double temperature; public double humidity; public MoldEntry(double t, double h) { temperature = t; humidity = h; } } --- NEW FILE: MoldTable.java --- package net.sourceforge.bprocessor.model.sense.core; import java.io.BufferedReader; import java.io.FileReader; import java.util.LinkedList; import java.util.List; public class MoldTable { public List<MoldEntry> entries; public MoldTable(String name) { entries = new LinkedList<MoldEntry>(); try { BufferedReader reader = new BufferedReader(new FileReader(name)); String line = reader.readLine(); while (line != null) { String[] s = line.split(";"); double t = Double.valueOf(s[0]); double h = Double.valueOf(s[1]); entries.add(new MoldEntry(t, h)); line = reader.readLine(); } } catch(Exception error) { } } public double get(double t) { MoldEntry previous = null; for (MoldEntry current : entries) { if (previous != null) { if (t > previous.temperature && t <= current.temperature) { return previous.humidity; } } previous = current; } return 100.0; } } Index: Consumer.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core/Consumer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Consumer.java 31 Aug 2010 13:48:02 -0000 1.1 --- Consumer.java 26 Nov 2010 14:20:31 -0000 1.2 *************** *** 2,5 **** public abstract class Consumer { ! public abstract void consume(Measurement value); } --- 2,5 ---- public abstract class Consumer { ! public abstract void consume(Object value); } |