Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getHeaderComment

        public static String getHeaderComment​(Format format)
      • 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
      • 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
      • 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)
      • sysEnvInfo

        public static String sysEnvInfo​(String indent)
      • 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