Esempio n. 1
0
   def save(self, event):
	   self.tty = str(self.tty_entry.GetValue())
	   self.timer = str(self.timer_entry.GetValue())
	   self.tp = str(self.tp_entry.GetValue())
	   self.sen = str(self.sen_sld.GetValue())
	   
	   settings.write_settings("settings", self.tty, self.tp, self.timer, str(self.sen))
Esempio n. 2
0
 def OnExport(self, evt):
     path = dialogs.get_file_to_save(self, wildcard=commands_wildcard, context="commands")
     if path:
         if not path.endswith(commands_ext) and "." not in path:
             path = path + commands_ext
         try:
             commands = clean_commands(self.GetCommands())
             write_settings(path, commands)
         except Exception as e:
             dialogs.error(self, "Error exporting commands file:\n\n%s" % e)
Esempio n. 3
0
def load_settings(api_instance, settings):
    try:
        set = api_instance.get_settings()
        if set is None:
            set = read_settings()
        else:
            sett.write_settings(settings)
        settings.update_settings(set)
        return
    except Exception as e:
        print('Error while loading settings')
        print(e)

    set = sett.read_settings()
    settings.update_settings(set)
Esempio n. 4
0
  i += 1
  start = time.time()
  print(
    "Completion := {0:.0%}\n"
    "TTL := {1}\n"
    "BUF := {2}\n".format(float(i)/n, ttl, bufferSize)
  )
  scenarioName = NAME.format(bufferSize=bufferSize, ttl=ttl)

  # Feed pair into settings generator.
  settings = get_settings(
    size_in_bytes=bufferSize,
    ttl=ttl,
    scenario_name=scenarioName
  )
  write_settings(settings)

  # Run the ONE simulation.
  try:
    run()

  except:
    print("Problem with TTL := {0}, BUF := {1}".format(ttl, bufferSize))

  else:
    # Grab the results from the simulation and append to a single file.
    results_from_sim = get_results_of_simulation(
      os.path.join(
        "reports",
        "{scenarioName}_MessageStatsReport.txt".format(
          scenarioName=scenarioName