def setUp(self):
		#init maindll
		self.maindll_handle = maindll.DllMainInit()
		
		# init other dlls
		def init_subdll(initer):
			retcode = initer(self.maindll_handle)
			if retcode != 0:
				raise Exception("Failed to init %s with error code %i" % ('initer.__name__', retcode))
		
		init_subdll(timedll.TimeFuncInit)
		init_subdll(tledll.TleInit)
		init_subdll(envdll.EnvInit)
		init_subdll(astrodll.AstroFuncInit)
		sgp4dll.Sgp4SetLicFilePath('./dshsaa/libdll/') #get the license before initing sgp4
		init_subdll(sgp4dll.Sgp4Init)
		
		# open a log file
		maindll.OpenLogFile('sgp4.log')
		
		# Initialize a TLE
		line1 = '1 25544U 98067A   19311.39056523  .00000757  00000-0  21099-4 0  9992'
		line2 = '2 25544  51.6451  11.2360 0005828 238.9618 210.3569 15.50258526197470'
		generic_satKey = tledll.TleAddSatFrLines(line1, line2)
		if generic_satKey.value <= 0:
			raise Exception("Failed to init generic_satKey with code %i" % generic_satKey.value)
		else:
			self.generic_satKey = generic_satKey
		
		# Initialize that satellite in the SGP4 context
		retcode = sgp4dll.Sgp4InitSat(generic_satKey)
		if retcode != 0:
			raise Exception("Failed to init tle with code %i" % (retcode))
Exemple #2
0
    def setUp(self):
        # init maindll
        self.maindll_handle = maindll.DllMainInit()

        # init timefunc and tle
        def init_subdll(initer):
            retcode = initer(self.maindll_handle)
            if retcode != 0:
                raise Exception("Failed to init %s with error code %i" %
                                ('initer.__name__', retcode))

        init_subdll(timedll.TimeFuncInit)
        init_subdll(tledll.TleInit)
        init_subdll(envdll.EnvInit)

        # Open a log file
        maindll.OpenLogFile('tle.log')

        # Make a test satKey available for many functions
        line1 = '1 25544U 98067A   19311.39056523  .00000757  00000-0  21099-4 0  9992'
        line2 = '2 25544  51.6451  11.2360 0005828 238.9618 210.3569 15.50258526197470'
        generic_satKey = tledll.TleAddSatFrLines(line1, line2)
        if generic_satKey.value <= 0:
            raise Exception("Failed to init generic_satKey with code %i" %
                            generic_satKey.value)
        else:
            self.generic_satKey = generic_satKey
Exemple #3
0
 def setUp(self):
     self.maindll_handle = maindll.DllMainInit()
     self.timedll_retcode = timedll.TimeFuncInit(self.maindll_handle)
     if self.timedll_retcode != 0:
         raise Exception("timedll init retcode was %i != 0" %
                         (self.timedll_retcode))
     return None
 def setUp(self):
     self.maindll_handle = maindll.DllMainInit()
     self.envdll_retcode = envdll.EnvInit(self.maindll_handle)
     if self.envdll_retcode != 0:
         raise Exception("envdll init retcode was %i != 0" %
                         (self.envdll_retcode))
     self.astrodll_retcode = astrodll.AstroFuncInit(self.maindll_handle)
     if self.astrodll_retcode != 0:
         raise Exception("astrodll init retcode was %i != 0" %
                         (self.astrodll_retcode))
     return None
 def test_DllMainInit(self):
     maindll_handle = maindll.DllMainInit()
     self.assertEqual(type(maindll_handle), settings.stay_int64)
Exemple #6
0
#! /user/bin/env python3
"""
This script is intended to demonstrate how to use the raw SGP4 interface to perform a common task: propogate an orbit.
The simplest possible syntax is used to assist new developers.
"""

# Import settings. This module configures some environment variables and shared assets.
from dshsaa.raw import settings

# Import all the dll interfaces. These modules provide direct access to the various dlls.
from dshsaa.raw import maindll, envdll, astrodll, timedll, tledll, sgp4dll

#init maindll and the other components of the SGP4 package
maindll_handle = maindll.DllMainInit()

# open a log file
maindll.OpenLogFile('example.log')

# init the other DLLs
retcode = timedll.TimeFuncInit(maindll_handle)
if retcode != 0:
    raise Exception("Failed to init %s with error code %i" %
                    ('timedll', retcode))

retcode = tledll.TleInit(maindll_handle)
if retcode != 0:
    raise Exception("Failed to init %s with error code %i" %
                    ('tledll', retcode))

retcode = envdll.EnvInit(maindll_handle)
if retcode != 0: