Moar stuff added
This commit is contained in:
parent
e559c2d730
commit
fee6a594df
BIN
.vscode/browse.vc.db
vendored
BIN
.vscode/browse.vc.db
vendored
Binary file not shown.
BIN
.vscode/browse.vc.db-shm
vendored
BIN
.vscode/browse.vc.db-shm
vendored
Binary file not shown.
BIN
.vscode/browse.vc.db-wal
vendored
BIN
.vscode/browse.vc.db-wal
vendored
Binary file not shown.
@ -3,20 +3,34 @@ project(BendCalc)
|
|||||||
|
|
||||||
# Set C++ standard
|
# Set C++ standard
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER /usr/bin/g++)
|
||||||
|
set(CMAKE_CXX_FLAGS -g -Wall -Wextra -Werror -pedantic)
|
||||||
# Include directories
|
# Include directories
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
target_include_directories(include)
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
# Add other source files here
|
src/Tonnage.cpp
|
||||||
|
src/Setback.cpp
|
||||||
|
src/Serializer.cpp
|
||||||
|
src/Kfactor.cpp
|
||||||
|
src/Deserializer.cpp
|
||||||
|
src/DataSave.cpp
|
||||||
|
src/DataLoad.cpp
|
||||||
|
include/Tonnage.h
|
||||||
|
include/Setback.h
|
||||||
|
include/Serializer.h
|
||||||
|
include/Kfactor.h
|
||||||
|
include/Deserializer.h
|
||||||
|
include/DataSave.h
|
||||||
|
include/DataLoad.h
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create executable
|
# Create executable
|
||||||
add_executable(bend_calc ${SOURCES})
|
add_executable(bend_calc ${SOURCES})
|
||||||
|
|
||||||
# Add subdirectories for modules
|
|
||||||
add_subdirectory(tests)
|
|
||||||
add_subdirectory(docs)
|
|
@ -1,3 +1,4 @@
|
|||||||
# BendCalc
|
# BendCalc
|
||||||
|
|
||||||
A C++ Bend calculator for sheet metal bending and forming calculations used in the sheet metal and forming and fabrication trades
|
A C++ Bend calculator for sheet metal bending and forming calculations used in the sheet metal and forming and fabrication trades
|
||||||
|
|
||||||
|
0
include/BendAllowance.h
Normal file
0
include/BendAllowance.h
Normal file
0
include/FormingTool.h
Normal file
0
include/FormingTool.h
Normal file
0
src/BendAllowance.cpp
Normal file
0
src/BendAllowance.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
void loadDataFromCSV(const std::string& fileName) {
|
||||||
|
std::ifstream file(fileName);
|
||||||
|
if (file.is_open()) {
|
||||||
|
std::string line;
|
||||||
|
while (std::getline(file, line)) {
|
||||||
|
// Process the line, e.g., parse and store the data
|
||||||
|
std::cout << line << std::endl; // Example: Output the line
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
} else {
|
||||||
|
std::cerr << "Failed to open the file: " << fileName << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// Load historical bend data from a CSV file
|
||||||
|
loadDataFromCSV("historical_bend_data.csv");
|
||||||
|
|
||||||
|
// Load machine data from a CSV file
|
||||||
|
loadDataFromCSV("machine_data.csv");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1 +1,23 @@
|
|||||||
D
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
void saveDataToCSV(const std::string& fileName, const std::string& data) {
|
||||||
|
std::ofstream file(fileName, std::ios::app);
|
||||||
|
if (file.is_open()) {
|
||||||
|
file << data << "\n";
|
||||||
|
file.close();
|
||||||
|
} else {
|
||||||
|
std::cerr << "Failed to open the file: " << fileName << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// Save historical bend data to a CSV file
|
||||||
|
saveDataToCSV("historical_bend_data.csv", "Your historical bend data here");
|
||||||
|
|
||||||
|
// Save machine data to a CSV file
|
||||||
|
saveDataToCSV("machine_data.csv", "Your machine data here");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
15
src/FormingTool.cpp
Normal file
15
src/FormingTool.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "FormingTool.h"
|
||||||
|
|
||||||
|
FormingTool::FormingTool(const std::string& name, double toolRadius, const std::string& materialType)
|
||||||
|
: m_name(name), m_toolRadius(toolRadius), m_materialType(materialType) {
|
||||||
|
// Constructor implementation
|
||||||
|
}
|
||||||
|
|
||||||
|
double FormingTool::getToolRadius() const {
|
||||||
|
return m_toolRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FormingTool::setToolRadius(double radius) {
|
||||||
|
m_toolRadius = radius;
|
||||||
|
}
|
||||||
|
// Implement other methods related to forming tools
|
@ -1,7 +1,11 @@
|
|||||||
#include "Kfactor.h"
|
#include "Kfactor.h"
|
||||||
|
#include <cmath> // Required for the pi constant
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
const double PI = 3.14159265358979323846;
|
||||||
|
|
||||||
// Function definition for calculating the K-factor
|
// Function definition for calculating the K-factor
|
||||||
double calculateKFactor(double neutralAxisLocation, double materialThickness) {
|
double calculateKFactor(double bendAllowance, double bendingAngle, double materialThickness, double innerRadius) {
|
||||||
double kFactor = neutralAxisLocation / materialThickness;
|
double kFactor = (180.0 * bendAllowance) / (PI * bendingAngle * materialThickness) - (innerRadius / materialThickness);
|
||||||
return kFactor;
|
return kFactor;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user