코딩 연습할 겸, 그리고 예전부터 만들오보고 싶은 프로그램이 있어서 만들어 보았습니다.
처음엔 무작정 VS Code를 열었는데, 코드 라인 보다도 더 중요한게 전체적인 컨셉과 구조를 잡는 것이더라고요.
코드는 깃허브에 공유했고 여기는 개발 노트들만 모아서 올릴 예정입니다. 개인적으로 의미 있는 기록이고, 또 공개함으로써 다른 분들에게도 참고가 되면 더 좋겠습니다.
프로그램 이름은 '배관용 계산기'입니다.
컨셉은 다음과 같습니다.
Calculator for Piping and Pipefitter
It performs 4 arithmetic operations like a general calculator, but if you enter piping material specifications instead of numbers (ex: 2*10-inch elbows + 10*6 reducer), it finds the length of the material in the database and converts it into numbers to perform calculations. (Material specifications are stored in .csv file format based on ASTM standards)
For example, in case of jointing two 10-inch pipe 5000 and bw type 10-inch elbow, to find the total length when combining two of them, the general calculator calculates as follows.
5000 + 38.1102 = 5762
Since the formula for calculating the value of a 90 degree elbow is simple, this cal파이썬
culation is not a problem. However, there is no case of memorizing the length of fittings such as special angles (elbow values of angles other than 90 and 45 degrees), tees, and reducers. Therefore, at the site, I look at the fitting and measure it myself and then add it, or I search the catalog to check the value and then add it. However, for this program, enter the command as follows.
5000 + elbow(10)*2 = 5762
In addition, not only elbows, but all fittings, valves, flanges, tees, etc. are possible if the user accurately writes the command.
배관용 계산기
일반적인 계산기와 마찬가지로 사칙연산을 수행하지만, 숫자 대신 배관 자재 스펙을 입력하면(ex 10인치 엘보 2개 + 10*6 레듀샤) 내장된 데이터베이스에서 해당 자재의 기장(길이)을 찾아 숫자로 바꿔 연산을 수행한다. (자재 스펙은 ASTM 기준으로 .csv 파일 형태로 저장되어 있음)
예를 들어, 10인치 파이프 5000, bw 타입 10인치 엘보 두개를 조인트 할 경우중 2개를 결합할 경우 총 기장을 구하려면 일반 계산기에서는 아래와 같이 계산한다.
5000 + 38.1102 = 5762
사실 90도 엘보값을 구하는 공식은 배관사들에게 널리 알려진 간단한 공식이기 때문에 이런 계산은 문제가 없다. 하지만 특수각(90, 45도 외의 각도의 엘보값)이나 티, 레듀샤 등의 피팅류의 기장값을 외우고 다니는 경우는 없다. 그렇기 때문에 현장에서는 피팅을 보고 직접 치수를 잰 뒤 더하거나, 카탈로그를 뒤져서 값을 확인 한 뒤 더한다. 그러나 이 프로그램의 경우 아래와 같이 커맨드를 입력할 경우 엘보값을 숫자로 바꿔서 자동으로 알려준다.
5000 + elbow(10)*2 = 5762
엘보뿐만 아니라 모든 피팅, 밸브, 플랜지, 티 등 에 대해서도 정해진 규칙대로 커맨드를 입력할 경우 마찬가지로 작동한다.
'나만의 프로젝트 : 배관 계산기' 카테고리의 다른 글
| 첫번째 개인 프로젝트 히스토리_5 배관 계산기 만들 (0) | 2023.08.10 |
|---|---|
| 첫번째 개인 프로젝트 히스토리 _4 배관 계산기 만들기 (0) | 2023.08.05 |
| 첫번째 개인 프로젝트 히스토리_3 배관 계산기 (0) | 2023.08.04 |
| 첫번째 개인 프로젝트 히스토리_2 : 배관 계산기 (0) | 2023.08.03 |