본문 바로가기
Home Cockpit/DIY

[MSFS] PMDG MCP Panel by Simconnect Mobiflight (Python)

by 비니미니파 2023. 5. 19.

https://github.com/Koseng/MSFSPythonSimConnectMobiFlightExtension

 

GitHub - Koseng/MSFSPythonSimConnectMobiFlightExtension: Extends the python simconnect library for MSFS2020 with the capability

Extends the python simconnect library for MSFS2020 with the capability to read A and L variables with help of the MobiFlight WASM module. - GitHub - Koseng/MSFSPythonSimConnectMobiFlightExtension: ...

github.com

 

Simconnect Mobiflight 를 활용하여 MCP 패널의 value 를 출력 해보자.

from simconnect_mobiflight import SimConnectMobiFlight
from mobiflight_variable_requests import MobiFlightVariableRequests
from time import sleep

sm = SimConnectMobiFlight()
vr = MobiFlightVariableRequests(sm)
vr.clear_sim_variables()

while True:
    # PMDG 737 MCP Value
    crs0 = vr.get("(L:ngx_CRSwindowL)")     # CRS Left
    spd = vr.get("(L:ngx_SPDwindow)")       # Speed
    hdg = vr.get("(L:ngx_HDGWindow)")       # Heading
    alt = vr.get("(L:ngx_ALTwindow)")       # Altitude
    vs = vr.get("(L:ngx_VSwindow)")         # V/S Speed
    crs1 = vr.get("(L:ngx_CRSwindowR)")     # CRS Right

    print(crs0)
    print(spd)
    print(hdg)
    print(alt)
    print(vs)
    print(crs1)
    print("###############")

    sleep(1)

 

위의 예제 처럼 vr.get( SIM_VARS ) 를 활용하면 값을 가져올수 있다.

 

PMDG L VARS 를 가져오려면 예) MCP Speed 

spd = vr.get("(L:ngx_SPDwindow)")

형식으로 가져오면 된다.

댓글