spsaswat / APPF_FLIR

AI Forward-looking infrared (FLIR) imaging
Mozilla Public License 2.0
9 stars 4 forks source link

Test for response from gantry api #22

Closed spsaswat closed 6 months ago

spsaswat commented 6 months ago

import requests

requests.get("http://localhost:8010/RestPLCService/setint?address=4010&value=1300") print(requests.get("http://localhost:8010/RestPLCService/getint?address=4020").json()["Value"])

spsaswat commented 6 months ago

def readCameraPos(): return int(requests.get("http://localhost:8010/RestPLCService/getint?address=4020").json()["Value"])

def moveCamera(position): requests.get("http://localhost:8010/RestPLCService/setint?address=4010&value=%d" % position)

key positions = [1510, 1209, 908, 607, 306, 0]

Use the above fucntions to communicate with the gantry

ConnorLirongxu commented 6 months ago

import requests

requests.get("http://localhost:8010/RestPLCService/setint?address=4010&value=1300") print(requests.get("http://localhost:8010/RestPLCService/getint?address=4020").json()["Value"].json()%5B%22Value%22%5D))

image This code snippet is working.

ConnorLirongxu commented 6 months ago

gantry communication successful