@@ -431,24 +431,36 @@ def getCableDD(dd,selected_cable,cableConfig,cableType_def,connVal):
431431 dd ['joints' ].append ({'cost' :joint_cost }) # default 0
432432
433433 # add routing if necessary
434- if dd ['cables' ][j ]['type' ] == 'static' :
434+ if 'static' in dd ['cables' ][j ]['cable_type' ] :
435435 cd ['routing' ] = []
436436 # if len(connDict[i]['coordinates'])>2:
437437 # for coord in connDict[i]['coordinates'][1:-1]:
438438 # cd['routing'].append(coord)
439439 cableType = 'static_cable_' + cableType_def [- 2 :]
440440 else :
441441 cableType = 'dynamic_cable_' + cableType_def [- 2 :]
442+ Acondd , jAcondd = getDynamicCables (cableConfig ['cableTypes' ][selected_cable ['sections' ][j ]],
443+ cableConfig ['cableTypes' ],
444+ cableConfig ['cableAppendages' ],
445+ depth
446+ )
447+ cd .update (Acondd )
442448 cd ['rJTube' ] = 5
449+ # for now reset these back
450+ cd ['A' ] = selected_cable ['A' ]
451+ cd ['z_anch' ] = - depth
452+ # if dd['connector_cost']:
453+ # cd['appendages'] = [{'type:'cable_connector',
454+ # 'cost':dd['connector_cost']}]
443455
444456
445- if not 'cable_type' in cd or not cd ['cable_type' ]:
457+ if not 'cable_type' in cd or not isinstance ( cd ['cable_type' ], dict ) :
446458 cp = loadCableProps (None )
447459 cabProps = getCableProps (connVal ['conductor_area' ],cableType ,cableProps = cp )
448460 # fix units
449461 cabProps ['power' ] = cabProps ['power' ]* 1e6
450462 cd ['cable_type' ] = cabProps
451-
463+
452464 cd ['cable_type' ]['name' ] = selected_cable ['sections' ][j ]
453465
454466 return (dd )
@@ -572,15 +584,15 @@ def getCableDesign(connVal, cableType_def, cableConfig, configType, depth=None):
572584 # else:
573585 # raise Exception(f"No cable matching the selection criteria found for cable {connVal['cable_id']}")
574586 dd = getCableDD (dd ,selected_cable ,cableConfig ,cableType_def ,connVal )
575- i_dc = [i for i ,sec in enumerate (dd ['cables' ]) if sec ['type' ] == 'dynamic' ]
587+ i_dc = [i for i ,sec in enumerate (dd ['cables' ]) if 'dynamic' in sec ['cable_type' ] ]
576588 dd ['name' ] = cableType_def
577589 dc_cands = []
578590 # pull out the dc definitions of candidate cables
579591 for cand in cable_candidates :
580592 cand = dict (cand )
581593 for sec in cand ['sections' ]:
582594 typedef = cableConfig ['cableTypes' ][sec ]
583- if typedef ['type' ] == 'dynamic' and typedef not in dc_cands :
595+ if 'dynamic' in typedef ['cable_type' ] and typedef not in dc_cands :
584596 dc_cands .append (cableConfig ['cableTypes' ][sec ])
585597 for i in i_dc :
586598 dd ['cables' ][i ] = cableDesignInterpolation (
0 commit comments