#  MIT License
#
#  Copyright (c) 2025 [fullname]
#
#  Permission is hereby granted, free of charge, to any person obtaining a copy
#  of this software and associated documentation files (the "Software"),
#  to deal in the Software without restriction, including without limitation
#  the rights to use, copy, modify, merge, publish, distribute, sublicense,
#  and/or sell copies of the Software, and to permit persons to whom
#  the Software is furnished to do so, subject to the following conditions:
#
#  The above copyright notice and this permission notice shall be included
#  in all copies or substantial portions of the Software.
#
#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
#  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
#  OTHER DEALINGS IN THE SOFTWARE.

from BudapestMetroDisplay.model import LED, LedStrip, Network, Route, Stop, StopId

# 63 LEDs, indices 0..62
leds = [LED(index=i) for i in range(63)]
led_strip = LedStrip(leds=leds)

network = Network()

network.add_route(m1 := Route(name="M1", route_id="BKK_5100", type="subway"))
network.add_route(m2 := Route(name="M2", route_id="BKK_5200", type="subway"))
network.add_route(m3 := Route(name="M3", route_id="BKK_5300", type="subway"))
network.add_route(m4 := Route(name="M4", route_id="BKK_5400", type="subway"))
network.add_route(h5 := Route(name="H5", route_id="BKK_H5", type="railway"))
network.add_route(h6 := Route(name="H6", route_id="BKK_H6", type="railway"))
network.add_route(h7 := Route(name="H7", route_id="BKK_H7", type="railway"))
network.add_route(h8 := Route(name="H8", route_id="BKK_H8", type="railway"))
m1.color = (255, 255, 0)
m2.color = (255, 0, 0)
m3.color = (0, 0, 255)
m4.color = (0, 255, 0)
h5.color = (255, 0, 255)
h6.color = (255, 0, 255)
h7.color = (255, 0, 255)
h8.color = (255, 0, 255)

# M1
m1_stop1 = Stop(name="Vörösmarty tér", led=leds[53], route=m1, is_terminus=True)
m1_stop2 = Stop(name="Deák Ferenc tér", led=leds[19], route=m1)
m1_stop3 = Stop(name="Bajcsy-Zsilinszky út", led=leds[54], route=m1)
m1_stop4 = Stop(name="Opera", led=leds[55], route=m1)
m1_stop5 = Stop(name="Oktogon", led=leds[56], route=m1)
m1_stop6 = Stop(name="Vörösmarty utca", led=leds[57], route=m1)
m1_stop7 = Stop(name="Kodály körönd", led=leds[58], route=m1)
m1_stop8 = Stop(name="Bajza utca", led=leds[59], route=m1)
m1_stop9 = Stop(name="Hősök tere", led=leds[60], route=m1)
m1_stop10 = Stop(name="Széchenyi fürdő", led=leds[61], route=m1)
m1_stop11 = Stop(name="Mexikói út", led=leds[62], route=m1, is_terminus=True)
StopId(stop_id="BKK_F00965", stop=m1_stop1)
StopId(stop_id="BKK_F00963", stop=m1_stop2)
StopId(stop_id="BKK_F00997", stop=m1_stop3)
StopId(stop_id="BKK_F01080", stop=m1_stop4)
StopId(stop_id="BKK_F01086", stop=m1_stop5)
StopId(stop_id="BKK_F01093", stop=m1_stop6)
StopId(stop_id="BKK_F01096", stop=m1_stop7)
StopId(stop_id="BKK_F01101", stop=m1_stop8)
StopId(stop_id="BKK_F01103", stop=m1_stop9)
StopId(stop_id="BKK_F02697", stop=m1_stop10)
StopId(stop_id="BKK_F02888", stop=m1_stop11)
StopId(stop_id="BKK_F02887", stop=m1_stop11)
StopId(stop_id="BKK_F02696", stop=m1_stop10)
StopId(stop_id="BKK_F01102", stop=m1_stop9)
StopId(stop_id="BKK_F01100", stop=m1_stop8)
StopId(stop_id="BKK_F01095", stop=m1_stop7)
StopId(stop_id="BKK_F01092", stop=m1_stop6)
StopId(stop_id="BKK_F01085", stop=m1_stop5)
StopId(stop_id="BKK_F01079", stop=m1_stop4)
StopId(stop_id="BKK_F00996", stop=m1_stop3)
StopId(stop_id="BKK_F00962", stop=m1_stop2)
StopId(stop_id="BKK_F00964", stop=m1_stop1)

# M2
m2_stop1 = Stop(name="Déli pályaudvar", led=leds[15], route=m2, is_terminus=True)
m2_stop2 = Stop(name="Széll Kálmán tér", led=leds[16], route=m2)
m2_stop3 = Stop(name="Batthyány tér", led=leds[17], route=m2)
m2_stop4 = Stop(name="Kossuth Lajos tér", led=leds[18], route=m2)
m2_stop5 = Stop(name="Deák Ferenc tér", led=leds[19], route=m2)
m2_stop6 = Stop(name="Astoria", led=leds[20], route=m2)
m2_stop7 = Stop(name="Blaha Lujza tér", led=leds[21], route=m2)
m2_stop8 = Stop(name="Keleti pályaudvar", led=leds[22], route=m2)
m2_stop9 = Stop(name="Puskás Ferenc Stadion", led=leds[23], route=m2)
m2_stop10 = Stop(name="Pillangó utca", led=leds[24], route=m2)
m2_stop11 = Stop(name="Örs vezér tere", led=leds[25], route=m2, is_terminus=True)
StopId(stop_id="BKK_F00094", stop=m2_stop1)
StopId(stop_id="BKK_F02481", stop=m2_stop2)
StopId(stop_id="BKK_F00063", stop=m2_stop3)
StopId(stop_id="BKK_F00959", stop=m2_stop4)
StopId(stop_id="BKK_F00961", stop=m2_stop5)
StopId(stop_id="BKK_F01019", stop=m2_stop6)
StopId(stop_id="BKK_F01292", stop=m2_stop7)
StopId(stop_id="BKK_F01336", stop=m2_stop8)
StopId(stop_id="BKK_F01325", stop=m2_stop9)
StopId(stop_id="BKK_F01743", stop=m2_stop10)
StopId(stop_id="BKK_F01749", stop=m2_stop11)
StopId(stop_id="BKK_F01742", stop=m2_stop10)
StopId(stop_id="BKK_F01324", stop=m2_stop9)
StopId(stop_id="BKK_F01335", stop=m2_stop8)
StopId(stop_id="BKK_F01291", stop=m2_stop7)
StopId(stop_id="BKK_F01018", stop=m2_stop6)
StopId(stop_id="BKK_F00960", stop=m2_stop5)
StopId(stop_id="BKK_F00958", stop=m2_stop4)
StopId(stop_id="BKK_F00062", stop=m2_stop3)
StopId(stop_id="BKK_F02480", stop=m2_stop2)
StopId(stop_id="BKK_F00093", stop=m2_stop1)

# M3
m3_stop1 = Stop(name="Újpest-központ", led=leds[35], route=m3, is_terminus=True)
m3_stop2 = Stop(name="Újpest-vársokapu", led=leds[36], route=m3)
m3_stop3 = Stop(name="Gyöngyösi utca", led=leds[37], route=m3)
m3_stop4 = Stop(name="Forgách utca", led=leds[38], route=m3)
m3_stop5 = Stop(name="Göncz Árpád városközpont", led=leds[39], route=m3)
m3_stop6 = Stop(name="Dózsa György út", led=leds[40], route=m3)
m3_stop7 = Stop(name="Lehel tér", led=leds[41], route=m3)
m3_stop8 = Stop(name="Nyugati pályaudvar", led=leds[42], route=m3)
m3_stop9 = Stop(name="Arany János utca", led=leds[43], route=m3)
m3_stop10 = Stop(name="Deák Ferenc tér", led=leds[19], route=m3)
m3_stop11 = Stop(name="Ferenciek tere", led=leds[44], route=m3)
m3_stop12 = Stop(name="Kálvin tér", led=leds[12], route=m3)
m3_stop13 = Stop(name="Corvin-negyed", led=leds[45], route=m3)
m3_stop14 = Stop(name="Klinikák", led=leds[46], route=m3)
m3_stop15 = Stop(name="Nagyvárad tér", led=leds[47], route=m3)
m3_stop16 = Stop(name="Népliget", led=leds[48], route=m3)
m3_stop17 = Stop(name="Ecseri út", led=leds[49], route=m3)
m3_stop18 = Stop(name="Pöttyös utca", led=leds[50], route=m3)
m3_stop19 = Stop(name="Határ út", led=leds[51], route=m3)
m3_stop20 = Stop(name="Kőbánya-Kispest", led=leds[52], route=m3, is_terminus=True)
StopId(stop_id="BKK_F00913", stop=m3_stop1)
StopId(stop_id="BKK_F00898", stop=m3_stop2)
StopId(stop_id="BKK_F02685", stop=m3_stop3)
StopId(stop_id="BKK_F02683", stop=m3_stop4)
StopId(stop_id="BKK_F02638", stop=m3_stop5)
StopId(stop_id="BKK_F02681", stop=m3_stop6)
StopId(stop_id="BKK_F02614", stop=m3_stop7)
StopId(stop_id="BKK_F00937", stop=m3_stop8)
StopId(stop_id="BKK_F00957", stop=m3_stop9)
StopId(stop_id="BKK_F00955", stop=m3_stop10)
StopId(stop_id="BKK_F00953", stop=m3_stop11)
StopId(stop_id="BKK_F01290", stop=m3_stop12)
StopId(stop_id="BKK_F01189", stop=m3_stop13)
StopId(stop_id="BKK_F01233", stop=m3_stop14)
StopId(stop_id="BKK_F01253", stop=m3_stop15)
StopId(stop_id="BKK_F01283", stop=m3_stop16)
StopId(stop_id="BKK_F01494", stop=m3_stop17)
StopId(stop_id="BKK_F01879", stop=m3_stop18)
StopId(stop_id="BKK_F01542", stop=m3_stop19)
StopId(stop_id="BKK_F01544", stop=m3_stop20)
StopId(stop_id="BKK_F01543", stop=m3_stop20)
StopId(stop_id="BKK_F01541", stop=m3_stop19)
StopId(stop_id="BKK_F01878", stop=m3_stop18)
StopId(stop_id="BKK_F01493", stop=m3_stop17)
StopId(stop_id="BKK_F01282", stop=m3_stop16)
StopId(stop_id="BKK_F01252", stop=m3_stop15)
StopId(stop_id="BKK_F01232", stop=m3_stop14)
StopId(stop_id="BKK_F01188", stop=m3_stop13)
StopId(stop_id="BKK_F01289", stop=m3_stop12)
StopId(stop_id="BKK_F00952", stop=m3_stop11)
StopId(stop_id="BKK_F00954", stop=m3_stop10)
StopId(stop_id="BKK_F00956", stop=m3_stop9)
StopId(stop_id="BKK_F00936", stop=m3_stop8)
StopId(stop_id="BKK_F02613", stop=m3_stop7)
StopId(stop_id="BKK_F02680", stop=m3_stop6)
StopId(stop_id="BKK_F02637", stop=m3_stop5)
StopId(stop_id="BKK_F02682", stop=m3_stop4)
StopId(stop_id="BKK_F02684", stop=m3_stop3)
StopId(stop_id="BKK_F00897", stop=m3_stop2)
StopId(stop_id="BKK_F00912", stop=m3_stop1)

# M4
m4_stop1 = Stop(name="Kelenföld vasútállomás", led=leds[6], route=m4, is_terminus=True)
m4_stop2 = Stop(name="Bikás park", led=leds[7], route=m4)
m4_stop3 = Stop(name="Újbuda-központ", led=leds[8], route=m4)
m4_stop4 = Stop(name="Móricz Zsigmond körtér", led=leds[9], route=m4)
m4_stop5 = Stop(name="Szent Gellért tér", led=leds[10], route=m4)
m4_stop6 = Stop(name="Fővám tér", led=leds[11], route=m4)
m4_stop7 = Stop(name="Kálvin tér", led=leds[12], route=m4)
m4_stop8 = Stop(name="Rákóczi tér", led=leds[13], route=m4)
m4_stop9 = Stop(name="II. János Pál pápa tér", led=leds[14], route=m4)
m4_stop10 = Stop(name="Keleti pályaudvar", led=leds[22], route=m4, is_terminus=True)
StopId(stop_id="BKK_056233", stop=m4_stop10)
StopId(stop_id="BKK_056231", stop=m4_stop9)
StopId(stop_id="BKK_056229", stop=m4_stop8)
StopId(stop_id="BKK_056227", stop=m4_stop7)
StopId(stop_id="BKK_056225", stop=m4_stop6)
StopId(stop_id="BKK_056223", stop=m4_stop5)
StopId(stop_id="BKK_056221", stop=m4_stop4)
StopId(stop_id="BKK_056219", stop=m4_stop3)
StopId(stop_id="BKK_056217", stop=m4_stop2)
StopId(stop_id="BKK_056215", stop=m4_stop1)
StopId(stop_id="BKK_056216", stop=m4_stop1)
StopId(stop_id="BKK_056218", stop=m4_stop2)
StopId(stop_id="BKK_056220", stop=m4_stop3)
StopId(stop_id="BKK_056222", stop=m4_stop4)
StopId(stop_id="BKK_056224", stop=m4_stop5)
StopId(stop_id="BKK_056226", stop=m4_stop6)
StopId(stop_id="BKK_056228", stop=m4_stop7)
StopId(stop_id="BKK_056230", stop=m4_stop8)
StopId(stop_id="BKK_056232", stop=m4_stop9)
StopId(stop_id="BKK_056234", stop=m4_stop10)

# H5
h5_stop1 = Stop(name="Batthyány tér", led=leds[17], route=h5, is_terminus=True)
h5_stop2 = Stop(name="Margit híd, budai hídfő", led=leds[27], route=h5)
h5_stop3 = Stop(name="Szépvölgyi út", led=leds[28], route=h5)
h5_stop4 = Stop(name="Tímár utca", led=leds[29], route=h5)
h5_stop5 = Stop(name="Szentlélek tér", led=leds[30], route=h5)
h5_stop6 = Stop(name="Filatorigát", led=leds[31], route=h5)
h5_stop7 = Stop(name="Kaszásdülő", led=leds[32], route=h5)
h5_stop8 = Stop(name="Aquincum", led=leds[33], route=h5)
h5_stop9 = Stop(name="Rómaifürdő", led=leds[34], route=h5)
StopId(stop_id="BKK_09159205", stop=h5_stop9)
StopId(stop_id="BKK_09100203", stop=h5_stop8)
StopId(stop_id="BKK_09084201", stop=h5_stop7)
StopId(stop_id="BKK_09118199", stop=h5_stop6)
StopId(stop_id="BKK_09068197", stop=h5_stop5)
StopId(stop_id="BKK_09050195", stop=h5_stop4)
StopId(stop_id="BKK_09043193", stop=h5_stop3)
StopId(stop_id="BKK_09019191", stop=h5_stop2)
StopId(stop_id="BKK_09001187", stop=h5_stop1)
StopId(stop_id="BKK_09001188", stop=h5_stop1)
StopId(stop_id="BKK_09001189", stop=h5_stop1)
StopId(stop_id="BKK_09019190", stop=h5_stop2)
StopId(stop_id="BKK_09043192", stop=h5_stop3)
StopId(stop_id="BKK_09050194", stop=h5_stop4)
StopId(stop_id="BKK_09068196", stop=h5_stop5)
StopId(stop_id="BKK_09118198", stop=h5_stop6)
StopId(stop_id="BKK_09084200", stop=h5_stop7)
StopId(stop_id="BKK_09100202", stop=h5_stop8)
StopId(stop_id="BKK_09159204", stop=h5_stop9)

# H6
h6_stop1 = Stop(name="Közvágóhíd", led=leds[2], route=h6, is_terminus=True)
h6_stop2 = Stop(name="Kén utca", led=leds[1], route=h6)
h6_stop3 = Stop(name="Pesterzsébet felső", led=leds[0], route=h6)
StopId(stop_id="BKK_19729240", stop=h6_stop3)
StopId(stop_id="BKK_19726239", stop=h6_stop2)
StopId(stop_id="BKK_19720236", stop=h6_stop1)
StopId(stop_id="BKK_19720237", stop=h6_stop1)
StopId(stop_id="BKK_19726238", stop=h6_stop2)
StopId(stop_id="BKK_19729241", stop=h6_stop3)

# H7
h7_stop1 = Stop(name="Boráros tér", led=leds[5], route=h7, is_terminus=True)
h7_stop2 = Stop(name="Müpa - Nemzeti Színház", led=leds[4], route=h7)
h7_stop3 = Stop(name="Szabadkikötő", led=leds[3], route=h7)
StopId(stop_id="BKK_09223228", stop=h7_stop3)
StopId(stop_id="BKK_09221227", stop=h7_stop2)
StopId(stop_id="BKK_09220224", stop=h7_stop1)
StopId(stop_id="BKK_09220225", stop=h7_stop1)
StopId(stop_id="BKK_09221226", stop=h7_stop2)
StopId(stop_id="BKK_09223229", stop=h7_stop3)

# H8
h8_stop1 = Stop(name="Örs vezér tere", led=leds[25], route=h8, is_terminus=True)
h8_stop2 = Stop(name="Rákosfalva", led=leds[26], route=h8)
StopId(stop_id="BKK_19798282", stop=h8_stop2)
StopId(stop_id="BKK_19795278", stop=h8_stop1)
StopId(stop_id="BKK_19795279", stop=h8_stop1)
StopId(stop_id="BKK_19795280", stop=h8_stop1)
StopId(stop_id="BKK_19798281", stop=h8_stop2)
