the default port to avoid multiple opening for same crate at same computer is 4300 + IP
This commit is contained in:
parent
a187e31d1c
commit
2bdd7deb41
18
IsegGUI.py
18
IsegGUI.py
|
@ -21,20 +21,12 @@ except:
|
||||||
token = None # Or assign a default value if needed
|
token = None # Or assign a default value if needed
|
||||||
|
|
||||||
org = "FSUFoxLab"
|
org = "FSUFoxLab"
|
||||||
ip = "https://fsunuc.physics.fsu.edu/influx/"
|
databaseIP="https://fsunuc.physics.fsu.edu/influx/"
|
||||||
# databaseIP="128.186.111.107"
|
|
||||||
databaseIP=ip
|
|
||||||
write_client = influxdb_client.InfluxDBClient(url=databaseIP, token=token, org=org)
|
write_client = influxdb_client.InfluxDBClient(url=databaseIP, token=token, org=org)
|
||||||
bucket = "ISEG"
|
bucket = "ISEG"
|
||||||
# write_api = write_client.write_api(write_options=ASYNCHRONOUS)
|
# write_api = write_client.write_api(write_options=ASYNCHRONOUS)
|
||||||
write_api = write_client.write_api(write_options=SYNCHRONOUS)
|
write_api = write_client.write_api(write_options=SYNCHRONOUS)
|
||||||
|
|
||||||
#assign a port, to prevent the script run mulitple time
|
|
||||||
s = socket.socket()
|
|
||||||
host = socket.gethostname()
|
|
||||||
port = 4305
|
|
||||||
s.bind((host,port))
|
|
||||||
|
|
||||||
nArg = len(sys.argv)
|
nArg = len(sys.argv)
|
||||||
|
|
||||||
if nArg > 1 :
|
if nArg > 1 :
|
||||||
|
@ -47,6 +39,14 @@ else :
|
||||||
|
|
||||||
pushToDB = False
|
pushToDB = False
|
||||||
|
|
||||||
|
|
||||||
|
#============== assign a port, to prevent the script run mulitple time
|
||||||
|
s = socket.socket()
|
||||||
|
host = socket.gethostname()
|
||||||
|
port = 4300 + int(IP[-3:])
|
||||||
|
print("using port " + str(port))
|
||||||
|
s.bind((host,port))
|
||||||
|
|
||||||
#===================== GUI
|
#===================== GUI
|
||||||
|
|
||||||
mpod = iseg.Mpod(IP)
|
mpod = iseg.Mpod(IP)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user