import gdsfactory as gf
from gdsfactory.technology import LayerMap
from gdsfactory.typings import Layer

from gf180.config import PATH


class LAYER(LayerMap):
    comp: Layer = (22, 0)
    dnwell: Layer = (12, 0)
    nwell: Layer = (21, 0)
    lvpwell: Layer = (204, 0)
    dualgate: Layer = (55, 0)
    poly2: Layer = (30, 0)
    nplus: Layer = (32, 0)
    pplus: Layer = (31, 0)
    sab: Layer = (49, 0)
    esd: Layer = (24, 0)
    contact: Layer = (33, 0)
    metal1: Layer = (34, 0)
    via1: Layer = (35, 0)
    metal2: Layer = (36, 0)
    via2: Layer = (38, 0)
    metal3: Layer = (42, 0)
    via3: Layer = (40, 0)
    metal4: Layer = (46, 0)
    via4: Layer = (41, 0)
    metal5: Layer = (81, 0)
    via5: Layer = (82, 0)
    metaltop: Layer = (53, 0)
    pad: Layer = (37, 0)
    resistor: Layer = (62, 0)
    fhres: Layer = (227, 0)
    fusetop: Layer = (75, 0)
    fusewindow_d: Layer = (96, 1)
    polyfuse: Layer = (220, 0)
    mvsd: Layer = (210, 0)
    mvpsd: Layer = (11, 39)
    nat: Layer = (5, 0)
    comp_dummy: Layer = (22, 4)
    poly2_dummy: Layer = (30, 4)
    metal1_dummy: Layer = (34, 4)
    metal2_dummy: Layer = (36, 4)
    metal3_dummy: Layer = (42, 4)
    metal4_dummy: Layer = (46, 4)
    metal5_dummy: Layer = (81, 4)
    metaltop_dummy: Layer = (53, 4)
    comp_label: Layer = (22, 10)
    poly2_label: Layer = (30, 10)
    metal1_label: Layer = (34, 10)
    metal2_label: Layer = (36, 10)
    metal3_label: Layer = (42, 10)
    metal4_label: Layer = (46, 10)
    metal5_label: Layer = (81, 10)
    metaltop_label: Layer = (53, 10)
    metal1_slot: Layer = (34, 3)
    metal2_slot: Layer = (36, 3)
    metal3_slot: Layer = (42, 3)
    metal4_slot: Layer = (46, 3)
    metal5_slot: Layer = (81, 3)
    metaltop_slot: Layer = (53, 3)
    ubmpperi: Layer = (183, 0)
    ubmparray: Layer = (184, 0)
    ubmeplate: Layer = (185, 0)
    schottky_diode: Layer = (241, 0)
    zener: Layer = (178, 0)
    res_mk: Layer = (110, 5)
    opc_drc: Layer = (124, 5)
    ndmy: Layer = (111, 5)
    pmndmy: Layer = (152, 5)
    v5_xtor: Layer = (112, 1)
    cap_mk: Layer = (117, 5)
    mos_cap_mk: Layer = (166, 5)
    ind_mk: Layer = (151, 5)
    diode_mk: Layer = (115, 5)
    drc_bjt: Layer = (127, 5)
    lvs_bjt: Layer = (118, 5)
    mim_l_mk: Layer = (117, 10)
    latchup_mk: Layer = (137, 5)
    guard_ring_mk: Layer = (167, 5)
    otp_mk: Layer = (173, 5)
    mtpmark: Layer = (122, 5)
    neo_ee_mk: Layer = (88, 17)
    sramcore: Layer = (108, 5)
    lvs_rf: Layer = (100, 5)
    lvs_drain: Layer = (100, 7)
    ind_mk1: Layer = (151, 5)
    hvpolyrs: Layer = (123, 5)
    lvs_io: Layer = (119, 5)
    probe_mk: Layer = (13, 17)
    esd_mk: Layer = (24, 5)
    lvs_source: Layer = (100, 8)
    well_diode_mk: Layer = (153, 51)
    ldmos_xtor: Layer = (226, 0)
    plfuse: Layer = (125, 5)
    efuse_mk: Layer = (80, 5)
    mcell_feol_mk: Layer = (11, 17)
    ymtp_mk: Layer = (86, 17)
    dev_wf_mk: Layer = (128, 17)
    metal1_blk: Layer = (34, 5)
    metal2_blk: Layer = (36, 5)
    metal3_blk: Layer = (42, 5)
    metal4_blk: Layer = (46, 5)
    metal5_blk: Layer = (81, 5)
    metalt_blk: Layer = (53, 5)
    pr_bndry: Layer = (0, 0)
    mdiode: Layer = (116, 5)
    metal1_res: Layer = (110, 11)
    metal2_res: Layer = (110, 12)
    metal3_res: Layer = (110, 13)
    metal4_res: Layer = (110, 14)
    metal5_res: Layer = (110, 15)
    metal6_res: Layer = (110, 16)
    border: Layer = (63, 0)


layer = LAYER
LAYER_VIEWS = gf.technology.LayerViews(PATH.lyp_yaml)

if __name__ == "__main__":
    LAYER_VIEWS.to_lyp(PATH.lyp)
