2025-12-31 19:21:25 +08:00
|
|
|
import pandas as pd
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
|
def create_template():
|
|
|
|
|
# Create sample data similar to the internal generator
|
|
|
|
|
data = []
|
|
|
|
|
|
|
|
|
|
# Add Substation
|
|
|
|
|
data.append({
|
|
|
|
|
'Type': 'Substation',
|
|
|
|
|
'ID': 'Sub1',
|
|
|
|
|
'X': 4000,
|
|
|
|
|
'Y': -800,
|
2026-01-01 12:23:00 +08:00
|
|
|
'Power': 0,
|
|
|
|
|
'PlatformHeight': 0
|
2025-12-31 19:21:25 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# Add Turbines (Grid layout)
|
|
|
|
|
n_turbines = 30
|
|
|
|
|
spacing = 800
|
|
|
|
|
n_cols = 6
|
|
|
|
|
|
|
|
|
|
for i in range(n_turbines):
|
|
|
|
|
row = i // n_cols
|
|
|
|
|
col = i % n_cols
|
|
|
|
|
x = col * spacing
|
|
|
|
|
y = row * spacing
|
|
|
|
|
data.append({
|
|
|
|
|
'Type': 'Turbine',
|
|
|
|
|
'ID': i,
|
|
|
|
|
'X': x,
|
|
|
|
|
'Y': y,
|
2026-01-01 12:23:00 +08:00
|
|
|
'Power': np.random.uniform(6.0, 10.0),
|
|
|
|
|
'PlatformHeight': 0
|
2025-12-31 19:21:25 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
df = pd.DataFrame(data)
|
|
|
|
|
|
2026-01-01 11:39:14 +08:00
|
|
|
# Create Cable data
|
|
|
|
|
cable_data = [
|
2026-01-01 23:58:03 +08:00
|
|
|
{'CrossSection': 35, 'Capacity': 150, 'Resistance': 0.524, 'Cost': 80, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 70, 'Capacity': 215, 'Resistance': 0.268, 'Cost': 120, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 95, 'Capacity': 260, 'Resistance': 0.193, 'Cost': 150, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 120, 'Capacity': 295, 'Resistance': 0.153, 'Cost': 180, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 150, 'Capacity': 330, 'Resistance': 0.124, 'Cost': 220, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 185, 'Capacity': 370, 'Resistance': 0.0991, 'Cost': 270, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 240, 'Capacity': 425, 'Resistance': 0.0754, 'Cost': 350, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 300, 'Capacity': 500, 'Resistance': 0.0601, 'Cost': 450, 'Optional': ''},
|
|
|
|
|
{'CrossSection': 400, 'Capacity': 580, 'Resistance': 0.0470, 'Cost': 600, 'Optional': ''}
|
2026-01-01 11:39:14 +08:00
|
|
|
]
|
|
|
|
|
df_cables = pd.DataFrame(cable_data)
|
|
|
|
|
|
2025-12-31 19:21:25 +08:00
|
|
|
# Save to Excel
|
|
|
|
|
output_file = 'coordinates.xlsx'
|
2026-01-01 11:39:14 +08:00
|
|
|
with pd.ExcelWriter(output_file) as writer:
|
|
|
|
|
df.to_excel(writer, sheet_name='Coordinates', index=False)
|
|
|
|
|
df_cables.to_excel(writer, sheet_name='Cables', index=False)
|
|
|
|
|
print(f"Created sample file: {output_file} with sheets 'Coordinates' and 'Cables'")
|
2025-12-31 19:21:25 +08:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
create_template()
|