fixed_params_template.py 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. """MotorCAD fixed parameter templates with Chinese names, categories and descriptions.
  2. Used to populate AI-generated simulation plans with comprehensive fixed parameters.
  3. Parameters that are also scan variables are automatically excluded.
  4. This file is the single source of truth for the fixed-parameter template.
  5. AI plan generation populates ALL parameters here (template-driven), so the
  6. frontend can reliably render a complete, balanced fixed-parameter table.
  7. """
  8. from typing import Dict, Any, List
  9. from .bc_fields import normalize_bc
  10. # Category Chinese names (8 motor-engineering categories)
  11. CATEGORY_CN = {
  12. "Geometry": "\u51e0\u4f55\u5c3a\u5bf8",
  13. "Stator": "\u5b9a\u5b50\u53c2\u6570",
  14. "Rotor": "\u8f6c\u5b50\u53c2\u6570",
  15. "Performance": "\u6027\u80fd\u89c4\u683c",
  16. "Winding": "\u7ed5\u7ec4\u53c2\u6570",
  17. "Material": "\u6750\u6599\u5c5e\u6027",
  18. "Thermal": "\u70ed\u4e0e\u51b7\u5374",
  19. "Simulation": "\u4eff\u771f\u8bbe\u7f6e",
  20. "System": "\u4eff\u771f\u8bbe\u7f6e",
  21. "Mechanical": "\u5176\u4ed6",
  22. "Electrical": "\u6027\u80fd\u89c4\u683c",
  23. "General": "\u5176\u4ed6",
  24. }
  25. # Fixed parameter templates: name -> {display_name, name_cn, unit, value, category, category_cn, description, description_cn}
  26. # Note: params marked "\u9700\u786e\u8ba4" in description_cn may need Motor-CAD variable name verification.
  27. FIXED_PARAM_TEMPLATES = [
  28. # ===== Geometry \u51e0\u4f55\u5c3a\u5bf8 =====
  29. {
  30. "name": "Outer_Rotor_Diameter",
  31. "motorcad_var": "RotorOuterDiameter",
  32. "display_name": "Outer Rotor Diameter",
  33. "name_cn": "\u8f6c\u5b50\u5916\u5f84",
  34. "unit": "mm",
  35. "value": 130.0,
  36. "category": "Geometry",
  37. "description": "Outer diameter of rotor back iron",
  38. "description_cn": "\u8f6c\u5b50\u80cc\u94c1\u5916\u5f84",
  39. },
  40. {
  41. "name": "Inner_Rotor_Diameter",
  42. "motorcad_var": None,
  43. "display_name": "Inner Rotor Diameter",
  44. "name_cn": "\u8f6c\u5b50\u5185\u5f84",
  45. "unit": "mm",
  46. "value": 120.0,
  47. "category": "Geometry",
  48. "description": "Inner diameter of rotor back iron",
  49. "description_cn": "\u8f6c\u5b50\u80cc\u94c1\u5185\u5f84",
  50. },
  51. {
  52. "name": "Stator_Outer_Diameter",
  53. "motorcad_var": "Stator_Lam_Dia",
  54. "display_name": "Stator Outer Diameter",
  55. "name_cn": "\u5b9a\u5b50\u5916\u5f84",
  56. "unit": "mm",
  57. "value": 76.0,
  58. "category": "Geometry",
  59. "description": "Outer diameter of stator lamination",
  60. "description_cn": "\u5b9a\u5b50\u51b2\u7247\u5916\u5f84",
  61. },
  62. {
  63. "name": "Stator_Inner_Diameter",
  64. "motorcad_var": "Stator_Bore",
  65. "display_name": "Stator Inner Diameter",
  66. "name_cn": "\u5b9a\u5b50\u5185\u5f84",
  67. "unit": "mm",
  68. "value": 50.0,
  69. "category": "Geometry",
  70. "description": "Inner diameter of stator lamination",
  71. "description_cn": "\u5b9a\u5b50\u51b2\u7247\u5185\u5f84",
  72. },
  73. {
  74. "name": "Airgap",
  75. "motorcad_var": "Airgap",
  76. "display_name": "Airgap Length",
  77. "name_cn": "\u6c14\u9699\u957f\u5ea6",
  78. "unit": "mm",
  79. "value": 1.0,
  80. "category": "Geometry",
  81. "description": "Mechanical airgap between stator and rotor",
  82. "description_cn": "\u5b9a\u8f6c\u5b50\u4e4b\u95f4\u6c14\u9699",
  83. },
  84. # ===== Stator \u5b9a\u5b50\u53c2\u6570 =====
  85. {
  86. "name": "Stator_Yoke_Thickness",
  87. "motorcad_var": None,
  88. "display_name": "Stator Yoke Thickness",
  89. "name_cn": "\u5b9a\u5b50\u8f6f\u539a",
  90. "unit": "mm",
  91. "value": 10.0,
  92. "category": "Stator",
  93. "description": "Radial thickness of stator yoke",
  94. "description_cn": "\u5b9a\u5b50\u8f6f\u90e8\u5f84\u5411\u539a\u5ea6",
  95. },
  96. {
  97. "name": "Slot_Depth",
  98. "motorcad_var": "Slot_Depth",
  99. "display_name": "Slot Depth",
  100. "name_cn": "\u69fd\u6df1",
  101. "unit": "mm",
  102. "value": 7.0,
  103. "category": "Stator",
  104. "description": "Depth of stator slot",
  105. "description_cn": "\u5b9a\u5b50\u69fd\u6df1\u5ea6",
  106. },
  107. {
  108. "name": "Slot_Width",
  109. "motorcad_var": "Slot_Width",
  110. "display_name": "Slot Width",
  111. "name_cn": "\u69fd\u5bbd",
  112. "unit": "mm",
  113. "value": 8.5,
  114. "category": "Stator",
  115. "description": "Width of stator slot opening",
  116. "description_cn": "\u5b9a\u5b50\u69fd\u53e3\u5bbd\u5ea6",
  117. },
  118. {
  119. "name": "Tooth_Width",
  120. "motorcad_var": "Tooth_Width",
  121. "display_name": "Tooth Width",
  122. "name_cn": "\u9f7f\u5bbd",
  123. "unit": "mm",
  124. "value": 7.0,
  125. "category": "Stator",
  126. "description": "Width of stator tooth",
  127. "description_cn": "\u5b9a\u5b50\u9f7f\u5bbd\u5ea6",
  128. },
  129. {
  130. "name": "Number_of_Slots",
  131. "motorcad_var": "Slot_Number",
  132. "display_name": "Number of Slots",
  133. "name_cn": "\u69fd\u6570",
  134. "unit": "",
  135. "value": 12,
  136. "category": "Stator",
  137. "description": "Total number of stator slots",
  138. "description_cn": "\u5b9a\u5b50\u603b\u69fd\u6570",
  139. },
  140. # ===== Rotor \u8f6c\u5b50\u53c2\u6570 =====
  141. {
  142. "name": "Rotor_Back_Iron_Thickness",
  143. "motorcad_var": "Back_Iron_Thickness",
  144. "display_name": "Rotor Back Iron Thickness",
  145. "name_cn": "\u8f6c\u5b50\u80cc\u94c1\u539a",
  146. "unit": "mm",
  147. "value": 5.0,
  148. "category": "Rotor",
  149. "description": "Radial thickness of rotor back iron",
  150. "description_cn": "\u8f6c\u5b50\u80cc\u94c1\u5f84\u5411\u539a\u5ea6",
  151. },
  152. {
  153. "name": "Magnet_Length",
  154. "motorcad_var": "Magnet_Length",
  155. "display_name": "Magnet Axial Thickness",
  156. "name_cn": "\u78c1\u94a2\u8f74\u5411\u957f\u5ea6",
  157. "unit": "mm",
  158. "value": 3.0,
  159. "category": "Rotor",
  160. "description": "Axial thickness of permanent magnet",
  161. "description_cn": "\u6c38\u78c1\u4f53\u8f74\u5411\u539a\u5ea6",
  162. },
  163. {
  164. "name": "Magnet_Thickness",
  165. "motorcad_var": "Magnet_Thickness",
  166. "display_name": "Magnet Radial Depth",
  167. "name_cn": "\u78c1\u94a2\u5f84\u5411\u539a\u5ea6",
  168. "unit": "mm",
  169. "value": 13.0,
  170. "category": "Rotor",
  171. "description": "Magnet ring radial depth",
  172. "description_cn": "\u78c1\u94a2\u73af\u5f84\u5411\u539a\u5ea6",
  173. },
  174. {
  175. "name": "Magnet_Arc_[ED]",
  176. "motorcad_var": "Magnet_Arc_[ED]",
  177. "display_name": "Magnet Pole Arc",
  178. "name_cn": "\u78c1\u94a2\u6781\u5f27\u89d2",
  179. "unit": "deg",
  180. "value": 121.0,
  181. "category": "Rotor",
  182. "description": "Magnet pole arc in electrical degrees",
  183. "description_cn": "\u78c1\u94a2\u6781\u5f27\u89d2\u5ea6(\u7535\u89d2\u5ea6)",
  184. },
  185. {
  186. "name": "Number_of_Poles",
  187. "motorcad_var": "Pole_Number",
  188. "display_name": "Number of Poles",
  189. "name_cn": "\u6781\u6570",
  190. "unit": "",
  191. "value": 10,
  192. "category": "Rotor",
  193. "description": "Total number of magnetic poles",
  194. "description_cn": "\u7535\u673a\u603b\u6781\u6570",
  195. },
  196. # ===== Performance \u6027\u80fd\u89c4\u683c =====
  197. {
  198. "name": "Current_Advance_Angle",
  199. "motorcad_var": "PhaseAdvance",
  200. "display_name": "Current Advance Angle",
  201. "name_cn": "\u7535\u6d41\u8d85\u524d\u89d2",
  202. "unit": "deg",
  203. "value": 0.0,
  204. "category": "Performance",
  205. "description": "Current advance angle for field weakening",
  206. "description_cn": "\u5f31\u78c1\u63a7\u5236\u7535\u6d41\u8d85\u524d\u89d2",
  207. },
  208. {
  209. "name": "DC_Link_Voltage",
  210. "motorcad_var": "DCBusVoltage",
  211. "display_name": "DC Link Voltage",
  212. "name_cn": "\u6bcd\u7ebf\u7535\u538b",
  213. "unit": "V",
  214. "value": 13.5,
  215. "category": "Performance",
  216. "description": "DC bus voltage",
  217. "description_cn": "\u76f4\u6d41\u6bcd\u7ebf\u7535\u538b",
  218. },
  219. {
  220. "name": "RMSCurrent",
  221. "motorcad_var": "RMSCurrent",
  222. "display_name": "RMS Phase Current",
  223. "name_cn": "\u989d\u5b9a\u7535\u6d41",
  224. "unit": "A",
  225. "value": 21.0,
  226. "category": "Performance",
  227. "description": "RMS phase current (CurrentDefinition=1)",
  228. "description_cn": "\u989d\u5b9a\u76f8\u7535\u6d41(RMS)",
  229. },
  230. {
  231. "name": "Shaft_Speed",
  232. "motorcad_var": "Shaft_Speed",
  233. "display_name": "Shaft Speed",
  234. "name_cn": "\u989d\u5b9a\u8f6c\u901f",
  235. "unit": "rpm",
  236. "value": 5000.0,
  237. "category": "Performance",
  238. "description": "Rotational shaft speed",
  239. "description_cn": "\u7535\u673a\u989d\u5b9a\u8f6c\u901f",
  240. },
  241. {
  242. "name": "Max_Speed",
  243. "motorcad_var": "WindageGraph_MaxSpeed",
  244. "display_name": "Max Speed",
  245. "name_cn": "\u6700\u9ad8\u8f6c\u901f",
  246. "unit": "rpm",
  247. "value": 7500.0,
  248. "category": "Performance",
  249. "description": "Maximum rotational speed (variable name may need Motor-CAD verification)",
  250. "description_cn": "\u7535\u673a\u6700\u9ad8\u8f6c\u901f\uff08\u53d8\u91cf\u540d\u9700\u786e\u8ba4\uff09",
  251. },
  252. # ===== Winding \u7ed5\u7ec4\u53c2\u6570 =====
  253. {
  254. "name": "Turns_per_Coil",
  255. "motorcad_var": "ConductorsPerSlot",
  256. "display_name": "Turns per Coil",
  257. "name_cn": "\u6bcf\u7ebf\u5708\u53a9\u6570",
  258. "unit": "",
  259. "value": 20,
  260. "category": "Winding",
  261. "description": "Number of turns per coil",
  262. "description_cn": "\u6bcf\u4e2a\u7ebf\u5708\u7684\u53a9\u6570",
  263. },
  264. {
  265. "name": "Parallel_Paths",
  266. "motorcad_var": "ParallelPaths",
  267. "display_name": "Parallel Paths",
  268. "name_cn": "\u5e76\u8054\u652f\u8def\u6570",
  269. "unit": "",
  270. "value": 1,
  271. "category": "Winding",
  272. "description": "Number of parallel winding paths",
  273. "description_cn": "\u7ed5\u7ec4\u5e76\u8054\u652f\u8def\u6570",
  274. },
  275. {
  276. "name": "Copper_Fill_Factor",
  277. "motorcad_var": "Slot_Fill",
  278. "display_name": "Copper Fill Factor",
  279. "name_cn": "\u69fd\u6ee1\u7387",
  280. "unit": "",
  281. "value": 0.45,
  282. "category": "Winding",
  283. "description": "Copper area to slot area ratio",
  284. "description_cn": "\u94dc\u7ebf\u9762\u79ef\u4e0e\u69fd\u9762\u79ef\u4e4b\u6bd4",
  285. },
  286. {
  287. "name": "Wire_Diameter",
  288. "motorcad_var": "Wire_Diameter",
  289. "display_name": "Wire Diameter",
  290. "name_cn": "\u7ebf\u5f84",
  291. "unit": "mm",
  292. "value": 1.63,
  293. "category": "Winding",
  294. "description": "Diameter of magnet wire",
  295. "description_cn": "\u6f06\u5305\u7ebf\u76f4\u5f84",
  296. },
  297. {
  298. "name": "Winding_Connection",
  299. "motorcad_var": "WindingConnection",
  300. "display_name": "Winding Connection",
  301. "name_cn": "\u7ed5\u7ec4\u8fde\u63a5\u65b9\u5f0f",
  302. "unit": "",
  303. "value": "Star",
  304. "category": "Winding",
  305. "description": "Winding connection (Star/Delta) - variable name may need verification",
  306. "description_cn": "\u7ed5\u7ec4\u8fde\u63a5\u65b9\u5f0f(\u661f/\u4e09\u89d2)\uff08\u53d8\u91cf\u540d\u9700\u786e\u8ba4\uff09",
  307. },
  308. {
  309. "name": "Current_Density",
  310. "motorcad_var": None,
  311. "display_name": "Current Density",
  312. "name_cn": "\u7535\u6d41\u5bc6\u5ea6",
  313. "unit": "A/mm2",
  314. "value": 6.0,
  315. "category": "Winding",
  316. "description": "Winding current density - variable name may need verification",
  317. "description_cn": "\u7ed5\u7ec4\u7535\u6d41\u5bc6\u5ea6\uff08\u53d8\u91cf\u540d\u9700\u786e\u8ba4\uff09",
  318. },
  319. # ===== Material \u6750\u6599\u5c5e\u6027 =====
  320. {
  321. "name": "Magnet_Material",
  322. "motorcad_var": "Material_Magnet",
  323. "display_name": "Magnet Material",
  324. "name_cn": "\u78c1\u94a2\u6750\u6599",
  325. "unit": "",
  326. "value": "N42UH",
  327. "category": "Material",
  328. "description": "Permanent magnet material grade",
  329. "description_cn": "\u6c38\u78c1\u4f53\u6750\u6599\u724c\u53f7",
  330. },
  331. {
  332. "name": "Steel_Grade",
  333. "motorcad_var": None,
  334. "display_name": "Steel Grade",
  335. "name_cn": "\u7845\u94a2\u7247\u724c\u53f7",
  336. "unit": "",
  337. "value": "M19_24G",
  338. "category": "Material",
  339. "description": "Electrical steel lamination grade",
  340. "description_cn": "\u7535\u5de5\u7845\u94a2\u7247\u724c\u53f7",
  341. },
  342. {
  343. "name": "Magnet_Temperature",
  344. "motorcad_var": "InitialMagnetTemperature",
  345. "display_name": "Magnet Temperature",
  346. "name_cn": "\u78c1\u94a2\u6e29\u5ea6",
  347. "unit": "C",
  348. "value": 40.0,
  349. "category": "Material",
  350. "description": "Operating temperature of magnets",
  351. "description_cn": "\u78c1\u94a2\u5de5\u4f5c\u6e29\u5ea6",
  352. },
  353. {
  354. "name": "Magnet_Remanence",
  355. "motorcad_var": "Magnet_Br_at_RefTemp",
  356. "display_name": "Magnet Remanence",
  357. "name_cn": "\u5269\u78c1",
  358. "unit": "T",
  359. "value": 1.31,
  360. "category": "Material",
  361. "description": "Permanent magnet remanence flux density - variable name may need verification",
  362. "description_cn": "\u6c38\u78c1\u4f53\u5269\u78c1\u5bc6\u5ea6\uff08\u53d8\u91cf\u540d\u9700\u786e\u8ba4\uff09",
  363. },
  364. # ===== Thermal \u70ed\u4e0e\u51b7\u5374 =====
  365. {
  366. "name": "Ambient_Temperature",
  367. "motorcad_var": "Ambient_Temperature",
  368. "display_name": "Ambient Temperature",
  369. "name_cn": "\u73af\u5883\u6e29\u5ea6",
  370. "unit": "C",
  371. "value": 40.0,
  372. "category": "Thermal",
  373. "description": "Ambient air temperature",
  374. "description_cn": "\u73af\u5883\u7a7a\u6c14\u6e29\u5ea6",
  375. },
  376. {
  377. "name": "Cooling_Method",
  378. "motorcad_var": "Cooling_Type",
  379. "display_name": "Cooling Method",
  380. "name_cn": "\u51b7\u5374\u65b9\u5f0f",
  381. "unit": "",
  382. "value": "Natural",
  383. "category": "Thermal",
  384. "description": "Cooling method (Natural/ForcedAir/WaterJacket)",
  385. "description_cn": "\u51b7\u5374\u65b9\u5f0f(\u81ea\u7136/\u5f3a\u8feb\u98ce\u51b7/\u6c34\u51b7)",
  386. },
  387. {
  388. "name": "Insulation_Class",
  389. "motorcad_var": None,
  390. "display_name": "Insulation Class",
  391. "name_cn": "\u7edd\u7f18\u7b49\u7ea7",
  392. "unit": "",
  393. "value": "F",
  394. "category": "Thermal",
  395. "description": "Insulation class (A/E/B/F/H) - variable name may need verification",
  396. "description_cn": "\u7edd\u7f18\u7b49\u7ea7(A/E/B/F/H)\uff08\u53d8\u91cf\u540d\u9700\u786e\u8ba4\uff09",
  397. },
  398. # ===== Simulation \u4eff\u771f\u8bbe\u7f6e =====
  399. {
  400. "name": "TorquePointsPerCycle",
  401. "motorcad_var": "TorquePointsPerCycle",
  402. "display_name": "Torque Points Per Cycle",
  403. "name_cn": "\u6bcf\u5468\u671f\u8f6c\u77e9\u91c7\u6837\u70b9",
  404. "unit": "",
  405. "value": 30,
  406. "category": "Simulation",
  407. "description": "Number of torque calculation points per electrical cycle",
  408. "description_cn": "\u6bcf\u7535\u5468\u671f\u8f6c\u77e9\u8ba1\u7b97\u91c7\u6837\u70b9\u6570",
  409. },
  410. {
  411. "name": "CurrentDefinition",
  412. "motorcad_var": "CurrentDefinition",
  413. "display_name": "Current Definition",
  414. "name_cn": "\u7535\u6d41\u5b9a\u4e49\u65b9\u5f0f",
  415. "unit": "",
  416. "value": 1.0,
  417. "category": "Simulation",
  418. "description": "1=RMS, 2=Peak current definition",
  419. "description_cn": "1=\u6709\u6548\u503c, 2=\u5cf0\u503c\u7535\u6d41\u5b9a\u4e49",
  420. },
  421. {
  422. "name": "AirgapMeshPoints_mesh",
  423. "motorcad_var": "AirgapMeshPoints_mesh",
  424. "display_name": "Airgap Mesh Points",
  425. "name_cn": "\u6c14\u9699\u7f51\u683c\u70b9\u6570",
  426. "unit": "",
  427. "value": 600.0,
  428. "category": "Simulation",
  429. "description": "Number of airgap mesh points (FE mesh refinement)",
  430. "description_cn": "\u6c14\u9699\u7f51\u683c\u70b9\u6570(\u663e\u5f0f\u6c42\u89e3\u7f51\u683c\u52a0\u5bc6)",
  431. },
  432. {
  433. "name": "MessageDisplayState",
  434. "motorcad_var": "MessageDisplayState",
  435. "display_name": "Message Display",
  436. "name_cn": "\u6d88\u606f\u663e\u793a",
  437. "unit": "",
  438. "value": 2.0,
  439. "category": "Simulation",
  440. "description": "Suppress popup dialogs during scripting",
  441. "description_cn": "\u811a\u672c\u8fd0\u884c\u65f6\u6291\u5236\u5f39\u7a97",
  442. },
  443. ]
  444. def get_fixed_param_template(name: str) -> Dict[str, Any]:
  445. """Get a fixed parameter template by name (case-insensitive)."""
  446. lower = name.lower()
  447. for p in FIXED_PARAM_TEMPLATES:
  448. if p["name"].lower() == lower:
  449. return dict(p)
  450. return {}
  451. def build_default_fixed_params(
  452. scan_variable_names: List[str],
  453. boundary_conditions: Dict[str, Any] = None,
  454. ) -> List[Dict[str, Any]]:
  455. """Build default fixed parameter list, excluding variables that are being scanned.
  456. Args:
  457. scan_variable_names: List of variable names used as scan variables.
  458. boundary_conditions: Project boundary conditions for value inference.
  459. Returns:
  460. List of fixed parameter dicts.
  461. """
  462. # Normalize the incoming boundary conditions through the single-source BC
  463. # catalog (bc_fields.normalize_bc): legacy aliases (rated_*, slot_count,
  464. # dc_link_voltage_v, cooling_method, ...) are mapped to the canonical keys
  465. # (current_a, speed_rpm, slots, voltage_v, cooling_type, ...) read below.
  466. # This replaces the previous local alias bridge and keeps all BC-key
  467. # handling in one place (P1-1).
  468. bc = normalize_bc(boundary_conditions or {})
  469. scan_names = {n.lower() for n in scan_variable_names}
  470. params = []
  471. for tmpl in FIXED_PARAM_TEMPLATES:
  472. # Skip if this parameter is already a scan variable
  473. if tmpl["name"].lower() in scan_names:
  474. continue
  475. p = dict(tmpl)
  476. p["category_cn"] = CATEGORY_CN.get(p["category"], p["category"])
  477. # Infer values from boundary conditions
  478. if tmpl["name"] == "Outer_Rotor_Diameter" and bc.get("outer_diameter_mm"):
  479. p["value"] = float(bc["outer_diameter_mm"])
  480. elif tmpl["name"] == "Stator_Outer_Diameter" and bc.get("outer_diameter_mm"):
  481. p["value"] = float(bc["outer_diameter_mm"]) - 2.0
  482. elif tmpl["name"] == "Inner_Rotor_Diameter" and bc.get("inner_diameter_mm"):
  483. p["value"] = float(bc["inner_diameter_mm"])
  484. elif tmpl["name"] == "Stator_Inner_Diameter" and bc.get("inner_diameter_mm"):
  485. p["value"] = float(bc["inner_diameter_mm"]) + 2.0
  486. elif tmpl["name"] == "Airgap" and bc.get("airgap_mm"):
  487. p["value"] = float(bc["airgap_mm"])
  488. elif tmpl["name"] == "Number_of_Poles" and bc.get("pole_pairs"):
  489. p["value"] = int(bc["pole_pairs"]) * 2
  490. elif tmpl["name"] == "Number_of_Slots" and bc.get("slots"):
  491. p["value"] = int(bc["slots"])
  492. elif tmpl["name"] == "RMSCurrent" and bc.get("current_a"):
  493. p["value"] = float(bc["current_a"])
  494. elif tmpl["name"] == "Shaft_Speed" and bc.get("speed_rpm"):
  495. p["value"] = float(bc["speed_rpm"])
  496. elif tmpl["name"] == "Max_Speed" and bc.get("max_speed_rpm"):
  497. p["value"] = float(bc["max_speed_rpm"])
  498. elif tmpl["name"] == "DC_Link_Voltage" and bc.get("voltage_v"):
  499. p["value"] = float(bc["voltage_v"])
  500. elif tmpl["name"] == "Magnet_Material" and bc.get("magnet_material"):
  501. p["value"] = bc["magnet_material"]
  502. elif tmpl["name"] == "Steel_Grade" and bc.get("steel_grade"):
  503. p["value"] = bc["steel_grade"]
  504. elif tmpl["name"] == "Cooling_Method" and bc.get("cooling_type"):
  505. p["value"] = bc["cooling_type"]
  506. elif tmpl["name"] == "Turns_per_Coil" and bc.get("turns_per_coil"):
  507. p["value"] = int(bc["turns_per_coil"])
  508. elif tmpl["name"] == "Parallel_Paths" and bc.get("parallel_paths"):
  509. p["value"] = int(bc["parallel_paths"])
  510. elif tmpl["name"] == "Magnet_Length" and bc.get("magnet_length_mm"):
  511. p["value"] = float(bc["magnet_length_mm"])
  512. elif tmpl["name"] == "Magnet_Thickness" and bc.get("magnet_thickness_mm"):
  513. p["value"] = float(bc["magnet_thickness_mm"])
  514. elif tmpl["name"] == "Magnet_Arc_[ED]" and bc.get("magnet_arc_deg"):
  515. p["value"] = float(bc["magnet_arc_deg"])
  516. elif tmpl["name"] == "Current_Density" and bc.get("current_density_a_mm2"):
  517. p["value"] = float(bc["current_density_a_mm2"])
  518. elif tmpl["name"] == "Magnet_Remanence" and bc.get("magnet_remanence_t"):
  519. p["value"] = float(bc["magnet_remanence_t"])
  520. elif tmpl["name"] == "Ambient_Temperature" and bc.get("ambient_temp_c"):
  521. p["value"] = float(bc["ambient_temp_c"])
  522. elif tmpl["name"] == "Magnet_Temperature" and bc.get("magnet_temp_c"):
  523. p["value"] = float(bc["magnet_temp_c"])
  524. elif tmpl["name"] == "Insulation_Class" and bc.get("insulation_class"):
  525. p["value"] = bc["insulation_class"]
  526. params.append(p)
  527. return params