def __init__(self): super().__init__() self.c = client.ClientSocket(self) self.c2 = client.ClientSocket(self) self.setupUi(self) self.pushButton.clicked.connect(self.connectClicked) self.pushButton_2.clicked.connect(self.imageRecvClicked)
def __init__(self): super().__init__() self.setGeometry(100, 200, 338, 600) self.c = client.ClientSocket(self) self.initUI()
def __init__(self): #super().__init__() self.c = client.ClientSocket(self) self.queue = client.queue self.rb = ur3() self.i = 0 self.box_on = 0 start_new_thread(self.webcam, (self.queue, )) self.obj_list = [[0] * 6 for _ in range(5)] self.setupUi(MainWindow)
def __init__(self): super().__init__() self.c = client.ClientSocket(self) self.c2 = client.ClientSocket(self) self.setupUi(self) self.pushButton.clicked.connect(self.connectClicked) self.pushButton_2.clicked.connect(self.resetCount) self.pushButton_3.clicked.connect(self.countSave) initialTableWideget(self.tableWidget.horizontalHeader()) self.df = self.settingModelTableWideget() self.label_2.setStyleSheet("color: white;" "background-color: #34465d;" "font : bold 20px") self.label_5.setStyleSheet("color: black;" "background-color: #bdc3c7;" "font : bold 15px") self.label_6.setStyleSheet("color: black;" "background-color: #bdc3c7;" "font : bold 15px") self.label_7.setStyleSheet("color: black;" "background-color: #bdc3c7;" "font : bold 15px")
def talk(self): # Method to call the robot talk function # print("robot speak") # IP = '10.200.9.122' # PORT = 5010 # speak = client.ClientSocket(IP, PORT) # speak.start() # time.sleep(1) # speak.sendData("Hello Human") # print("hello human") IP = '10.200.57.202' PORT = 5010 speak = client.ClientSocket(IP, PORT) speak.sendData("hello human")
def main(): # initialize the camera and grab a reference to the raw camera capture camera = PiCamera() camera.resolution = (640, 480) camera.framerate = 32 rawCapture = PiRGBArray(camera, size=(640, 480)) # allow the camera to warmup time.sleep(0.1) IP = '10.200.23.235' PORT = 5010 phone = client.ClientSocket(IP, PORT) mainLoop(camera, rawCapture,phone) cv2.destroyAllWindows()
def __init__(self): super().__init__() self.c = client.ClientSocket(self) self.setupUi(self) self.pushButton.clicked.connect(self.connectClicked) self.pushButton_4.clicked.connect(self.historyClear) self.pushButton_7.clicked.connect(self.openSelectedDir) global stop stop = False self.btnClicked = False self.pushButton_3.clicked.connect(self.commandClicked) self.label_2.setStyleSheet("background-color: #CCCCCC;" "border-radius: 3px;" "color: blue;" "border-style: solid;" "border-width: 2px;" "border-color: #999999") self.label_5.setStyleSheet("background-color: #CCCCCC;" "border-radius: 3px;" "color: blue;" "border-style: solid;" "border-width: 2px;" "border-color: #999999") self.dateEdit.setDate(QDate.currentDate()) self.dateEdit.setMaximumDate(QDate.currentDate()) dt = datetime.datetime.now() self.dateEdit.setMinimumDate(QDate(dt.year, dt.month - 1, dt.day)) self.label_3.setStyleSheet("color: red;" "background-color: #FFCCCC") self.label_19.setStyleSheet("color: red;" "background-color: #FFCCCC") self.cameraNameList = ['ivuImage', 'v20cImage'] self.makeDirectory(self.cameraNameList[0]) self.makeDirectory(self.cameraNameList[1]) self.actionNetwork.triggered.connect(self.networkConnected) self.actionDatabase.triggered.connect(self.dbSettingConnected) self.settingValueList = readEthernetSettingValue() self.cameraBrand = self.settingValueList[0][4] self.label_33.setText(self.cameraBrand) script_dir = os.path.dirname(__file__) productInfo = 'setting/productInfoReference.xlsx' productInfoAbs = os.path.join(script_dir, productInfo) self.df_productInfo = pd.read_excel(productInfoAbs, header=0) self.productsList = [] self.codeList = [] self.standardList = [] self.volumeList = [] for i in range(len(self.df_productInfo)): self.codeList.append( self.df_productInfo[self.df_productInfo.columns[0]][i]) self.productsList.append( self.df_productInfo[self.df_productInfo.columns[1]][i]) self.standardList.append( self.df_productInfo[self.df_productInfo.columns[2]][i]) self.volumeList.append( self.df_productInfo[self.df_productInfo.columns[3]][i]) self.comboBox.setEditable(True) self.comboBox.lineEdit().setAlignment(QtCore.Qt.AlignHCenter) self.comboBox.addItems(self.productsList) self.comboBox.currentIndexChanged.connect(self.selectionchange) self.label_12.setText( str((self.codeList[self.comboBox.currentIndex()]))) self.label_14.setText( str((self.standardList[self.comboBox.currentIndex()]))) self.label_15.setText( str((self.volumeList[self.comboBox.currentIndex()]))) tagInfo = 'setting/tagInfoReference.xlsx' tagInfoAbs = os.path.join(script_dir, tagInfo) self.df_tagInfo = pd.read_excel(tagInfoAbs, header=0) self.inspectionNumber = len(self.df_tagInfo) self.label_26.setText(self.df_tagInfo[self.df_tagInfo.columns[1]][0]) self.label_28.setText(self.df_tagInfo[self.df_tagInfo.columns[0]][0]) self.inspectionSensor = [] self.lineEdit.setText(readTimeIntervalValue()) makeDirectory('imageTemp') readResult = readResultHistory() historyFirst = readResult[0] self.label_23.setText(historyFirst[0]) self.label_21.setText(historyFirst[1]) self.label_24.setText(historyFirst[2]) if self.inspectionNumber > 1: self.label_35.setText( self.df_tagInfo[self.df_tagInfo.columns[1]][1]) self.label_37.setText( self.df_tagInfo[self.df_tagInfo.columns[0]][1]) self.label_43.setText( self.df_tagInfo[self.df_tagInfo.columns[1]][0]) self.label_49.setText( self.df_tagInfo[self.df_tagInfo.columns[1]][1]) historySecond = readResult[1] self.label_31.setText(historySecond[0]) self.label_39.setText(historySecond[1]) self.label_41.setText(historySecond[2]) self.label_40.setText('2') else: self.label_40.setText('1')
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') # initialize the camera and grab a reference to the raw camera capture and # capture frames from the camera camera = PiCamera() camera.resolution = (640, 480) camera.framerate = 32 rawCapture = PiRGBArray(camera, size=(640, 480)) # allow the camera to warmup time.sleep(0.1) # gets IP address from phone and then connects to the app on the phone IP = '10.200.42.220' PORT = 5010 client = client.ClientSocket(IP, PORT) MOTORS = 1 TURN = 2 BODY = 0 HEADTILT = 4 HEADTURN = 3 #sets up keyboard object for input keys = KeyControl() keys.head(ord('w')) state = 0 faceLR = 'R' size = 0 centerX = 0
def talk(self): # Method to call the robot talk function IP = '10.200.57.202' PORT = 5010 speak = client.ClientSocket(IP, PORT) speak.sendData("hello human")
def init_commu(): host_ip = rospy.get_param("/commu_node/host_ip") port = rospy.get_param('/commu_node/port') host = (host_ip, port) Client = client.ClientSocket(host) return Client