pub struct Cpk {
pub cpk: f64,
pub ca: f64,
pub cp: f64,
pub usl: f64,
pub lsl: f64,
pub stddev: f64,
pub avg: f64,
pub max: f64,
pub min: f64,
}Expand description
制程能力指标
Fields§
§cpk: f64制程能力
ca: f64制程准确度
cp: f64制程精密度
usl: f64规格上限
lsl: f64规格下限
stddev: f64标准差
avg: f64平均值
max: f64最大值
min: f64最小值
Implementations§
source§impl Cpk
impl Cpk
sourcepub fn new<T: Display + Debug>(usl: f64, lsl: f64, array: Vec<T>) -> Self
pub fn new<T: Display + Debug>(usl: f64, lsl: f64, array: Vec<T>) -> Self
初始化
- usl 上限值
- lsl 下限值
- array 数据
Examples found in repository?
examples/cpk.rs (line 56)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
fn main() {
let list = vec![
20.470,
20.480,
20.470,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.470,
20.450,
20.450,
20.450,
20.440,
];
let data = Cpk::new(20.570, 20.37, list);
println!("stddev: {}", data.stddev);
println!("avg: {}", data.avg);
println!("max: {}", data.max);
println!("min: {}", data.min);
println!("ca: {} {:?}", data.ca, data.ca_rating_criteria());
println!("cp: {} {:?}", data.cp, data.cp_rating_criteria());
println!("cpk: {} {:?}", data.cpk, data.cpk_rating_criteria());
}sourcepub fn cpk_rating_criteria(&self) -> (&'static str, &'static str)
pub fn cpk_rating_criteria(&self) -> (&'static str, &'static str)
Examples found in repository?
examples/cpk.rs (line 64)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
fn main() {
let list = vec![
20.470,
20.480,
20.470,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.470,
20.450,
20.450,
20.450,
20.440,
];
let data = Cpk::new(20.570, 20.37, list);
println!("stddev: {}", data.stddev);
println!("avg: {}", data.avg);
println!("max: {}", data.max);
println!("min: {}", data.min);
println!("ca: {} {:?}", data.ca, data.ca_rating_criteria());
println!("cp: {} {:?}", data.cp, data.cp_rating_criteria());
println!("cpk: {} {:?}", data.cpk, data.cpk_rating_criteria());
}sourcepub fn ca_rating_criteria(&self) -> (&'static str, &'static str)
pub fn ca_rating_criteria(&self) -> (&'static str, &'static str)
Examples found in repository?
examples/cpk.rs (line 62)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
fn main() {
let list = vec![
20.470,
20.480,
20.470,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.470,
20.450,
20.450,
20.450,
20.440,
];
let data = Cpk::new(20.570, 20.37, list);
println!("stddev: {}", data.stddev);
println!("avg: {}", data.avg);
println!("max: {}", data.max);
println!("min: {}", data.min);
println!("ca: {} {:?}", data.ca, data.ca_rating_criteria());
println!("cp: {} {:?}", data.cp, data.cp_rating_criteria());
println!("cpk: {} {:?}", data.cpk, data.cpk_rating_criteria());
}sourcepub fn cp_rating_criteria(&self) -> (&'static str, &'static str)
pub fn cp_rating_criteria(&self) -> (&'static str, &'static str)
Examples found in repository?
examples/cpk.rs (line 63)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
fn main() {
let list = vec![
20.470,
20.480,
20.470,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.450,
20.470,
20.450,
20.450,
20.440,
20.470,
20.470,
20.450,
20.450,
20.450,
20.440,
];
let data = Cpk::new(20.570, 20.37, list);
println!("stddev: {}", data.stddev);
println!("avg: {}", data.avg);
println!("max: {}", data.max);
println!("min: {}", data.min);
println!("ca: {} {:?}", data.ca, data.ca_rating_criteria());
println!("cp: {} {:?}", data.cp, data.cp_rating_criteria());
println!("cpk: {} {:?}", data.cpk, data.cpk_rating_criteria());
}Auto Trait Implementations§
impl RefUnwindSafe for Cpk
impl Send for Cpk
impl Sync for Cpk
impl Unpin for Cpk
impl UnwindSafe for Cpk
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more