Home Reference Source Test
public class | source

FZP

The FZP class is the main fzp data entry. Here you can access the main data properties/objects and some utility functions can be used to load svgs as string, count the total number of connections or set a connector.

Example:

const {FZP} = require('fzp-js')

let fzp = new FZP({moduleId: 'sample'})
fzp.version = '1.0.0'
fzp.setTag('demo')
fzp.setProperty('p', 'hello', true)
fzp.setView()
fzp.setConnector()
fzp.setBus()

Constructor Summary

Public Constructor
public

FZP constructor has an opt argument object that can be used to setup data at the initialization.

Member Summary

Public Members
public

The FZP author

public

The FZP buses is a map with instances of the Bus class.

public

The FZP connectors

public

The FZP date

public

The FZP description

public

The FZP family

public

The FZP fritzing version

public

The FZP label

public

The FZP language

public

The FZP module id

public

The FZP properties

public

The FZP tags

public

The FZP taxonomy

public

The FZP title

public

The FZP url

public

The FZP variant

public

The FZP version

public

The FZP views (icon, breadboard, schematic, pcb)

Method Summary

Public Methods
public

Get a FZP property by the given key.

public

loadSVGs(baseurl: String): FZP

Load all SVG sources.

public

setBus(name: String, bus: FZPBus): FZP

setBus

public

setConnector(name: String, connector: FZPConnector): FZP

setConnector

public

setProperty(key: String, value: String, showInLabel: Boolean): FZP

Create or update a FZPProperty instance to the FZP.

public

setTag(tag: String): FZP

Set a tag

public

setView(name: String, view: FZPView): FZP

Set a view

public

Get the total number of buses.

public

Get the total number of connector.

public

Get the total number of properties.

public

Get the total number of tags.

Public Constructors

public constructor(opt: Object) source

FZP constructor has an opt argument object that can be used to setup data at the initialization.

Params:

NameTypeAttributeDescription
opt Object

Public Members

public author: String source

The FZP author

public buses: Object source

The FZP buses is a map with instances of the Bus class.

public connectors: Object source

The FZP connectors

public date: String source

The FZP date

public description: String source

The FZP description

public family: String source

The FZP family

public fritzingVersion: String source

The FZP fritzing version

public label: String source

The FZP label

public language: String source

The FZP language

public moduleId: String source

The FZP module id

public properties: Object source

The FZP properties

public tags: Array source

The FZP tags

public taxonomy: String source

The FZP taxonomy

public title: String source

The FZP title

public url: String source

The FZP url

public variant: String source

The FZP variant

public version: String source

The FZP version

public views: Object source

The FZP views (icon, breadboard, schematic, pcb)

Public Methods

public getProperty(key: String): FZPProperty source

Get a FZP property by the given key.

Params:

NameTypeAttributeDescription
key String

Return:

FZPProperty

public loadSVGs(baseurl: String): FZP source

Load all SVG sources.

Params:

NameTypeAttributeDescription
baseurl String

Return:

FZP

public setBus(name: String, bus: FZPBus): FZP source

setBus

Params:

NameTypeAttributeDescription
name String
bus FZPBus

Return:

FZP

public setConnector(name: String, connector: FZPConnector): FZP source

setConnector

Params:

NameTypeAttributeDescription
name String
connector FZPConnector

Return:

FZP

public setProperty(key: String, value: String, showInLabel: Boolean): FZP source

Create or update a FZPProperty instance to the FZP.

Params:

NameTypeAttributeDescription
key String
value String
showInLabel Boolean

Return:

FZP

public setTag(tag: String): FZP source

Set a tag

Params:

NameTypeAttributeDescription
tag String

Return:

FZP

public setView(name: String, view: FZPView): FZP source

Set a view

Params:

NameTypeAttributeDescription
name String

The name of the view can be 'breadboard', 'pcb', or 'schematic'

view FZPView

Return:

FZP

public totalBuses(): Number source

Get the total number of buses.

Return:

Number

public totalConnector(): Number source

Get the total number of connector.

Return:

Number

public totalProperties(): Number source

Get the total number of properties.

Return:

Number

public totalTags(): Number source

Get the total number of tags.

Return:

Number