mirror of
https://github.com/Cian-H/Melter.git
synced 2026-03-19 21:32:46 +00:00
Added features increasing user friendliness of the software
This commit is contained in:
81
Data/Calibration.py
Normal file
81
Data/Calibration.py
Normal file
@@ -0,0 +1,81 @@
|
||||
class CalCurve():
|
||||
|
||||
def __init__(self):
|
||||
self.name = "None"
|
||||
self.formula = "y=x"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class AlSi7Mg(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "AlSi7Mg"
|
||||
self.formula = "N/A"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class Al6061(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "Al6061"
|
||||
self.formula = "T=(V+84.66)/1.45"
|
||||
|
||||
def __call__(self, x):
|
||||
return (x + 84.661) / 1.4516
|
||||
|
||||
|
||||
class _15_5PH(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "15-5PH Stainless Steel"
|
||||
self.formula = "N/A"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class H13(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "H13 Tool Steel"
|
||||
self.formula = "N/A"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class Inconel625(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "Inconel 625"
|
||||
self.formula = "N/A"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class Inconel718(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "Inconel 718"
|
||||
self.formula = "N/A"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
|
||||
|
||||
class Custom(CalCurve):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "Custom"
|
||||
self.formula = "y=mx+c"
|
||||
|
||||
def __call__(self, x):
|
||||
return x
|
||||
64
Data/ThresholdFunctions.py
Normal file
64
Data/ThresholdFunctions.py
Normal file
@@ -0,0 +1,64 @@
|
||||
import operator as __op
|
||||
|
||||
|
||||
class __Base():
|
||||
|
||||
def __init__(self):
|
||||
self.name = "None"
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Greater(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = ">"
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.gt(*args)
|
||||
|
||||
|
||||
class GreaterOrEqual(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "≥"
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.ge(*args)
|
||||
|
||||
|
||||
class Equal(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "="
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.eq(*args)
|
||||
|
||||
|
||||
class NotEqual(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "≠"
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.ne(*args)
|
||||
|
||||
|
||||
class LessOrEqual(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "≤"
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.le(*args)
|
||||
|
||||
|
||||
class Less(__Base):
|
||||
|
||||
def __init__(self):
|
||||
self.name = "<"
|
||||
|
||||
def __call__(self, *args):
|
||||
return __op.lt(*args)
|
||||
Reference in New Issue
Block a user