Skip to content

Commit

Permalink
rename lib.rs function to component in toml file
Browse files Browse the repository at this point in the history
  • Loading branch information
saturn77 committed Dec 4, 2020
1 parent f9c4abc commit 92730fa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
1 change: 0 additions & 1 deletion .rustc_info.json

This file was deleted.

4 changes: 2 additions & 2 deletions cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "atlantix-eda" # the name of the package
name = "atlantix_eda" # the name of the package
version = "0.1.1" # the current version, obeying semver
authors = ["James <[email protected]>"]
description = "Programmatically generated libraries for PCB Design."
Expand All @@ -11,5 +11,5 @@ fs_extra = "1.2.0"


[lib]
name = "generate"
name = "component"

41 changes: 21 additions & 20 deletions examples/gen_vishay_resistor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@
//! PADS was tested with an older version of this software so it should easily be adopted.
//! Tools such as the [KiCad]( https://gitlab.com/kicad/libraries/kicad-library-utils) generator functionality could
//! be replaced by Atlantix-EDA generate module, with the help of templating to take care of
//! boilerplate code in the resistor library. A template engine such as [Askama](https://djc.github.io/askama/) would be a good
//! boilerplate code in the component::Resistor library. A template engine such as [Askama](https://djc.github.io/askama/) would be a good
//! approach.
//!
//! Overall, resistor libraries for Altium are included as part of this repo that include
//! Overall, component::Resistor libraries for Altium are included as part of this repo that include
//! every E-96 value from 0201 to 2512, which is over 5,000 parts.
//!
//! # Background
//!
//! For a complete resistor library from 0201 to 2512 in the E-96 1% series there are 5,184 resistor values. The ability to generate these libraries on the fly
//! For a complete component::Resistor library from 0201 to 2512 in the E-96 1% series there are 5,184 component::Resistor values. The ability to generate these libraries on the fly
//! and change any data associated with each part is quite powerful.
//!
//! The use of Atlantix-EDA to generate the resistor library enables engineers developing in tools such as Altium, KiCad, etc. to have a comprehensive library
//! The use of Atlantix-EDA to generate the component::Resistor library enables engineers developing in tools such as Altium, KiCad, etc. to have a comprehensive library
//! available to them. This library enables quicker design cycles by
//! eliminating part creation and more robust design as BOM generation from the schematic will be accurate and true.
//!
//! ![image](../table.jpg)
//!
//! A history and more complete background of the [resistor series.](https://en.wikipedia.org/wiki/E_series_of_preferred_numbers "Wikipedia resistor series background")
//! A history and more complete background of the [component::Resistor series.](https://en.wikipedia.org/wiki/E_series_of_preferred_numbers "Wikipedia component::Resistor series background")
//!
//!
//! ## Basic usage example
Expand All @@ -62,14 +62,14 @@
//!
//! ```
//! let decades = [1,10,100,1000,10000,100000];
//! let mut r0603 = generate::Resistor::new(96, "0603".to_string());
//! let mut r0603 = generate::component::Resistor::new(96, "0603".to_string());
//!
//! for decade in decades.iter() {
//! r0603.generate(*decade);
//! }
//! ```
//! ## Detailed usage example
//! The code below shows how to actually instantiate the resistor object and generate
//! The code below shows how to actually instantiate the component::Resistor object and generate
//! values across several decade values while writing to a file, which is then imported
//! by Altium or another tool.
//!
Expand All @@ -78,7 +78,7 @@
//! let decades = [1,10,100,1000,10000,100000];
//! let mut name_0402 : String = " ".to_string();
//!
//! let mut r0402 = generate::Resistor::new(96, "0402".to_string());
//! let mut r0402 = generate::component::Resistor::new(96, "0402".to_string());
//!
//! for decade in decades.iter() {
//! name_0402 = r0402.generate(*decade);
Expand All @@ -92,7 +92,7 @@
//!
//! file.write_all(name_0402.as_bytes()).expect("write failed");
//!
//! println!("** Success::0402 resistor generation.");
//! println!("** Success::0402 component::Resistor generation.");
//! }
//! ```
//!
Expand All @@ -105,8 +105,9 @@
use std::fs::OpenOptions;
use std::io::prelude::*;


//============================================================
// Main::Creating Programmatically Generated Resistor Library
// Main::Creating Programmatically Generated component::Resistor Library
//============================================================

/// The main module which instantiates the generate module as an object. The generator can yield values over decade ranges.
Expand All @@ -121,7 +122,7 @@ fn main() -> std::io::Result<()> {

//--------------------------------------------------------------

let mut r0402 = generate::Resistor::new(96, "0402".to_string());
let mut r0402 = component::Resistor::new(96, "0402".to_string());
for decade in decades.iter() {
name_0402 = r0402.generate(*decade);
//println!("{ }",name_0402)
Expand All @@ -137,47 +138,47 @@ fn main() -> std::io::Result<()> {
file.write_all("Part,Description,Value,Case,Power,Supplier 1,Supplier Part Number 1,Library Path,Library Ref,Footprint Path,Footprint Ref,Company,Comment \r\n".as_bytes()).expect("write failed");

file.write_all(name_0402.as_bytes()).expect("write failed");
println!("** Success::0402 resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");
println!("** Success::0402 component::Resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");

//--------------------------------------------------------------

let mut r0603 = generate::Resistor::new(96, "0603".to_string());
let mut r0603 = component::Resistor::new(96, "0603".to_string());
for decade in decades.iter() {
name_0603 = r0603.generate(*decade);
//println!("{ }",name_0603)
}
file.write_all(name_0603.as_bytes()).expect("write failed");
println!("** Success::0603 resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");
println!("** Success::0603 component::Resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");

//--------------------------------------------------------------

let mut r0805 = generate::Resistor::new(96, "0805".to_string());
let mut r0805 = component::Resistor::new(96, "0805".to_string());
for decade in decades.iter() {
name_0805 = r0805.generate(*decade);
//println!("{}",name_0805);
}
file.write_all(name_0805.as_bytes()).expect("write failed");
println!("** Success::0805 resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");
println!("** Success::0805 component::Resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");

//--------------------------------------------------------------

let mut r1206 = generate::Resistor::new(96, "1206".to_string());
let mut r1206 = component::Resistor::new(96, "1206".to_string());
for decade in decades.iter() {
name_1206 = r1206.generate(*decade);
//println!("{}",name_0805);
}
file.write_all(name_1206.as_bytes()).expect("write failed");
println!("** Success::1206 resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");
println!("** Success::1206 component::Resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");

//--------------------------------------------------------------

let mut r1210 = generate::Resistor::new(96, "1210".to_string());
let mut r1210 = component::Resistor::new(96, "1210".to_string());
for decade in decades.iter() {
name_1210 = r1210.generate(*decade);
//println!("{}",name_0805);
}
file.write_all(name_1210.as_bytes()).expect("write failed");
println!("** Success::1210 resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");
println!("** Success::1210 component::Resistor E-96 series generation (1 Ohm to 1 MOhm).\r\n");

//--------------------------------------------------------------
Ok(())
Expand Down
1 change: 0 additions & 1 deletion outputs/.~lock.data.xlsx#

This file was deleted.

0 comments on commit 92730fa

Please sign in to comment.