# Path: basestation/base_station.py
# class BaseStation(object, metaclass=Singleton):
#     """
#     Contains logic to manage and unify input and output between bots and vision
#     sources. This class is a singleton to prevent accidental BaseStation
#     duplication.
#     """
#     # https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python
# 
#     def __init__(self):
#         """
#         Creates singleton base station. Contains a bot and vision manager.
#         """
#         self.bot_manager = BotManager()
#         self.vision_manager = VisionManager()
#         return
# 
#     def get_bot_manager(self):
#         """
#         Gets the bot manager associated with current BaseStation.
#         """
#         return self.bot_manager
# 
#     def get_vision_manager(self):
#         """
#         Gets the vision manager associated with current BaseStation.
#         """
#         return self.vision_manager


import tornado
import tornado.web
import os.path
import json
import logging
import sys
from basestation.base_station import BaseStation
        fr = info['fr']
        bl = info['bl']
        br = info['br']

        # Gets virtual bot.
        bot_cc = BaseStation().get_bot_manager().\
            get_bot_by_name(name).get_command_center()

        # temp success/failure messages
        if bot_cc.set_wheel_power(fl, fr, bl, br):
            self.write("Wheel power adjusted".encode())
        else:
            self.write("Wheel power adjustment failed".encode())


class DiscoverBotsHandler(tornado.web.RequestHandler):
    """
    Listens for bot discoverability.
    """
    def post(self):
        discovered = BaseStation().get_bot_manager().get_all_discovered_bots()
        print("Discovered bot: " + str(discovered))
        self.write(json.dumps(discovered))


class GetTrackedBotHandler(tornado.web.RequestHandler):
    """
    Gets bot tracked by BotManager.
    """
    def post(self):

# Path: basestation/base_station.py
# class BaseStation(object, metaclass=Singleton):
#     """
#     Contains logic to manage and unify input and output between bots and vision
#     sources. This class is a singleton to prevent accidental BaseStation
#     duplication.
#     """
#     # https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python
# 
#     def __init__(self):
#         """
#         Creates singleton base station. Contains a bot and vision manager.
#         """
#         self.bot_manager = BotManager()
#         self.vision_manager = VisionManager()
#         return
# 
#     def get_bot_manager(self):
#         """
#         Gets the bot manager associated with current BaseStation.
#         """
#         return self.bot_manager
# 
#     def get_vision_manager(self):
#         """
#         Gets the vision manager associated with current BaseStation.
#         """
#         return self.vision_manager


# Path: gui/main.py
import tornado
import tornado.web
import os.path
import json
import logging
import sys
from basestation.base_station import BaseStation

        fr = info['fr']
        bl = info['bl']
        br = info['br']

        # Gets virtual bot.
        bot_cc = BaseStation().get_bot_manager().\
            get_bot_by_name(name).get_command_center()

        # temp success/failure messages
        if bot_cc.set_wheel_power(fl, fr, bl, br):
            self.write("Wheel power adjusted".encode())
        else:
            self.write("Wheel power adjustment failed".encode())


class DiscoverBotsHandler(tornado.web.RequestHandler):
    """
    Listens for bot discoverability.
    """
    def post(self):
        discovered = BaseStation().get_bot_manager().get_all_discovered_bots()
        print("Discovered bot: " + str(discovered))
        self.write(json.dumps(discovered))


class GetTrackedBotHandler(tornado.web.RequestHandler):
    """
    Gets bot tracked by BotManager.
    """
    def post(self):

        tracked_bots = BaseStation().bot_manager. get_all_tracked_bots_names()