def get_mu(t): """ Select measure unit :param t: instrument type 1200/1800/1100/local :returns: measure unit or False """ if re.search('120[0-9]$', t): return LeicaTPS1200() elif re.search('110[0-9]$', t): return LeicaTCRA1100() elif re.search('180[0-9]$', t): return LeicaTCA1800() elif re.search('^local', t): return LeicaTPS1200() return False
if ofname[-4:] == '.csv' or ofname[-4:] == '.dmp': ofname = ofname[:-4] otype = 'csv' elif ofname[-4:] == '.geo' or ofname[-4:] == '.coo': ofname = ofname[:-4] otype = 'geo' else: print("invalid output type, allowed types: .geo, .coo, .csv, .dmp") exit(-1) if len(sys.argv) > 2: stationtype = sys.argv[2] else: stationtype = '1200' if re.search('120[0-9]$', stationtype): from leicatps1200 import LeicaTPS1200 mu = LeicaTPS1200() elif re.search('110[0-9]$', stationtype): from leicatcra1100 import LeicaTCRA1100 mu = LeicaTCRA1100() elif re.search('180[0-9]$', stationtype): from leicatca1800 import LeicaTCA1800 mu = LeicaTCA1800() elif re.search('550[0-9]$', stationtype): from trimble5500 import Trimble5500 mu = Trimble5500() else: print("unsupported instrument type") exit(1) if len(sys.argv) > 3: port = sys.argv[3] else: