import clr
clr.AddReference('Soti.Connect.SemanticEngine.Conversions')

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading CitizenCLToGeneralSpeed Converter")

class CitizenCLToGeneralSpeed(Converter):
    def Execute(self, args):

        res = 1.0
        speed = args[0]

        if (speed == "2 IPS"):
            res = 50.8
        elif (speed  == "3 IPS"):
            res = 76.2
        elif (speed  == "4 IPS"):
            res = 101.6
        elif (speed  == "5 IPS"):
            res = 127
        elif (speed  == "6 IPS"):
            res = 152.4
        elif (speed  == "7 IPS"):
            res = 177.8
        elif (speed  == "8 IPS"):
            res = 203.2
        elif (speed  == "9 IPS"):
            res = 228.6
        elif (speed  == "10 IPS"):
            res = 254.0
        else:
            res = 50.8
        return res




plugin = CitizenCLToGeneralSpeed("CitizenCLToGeneralSpeed")

store.AddConverter(plugin)