pub fn render(self, components: &[Component]) -> Result<()> {
        let mut f = File::create(format!("{}.kicad_sym", self.name))?;
        let today = Local::now().date();
        writeln!(
            f,
            "(kicad_symbol_lib (version {}) (generator qeda)",
            today.format("%Y%m%d")
        )?;

        for component in components {
            let name = &component.name;
            let symbol = &component.symbol;
            ensure!(
                !symbol.parts.is_empty(),
                QedaError::InvalidSymbolNoParts(name.to_string())
            );
            info!("  • symbol: '{}'", name);
            writeln!(f, "  (symbol \"{}:{}\"", self.name, component.name)?;
            writeln!(f, "  )")?;
        }
        writeln!(f, ")")?;
        Ok(())
    }
/// Renders symbols to a KiCad symbol library.
Renders symbols to a KiCad symbol library.
Renders symbols to a KiCad symbol library .
pub fn render(self, components: &[Component]) -> Result<()> {
        let mut f = File::create(format!("{}.kicad_sym", self.name))?;
        let today = Local::now().date();
        writeln!(
            f,
            "(kicad_symbol_lib (version {}) (generator qeda)",
            today.format("%Y%m%d")
        )?;
        for component in components {
            let name = &component.name;
            let symbol = &component.symbol;
            ensure!(
                !symbol.parts.is_empty(),
                QedaError::InvalidSymbolNoParts(name.to_string())
            );
            info!("  • symbol: '{}'", name);
            writeln!(f, "  (symbol \"{}:{}\"", self.name, component.name)?;
            writeln!(f, "  )")?;
        }
        writeln!(f, ")")?;
        Ok(())
    }
pub fn render ( self , components : & [ Component ] ) -> Result < ( ) > { let mut f = File :: create ( format ! ( " " self name ) ) ? ; let today = Local :: now ( ) . date ( ) ; writeln ! ( f " " today format ( " " ) ) ? ; for component in components { let name = & component . name ; let symbol = & component . symbol ; ensure ! ( symbol parts is_empty ( ) QedaError InvalidSymbolNoParts ( name to_string ( ) ) ) ; info ! ( " me); writeln ! ( f " \" \" " self name component name ) ? ; writeln ! ( f " " ) ? ; } writeln ! ( f " " ) ? ; Ok ( ( ) ) }
Renders symbols to a KiCad symbol library.
Renders symbols to a KiCad symbol library .
self
components
&[Component]
self
components
&[Component]