2 Commits

Author SHA1 Message Date
GotPPay
7d87849ba9 fix after rebase 2017-11-27 21:27:21 +01:00
GotPPay
3472fff26f code fix 2017-11-27 20:59:13 +01:00
7 changed files with 27 additions and 24 deletions

View File

@@ -91,13 +91,15 @@ class EbomCalculator(object):
for monitor in monitors: for monitor in monitors:
if monitor['power_source'][0] == 'Switch Gear/External': if monitor['power_source'][0] == 'Switch Gear/External':
add_parts_to_list(part_list, {proper_monitor_controller: 1}, 1) add_parts_to_list(part_list, {proper_monitor_controller: 1}, 1)
if (is_delta):
add_parts_to_list(part_list, {ethernet_plug: 2},1)
add_parts_to_list(part_list, {wire_clip_large: inverter_count}, self.row_count) add_parts_to_list(part_list, {wire_clip_large: inverter_count}, self.row_count)
add_parts_to_list(part_list, {stump: 1}, ceil(total_ac_run_length / 4.0)) add_parts_to_list(part_list, {stump: 1}, ceil(total_ac_run_length / 4.0))
cable_supports = self.calculate_cable_supports(panel_board_counts, len(standalone_inverters)) cable_supports = self.calculate_cable_supports(panel_board_counts, len(standalone_inverters))
add_parts_to_list(part_list, {cable_support: 1, cable_support_lid: 1}, cable_supports) add_parts_to_list(part_list, {cable_support: 1, cable_support_lid: 1}, cable_supports)
add_parts_to_list(part_list, {rear_skirt: -1}, ceil(cable_supports*.38)) add_parts_to_list(part_list, {rear_skirt_1_1: -1}, ceil(cable_supports*.38))
dependent_part_list = {} dependent_part_list = {}

View File

@@ -55,7 +55,7 @@ class SingleTiltParts(object):
def module(self, module_type): def module(self, module_type):
if module_type == ModuleType.Cell96: if module_type == ModuleType.Cell96:
rear_skirt_parts = rear_skirt rear_skirt_parts = rear_skirt_1_1
spoiler_parts = spoiler spoiler_parts = spoiler
else: else:
rear_skirt_parts = rear_skirt_1_1 rear_skirt_parts = rear_skirt_1_1

View File

@@ -10,7 +10,6 @@ from helix.models.coordinate import Coordinate
from helix.models.panel import PanelData, Panel from helix.models.panel import PanelData, Panel
from helix.models.sql.inverter_brands import InverterBrand from helix.models.sql.inverter_brands import InverterBrand
class UserValues(object): class UserValues(object):
def __init__(self, store, site): def __init__(self, store, site):
self.store = store self.store = store

View File

@@ -491,6 +491,8 @@ class CalculatorTest(unittest.TestCase):
assert_array_equal(sorted(self.subject.documentation_bom()), sorted(expected)) assert_array_equal(sorted(self.subject.documentation_bom()), sorted(expected))
# Performance Tests
def test_performance_with_1000ish_module_site(self): def test_performance_with_1000ish_module_site(self):
store = Store(mockredis.mock_redis_client(), "foo") store = Store(mockredis.mock_redis_client(), "foo")

View File

@@ -118,7 +118,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2907, wire_clip_large: 2907,
cable_support_lid: 368, cable_support_lid: 368,
cable_support: 368, cable_support: 368,
rear_skirt: -140, rear_skirt_1_1: -140,
dc_switch_bracket: 2, dc_switch_bracket: 2,
front_legs: 23, front_legs: 23,
back_legs: 23, back_legs: 23,
@@ -196,7 +196,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 513, wire_clip_large: 513,
cable_support_lid: 0, cable_support_lid: 0,
cable_support: 0, cable_support: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
rubber_foot: 9, rubber_foot: 9,
delta_inverter_leg: 9, delta_inverter_leg: 9,
harness_4_string_mf: 4, harness_4_string_mf: 4,
@@ -231,7 +231,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 171, wire_clip_large: 171,
cable_support_lid: 0, cable_support_lid: 0,
cable_support: 0, cable_support: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
rubber_foot: 3, rubber_foot: 3,
delta_inverter_leg: 3, delta_inverter_leg: 3,
harness_4_string_mf: 2, harness_4_string_mf: 2,
@@ -380,7 +380,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 270, cable_support: 270,
cable_support_lid: 270, cable_support_lid: 270,
rear_skirt: -103, rear_skirt_1_1: -103,
ethernet_plug: 7.2, ethernet_plug: 7.2,
monitor_power_plug: 1, monitor_power_plug: 1,
sunshade_bolt: 12, sunshade_bolt: 12,
@@ -492,7 +492,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 270, cable_support: 270,
cable_support_lid: 270, cable_support_lid: 270,
rear_skirt: -103, rear_skirt_1_1: -103,
ethernet_plug: 7.2, ethernet_plug: 7.2,
monitor_power_plug: 1, monitor_power_plug: 1,
sunshade_bolt: 12, sunshade_bolt: 12,
@@ -604,7 +604,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 270, cable_support: 270,
cable_support_lid: 270, cable_support_lid: 270,
rear_skirt: -103, rear_skirt_1_1: -103,
ethernet_plug: 7.2, ethernet_plug: 7.2,
monitor_power_plug: 1, monitor_power_plug: 1,
fuseshade: 14, fuseshade: 14,
@@ -630,7 +630,7 @@ class EbomCalculatorTest(unittest.TestCase):
stump: 0, stump: 0,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_controller_480_v:1, monitor_controller_480_v:1,
} }
@@ -650,7 +650,7 @@ class EbomCalculatorTest(unittest.TestCase):
stump: 0, stump: 0,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_controller_480_v:1, monitor_controller_480_v:1,
flat_washer: 4, flat_washer: 4,
channel_nut: 4, channel_nut: 4,
@@ -771,7 +771,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 694, cable_support: 694,
cable_support_lid: 694, cable_support_lid: 694,
rear_skirt: -264, rear_skirt_1_1: -264,
ethernet_plug: 7.2, ethernet_plug: 7.2,
monitor_power_plug: 1, monitor_power_plug: 1,
fuseshade: 14, fuseshade: 14,
@@ -922,7 +922,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 270, cable_support: 270,
cable_support_lid: 270, cable_support_lid: 270,
rear_skirt: -103, rear_skirt_1_1: -103,
ethernet_plug: 7.2, ethernet_plug: 7.2,
monitor_power_plug: 1, monitor_power_plug: 1,
sunshade_bolt: 12, sunshade_bolt: 12,
@@ -968,7 +968,7 @@ class EbomCalculatorTest(unittest.TestCase):
wire_clip_large: 2394, wire_clip_large: 2394,
cable_support: 270, cable_support: 270,
cable_support_lid: 270, cable_support_lid: 270,
rear_skirt: -103, rear_skirt_1_1: -103,
ethernet_plug: 7.2, ethernet_plug: 7.2,
sunshade_bolt: 12, sunshade_bolt: 12,
sunshade_washer: 12, sunshade_washer: 12,
@@ -1027,7 +1027,7 @@ class EbomCalculatorTest(unittest.TestCase):
mounting_back_plate: 1, mounting_back_plate: 1,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_power_plug: 1, monitor_power_plug: 1,
} }
@@ -1046,7 +1046,7 @@ class EbomCalculatorTest(unittest.TestCase):
mounting_back_plate: 1, mounting_back_plate: 1,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_power_plug: 1, monitor_power_plug: 1,
} }
@@ -1055,14 +1055,14 @@ class EbomCalculatorTest(unittest.TestCase):
stump: 0, stump: 0,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0 rear_skirt_1_1: 0
} }
expected_output_240_pseries = { expected_output_240_pseries = {
stump: 0, stump: 0,
cable_support_lid: 0, cable_support_lid: 0,
cable_support: 0, cable_support: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_controller_240_v: 1, monitor_controller_240_v: 1,
} }
@@ -1111,14 +1111,14 @@ class EbomCalculatorTest(unittest.TestCase):
self.user_values.system_type.return_value = SystemType.singleTilt self.user_values.system_type.return_value = SystemType.singleTilt
self.user_values.module_type.return_value = ModuleType.Cell96 self.user_values.module_type.return_value = ModuleType.Cell96
expected_output = { expected_output = {
monitor_power_plug: 1, monitor_power_plug: 1,
stump: 0, stump: 0,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_controller_480_v: 1, monitor_controller_480_v: 1,
ethernet_plug: 2,
} }
assert_dictionary_equal(self.subject.compute_ebom(), expected_output) assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
@@ -1137,7 +1137,7 @@ class EbomCalculatorTest(unittest.TestCase):
stump: 0, stump: 0,
cable_support: 0, cable_support: 0,
cable_support_lid: 0, cable_support_lid: 0,
rear_skirt: 0, rear_skirt_1_1: 0,
monitor_controller_480_v:1, monitor_controller_480_v:1,
flat_washer: 4, flat_washer: 4,
channel_nut: 4, channel_nut: 4,
@@ -1155,4 +1155,4 @@ class EbomCalculatorTest(unittest.TestCase):

View File

@@ -99,7 +99,7 @@ class MechanicalBomCalculatorWhenSingleTilt96CellTest(unittest.TestCase):
cross_tray: 5, cross_tray: 5,
rubber_foot: 4.4, rubber_foot: 4.4,
front_skirt: 24, front_skirt: 24,
rear_skirt: 44, rear_skirt_1_1: 44,
leading_tray: 25, leading_tray: 25,
ballast: 192, ballast: 192,
anchor: 15, # 12 + the 3 seismic anchors anchor: 15, # 12 + the 3 seismic anchors

View File

@@ -43,13 +43,13 @@ Part # Description Total
514865 BOLT, HH, 3/8-16 X 1/2, 18-8 SS 350 514865 BOLT, HH, 3/8-16 X 1/2, 18-8 SS 350
515059 ASSY, WHIP TRAY W/FUSE CLIPS, INVERTER, HELIX 16 515059 ASSY, WHIP TRAY W/FUSE CLIPS, INVERTER, HELIX 16
515928 FRONT SKIRT, HELIX ROOF 197 515928 FRONT SKIRT, HELIX ROOF 197
515929 REAR SKIRT, HELIX ROOF 1469
516043 AC SWITCH, CONNECTORIZED, HELIX ROOF 2 516043 AC SWITCH, CONNECTORIZED, HELIX ROOF 2
516045 AC SPLICE BOX, CONNECTORIZED, HELIX ROOF 1 516045 AC SPLICE BOX, CONNECTORIZED, HELIX ROOF 1
517871 TRAY, LEADING, HELIX ROOF, RIVETED VERSION 210 517871 TRAY, LEADING, HELIX ROOF, RIVETED VERSION 210
518058 CONNECTOR, ETHERNET, PLUG, RJ-45, WEATHERPROOF, SHIELDED 15 518058 CONNECTOR, ETHERNET, PLUG, RJ-45, WEATHERPROOF, SHIELDED 15
518331 MOUNTING BACK PLATE, INVERTER/PANEL BOARD, HELIX ROOF/TRACKER 22 518331 MOUNTING BACK PLATE, INVERTER/PANEL BOARD, HELIX ROOF/TRACKER 22
518477 WASHER, FLAT, 3/8, 1.00 OD, 18-8 SS 425 518477 WASHER, FLAT, 3/8, 1.00 OD, 18-8 SS 425
520301 REAR SKIRT, HELIX ROOF V1.1 1469
521031 WASHER, FLAT, M10 X 20MM OD, SS 10 521031 WASHER, FLAT, M10 X 20MM OD, SS 10
521794 DEFLECTOR, LH, HELIX ROOF V1.1 171 521794 DEFLECTOR, LH, HELIX ROOF V1.1 171
521795 DEFLECTOR, RH, HELIX ROOF V1.1 171 521795 DEFLECTOR, RH, HELIX ROOF V1.1 171
Can't render this file because it contains an unexpected character in line 10 and column 30.