示例#1
0
    def CreateSourceFiles(self):
        makefile = self.makefile_src
        ioc = self.ioc_name

        if self.cross_build or configure.TargetOS() == 'WIN32':
            prod_ioc = 'PROD_IOC_%s' % configure.TargetOS()
        else:
            prod_ioc = 'PROD_IOC'
        makefile.AddLine('%s = %s' % (prod_ioc, ioc))
        makefile.AddLine('DBD += %s.dbd' % ioc)

        for dbd_part in Hardware.GetDbdList():
            makefile.AddLine('%s_DBD += %s.dbd' % (ioc, dbd_part))
        makefile.AddLine('%s_SRCS += %s_registerRecordDeviceDriver.cpp' %
                         (ioc, ioc))

        # Library dependencies need to be expressed in reverse dependency
        # order so that each library pulls in the required symbols from the
        # next library loaded.
        for lib in reversed(Hardware.GetLibList()):
            makefile.AddLine('%s_LIBS += %s' % (ioc, lib))
        # Add the system libraries
        for lib in reversed(Hardware.GetSysLibList()):
            makefile.AddLine('%s_SYS_LIBS += %s' % (ioc, lib))
        # Add makefile variables
        for text in reversed(Hardware.GetMakefileStringList()):
            makefile.AddLine(text % self.__dict__)
        makefile.AddLine('%s_LIBS += $(EPICS_BASE_IOC_LIBS)' % ioc)
        # Finally add the target specific files.
        configure.Call_TargetOS(self, 'CreateSourceFiles')
示例#2
0
    def UseModule(cls):
        super(Device, cls).UseModule()

        # Add to list of libraries, check that all our resources exist, and
        # finally load the dbd files.
        Hardware.AddLibrary(cls)
        cls.__CheckResources()
示例#3
0
    def __init__(self):
        # Constructing a Device subclass instance adds the class to the list
        # of libraries to be loaded and the instance to the list of devices to
        # be initialised.
        self.__super.__init__()

        # Add this instance to the list of devices to be configured
        Hardware.AddHardware(self)

        # Support for commands specified during initialisation.
        self.__Commands = []
        self.__CommandsPostInit = []
示例#4
0
 def CreateBuildInstructions(self):
     print '/**'
     print '\page %s Build Instructions for %s' % \
         (self.page_name, self.ioc_name)
     print 'Build Instructions for %s' % self.ioc_name
     print '<ol>'
     print '<li> Add the dependencies to configure/RELEASE.'
     print '\\verbatim'
     gen_paths = [(m.LibPath(), m.MacroName())
                  for m in libversion.ModuleBase.ListModules()]
     for path, name in gen_paths:
         if name != 'EPICS_BASE':
             print name + '=' + path
     print '\\endverbatim'
     print
     print '<li> Add the DBD dependencies to src/Makefile'
     print '\\verbatim'
     for dbd in Hardware.GetDbdList():
         print '%s_DBD += %s.dbd' % (self.ioc_name, dbd)
     print '\\endverbatim'
     print
     print '<li> Add the LIBS dependencies to src/Makefile'
     print '\\verbatim'
     for lib in reversed(Hardware.GetLibList()):
         print '%s_LIBS += %s' % (self.ioc_name, lib)
     for lib in reversed(Hardware.GetSysLibList()):
         print '%s_SYS_LIBS += %s' % (self.ioc_name, lib)
     for text in reversed(Hardware.GetMakefileStringList()):
         print text % self.__dict__
     print '\\endverbatim'
     print
     print '<li> Use the template files to add records to the database.'
     print '\\verbatim'
     recordset.RecordsSubstitutionSet.Print()
     print '\\endverbatim'
     print
     print '<li> Add the startup commands to st.cmd'
     print '\\verbatim'
     Hardware.PrintBody()
     Hardware.PrintPostIocInit()
     print '\\endverbatim'
     print '</ol>'
     print '**/'
示例#5
0
文件: iocinit.py 项目: rorydog1/epics
 def PrintIoc(self, ioc_root=None):
     self.PrintHeader(ioc_root)
     Hardware.PrintBody()
     self.PrintFooter()
     Hardware.PrintPostIocInit()
示例#6
0
 def GetEnvironmentVariables(self):
     return Hardware.GetEnvironmentVariables()
示例#7
0
 def AllocateIntVector(cls, count=1):
     return Hardware.AllocateIntVector(count)