From 4f654973e5139f14d6fa63357a274ad0e3cbb202 Mon Sep 17 00:00:00 2001 From: sam-anthony Date: Sat, 9 Apr 2022 12:05:19 -0230 Subject: selecteable compressor and add BW K03 --- compressor/compressor.go | 41 ++++++++++++++++++++++++++++++++++-- compressor/res/GarrettG25660.jpg | Bin 833764 -> 0 bytes compressor/res/borgwarner/k/03.jpg | Bin 0 -> 185706 bytes compressor/res/garrett/g/25-660.jpg | Bin 0 -> 833764 bytes 4 files changed, 39 insertions(+), 2 deletions(-) delete mode 100644 compressor/res/GarrettG25660.jpg create mode 100644 compressor/res/borgwarner/k/03.jpg create mode 100644 compressor/res/garrett/g/25-660.jpg (limited to 'compressor') diff --git a/compressor/compressor.go b/compressor/compressor.go index a3ac4bf..940d6fa 100644 --- a/compressor/compressor.go +++ b/compressor/compressor.go @@ -8,6 +8,7 @@ import ( ) type Compressor struct { + Name string FileName string // MinX is the distance of the y-axis from left of image in pixels. MinX int @@ -26,7 +27,23 @@ type Compressor struct { MaxPressureRatio float32 } -func GarrettG25660() Compressor { +var compressors = make(map[string]map[string]map[string]Compressor) + +func init() { + compressors["Garrett"] = make(map[string]map[string]Compressor) + compressors["Garrett"]["G"] = make(map[string]Compressor) + compressors["Garrett"]["G"]["25-660"] = garrettG25660() + + compressors["BorgWarner"] = make(map[string]map[string]Compressor) + compressors["BorgWarner"]["K"] = make(map[string]Compressor) + compressors["BorgWarner"]["K"]["03"] = borgwarnerK03() +} + +func Compressors() map[string]map[string]map[string]Compressor { + return compressors +} + +func garrettG25660() Compressor { maxFlow, err := mass.NewFlowRate( mass.Mass{70, mass.Pound}, time.Minute, @@ -34,7 +51,8 @@ func GarrettG25660() Compressor { ) util.Check(err) return Compressor{ - "compressor/res/GarrettG25660.jpg", + "Garrett G25-660", + "compressor/res/garrett/g/25-660.jpg", 204, 1885, 1665, @@ -43,3 +61,22 @@ func GarrettG25660() Compressor { 4.0, } } + +func borgwarnerK03() Compressor { + maxFlow, err := mass.NewFlowRate( + mass.Mass{0.13, mass.Kilogram}, + time.Second, + mass.KilogramsPerSecond, + ) + util.Check(err) + return Compressor{ + "BorgWarner K03", + "compressor/res/borgwarner/k/03.jpg", + 30, + 714, + 876, + 4, + maxFlow, + 2.8, + } +} diff --git a/compressor/res/GarrettG25660.jpg b/compressor/res/GarrettG25660.jpg deleted file mode 100644 index aa8d12a..0000000 Binary files a/compressor/res/GarrettG25660.jpg and /dev/null differ diff --git a/compressor/res/borgwarner/k/03.jpg b/compressor/res/borgwarner/k/03.jpg new file mode 100644 index 0000000..3464331 Binary files /dev/null and b/compressor/res/borgwarner/k/03.jpg differ diff --git a/compressor/res/garrett/g/25-660.jpg b/compressor/res/garrett/g/25-660.jpg new file mode 100644 index 0000000..aa8d12a Binary files /dev/null and b/compressor/res/garrett/g/25-660.jpg differ -- cgit v1.2.3