MAPI service SimulationControl
IMPORTANT: This service is available only with xMOD.
To get SimulationControl service use:
Bases: MAPIServiceWithSignalR
SimulationControl MAPI service allows to control simulations.
Source code in restmapi\restmapi\services.py
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 | |
__init__(url)
DO NOT create SimulationControlRestServiceProxy by yourself. Always use MAPIServices.get_service("SimulationControl") method to create it.
Parameters:
-
url(string) –Base URL to create of the REST service.
Source code in restmapi\restmapi\services.py
delete_simulation(name)
Delete simulation
Parameters:
-
name(string) –Simulation name
get_channel_value(channel_name)
Get channel current value
Parameters:
-
channel_name(string) –Channel name
Returns:
-
double–Channel value
Source code in restmapi\restmapi\services.py
get_current_name()
get_last_log_files_zip()
Get last log files zip archive
Returns:
-
bytes–Zip archive content
get_last_report_messages()
Get last report messages
Returns:
-
RestReportMessage array–List of report messages
get_last_result()
Get last results subfolder name
Returns:
-
string–Last result subfolder name
get_parameters(name)
Get parameters array for specific simulation
Parameters:
-
name(string) –Simulation name
Returns:
-
Parameter array–List of parameters
Source code in restmapi\restmapi\services.py
get_result_file(path, group, id)
Get results file content
Parameters:
-
path(string) –Results subfolder name -
group(string) –Section in .files -
id(string) –Id of the file
Returns:
-
bytes–File content
Source code in restmapi\restmapi\services.py
get_result_files(path)
Get results files
Parameters:
-
path(string) –Results subfolder name
Returns:
-
ResultFile array–List of result files
Source code in restmapi\restmapi\services.py
get_results_url_array(filter_str, skip=0, count=100)
Get results array
Parameters:
-
filter_str(string) –Filter -
skip(int, default:0) –Number of results to skip, by default 0 -
count(int, default:100) –Maximum number of results to return, by default 100
Returns:
-
string array–List of result URLs
Source code in restmapi\restmapi\services.py
get_simulation_details(name)
Get simulation details
Parameters:
-
name(string) –Simulation name
Returns:
-
SimulationDetails–Simulation details object
Source code in restmapi\restmapi\services.py
get_simulation_progress()
Get current simulation progress in percentage
Returns:
-
int–Progress percentage
get_simulation_settings(name)
Get simulation settings
Parameters:
-
name(string) –Simulation name
Returns:
-
SimulationSettings–Simulation settings object
Source code in restmapi\restmapi\services.py
get_simulations_list()
Get list of all simulations
Returns:
-
string array–List of simulation names
get_status()
get_table_value(table_name)
Get table current value
Parameters:
-
table_name(string) –Table name
Returns:
-
string–Table value
Source code in restmapi\restmapi\services.py
get_variables(filter_str, format_str, skip=0, count=100)
Get variables list
Parameters:
-
filter_str(string) –Filter -
format_str(string) –Return format(json or string) -
skip(int, default:0) –Number of variables to skip, by default 0 -
count(int, default:100) –Maximum number of variables to return, by default 100
Returns:
-
object array–List of variables
Source code in restmapi\restmapi\services.py
get_variables_values(names)
Set variable value
Parameters:
-
names(string array) –Quantity names
Returns:
-
Variable array–List of variables with values
Source code in restmapi\restmapi\services.py
has_started()
Get the information if the simulation has started
Returns:
-
bool–True if started
pause_simulation()
register_status_changed_callback(action)
Register a signalR callback to be called when the simulation status changes. init_signalr() method has to be called before to initialize signalR communication.
Parameters:
-
action(Function with a string parameter) –A callback function with a parameter (new status).
Source code in restmapi\restmapi\services.py
resume_simulation()
set_channel_value(channel_name, value)
Set channel value
Parameters:
-
channel_name(string) –Channel name -
value(double) –Value to be set
Source code in restmapi\restmapi\services.py
set_simulation_settings(name, settings)
Set simulation settings
Parameters:
-
name(string) –Simulation name -
settings(SimulationSettings) –Simulation settings object
Source code in restmapi\restmapi\services.py
set_table_value(table_name, value)
Set table value
Parameters:
-
table_name(string) –Table name -
value(double array array) –Value to be set
Source code in restmapi\restmapi\services.py
start_simulation(name, xpar_parameters=None)
Start new simulation
Parameters:
-
name(string) –Simulation name -
xpar_parameters(bytes or string, default:None) –XPAR parameters content, by default None