Package org.neuroml.export.utils
Class Utils
- java.lang.Object
-
- org.neuroml.export.utils.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARCH_64BIT
static String
ARCH_I386
static String
ARCH_I686
static String
ARCH_POWERPC
static String
ARCH_UMAC
static String
DIR_64BIT
static String
DIR_I386
static String
DIR_I686
static String
DIR_POWERPC
static String
DIR_UMAC
static String
LEMS_EXAMPLES_RESOURCES_DIR
static String
NEUROML_COMPTYPR_RESOURCES_DIR
static String
NEUROML_EXAMPLES_RESOURCES_DIR
static String
ORG_NEUROML_EXPORT_VERSION
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LinkedHashMap<String,org.neuroml.model.Standalone>
convertLemsComponentToNeuroML(org.lemsml.jlems.core.type.Component comp, boolean fixExternalMorphsBiophys, org.lemsml.jlems.core.type.Lems lems)
static org.neuroml.model.NeuroMLDocument
convertLemsComponentToNeuroMLDocument(org.lemsml.jlems.core.type.Component comp)
static String
convertLemsToNeuroMLLikeXml(org.lemsml.jlems.core.type.Lems lems, String onlyNetwork)
static org.lemsml.jlems.core.type.Component
convertNeuroMLToComponent(org.neuroml.model.Standalone nmlElement)
static org.lemsml.jlems.core.sim.Sim
convertNeuroMLToSim(org.neuroml.model.Standalone nmlElement)
static File
copyFromJarToTempLocation(String filename)
static String
extractLemsSimulationXml(org.lemsml.jlems.core.type.Lems lems, String externalFiletoInclude)
static String
extractLemsSimulationXml(org.lemsml.jlems.core.type.Lems lems, String externalFiletoInclude, String reportFile)
static String
getArchSpecificDir()
static org.neuroml.model.Cell
getCellFromComponent(org.lemsml.jlems.core.type.Component comp, org.lemsml.jlems.core.type.Lems lems)
static org.lemsml.jlems.core.type.Dimension
getDimension(String nml2Quantity)
static String
getHeaderComment(Format format)
static float
getMagnitudeInSI(String nml2Quantity)
static org.lemsml.jlems.core.type.Unit
getSIUnitInNeuroML(org.lemsml.jlems.core.type.Dimension dim)
static boolean
is64bitPlatform()
static boolean
isLinuxBasedPlatform()
static boolean
isMacBasedPlatform()
static boolean
isVersionControlDir(File dir)
static boolean
isVersionControlDir(String dirname)
static boolean
isWindowsBasedPlatform()
static void
loadLemsFile(File lemsFile, boolean run, boolean showGui)
static void
main(String[] args)
static int
parseCellRefStringForCellNum(String cellRef)
static String
parseCellRefStringForPopulation(String cellRef)
static org.lemsml.jlems.core.sim.Sim
readLemsNeuroMLFile(File f)
static org.lemsml.jlems.core.sim.Sim
readLemsNeuroMLFile(File f, boolean includeConnectionsFromHDF5)
static org.lemsml.jlems.core.sim.Sim
readLemsNeuroMLFile(String contents)
static org.lemsml.jlems.core.sim.Sim
readNeuroMLFile(File f)
static org.lemsml.jlems.core.sim.Sim
readNeuroMLFile(File f, boolean includeConnectionsFromHDF5)
static org.lemsml.jlems.core.sim.Sim
readNeuroMLFile(String contents)
static void
removeAllFiles(File directory, boolean removeDirToo, boolean removeVC)
static AbstractList
reorderAlphabetically(AbstractList list, boolean ascending)
static String
replaceInExpression(String expression, String oldVal, String newVal)
static void
runLemsFile(File f, boolean showGui)
static String
sysEnvInfo(String indent)
-
-
-
Field Detail
-
ORG_NEUROML_EXPORT_VERSION
public static String ORG_NEUROML_EXPORT_VERSION
-
ARCH_I686
public static final String ARCH_I686
- See Also:
- Constant Field Values
-
ARCH_I386
public static final String ARCH_I386
- See Also:
- Constant Field Values
-
ARCH_64BIT
public static final String ARCH_64BIT
- See Also:
- Constant Field Values
-
ARCH_POWERPC
public static final String ARCH_POWERPC
- See Also:
- Constant Field Values
-
ARCH_UMAC
public static final String ARCH_UMAC
- See Also:
- Constant Field Values
-
DIR_I386
public static final String DIR_I386
- See Also:
- Constant Field Values
-
DIR_I686
public static final String DIR_I686
- See Also:
- Constant Field Values
-
DIR_64BIT
public static final String DIR_64BIT
- See Also:
- Constant Field Values
-
DIR_POWERPC
public static final String DIR_POWERPC
- See Also:
- Constant Field Values
-
DIR_UMAC
public static final String DIR_UMAC
- See Also:
- Constant Field Values
-
LEMS_EXAMPLES_RESOURCES_DIR
public static final String LEMS_EXAMPLES_RESOURCES_DIR
- See Also:
- Constant Field Values
-
NEUROML_COMPTYPR_RESOURCES_DIR
public static final String NEUROML_COMPTYPR_RESOURCES_DIR
- See Also:
- Constant Field Values
-
NEUROML_EXAMPLES_RESOURCES_DIR
public static final String NEUROML_EXAMPLES_RESOURCES_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMagnitudeInSI
public static float getMagnitudeInSI(String nml2Quantity) throws org.neuroml.model.util.NeuroMLException
- Throws:
org.neuroml.model.util.NeuroMLException
-
getDimension
public static org.lemsml.jlems.core.type.Dimension getDimension(String nml2Quantity) throws org.neuroml.model.util.NeuroMLException
- Throws:
org.neuroml.model.util.NeuroMLException
-
parseCellRefStringForPopulation
public static String parseCellRefStringForPopulation(String cellRef)
-
parseCellRefStringForCellNum
public static int parseCellRefStringForCellNum(String cellRef)
-
getSIUnitInNeuroML
public static org.lemsml.jlems.core.type.Unit getSIUnitInNeuroML(org.lemsml.jlems.core.type.Dimension dim) throws org.neuroml.model.util.NeuroMLException
- Throws:
org.neuroml.model.util.NeuroMLException
-
readLemsNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readLemsNeuroMLFile(String contents) throws org.lemsml.jlems.core.sim.LEMSException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
-
readNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readNeuroMLFile(File f) throws org.lemsml.jlems.core.sim.LEMSException, IOException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
IOException
-
readNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readNeuroMLFile(File f, boolean includeConnectionsFromHDF5) throws org.lemsml.jlems.core.sim.LEMSException, IOException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
IOException
-
readNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readNeuroMLFile(String contents) throws org.lemsml.jlems.core.sim.LEMSException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
-
copyFromJarToTempLocation
public static File copyFromJarToTempLocation(String filename) throws org.lemsml.jlems.core.sim.ContentError, IOException
- Throws:
org.lemsml.jlems.core.sim.ContentError
IOException
-
readLemsNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readLemsNeuroMLFile(File f) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
readLemsNeuroMLFile
public static org.lemsml.jlems.core.sim.Sim readLemsNeuroMLFile(File f, boolean includeConnectionsFromHDF5) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
replaceInExpression
public static String replaceInExpression(String expression, String oldVal, String newVal)
-
convertLemsToNeuroMLLikeXml
public static String convertLemsToNeuroMLLikeXml(org.lemsml.jlems.core.type.Lems lems, String onlyNetwork) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
extractLemsSimulationXml
public static String extractLemsSimulationXml(org.lemsml.jlems.core.type.Lems lems, String externalFiletoInclude) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
extractLemsSimulationXml
public static String extractLemsSimulationXml(org.lemsml.jlems.core.type.Lems lems, String externalFiletoInclude, String reportFile) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
convertLemsComponentToNeuroMLDocument
public static org.neuroml.model.NeuroMLDocument convertLemsComponentToNeuroMLDocument(org.lemsml.jlems.core.type.Component comp) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
convertLemsComponentToNeuroML
public static LinkedHashMap<String,org.neuroml.model.Standalone> convertLemsComponentToNeuroML(org.lemsml.jlems.core.type.Component comp, boolean fixExternalMorphsBiophys, org.lemsml.jlems.core.type.Lems lems) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
convertNeuroMLToComponent
public static org.lemsml.jlems.core.type.Component convertNeuroMLToComponent(org.neuroml.model.Standalone nmlElement) throws org.neuroml.model.util.NeuroMLException, org.lemsml.jlems.core.sim.LEMSException
- Throws:
org.neuroml.model.util.NeuroMLException
org.lemsml.jlems.core.sim.LEMSException
-
getCellFromComponent
public static org.neuroml.model.Cell getCellFromComponent(org.lemsml.jlems.core.type.Component comp, org.lemsml.jlems.core.type.Lems lems) throws org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
convertNeuroMLToSim
public static org.lemsml.jlems.core.sim.Sim convertNeuroMLToSim(org.neuroml.model.Standalone nmlElement) throws org.neuroml.model.util.NeuroMLException, org.lemsml.jlems.core.sim.LEMSException
- Throws:
org.neuroml.model.util.NeuroMLException
org.lemsml.jlems.core.sim.LEMSException
-
reorderAlphabetically
public static AbstractList reorderAlphabetically(AbstractList list, boolean ascending)
-
runLemsFile
public static void runLemsFile(File f, boolean showGui) throws org.lemsml.jlems.core.sim.LEMSException, ModelFeatureSupportException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
ModelFeatureSupportException
org.neuroml.model.util.NeuroMLException
-
loadLemsFile
public static void loadLemsFile(File lemsFile, boolean run, boolean showGui) throws org.lemsml.jlems.core.sim.LEMSException, ModelFeatureSupportException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.LEMSException
ModelFeatureSupportException
org.neuroml.model.util.NeuroMLException
-
isWindowsBasedPlatform
public static boolean isWindowsBasedPlatform()
-
isLinuxBasedPlatform
public static boolean isLinuxBasedPlatform()
-
isMacBasedPlatform
public static boolean isMacBasedPlatform()
-
getArchSpecificDir
public static String getArchSpecificDir()
- Returns:
- i686 for most, x86_64 if "64" present in system properties os.arch, e.g. amd64. Will need updating as Neuron tested on more platforms...
-
is64bitPlatform
public static boolean is64bitPlatform()
-
isVersionControlDir
public static boolean isVersionControlDir(String dirname)
-
isVersionControlDir
public static boolean isVersionControlDir(File dir)
-
removeAllFiles
public static void removeAllFiles(File directory, boolean removeDirToo, boolean removeVC)
-
main
public static void main(String[] args) throws org.lemsml.jlems.core.sim.ContentError, IOException, org.lemsml.jlems.core.sim.LEMSException, org.neuroml.model.util.NeuroMLException
- Throws:
org.lemsml.jlems.core.sim.ContentError
IOException
org.lemsml.jlems.core.sim.LEMSException
org.neuroml.model.util.NeuroMLException
-
-