SpecctraDocs: added ommited Module descriptions

This commit is contained in:
hakki 2024-09-28 10:04:27 +02:00 committed by mikolaj
parent 41f01c780f
commit 8a12ce350c
3 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,6 @@
//! Module for managing the various Specctra PCB design, including loading the
//! Design DSN file, creating the [`Board`] object from the file, as well as
//! exporting the session file
use std::collections::HashMap; use std::collections::HashMap;
use geo::{point, Point, Rotate}; use geo::{point, Point, Rotate};
@ -52,7 +55,6 @@ impl SpecctraDesign {
/// This function reads the Specctra Design data from an input stream. /// This function reads the Specctra Design data from an input stream.
/// Later the data is parsed and loaded into a [`SpecctraDesign`] structure, /// Later the data is parsed and loaded into a [`SpecctraDesign`] structure,
/// allowing further operations such as rule validation, routing, or netlist management. /// allowing further operations such as rule validation, routing, or netlist management.
///
pub fn load(reader: impl std::io::BufRead) -> Result<SpecctraDesign, LoadingError> { pub fn load(reader: impl std::io::BufRead) -> Result<SpecctraDesign, LoadingError> {
let mut list_reader = ListTokenizer::new(reader); let mut list_reader = ListTokenizer::new(reader);
let dsn = list_reader.read_value::<DsnFile>()?; let dsn = list_reader.read_value::<DsnFile>()?;
@ -72,7 +74,6 @@ impl SpecctraDesign {
/// This function generates a Specctra SES session file that represents the board's net routing and /// This function generates a Specctra SES session file that represents the board's net routing and
/// writes it to the provided output stream. The session data includes routed nets, wires, /// writes it to the provided output stream. The session data includes routed nets, wires,
/// layers, and other essential information for routing management. /// layers, and other essential information for routing management.
///
pub fn write_ses( pub fn write_ses(
&self, &self,
board: &Board<SpecctraMesadata>, board: &Board<SpecctraMesadata>,
@ -184,7 +185,6 @@ impl SpecctraDesign {
/// which is used for layout and routing operations. The board is initialized with [`SpecctraMesadata`], /// which is used for layout and routing operations. The board is initialized with [`SpecctraMesadata`],
/// which includes layer and net mappings, and is populated with components, pins, vias, and wires /// which includes layer and net mappings, and is populated with components, pins, vias, and wires
/// from the PCB definition. /// from the PCB definition.
///
pub fn make_board(&self) -> Board<SpecctraMesadata> { pub fn make_board(&self) -> Board<SpecctraMesadata> {
let mesadata = SpecctraMesadata::from_pcb(&self.pcb); let mesadata = SpecctraMesadata::from_pcb(&self.pcb);
let mut board = Board::new(Layout::new(Drawing::new( let mut board = Board::new(Layout::new(Drawing::new(

View File

@ -1,3 +1,6 @@
//! Module for handling Specctra's mesadata - design rules, as well as layers
//! or net properties
use std::collections::HashMap; use std::collections::HashMap;
use bimap::BiHashMap; use bimap::BiHashMap;
@ -10,7 +13,7 @@ use crate::{
#[derive(Debug)] #[derive(Debug)]
/// [`SpecctraRule`] represents the basic routing constraints used by an auto-router, such as /// [`SpecctraRule`] represents the basic routing constraints used by an auto-router, such as
/// the Specctra auto-router, in a PCB design process. This struct defines two key design /// the Topola auto-router, in a PCB design process. This struct defines two key design
/// rules: the width of the trace and the minimum clearance between electrical features. /// rules: the width of the trace and the minimum clearance between electrical features.
pub struct SpecctraRule { pub struct SpecctraRule {
/// Specifies the width of the trace (or conductor) in millimeters. /// Specifies the width of the trace (or conductor) in millimeters.
@ -70,7 +73,6 @@ impl SpecctraMesadata {
/// ///
/// This function extracts the necessary metadata from the `Pcb` struct, such as /// This function extracts the necessary metadata from the `Pcb` struct, such as
/// layer-to-layer name mappings, net-to-net name mappings, and net class rules. /// layer-to-layer name mappings, net-to-net name mappings, and net class rules.
///
pub fn from_pcb(pcb: &Pcb) -> Self { pub fn from_pcb(pcb: &Pcb) -> Self {
let mut layer_layername = BiHashMap::from_iter( let mut layer_layername = BiHashMap::from_iter(
pcb.structure.layers pcb.structure.layers

View File

@ -1,3 +1,6 @@
//! Module containing the informations about handling the Specctra
//! based file format, and parsing it into Topola's objects
mod common; mod common;
pub mod design; pub mod design;
pub mod mesadata; pub mod mesadata;