[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Persistence.java, 1.90, 1.91 Item.ja
Status: Pre-Alpha
Brought to you by:
henryml
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(); + } } |