def main() : gcs_to_robot = Queue(maxsize = -1) robot_to_gcs = Queue(maxsize = -1) commands = Queue(maxsize = -1) gcsSocket = sample_socket.SampleSocket("Socket_Thread", gcs_to_robot, robot_to_gcs, remote_ip="192.168.1.105", remote_socket=10010) gcsParser = sample_parser.SampleParser("Parser_Thread", robot_to_gcs, commands, gcs_to_robot) gcsSocket.init_socket() gcsSocket.start() gcsParser.start() command = "" print "CONNECTED." while command != "Exit" : if (len(command.strip()) > 0) : commands.put(command) command = raw_input() print "Exitting GCS" gcsSocket.stop() gcsParser.stop()
def main(): gcs_to_robot = Queue(maxsize=-1) robot_to_gcs = Queue(maxsize=-1) commands = Queue(maxsize=-1) gcsSocket = sample_socket.SampleSocket( "Socket_Thread", gcs_to_robot, robot_to_gcs, # remote_ip="192.168.1.100", remote_ip="10.100.32.215", remote_socket=10010) gcsParser = sample_parser.SampleParser("Parser_Thread", robot_to_gcs, commands, gcs_to_robot) gcsSocket.init_socket() gcsSocket.start() gcsParser.start() command = 0 pygame_gui.init() old_val = 0 while command != 8913168: #this is equal to holding "exit" on the keyboard new_val = pygame_gui.test_pygame() if old_val != new_val: old_val = new_val command = new_val commands.put(str(command)) print(command) #command = raw_input() print "Exitting GCS" gcsSocket.stop() gcsParser.stop()
import xml.etree.ElementTree as ET import matplotlib.pyplot as plt import sample_parser as spl from mpl_toolkits import mplot3d print "Starting XML Parsing...." regs = spl.CpuRegs() p = spl.SampleParser() # with open("mm_samplesG.txt") as xml_file: # goldenParse = ET.parse(xml_file) # golden_samples = goldenParse.getroot() with open("samples.txt") as xml_file: injectParse = ET.parse(xml_file) samples = injectParse.getroot() num_samples = len(samples) - 1 num_global_var = len(samples[0][3]) reg_err = [] heap_err = [] stack_err = [] errCnt = 0 heapCnt = [] seq_loss_errs = [] try: val_listA = samples[0][3][0].text.split(' ')