37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
import pandas as pd
|
|
import os
|
|
|
|
def create_dummy_trackinfo():
|
|
# 상선TC2 데이터 (Pos, Code, Name, No, DoorDir)
|
|
# C# 코드 기준: Col 1(Pos), 2(Code), 3(Name), 4(No), 5(DoorDir) -> 엑셀 A, B, C, D, E
|
|
# 하지만 station_info.py 파싱 로직:
|
|
# row[0]: Pos, row[1]: Code, row[2]: Name, row[3]: No, row[4]: DoorDir
|
|
|
|
data_tc2 = [
|
|
["Pos", "Code", "Name", "No", "DoorDir"], # Header
|
|
[100.0, 101, "TestStation1", 1, "DW"],
|
|
[200.0, 102, "TestStation2", 2, "DE"],
|
|
[300.0, 103, "TestStation3", 3, "DW"],
|
|
]
|
|
|
|
data_tc1 = [
|
|
["Pos", "Code", "Name", "No", "DoorDir"], # Header
|
|
[300.0, 103, "TestStation3", 3, "DW"],
|
|
[200.0, 102, "TestStation2", 2, "DE"],
|
|
[100.0, 101, "TestStation1", 1, "DW"],
|
|
]
|
|
|
|
df_tc2 = pd.DataFrame(data_tc2)
|
|
df_tc1 = pd.DataFrame(data_tc1)
|
|
|
|
filepath = "TrackInfo.xlsx"
|
|
|
|
with pd.ExcelWriter(filepath, engine='openpyxl') as writer:
|
|
df_tc2.to_excel(writer, sheet_name="상선TC2", header=False, index=False)
|
|
df_tc1.to_excel(writer, sheet_name="하선TC1", header=False, index=False)
|
|
|
|
print(f"Created dummy {filepath}")
|
|
|
|
if __name__ == "__main__":
|
|
create_dummy_trackinfo()
|