def set_block_model(self, block_model, blocks): name = block_model['name'] mineral_deposit = block_model['mineral_deposit_name'] headers = block_model['headers'] data_map = block_model['data_map'] max_x, max_y, max_z = self.db_manager.get_max_x_y_z_value( mineral_deposit, name) self.block_model = BlockModel(name, mineral_deposit, headers, data_map, max_x, max_y, max_z) self.block_model.add_blocks(blocks)
def setUp(self): name = "v1" mineral_deposit = "Zuck small" headers = [ "id", "x", "y", "z", "cost", "value", "rock_tonnes", "ore_tonnes" ] data_map = { "x": "x", "y": "y", "z": "z", "weight": "rock_tonnes", "grade": { "Au": "ore_tonnes" } } blocks = [{ "_id": { "$oid": "5cb0f608b766f9aa245cb3f0" }, "mineral_deposit": "Zuck small", "block_model": "v1", "id": 9369, "x": 0, "y": 0, "z": 0, "cost": 56592, "value": 135786.28, "rock_tonnes": 62880, "ore_tonnes": 0.25572519083969464 }, { "_id": { "$oid": "5cb0f608b766f9aa245cb3f1" }, "mineral_deposit": "Zuck small", "block_model": "v1", "id": 9370, "x": 1, "y": 0, "z": 0, "cost": 56592, "value": 115580.184, "rock_tonnes": 1, "ore_tonnes": 0 }, { "_id": { "$oid": "5cb0f608b766f9aa245cb3f1" }, "mineral_deposit": "Zuck small", "block_model": "v1", "id": 9370, "x": 0, "y": 1, "z": 0, "cost": 56592, "value": 115580.184, "rock_tonnes": 0, "ore_tonnes": 0 }, { "_id": { "$oid": "5cb0f608b766f9aa245cb3f1" }, "mineral_deposit": "Zuck small", "block_model": "v1", "id": 9370, "x": 1, "y": 1, "z": 0, "cost": 56592, "value": 115580.184, "rock_tonnes": 0, "ore_tonnes": 0 }] self.block_model = BlockModel(name, mineral_deposit, headers, data_map, 1, 1, 0) self.block_model.add_blocks(blocks) self.rx = 2 self.ry = 2 self.rz = 1