/*
 * This file is part of <project name>.
 *
 * <project name> is free software: you can redistribute it and/or modify
 * it under the terms of the <license name> as published by
 * the <license organization>, either version <license version> of the License, or
 * (at your option) any later version.
 *
 * <project name> is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * <license name> for more details.
 *
 * You should have received a copy of the <license name>
 * along with <project name>.  If not, see <license URL>.
 */

#include <algorithm>
#include <array>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <chrono>
#include <cmath>
#include <condition_variable>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <memory>
#include <mutex>
#include <random>
#include <regex>
#include <sstream>
#include <string>
#include <thread>
#include <vector>

#include "Tonnage.h"
#include "Kfactor.h"

int main()
{

	/*
	 * Required Press Tonnage Calculation
    */

	double materialThickness, bendLength, dieOpeningWidth, materialFactor, methodFactor, multipleBendToolingFactor;

    // Get user inputs
    std::cout << "Enter material thickness (in inches): ";
    std::cin >> materialThickness;
    std::cout << "Enter bend length (in inches): ";
    std::cin >> bendLength;
    std::cout << "Enter die opening width (in inches): ";
    std::cin >> dieOpeningWidth;
    std::cout << "Enter material factor: ";
    std::cin >> materialFactor;
    std::cout << "Enter method factor: ";
    std::cin >> methodFactor;
    std::cout << "Enter multiple-bend tooling factor: ";
    std::cin >> multipleBendToolingFactor;

    // Calculate the press brake tonnage using the module function
    double tonnage = calculateTonnage(materialThickness, bendLength, dieOpeningWidth, materialFactor, methodFactor, multipleBendToolingFactor);

    // Output the calculated tonnage
    std::cout << "The required press brake tonnage is: " << tonnage << " tons" << std::endl;

    return 0;

	/*
	 * Kfactor calculation
    */

	// User inputs for K-factor calculation
    double neutralAxisLocation, materialThickness;

    // Get user inputs
    std::cout << "Enter neutral axis location: ";
    std::cin >> neutralAxisLocation;
    std::cout << "Enter material thickness: ";
    std::cin >> materialThickness;

    // Calculate the K-factor using the module function
    double kFactor = calculateKFactor(neutralAxisLocation, materialThickness);

    // Output the calculated K-factor
    std::cout << "The calculated K-factor is: " << kFactor << std::endl;

    return 0;
}