3. i-SAS_ShipVisualizer¶
3.1. interface¶
-
class
ship_visualizer.interface.Interface(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)¶ Bases:
objectinterface class
-
GRID_NUM= 12¶
-
DPI= 100¶
-
package_name= 'ship_visualizer'¶
-
content_type= 'visualizer'¶
-
__init__(fig_name, size_ratio, input_names=None, variable_names=None, structural_model_name=None, **kwargs)¶ initialization.
- Parameters
fig_name (str) – figure name.
size_ratio (tuple(int, int)) – figure size ratio. (1 <= int <= 12)
input_names (dict. optional) – dict whose keys are names of input quantity and values are names of input data.
variable_names (dict, optional) – dict whose keys are names of used quantity and values are names of variables.
structural_model_name (str, optional) – structural model name
**kwargs – Arbitrary keyword arguments.
-
set_project(project_name)¶ set project
- Parameters
project_name (str) – project name.
-
set_model(structural_models)¶ set model
- Parameters
structural_models (dict) – structural models.
-
setup(window_width)¶ create figure canvas in gui
- Parameters
window_width (int) – window width (px)
- Returns
figure canvas
- Return type
FigureCanvasQTAgg
-
update(data, variables, count)¶ update figure in gui
- Parameters
data (dict) – calculated data
variables (dict) – variables for interactive gui.
count (int) – iteration count
-
__call__(window_width, data, variables)¶ create figure in visualization
- Parameters
window_width (int) – window width (px)
data (dict) – calculated data
variables (dict) – variables for interactive gui.
-
3.2. model¶
-
class
ship_visualizer.model.Model(fig_name, cfg)¶ Bases:
objectmodel class
-
IMG_DIR= PosixPath('/root/datadrive/gui/ship_visualizer')¶
-
common_data= {}¶
-
update_count= {}¶
-
__init__(fig_name, cfg)¶ constructor
- Parameters
fig_name (str) – figure name.
cfg (dict) – config.
-
set_model(structural_models)¶ set model
- Parameters
structural_models (dict) – structural models.
-
__call__(ax, data, variables, count=nan)¶ draw figure
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
data (pandas.DataFrame) – calculated data.
variables (dict) – variables for interactive gui.
count (int or float, optional) – the number of iterations
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-
sii_bending(ax)¶ create figure named sii_bending.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-
sii_stress(ax)¶ create figure named sii_stress.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-
sii_fatigue(ax)¶ create figure named sii_fatigue.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-
sii_wave(ax)¶ create figure named sii_wave.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-
moment(ax)¶ create figure named moment.
- Parameters
ax (matplotlib.figure.axes) – axes of matplotlib figure
- Returns
axes after being drawn
- Return type
matplotlib.figure.axes
-