dt='%Y-%m-%d %H:%M:%S', filt=['id', 'hz', 'v', 'distance', 'east', 'north', 'elev'], fname=sys.argv[5], mode='a', sep=';') else: wrt = EchoWriter() ts = TotalStation("Leica", mu, iface) slopeDist = 0 if edm not in mu.edmModes: edm = 'FAST' ts.SetEDMMode(edm) # initialize instrument and variables if mode > 0: ts.SetLock(0) ts.SetATR(1) ts.MoveRel(Angle(0), Angle(0), 1) ts.Measure() measurement = ts.GetMeasure() if 'distance' in measurement: slopeDist = measurement['distance'] if mode in (3, 4, 5): ts.SetLock(1) ts.LockIn() if mode == 5: last_hz = measurement['hz'] # direction of last measured point last_v = measurement['v'] prev_hz = measurement['hz'] # direction of last measured point prev_v = measurement['v']
if len(sys.argv) > 7: arange = float(sys.argv[7]) / 360.0 * PI2 iface = SerialIface("rs-232", port) ## eomRead='\n' wrt = CsvWriter(angle='DMS', dist='.3f', filt=['id', 'east', 'north', 'elev'], fname='section.txt', mode='w', sep=';') ts = TotalStation(stationtype, mu, iface) if isinstance(mu, Trimble5500): print("Set Trimble 550x to direct reflex (MNU 722)") raw_input() else: ts.SetATR(0) # ATR mode off ts.SetLock(0) # Lock mode off ts.SetEDMMode("RLSTANDARD") # Reflectorless distance measurement ts.SetRedLaser(1) # Direction of the points to defining the plane points = [] for i in range(numberOfPoints): raw_input("Target on %d point and press enter" % (i + 1)) ts.Measure() obs = ts.GetMeasure() if ts.measureIface.state != ts.measureIface.IF_OK or \ 'errorCode' in obs: print('Start again!') exit(1) # Calculation of the directed coordinates according to the instrument's origin obs['east'] = obs['distance'] * math.sin(obs['v'].GetAngle()) * \