# UniTAP.dev.ports.modules.pdc.pdc_power_source

class PowerSource:

Class `PowerSource` contains information about PDO's on Source side.

- Get PDO count `pdo_count`, type `int`.
- Set and get PDO list, `set_pdo_list`, `get_pdo_list`, type `list` with `Pdo`.
- Set and get PDO by index, `set_pdo_by_index`, `get_pdo_by_index`, type `Pdo`.
- Send Source PDO's, `send_pdo`.
- Save information about PDO's to file, `save_pdo`.
- Load information about PDO's from file, `load_pdo`.

PowerSource(pdc_io: UniTAP.dev.ports.modules.pdc.pdc_io.PDCPortIO)
pdo_count: int

Returns current pdo count.

###### Returns:

> object of `int` type

def send_pdo(self):

Send Source PDO's.

def get_pdo_list( self, read_from_device: bool = False) -> List[ UniTAP.dev.ports.modules.pdc.pdo.Pdo ]:

Returns current pdo list.

###### Arguments:

- read_from_device (`bool`)

###### Returns:

> object of `list` type with `Pdo`.

def get_pdo_by_index(self, index: int, read_from_device: bool = False):

Returns current pdo by index.

###### Arguments:

- index (`int`)
- read_from_device (`bool`)

###### Returns:

> object of `Pdo` type.

def set_pdo_list(self, pdo_list: List[ UniTAP.dev.ports.modules.pdc.pdo.Pdo ]):

Set new Pdo list.

###### Arguments:

- pdo_list (`list` with 'Pdo')

def set_pdo_by_index(self, pdo_object, index: int):

Set new Pdo by index.

###### Arguments:

- pdo_object ('Pdo')
- index (`int`)

def save_pdo(self, path: str):

Save information about PDO's to file. Supported formats:

- txt
- json

###### Arguments:

- path (`str`)

def load_pdo(self, path: str):

Load information about PDO's from file. Supported formats:

- txt
- json

###### Arguments:

- path (`str`)