# Path: src/view.py

# 
# Path: model/geotechnic/surcharge_load.py
# class Surcharge_Load:
#     def __init__(self):
#     def point(self, q, x_load, H, start, end, type):
#     def strip(self, q, x_load, width, H, start, end, type):
#             A = 1.77
#             B = pow(m,2)
#             C = B
#             A = 0.28
#             B = 0.16
#             C = 1
#         X,Y = np.meshgrid(x,y)
#         Z = []
#         Z = np.array(Z).reshape((len(y), len(x))).transpose()
#         X,Y = np.meshgrid(x,y)
#         Z = []
#         Z = np.array(Z).reshape((len(y), len(x))).transpose()
# 
# Path: model/utils/plot.py
# class Plot:
#     def __init__(self):
#     def pcolor(self, x, y, z):
#     def line(self, x, y, xlabel="X", ylabel="Y", title="X vs Y"):
#     def encode_base64(self, img):


from src import view
from model.geotechnic import surcharge_load
from model.utils import plot
import cherrypy


class Surcharge_Load:
    def __init__(self):
        pass

    def point(self, **var):
        # Prepare view & model object
        template = view.lookup.get_template('geotechnic/surcharge_point.mako')
        model = surcharge_load.Surcharge_Load()

        # Prepare url params & cookie as default value
        param = cherrypy.request.params
        cookie = cherrypy.request.cookie

        # Get url parameter or set default variable (if None)
        q = float(param.get('q') or 200)
        x_load = float(param.get('x_load') or 1.2)
        H = float(param.get('H') or 12)
        start = float(param.get('start') or -10)
        end = float(param.get('end') or 10)
        type = float(param.get('type') or 2)

        # Calculate
        x, y, z = model.point(q, x_load, H, start, end, type)

# Path: src/view.py

# 
# Path: model/geotechnic/surcharge_load.py
# class Surcharge_Load:
#     def __init__(self):
#     def point(self, q, x_load, H, start, end, type):
#     def strip(self, q, x_load, width, H, start, end, type):
#             A = 1.77
#             B = pow(m,2)
#             C = B
#             A = 0.28
#             B = 0.16
#             C = 1
#         X,Y = np.meshgrid(x,y)
#         Z = []
#         Z = np.array(Z).reshape((len(y), len(x))).transpose()
#         X,Y = np.meshgrid(x,y)
#         Z = []
#         Z = np.array(Z).reshape((len(y), len(x))).transpose()
# 
# Path: model/utils/plot.py
# class Plot:
#     def __init__(self):
#     def pcolor(self, x, y, z):
#     def line(self, x, y, xlabel="X", ylabel="Y", title="X vs Y"):
#     def encode_base64(self, img):


# Path: controller/geotechnic/surcharge_load.py
from src import view
from model.geotechnic import surcharge_load
from model.utils import plot
import cherrypy


class Surcharge_Load:
    def __init__(self):
        pass

    def point(self, **var):
        # Prepare view & model object
        template = view.lookup.get_template('geotechnic/surcharge_point.mako')
        model = surcharge_load.Surcharge_Load()

        # Prepare url params & cookie as default value
        param = cherrypy.request.params
        cookie = cherrypy.request.cookie

        # Get url parameter or set default variable (if None)
        q = float(param.get('q') or 200)
        x_load = float(param.get('x_load') or 1.2)
        H = float(param.get('H') or 12)
        start = float(param.get('start') or -10)
        end = float(param.get('end') or 10)
        type = float(param.get('type') or 2)

        # Calculate
        x, y, z = model.point(q, x_load, H, start, end, type)

        plt = plot.Plot()
