use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ComponentData {
pub lcsc_id: String,
pub title: String,
pub data_str: Vec<String>,
pub bbox_x: f64, pub bbox_y: f64, pub package_detail: Vec<String>,
pub package_bbox_x: f64, pub package_bbox_y: f64, pub model_3d: Option<Model3dInfo>,
pub manufacturer: String,
pub datasheet: String,
pub jlc_id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Model3dInfo {
pub uuid: String,
pub title: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ApiResponse {
pub success: bool,
pub result: Option<ApiResult>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ApiResult {
#[serde(rename = "dataStr")]
pub data_str: Option<serde_json::Value>,
pub title: Option<String>,
#[serde(rename = "packageDetail")]
pub package_detail: Option<serde_json::Value>,
pub lcsc: Option<serde_json::Value>,
}
#[derive(Debug, Clone)]
pub struct EeSymbol {
pub name: String,
pub prefix: String,
pub pins: Vec<EePin>,
pub rectangles: Vec<EeRectangle>,
pub circles: Vec<EeCircle>,
pub ellipses: Vec<EeEllipse>,
pub arcs: Vec<EeArc>,
pub polylines: Vec<EePolyline>,
pub polygons: Vec<EePolygon>,
pub paths: Vec<EePath>,
pub texts: Vec<EeText>,
}
#[derive(Debug, Clone)]
pub struct EePin {
pub number: String,
pub name: String,
pub x: f64,
pub y: f64,
pub rotation: i32,
pub length: f64,
pub name_visible: bool,
pub number_visible: bool,
pub electric_type: String,
pub dot: bool,
pub clock: bool,
}
#[derive(Debug, Clone)]
pub struct EeRectangle {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
pub stroke_width: f64,
pub fill: bool,
pub layer_id: i32,
}
#[derive(Debug, Clone)]
pub struct EeCircle {
pub cx: f64,
pub cy: f64,
pub radius: f64,
pub stroke_width: f64,
pub fill: bool,
pub layer_id: i32,
}
#[derive(Debug, Clone)]
pub struct EeEllipse {
pub cx: f64,
pub cy: f64,
pub rx: f64,
pub ry: f64,
pub stroke_width: f64,
pub fill: bool,
}
#[derive(Debug, Clone)]
pub struct EeArc {
pub x: f64,
pub y: f64,
pub radius: f64,
pub start_angle: f64,
pub end_angle: f64,
pub stroke_width: f64,
}
#[derive(Debug, Clone)]
pub struct EeFootprintArc {
pub stroke_width: f64,
pub layer_id: i32,
pub path: String, }
#[derive(Debug, Clone)]
pub struct EePolyline {
pub points: Vec<(f64, f64)>,
pub stroke_width: f64,
}
#[derive(Debug, Clone)]
pub struct EePolygon {
pub points: Vec<(f64, f64)>,
pub stroke_width: f64,
pub fill: bool,
}
#[derive(Debug, Clone)]
pub struct EePath {
pub path_data: String, pub stroke_width: f64,
pub fill: bool,
}
#[derive(Debug, Clone)]
pub struct EeText {
pub text: String,
pub x: f64,
pub y: f64,
pub rotation: i32,
pub font_size: f64,
pub stroke_width: f64,
pub layer_id: i32,
}
#[derive(Debug, Clone)]
pub struct EeFootprint {
pub name: String,
pub pads: Vec<EePad>,
pub tracks: Vec<EeTrack>,
pub circles: Vec<EeCircle>,
pub arcs: Vec<EeFootprintArc>,
pub rectangles: Vec<EeRectangle>,
pub texts: Vec<EeText>,
pub holes: Vec<EeHole>,
pub vias: Vec<EeVia>,
pub svg_nodes: Vec<EeSvgNode>,
}
#[derive(Debug, Clone)]
pub struct EePad {
pub number: String,
pub shape: String,
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
pub rotation: f64,
pub hole_radius: Option<f64>,
pub hole_length: Option<f64>, pub points: String, pub layer_id: i32,
}
#[derive(Debug, Clone)]
pub struct EeTrack {
pub stroke_width: f64,
pub layer_id: i32,
pub net: String,
pub points: String, }
#[derive(Debug, Clone)]
pub struct EeHole {
pub x: f64,
pub y: f64,
pub radius: f64, }
#[derive(Debug, Clone)]
pub struct EeVia {
pub x: f64,
pub y: f64,
pub diameter: f64, pub net: String,
pub radius: f64, }
#[derive(Debug, Clone)]
pub struct EeSvgNode {
pub path: String,
pub stroke_width: f64,
pub layer: String,
}