Main Package

MoilApp

class Ui_MoilApp.Ui_MainWindow[source]

Bases: object

This class sets up the main window UI for the Moil Software application. It initializes the main window and its widgets, including labels, buttons, and layout configurations.

setupUi(MainWindow)[source]

Sets up the UI components for the main window.

Parameters:

MainWindow (QMainWindow) – The main window to set up the UI components in.

retranslateUi(MainWindow)[source]

plugin module

This module defines a base class for creating plugins. Each plugin must inherit from the Plugin class and implement the necessary methods defined in it.

Plugins are expected to perform specific operations as part of a larger application framework. By inheriting from the Plugin base class, plugins are guaranteed to have a consistent interface that the main application can interact with.

class base_plugin.Plugin[source]

Bases: object

Base class for all plugins.

Each plugin must inherit from this class and implement the required methods. This ensures that all plugins have a consistent interface, making it easier to integrate them into the main application.

description

A brief description of the plugin. Defaults to “UNKNOWN”.

Type:

str

This is the base class that each plugin must inheritance from. Within this class you have to define the methods that all of your plugins must implement.

perform_operation(argument)[source]

The method that we expect all plugins to implement. this is the framework our method will call.

Parameters:

() (argument) – The object widget from main application.

Returns:

None

Lib

class exif_lib.MetaImage(filename, encoding='utf-8')[source]

Bases: object

Open an image based on the file path. Read and write the metadata of the image. This Library just provide can modify the comment, read the comment and clear the comment in metadata.

Open an image and load its metadata.

Parameters:
  • () (encoding) – The name of image data.

  • () – Convert string to data that can stored on metadata image

close()[source]

Free the memory or close from accessing image data.

Returns:

None

read_comment(encoding='utf-8') str[source]

This function is for read the comment from metadata Image and return with decode the data to be string.

Parameters:

() (encoding) – Convert string to data that can stored on metadata image

Returns:

The comment data from Metadata Image.

modify_comment(data: str, encoding='utf-8')[source]

Modify the comment in metadata Image.

Parameters:
  • () (encoding) – the comment string.

  • () – Convert string to data that can stored on metadata image

Returns:

None

clear_comment()[source]

Clear all the comment in metadata Image.

Returns:

None.

Main

This module defines the main application controller for MoilApp, a software to process fisheye images resulting in panorama and Anypoint views. It includes functions for directory operations, displaying help information, and a main application controller class that manages the UI and plugin interactions.

MoilApp provides a panoramic view that offers a horizontal view in a specific immersed environment to meet common human visual perception. The Anypoint view presents an undistorted image in a certain area according to the input coordinates.

main.dir_copy(srcpath, dstdir)[source]

Copy directory.

Parameters:
  • () (dstdir) – source path or original path folder

  • () – destination directory.

Returns:

file copied in destination directory.

main.open_help()[source]

Provide the information about MoilApp.

Returns:

Showing Window.

class main.ControllerMainApps(parent=None)[source]

Bases: QMainWindow

The initial class controller Main application to control UI MainWindow.

Parameters:

() (parent) – None

connect_button()[source]

Connect button in widget to execute function.

Returns:

None

open_application()[source]

Open application depend on selected application available on comboBox.

Returns:

Will hide the main apps window and show the selection application.

delete_apps()[source]

Delete selected application from the list.

Returns:

None.

add_application()[source]

Add application plugin collection.

Returns:

None.

exit()[source]

Exit main window function, Its will connect to close function which is will ask question before close.

Returns:

None.

main.main()[source]

Create instance Main window to create the main window of Application.

Returns:

None.

Collection

This module defines the PluginCollection class, which is responsible for discovering and loading plugin modules that inherit from a base Plugin class. The PluginCollection class recursively walks through a specified package to find and instantiate plugin classes.

Plugins are expected to perform specific operations within a larger application framework, ensuring a consistent interface for interaction.

class plugin_collection.PluginCollection(plugin_package)[source]

Bases: object

Manages the collection of plugins by discovering and loading them from a specified package.

plugins

A list of instantiated plugin objects.

Type:

list

name_application

A list of plugin class names.

Type:

list

seen_paths

A list of paths that have already been scanned for plugins.

Type:

list

path_folder

A list of module paths where plugins were found.

Type:

list

plugin_package

The name of the package to search for plugins.

Type:

str

Upon creation, this class will read the plugins package for modules that contains a class definition that is inheriting from the Plugin class.

Parameters:

() (plugin_package) – The folder name of plugins directory. i.e here is “plugins”

reload_plugins()[source]

Reset the list of all plugins and initiate the walk over the main provided plugin package to load all available plugins.

Returns:

None

application(argument, index)[source]

Apply all of the plugin on the argument supplied to this function.

Parameters:
  • () (index) – this is the widget send from main apps(QMainWindow)

  • () – The index number from the list plugins available

Returns:

None

walk_package(package)[source]

Recursively walk the supplied package to retrieve all plugins.

Parameters:

() (package) – The name folder e define. i.e “plugins”

Returns:

Create list plugins that find from plugin directory.

API Module

This module defines the ThreadAxisAPI class, which provides an interface for controlling an axis through a serial port. The class includes methods for initializing the axis position, moving the axis, setting speed, and reading the current position. It also handles serial port connections and disconnections and logs all operations.

The logging information is stored in the ‘../log/Axis_control.log’ file.

class serial_axis_api.ThreadAxisAPI[source]

Bases: object

Provides an interface for controlling an axis via a serial port connection.

serial_port

The serial port to which the axis controller is connected.

Type:

str

ser

The serial connection object for communication with the axis controller.

Type:

serial.Serial

logger

Logger object for logging axis control operations.

Type:

logging.Logger

axis_init()[source]

Move the axis in init position.

Returns:

None

reset()[source]

Define the position and seed in default value.

Returns:

None

absolute_moving(distance)[source]

Moving the axis with Absolute motion is the change of position from one absolute place to another.

Parameters:

() (distance) – distance value

Returns:

None

related_moving(distance)[source]

Move the axis from one relative place to another.

Parameters:

() (distance) – distance value

Returns:

None

default_speed()[source]

Set the speed value to default.

Returns:

None

set_speed(speed)[source]

Set the speed value to speed value given by user.

Parameters:

() (speed) – speed value

Returns:

None

show_position()[source]

Show the current position of axis.

Returns:

None

connect_serial(serial_port)[source]

Connect the serial port axis controller to the system.

Parameters:

() (serial_port) – the serial port of axis controller

Returns:

None

disconnect_serial()[source]

Disconnect the serial port axis controller.

Returns:

None

read_position()[source]

Read the axis current position.

Returns:

None

Lib

This module contains unit tests for the MetaImage class in the exif_lib module. The tests verify the functionality of modifying, reading, and clearing comments in image metadata using the MetaImage class.

class test_exif_lib.TestExivlib(methodName='runTest')[source]

Bases: TestCase

Unit tests for the MetaImage class to ensure correct functionality of modifying, reading, and clearing image comments.

comment

The comment to be used in tests for modifying and reading image comments.

Type:

str

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

comment = 'Raspi'
test_modify_comment()[source]

Test the modify_comment method of MetaImage.

This test initializes a MetaImage object with a sample image, modifies the comment in the image metadata, and asserts that the comment was modified correctly.

test_read_comment()[source]

Test the read_comment method of MetaImage.

This test initializes a MetaImage object with a sample image and asserts that the comment read from the image metadata matches the expected comment.

test_clear_comment()[source]

Test the clear_comment method of MetaImage.

This test initializes a MetaImage object with a sample image, clears the comment in the image metadata, and asserts that the comment was cleared (returns None).

Moildev