User Tools

Site Tools


development:blog

Development blog

A list of memo notes about particular things and problems that may arise from time to time in the various projects in Capsis, and a list of people involved in the co-development community.

fc+mw-19.4.2022 A MacOSX configuration with no Capsis/AMAPstudio 3D problems

  • Modèle : MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports)
  • Logiciel : macOS Monterey Version 12.3.1
  • Processeur : 2,4 GHz Intel Core i5 4 cœurs
  • RAM : 8Go 2133 MHz LPDDR3
  • Carte graphique : Intel Iris Plus Graphics 655 1536Go
  • ant revision:
  • [java] PathManager installDir: /Users/mattwillecomme/Desktop/Capsis4
  • [echo] Capsis revision 18408
  • [echo] os.name: Mac OS X
  • [echo] os.arch: x86_64
  • [echo] java.vm.name: Java HotSpot(TM) 64-Bit Server VM
  • [echo] java.version: 1.8.0_202
  • [echo] javac.version: javac 1.8.0_321

fc+jfb-5.4.2022 JOGL problem under Ubuntu 21.04 on a laptop

J'ai fini par reussir a demarrer Xplo en ajoutant la variable d'environnement suivante: LIBGL_ALWAYS_SOFTWARE=1

J'ai regarde l'effet de cette variable. Ca se passe au niveau de mesa (la lib opengl de linusque), elle oblige a effectuer un rendu soft et donc affranchit de la zoubia des cartes graphiques. Donc le probleme est contourne mais une solution est en place. Sur mon portable ca a l'air de repondre suffisamment bien pour l'usage que j'en attends.

fc-1.4.2022 Interesting article about threads and synchronization (fr)

http://blog.paumard.org/cours/java-api/chap05-concurrent-synchronisation.html

fc+ta-18.3.2022 Picking problem on Mac Book Pro Retina screens

Je viens de soumettre le pb à Fred Boudon (chez qui ça marchait bien), et il a de suite réagit en me disait qu'il connaissait ce pb. En fait ça vient des écrans Retina des MacBook Pro, (c'est assez flou) les pixels sont pris en compte différemment avec les Retina et il y a un facteur 2 qui rentre en jeu quelque part. Si je ferme mon mac et que je travaille uniquement avec un écran extérieur, alors tout marche bien. En revanche, si je laisse mon ordinateur ouvert, ça ne marche pas (que ça soit sur l'écran Retina ou sur l'écran extérieur). Il m'a dit qu'il a solutionné ça avec une fonction OpenGL add-hoc dans PlantScan3D.

Voila voila… information à garder en mémoire (et peut être dans un endroit plus perenne) car cela risque d'arriver à d'autres.

Ils ont l'air d'en parler ici:

https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/EnablingOpenGLforHighResolution/EnablingOpenGLforHighResolution.html

ou encore ici:

https://developer.apple.com/library/archive/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html

fc-14.10.2021 TechnicalPackages

It is sometimes interesting to launch a simulation in the GUI context without seeing it in the projectManager. For this purpose, the technicalPackage feature of the ModelManager can be used.

2 possibilities :

  • in the etc/models.list, the model package names are listed for the ModelManager, with for each a true/false value. 'false' is for the technical packages, they will not appear in the lists proposed to user (e.g. New Project) and if simulations are run by program with them, they will not appear in the projectManager (e.g. capsis.lib.metatrom.module=false).
  • For a model which declaration is 'true' in etc/capsis.models, it is possible to change its status to 'technical' for the time of a programmatically launched (script) simulation, and to turn it back to 'false' at the end with the following commands:
// E.g. in EcoafRadiativeBalance, we rely on the SamsaraLightLoader module
 
// The projects with this model will not appear in the ProjectManager
ModelManager.getInstance().addTechnicalPackageName("samsaralightloader");
 
(... simulation in script mode ... close the project at the end ...)
 
// The projects with this model will appear again in the ProjectManager
ModelManager.getInstance().removeTechnicalPackageName("samsaralightloader");
 
// The samsaraLightModule can be used normally with New Project again
  • When creating a simulation with a C4Script, the project can be set technical after script.init(ip); by calling script.setTechnicalProject (true);. This will give the best result: even in case Capsis is shut down abnormally, the project if reloaded will not appear in the projectManager.

fc-30.8.2021 ListOfConfigProperties<T>

There was a configuration problem in DataExtractors: when two instances of the same extractor class were opened at the same time, a change in the config of one (e.g. perHectare) was reported in the second after a synchronization (e.g. moving the graphs to another step).

This old non blocking bug was tricky to find, it was in AbstractDataExtractor, ExtensionManager.applySettings(this), relying on a ParamMap with @Param like tags, not managing maps, and the concerned properties were in TreeMaps.

→ added ListOfConfigProperties<T> (With T: Boolean, Integer, String, Double…), based on a list, which is handled correctly by ParamMap.

The bug is out, we can configure extractors separately without choice propagations.

Next step: propagate when user wants with a dedicated button next to each propagable property (e.g. perHectare → propagate to all opened graphs).

Also removed a bunch of old specific properties, e.g. HECTARE was replaced by a standard boolean property named perHectare, checked by the standard isSet“perHectare”) method.

fc-16.6.2021 RGModelWithRemovalOfEmptyCohortSizeClasses

In capsis.lib.regeneration, we can have cohoerts (RGCohort) with sizeclasses inside (RGCohortSizeClass).

When managing these cohorts (have a number), the number may reach 0. Previously, the empty cohortSizeClasses were kept. Sometimes, it may be better to remove them. If the model class of a module implement the RGModelWithRemovalOfEmptyCohortSizeClasses interface, the empty sizeClasses will be removed in RGCohort.understoreyGrowth ().

This is used in Heterofor by Frédéric André.

fc-6.5.2021 ListOfCategories, Category and Calculator

ListOfCategory / Category (name, value) and Calculator have been added. They can be mixed to calculate e.g. basal area per species, See Samsa2SpeciesCategories (extends ListOfCategories) and SamsaBasalAreaCalculator (calculates basalArea for a list of trees).

See how they were made available for other tools (e.g. graphs) in the Samsa2MethodProvider :

public ListOfCategories getListOfSpeciesBasalArea(GScene stand, Collection trees) 
public ListOfCategories getListOfLargeDiameterBasalArea(GScene stand, Collection trees)
public ListOfCategories getListOfQualityBasalArea(GScene stand, Collection trees)

And their possible use from an external tool, e.g. SVMaid :

fc-30.4.2021 Log headers

A way to declare a header for a specific log were formatted data is to be written (with columns separated by e.g. tabs). The header can be declared just before the Log.println () line, it will be written only once at before the first println (logName, message)

// E.g. in PHPlant
// This header will only be written once in the log
Log.prepareHeader("SureauClimateHourInterpolation", "time_s\t" + PHClimateHour.toStringHeader());
Log.println("SureauClimateHourInterpolation", "" + time_s + "\t" + interpolatedClimHour.toString ());

fc-9.3.2021 Statistics with ListOfValues

A tool to centralize statistics on a list of values.

https://capsis.cirad.fr/capsis/documentation/easy_statistics_on_a_list_of_values

fc-16.2.2021 Problems in DRGraph

If a DataExtractor based on DFCurves does not provide labels for its curves (Introgression, Mediterranea), the rendering in DRGraph may not show all the curves at opening time and a zoom out action may be needed.

A fix has been added in GraphConverter to add (1), (2), etc. if the labels are 'equals' to help the autoRange feature in the vertical (range) axis of the JFreeChart XYPlot.

fc-15.12.2020 Add Plotting features to a table

See CsvFileViewer. Warning: this feature relies on cells selection and may work badly in tables where row selection is allowed, e.g. SVController)

// fc-15.12.2020 Add the plotting features on Right-click
PlottingPopup.addPlottingFeaturesToTable(table, false);		
// fc-15.12.2020 Add the standard popup menu on the header
StandardTableHeaderPopup.addPopup(table);

fc-14.12.2020 Mac OS X problems

Problems were reported when using Capsis or AMAPstudio under Mac OS X.

  • 'Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'', Camilo Valdes, 21.10.2020, Francois Pimont, 1.9.2020, this could be fixed by switching from Java 1.8.0_261 to Java 1.8.0_202.

fc-8.12.2020 SVN checkout problems

Lisa Grell (X. Morin) has repeated problems during a checkout:

  • ra_serf: The server sent a truncated HTTP response body
  • RA layer request failed, then REPORT request on '/svn/capsis/!svn/me' failed

This seems to be due to timeouts related connections problems or a slow machine. Repetitive cleanup and update actions could finally solve the problem.

fc-1.12.2020 Phenofit

  • phenofit4 / Fit4: based on Fitlib function (capsis.lib.phenofit.Fitlib*), annual methods, all phenos are processed annually one after the other
  • phenofit5 / Fit5-Fit2018 OR Fit5-Phelib: based on Fit2018 functions (a modernized subpart of Fitlib), daily methods, OR Phelib functions, all phenos are processed daily one after the other. Isabelle Chuine uses Fit5-Phelib. Castaneaonly and PDG rely on Fit5-Fit2018 (only few functions available at this time in Fit2018: UniChillThreshold, UniForc, Fructification2Phases, SenDelpierre, Gauzere).
  • other versions: phenofit5nt / Fit5NT is a Fit5-Fit2018 attempt (without Phelib, discontinued because phenofit5 is the most up to date release), phenofit5frozen / Fit5Frozen is a Fit5 backup copy before replacing Fitlib by Fit2018.

fc-24.11.2020 CapsisExtensionManager, clarified isExport(className) Returned true if instanceof OFormat OR isExport () found by reflection and returned true OR in case of exception during the checking returned true

Now: returns true if className is subclass of OFormat

an extension is an export if it implements OFormat

→ StandRecordSet is a superclass for inventory file loaders, it was implementing OFormat so all subclasses 'could also be' exports, but only some of them actually implemented the export methods. Changed StandRecordSet, it does not implement OFormat any more and changed subclasses to add OFormat only when needed.

→ Deprecated all 'isImport ()' and 'isExport ()' methods, now unused

fc+jb-18.11.2020 Changed species typologies in RReShar and capsis.lib.regeneration

RGVegetationLayer (for vegetationLayers, match classes in regeneration lib)

  • RGCallunaVulgaris.CALLUNA_VULGARIS
  • RGFilicophyta.FILICOPHYTA
  • RGMoliniaCaerulea.MOLINIA_CAERULEA
  • RGQuercusCoccifera.QUERCUS_COCCIFERA
  • RGRubusFructicosus.RUBUS_FRUCTICOSUS

RGSaplings (for saplings, match classes in regeneration lib)

  • RGArbutusUnedo.ARBUTUS_UNEDO
  • RGFraxinusOrnus.FRAXINUS_ORNUS
  • RGSorbusDomestica.SORBUS_DOMESTICA
  • RGQuercusRobur.QUERCUS_ROBUR

RRSSpecies (for trees and cohorts, RReShar level, closed typology, see RRSSpecies.getCrownBaseHeight(), can be changed)

  • RRSSpecies.QUERCUS_ROBUR
  • RRSSpecies.PINUS_SYLVESTRIS
  • RRSSpecies.PINUS_HALEPENSIS

fc-18.11.2020 Viewer3D does not like large values of coordinates When data come from GIS, the coordinates may be very large, e.g. x=850000. They must be shifted back in the sketchLinker to have a correct drawing. A possible approach is to remove stand.origin to all x and y. See Samsa2SketchLinker

fc-17.11.2020 Popup does not open on Windows isPopupTrigger () must be checked on mousePressed() and mouseReleased (), see method comment in MouseEvent.isPopupTrigger (). See PlottingPopup (jeeb-util, CsvFileViewer)

fc-16.11.2020 Ubuntu: open a given file with a given Editor Right click on the file in the file manager > Properties > Open with > e.g. sublime text

fc-16-11-2020 Excel files contain extra quotes surounding values (e.g. “0.23”) Adapt the file loader' correctLine () method to replace them by empty strings

// e.g. Samsa2Inventory
protected String correctLine(String line) {
 
	// fc+bc-16.11.2020 Remove extra " written by Excel at export time
	line = line.replace("\"", "");
 
	return line;
}
development/blog.txt · Last modified: 2022/04/19 13:05 by coligny