Add configurable production machine constraints
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from machine_constraints import check_production_feasibility, get_machine
|
||||
from roll_calculation import (
|
||||
ArticleRepository,
|
||||
calculate_material_weight,
|
||||
@@ -28,6 +29,33 @@ def search_articles_result(query: str) -> dict[str, Any]:
|
||||
return ArticleRepository.load().search(query)
|
||||
|
||||
|
||||
def get_machine_result(machine: str | None = None) -> dict[str, Any]:
|
||||
"""Delegate configured-machine resolution to the shared repository."""
|
||||
return get_machine(machine)
|
||||
|
||||
|
||||
def check_production_feasibility_result(
|
||||
*,
|
||||
machine: str,
|
||||
roll_weight_kg: float | None = None,
|
||||
average_diameter_mm: float | None = None,
|
||||
maximum_diameter_mm: float | None = None,
|
||||
core_diameter_mm: float | None = None,
|
||||
product_width_m: float | None = None,
|
||||
line_speed_m_per_min: float | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Delegate configured production feasibility to the shared domain."""
|
||||
return check_production_feasibility({
|
||||
"machine": machine,
|
||||
"roll_weight_kg": roll_weight_kg,
|
||||
"average_diameter_mm": average_diameter_mm,
|
||||
"maximum_diameter_mm": maximum_diameter_mm,
|
||||
"core_diameter_mm": core_diameter_mm,
|
||||
"product_width_m": product_width_m,
|
||||
"line_speed_m_per_min": line_speed_m_per_min,
|
||||
})
|
||||
|
||||
|
||||
def calculate_material_weight_result(
|
||||
*,
|
||||
roll_length_m: float,
|
||||
|
||||
Reference in New Issue
Block a user