Full Code of trombastic/PyScada for AI

main c75dbbcdf133 cached
462 files
3.1 MB
846.7k tokens
1384 symbols
1 requests
Download .txt
Showing preview only (3,380K chars total). Download the full file or copy to clipboard to get everything.
Repository: trombastic/PyScada
Branch: main
Commit: c75dbbcdf133
Files: 462
Total size: 3.1 MB

Directory structure:
gitextract_2o9djmi1/

├── .flake8
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── AUTHORS
├── CHANGELOG.txt
├── LICENSE
├── MANIFEST.in
├── README.rst
├── docker/
│   ├── docker-compose.yml-tmp
│   ├── mysql/
│   │   └── Dockerfile-tmp
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── pyscada/
│       ├── Dockerfile
│       ├── pyscada
│       └── pyscada_init
├── docs/
│   ├── Makefile
│   ├── backend.rst
│   ├── command-line.rst
│   ├── conf.py
│   ├── control_item.rst
│   ├── develop.rst
│   ├── device_protocol.rst
│   ├── django_settings.rst
│   ├── docker.rst
│   ├── frontend.rst
│   ├── grafana.rst
│   ├── index.rst
│   ├── installation.rst
│   ├── make.bat
│   ├── nginx_setup.rst
│   ├── phant.rst
│   ├── plugin_install.rst
│   ├── quick_install.rst
│   ├── raspberryPiOS.rst
│   ├── uninstall.rst
│   ├── update.rst
│   └── visa.rst
├── eslint.config.mjs
├── extras/
│   ├── 0.7to0.8.sh
│   ├── Grafana-test-dashboard.json
│   ├── nginx_sample.conf
│   ├── pyscada-logrotate
│   ├── service/
│   │   ├── SysV-init/
│   │   │   ├── gunicorn_django
│   │   │   └── pyscada_daemon
│   │   ├── systemd/
│   │   │   ├── gunicorn.service
│   │   │   ├── gunicorn.socket
│   │   │   ├── owfs.service
│   │   │   └── pyscada_daemon.service
│   │   └── windows/
│   │       └── register_windows_service.py
│   ├── settings.py
│   └── urls.py
├── install.sh
├── install_docker.sh
├── install_venv.sh
├── move_data.py
├── pyproject.toml
├── pyscada/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── cache_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── core/
│   │   ├── __init__.py
│   │   └── urls.py
│   ├── device.py
│   ├── django_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── event/
│   │   ├── __init__.py
│   │   └── worker.py
│   ├── export/
│   │   ├── __init__.py
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── csv_file.py
│   │   ├── export.py
│   │   ├── hdf5_file.py
│   │   ├── management/
│   │   │   ├── __init__.py
│   │   │   └── commands/
│   │   │       ├── PyScadaExportData.py
│   │   │       └── __init__.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   ├── 0002_auto_20151201_1617.py
│   │   │   ├── 0003_auto_20160315_1140.py
│   │   │   ├── 0004_exporttask.py
│   │   │   ├── 0005_auto_20160403_1454.py
│   │   │   ├── 0006_auto_20160404_0949.py
│   │   │   ├── 0007_auto_20161124_1002.py
│   │   │   ├── 0008_auto_20161124_1003.py
│   │   │   ├── 0009_auto_20161128_0948.py
│   │   │   ├── 0010_auto_20161128_1049.py
│   │   │   ├── 0011_exporttask_filename.py
│   │   │   ├── 0012_exporttask_backgroundprocess.py
│   │   │   ├── 0013_auto_20170711_0729.py
│   │   │   ├── 0014_auto_20170711_1326.py
│   │   │   ├── 0015_remove_exporttask_backgroundtask.py
│   │   │   ├── 0016_auto_20191004_0912.py
│   │   │   └── __init__.py
│   │   ├── models.py
│   │   └── worker.py
│   ├── fixtures/
│   │   ├── color.json
│   │   └── units.json
│   ├── generic/
│   │   ├── __init__.py
│   │   ├── device.py
│   │   ├── devices/
│   │   │   ├── __init__.py
│   │   │   ├── dummy.py
│   │   │   └── waveform.py
│   │   └── worker.py
│   ├── hmi/
│   │   ├── __init__.py
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   ├── 0002_auto_20151016_1932.py
│   │   │   ├── 0003_auto_20151130_1456.py
│   │   │   ├── 0004_auto_20151130_1502.py
│   │   │   ├── 0005_auto_20160111_1822.py
│   │   │   ├── 0006_auto_20160111_1848.py
│   │   │   ├── 0007_auto_20160518_0848.py
│   │   │   ├── 0008_auto_20180620_0716.py
│   │   │   ├── 0009_controlitem_property_name.py
│   │   │   ├── 0010_auto_20180705_1341.py
│   │   │   ├── 0011_auto_20180710_1549.py
│   │   │   ├── 0012_auto_20180912_1302.py
│   │   │   ├── 0013_widget_update_20180912_1315.py
│   │   │   ├── 0014_auto_20180912_1340.py
│   │   │   ├── 0015_auto_20180913_1608.py
│   │   │   ├── 0016_auto_20181004_0831.py
│   │   │   ├── 0017_groupdisplaypermission_forms.py
│   │   │   ├── 0018_auto_20181205_0937.py
│   │   │   ├── 0019_auto_20181205_1058.py
│   │   │   ├── 0020_pie.py
│   │   │   ├── 0021_auto_20190528_0924.py
│   │   │   ├── 0022_auto_20191004_0912.py
│   │   │   ├── 0023_dropdownitem_value.py
│   │   │   ├── 0024_auto_20191212_1516.py
│   │   │   ├── 0025_widgetcontent_content_str.py
│   │   │   ├── 0026_auto_20200915_1333.py
│   │   │   ├── 0027_auto_20200915_1407.py
│   │   │   ├── 0028_auto_20200915_1540.py
│   │   │   ├── 0029_auto_20200916_0720.py
│   │   │   ├── 0030_auto_20200918_0842.py
│   │   │   ├── 0031_auto_20200918_1206.py
│   │   │   ├── 0032_auto_20200918_1408.py
│   │   │   ├── 0033_auto_20200918_1439.py
│   │   │   ├── 0034_auto_20200918_1445.py
│   │   │   ├── 0035_auto_20200918_1517.py
│   │   │   ├── 0036_auto_20200923_0850.py
│   │   │   ├── 0037_auto_20200923_0852.py
│   │   │   ├── 0038_auto_20200929_1410.py
│   │   │   ├── 0039_auto_20201002_0928.py
│   │   │   ├── 0040_dictionary_dictionaryitem.py
│   │   │   ├── 0041_auto_20201002_0934.py
│   │   │   ├── 0042_auto_20201201_1335.py
│   │   │   ├── 0043_auto_20201201_1411.py
│   │   │   ├── 0044_auto_20201201_1539.py
│   │   │   ├── 0045_auto_20201201_2100.py
│   │   │   ├── 0046_auto_20201201_2109.py
│   │   │   ├── 0047_auto_20201202_1445.py
│   │   │   ├── 0048_chartaxis_fill.py
│   │   │   ├── 0049_auto_20201202_2037.py
│   │   │   ├── 0050_auto_20201203_2101.py
│   │   │   ├── 0051_auto_20201204_0901.py
│   │   │   ├── 0052_auto_20201204_0949.py
│   │   │   ├── 0053_auto_20211118_1438.py
│   │   │   ├── 0054_displayvalueoption_type.py
│   │   │   ├── 0055_auto_20211125_1405.py
│   │   │   ├── 0056_auto_20211210_1608.py
│   │   │   ├── 0057_auto_20211214_1157.py
│   │   │   ├── 0058_auto_20220523_1639.py
│   │   │   ├── 0059_alter_view_theme.py
│   │   │   ├── 0060_chartaxis_show_bars.py
│   │   │   ├── 0061_auto_20220610_1459.py
│   │   │   ├── 0062_auto_20220616_1523.py
│   │   │   ├── 0063_move_group_display_permissions.py
│   │   │   ├── 0064_auto_20220617_1333.py
│   │   │   ├── 0065_auto_20220620_0854.py
│   │   │   ├── 0066_auto_20221205_1435.py
│   │   │   ├── 0067_alter_cssclass_options.py
│   │   │   ├── 0068_alter_displayvalueoption_timestamp_conversion.py
│   │   │   ├── 0069_displayvalueoption_color_and_more.py
│   │   │   ├── 0070_move_displayvalueoptions.py
│   │   │   ├── 0071_remove_displayvalueoption_color_1_and_more.py
│   │   │   ├── 0072_alter_groupdisplaypermission_hmi_group.py
│   │   │   ├── 0073_alter_processflowdiagramitem_control_item.py
│   │   │   ├── 0074_alter_cssclass_css_class.py
│   │   │   ├── 0075_alter_processflowdiagram_url_height_and_more.py
│   │   │   ├── 0076_displayvalueoptiontemplate_transformdata_and_more.py
│   │   │   ├── 0077_transformdatacountvalue.py
│   │   │   ├── 0078_alter_theme_base_filename_alter_theme_view_filename.py
│   │   │   ├── 0079_displayvalueoption_from_timestamp_offset.py
│   │   │   ├── 0080_view_default_time_delta.py
│   │   │   ├── 0081_groupdisplaypermission_unauthenticated_users.py
│   │   │   ├── 0082_externalview.py
│   │   │   ├── 0083_externalviewgroupdisplaypermission.py
│   │   │   └── __init__.py
│   │   ├── models.py
│   │   ├── signals.py
│   │   ├── static/
│   │   │   └── pyscada/
│   │   │       ├── css/
│   │   │       │   ├── bootstrap/
│   │   │       │   │   ├── bootstrap-theme.css
│   │   │       │   │   └── bootstrap.css
│   │   │       │   ├── daterangepicker/
│   │   │       │   │   └── daterangepicker.css
│   │   │       │   ├── fonts/
│   │   │       │   │   └── roboto/
│   │   │       │   │       └── LICENSE.txt
│   │   │       │   ├── jquery-ui/
│   │   │       │   │   ├── AUTHORS.txt
│   │   │       │   │   ├── LICENSE.txt
│   │   │       │   │   ├── jquery-ui.css
│   │   │       │   │   ├── jquery-ui.structure.css
│   │   │       │   │   ├── jquery-ui.theme.css
│   │   │       │   │   └── package.json
│   │   │       │   └── pyscada/
│   │   │       │       └── pyscada-theme.css
│   │   │       └── js/
│   │   │           ├── MIT-LICENSE.txt
│   │   │           ├── admin/
│   │   │           │   ├── display_inline_datasource.js
│   │   │           │   ├── display_inline_protocols_device.js
│   │   │           │   ├── display_inline_protocols_variable.js
│   │   │           │   ├── display_inline_transform_data_display_value_option.js
│   │   │           │   ├── handler_content_as_pre.js
│   │   │           │   └── hideshow.js
│   │   │           ├── bootstrap/
│   │   │           │   ├── affix.js
│   │   │           │   ├── alert.js
│   │   │           │   ├── bootstrap.js
│   │   │           │   ├── button.js
│   │   │           │   ├── carousel.js
│   │   │           │   ├── collapse.js
│   │   │           │   ├── dropdown.js
│   │   │           │   ├── modal.js
│   │   │           │   ├── npm.js
│   │   │           │   ├── popover.js
│   │   │           │   ├── scrollspy.js
│   │   │           │   ├── tab.js
│   │   │           │   ├── tooltip.js
│   │   │           │   └── transition.js
│   │   │           ├── dexie/
│   │   │           │   └── LICENSE.txt
│   │   │           ├── flot/
│   │   │           │   ├── LICENSE.txt
│   │   │           │   ├── jquery.event.drag.LICENSE.txt
│   │   │           │   ├── jquery.mousewheel.LICENSE.txt
│   │   │           │   ├── lib/
│   │   │           │   │   ├── globalize.culture.en-US.js
│   │   │           │   │   ├── globalize.js
│   │   │           │   │   ├── jquery.event.drag.js
│   │   │           │   │   └── jquery.mousewheel.js
│   │   │           │   └── source/
│   │   │           │       ├── jquery.canvaswrapper.js
│   │   │           │       ├── jquery.colorhelpers.js
│   │   │           │       ├── jquery.flot.axislabels.js
│   │   │           │       ├── jquery.flot.browser.js
│   │   │           │       ├── jquery.flot.categories.js
│   │   │           │       ├── jquery.flot.composeImages.js
│   │   │           │       ├── jquery.flot.crosshair.js
│   │   │           │       ├── jquery.flot.drawSeries.js
│   │   │           │       ├── jquery.flot.errorbars.js
│   │   │           │       ├── jquery.flot.fillbetween.js
│   │   │           │       ├── jquery.flot.flatdata.js
│   │   │           │       ├── jquery.flot.gauge.js
│   │   │           │       ├── jquery.flot.hover.js
│   │   │           │       ├── jquery.flot.image.js
│   │   │           │       ├── jquery.flot.js
│   │   │           │       ├── jquery.flot.legend.js
│   │   │           │       ├── jquery.flot.logaxis.js
│   │   │           │       ├── jquery.flot.navigate.js
│   │   │           │       ├── jquery.flot.pie.js
│   │   │           │       ├── jquery.flot.resize.js
│   │   │           │       ├── jquery.flot.saturated.js
│   │   │           │       ├── jquery.flot.selection.js
│   │   │           │       ├── jquery.flot.stack.js
│   │   │           │       ├── jquery.flot.symbol.js
│   │   │           │       ├── jquery.flot.threshold.js
│   │   │           │       ├── jquery.flot.time.js
│   │   │           │       ├── jquery.flot.touch.js
│   │   │           │       ├── jquery.flot.touchNavigate.js
│   │   │           │       ├── jquery.flot.uiConstants.js
│   │   │           │       └── jquery.js
│   │   │           ├── jquery/
│   │   │           │   ├── jquery.cookie.js
│   │   │           │   └── parser-input-select.js
│   │   │           ├── jquery-ui/
│   │   │           │   ├── AUTHORS.txt
│   │   │           │   ├── LICENSE.txt
│   │   │           │   ├── jquery-ui.js
│   │   │           │   └── package.json
│   │   │           ├── jquery.flot.axisvalues.js
│   │   │           ├── pyscada/
│   │   │           │   ├── TransformDataHmiPlugin.js
│   │   │           │   ├── pyscada_tests.js
│   │   │           │   └── pyscada_v0-9-0.js
│   │   │           └── tempusdominus-bootstrap-3.js
│   │   ├── templates/
│   │   │   ├── 403.html
│   │   │   ├── _chart_legend.html
│   │   │   ├── base.html
│   │   │   ├── button.html
│   │   │   ├── chart.html
│   │   │   ├── chart_legend.html
│   │   │   ├── choose_login.html
│   │   │   ├── circular_gauge.html
│   │   │   ├── content_page.html
│   │   │   ├── control_element.html
│   │   │   ├── control_panel.html
│   │   │   ├── custom_html_panel.html
│   │   │   ├── dropdown.html
│   │   │   ├── form.html
│   │   │   ├── login.html
│   │   │   ├── modelProperties.html
│   │   │   ├── password_change.html
│   │   │   ├── password_change_done.html
│   │   │   ├── pie.html
│   │   │   ├── process_flow_diagram.html
│   │   │   ├── status_element.html
│   │   │   ├── svg_loading_icon.html
│   │   │   ├── template_not_found.html
│   │   │   ├── user_dropdown.html
│   │   │   ├── user_profile_change.html
│   │   │   ├── value_field.html
│   │   │   ├── view.html
│   │   │   ├── view_overview.html
│   │   │   └── widget_row.html
│   │   ├── templatetags/
│   │   │   ├── __init__.py
│   │   │   └── views_extras.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── log/
│   │   └── __init__.py
│   ├── mail/
│   │   ├── __init__.py
│   │   └── worker.py
│   ├── management/
│   │   ├── __init__.py
│   │   └── commands/
│   │       ├── __init__.py
│   │       └── pyscada_daemon.py
│   ├── migrations/
│   │   ├── 0001_initial.py
│   │   ├── 0002_event_hysteresis.py
│   │   ├── 0003_auto_20151026_1826.py
│   │   ├── 0004_unit_udunit.py
│   │   ├── 0005_merge.py
│   │   ├── 0006_auto_20151130_1449.py
│   │   ├── 0007_auto_20151201_1613.py
│   │   ├── 0008_auto_20151201_1614.py
│   │   ├── 0009_auto_20160111_1802.py
│   │   ├── 0010_auto_20160115_0918.py
│   │   ├── 0011_auto_20160115_0920.py
│   │   ├── 0012_auto_20160119_0950.py
│   │   ├── 0013_auto_20160204_0840.py
│   │   ├── 0014_auto_20160210_1152.py
│   │   ├── 0015_auto_20160215_1522.py
│   │   ├── 0016_auto_20160215_2002.py
│   │   ├── 0017_recordeddata.py
│   │   ├── 0018_auto_20160228_1623.py
│   │   ├── 0019_datamigration_20160228_1624.py
│   │   ├── 0020_auto_20160228_1641.py
│   │   ├── 0021_auto_20160228_1643.py
│   │   ├── 0022_auto_20160228_2029.py
│   │   ├── 0023_auto_20160314_1817.py
│   │   ├── 0024_auto_20160517_1047.py
│   │   ├── 0025_auto_20160517_1734.py
│   │   ├── 0026_auto_20160518_0848.py
│   │   ├── 0027_auto_20160530_1436.py
│   │   ├── 0028_auto_20160630_0831.py
│   │   ├── 0029_scaling_limit_input.py
│   │   ├── 0030_device_polling_interval.py
│   │   ├── 0031_delete_variableconfigfileimport.py
│   │   ├── 0032_auto_20161107_2206.py
│   │   ├── 0033_auto_20161107_2241.py
│   │   ├── 0034_auto_20170213_0855.py
│   │   ├── 0035_auto_20170224_1215.py
│   │   ├── 0036_auto_20170224_1245.py
│   │   ├── 0037_auto_20170418_0931.py
│   │   ├── 0038_auto_20170707_1209.py
│   │   ├── 0039_auto_20170711_1326.py
│   │   ├── 0040_auto_20170905_0942.py
│   │   ├── 0041_update_protocol_id.py
│   │   ├── 0042_auto_20180604_1240.py
│   │   ├── 0043_devicewritetask_property_name.py
│   │   ├── 0044_auto_20180704_1307.py
│   │   ├── 0045_auto_20180705_1341.py
│   │   ├── 0046_remove_devicewritetask_property_name.py
│   │   ├── 0047_recordeddatanew.py
│   │   ├── 0047_variableproperty_unit.py
│   │   ├── 0048_datamigration_20181025_0918.py
│   │   ├── 0049_auto_20181025_1049.py
│   │   ├── 0050_merge_20181130_1143.py
│   │   ├── 0051_auto_20181206_1107.py
│   │   ├── 0052_auto_20181207_1019.py
│   │   ├── 0053_auto_20190207_1526.py
│   │   ├── 0053_auto_20190307_1423.py
│   │   ├── 0054_auto_20190208_0913.py
│   │   ├── 0054_auto_20190411_0749.py
│   │   ├── 0055_auto_20190625_1752.py
│   │   ├── 0056_auto_20190625_1823.py
│   │   ├── 0057_auto_20191004_0912.py
│   │   ├── 0058_merge_20191206_1328.py
│   │   ├── 0059_auto_20200211_1049.py
│   │   ├── 0060_auto_20200914_1417.py
│   │   ├── 0061_devicereadtask.py
│   │   ├── 0062_auto_20201002_0830.py
│   │   ├── 0063_complexevent_complexeventitem_complexeventitemvariable.py
│   │   ├── 0064_auto_20201005_1443.py
│   │   ├── 0065_auto_20201005_1454.py
│   │   ├── 0066_auto_20201006_0718.py
│   │   ├── 0067_auto_20201006_0719.py
│   │   ├── 0068_auto_20201006_0826.py
│   │   ├── 0069_complexeventgroup_current_level.py
│   │   ├── 0070_auto_20201006_1327.py
│   │   ├── 0071_recordedevent_level.py
│   │   ├── 0072_auto_20201006_1408.py
│   │   ├── 0073_auto_20201007_0858.py
│   │   ├── 0074_complexeventitem_active.py
│   │   ├── 0075_auto_20201007_1609.py
│   │   ├── 0076_mail_html_message.py
│   │   ├── 0077_auto_20201104_1656.py
│   │   ├── 0078_auto_20201123_1906.py
│   │   ├── 0079_devicehandler.py
│   │   ├── 0080_variableproperty_last_modified.py
│   │   ├── 0081_calculatedvariable_periodfield_variablecalculatedfields.py
│   │   ├── 0082_auto_20211112_1043.py
│   │   ├── 0083_auto_20211115_0812.py
│   │   ├── 0084_auto_20211115_1503.py
│   │   ├── 0085_calculatedvariableselector_active.py
│   │   ├── 0086_auto_20211115_1612.py
│   │   ├── 0087_auto_20211116_1329.py
│   │   ├── 0088_auto_20211117_1023.py
│   │   ├── 0089_calculatedvariable_state.py
│   │   ├── 0090_auto_20211117_1239.py
│   │   ├── 0091_auto_20211118_1019.py
│   │   ├── 0092_auto_20211125_1054.py
│   │   ├── 0093_auto_20211125_1256.py
│   │   ├── 0094_move_dictionaries.py
│   │   ├── 0095_auto_20211203_1949.py
│   │   ├── 0096_auto_20211210_0924.py
│   │   ├── 0097_auto_20220118_1046.py
│   │   ├── 0098_alter_device_polling_interval.py
│   │   ├── 0099_alter_dictionaryitem_label.py
│   │   ├── 0100_device_instrument_handler.py
│   │   ├── 0101_complexeventchangevariable.py
│   │   ├── 0102_move_complex_event_variables.py
│   │   ├── 0103_remove_complexevent_new_value_and_more.py
│   │   ├── 0104_rename_complexeventitem_complexeventinput_and_more.py
│   │   ├── 0105_edit_generic_device_protocol.py
│   │   ├── 0106_datasource_datasourcemodel_djangodatabase_and_more.py
│   │   ├── 0107_alter_calculatedvariableselector_period_fields.py
│   │   ├── 0108_remove_calculatedvariable_period_and_more.py
│   │   ├── 0109_alter_variable_value_class.py
│   │   ├── 0110_variable_readable.py
│   │   ├── 0111_devicehandlerparameter.py
│   │   ├── 0112_alter_devicehandlerparameter_value.py
│   │   ├── 0113_variablehandlerparameter.py
│   │   ├── 0114_alter_devicehandlerparameter_value_and_more.py
│   │   ├── 0115_remove_recordeddata_variable_and_more.py
│   │   ├── 0116_variable_pause_recording.py
│   │   └── __init__.py
│   ├── models.py
│   ├── signals.py
│   ├── single_value_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── tests.py
│   ├── utils/
│   │   ├── __init__.py
│   │   └── scheduler.py
│   └── views.py
├── setup.py
├── tests/
│   ├── project_template/
│   │   ├── manage.py-tpl
│   │   └── project_name/
│   │       ├── __init__.py-tpl
│   │       ├── asgi.py-tpl
│   │       ├── settings.py-tpl
│   │       ├── urls.py-tpl
│   │       └── wsgi.py-tpl
│   ├── test.sh
│   ├── test_modbus.sh
│   └── test_without_plugins.sh
└── tox.ini

================================================
FILE CONTENTS
================================================

================================================
FILE: .flake8
================================================
[flake8]
exclude = 
    build,
    .git,
    .tox,
    tests/.env,
    */migrations/*
    
extend-ignore = E203
max-line-length = 88


================================================
FILE: .gitignore
================================================
*.log
*.pot
*.pyc
local_settings.py
build
PyScada.egg-info
dist
/.project
docs/_build
/.idea/*

# Emacs backup files
*~
/tests/test/*
/tests/project_template_tmp/*

/docker/nginx/ssl/*
/docker/pyscada/pyscada.zip
/docker/pyscada/project_template.zip
logs_install.txt
logs_docker.txt
/docker/mysql/Dockerfile
/docker/docker-compose.yml


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 24.4.2
    hooks:
    - id: black
      exclude: \.py-tpl$
  - repo: https://github.com/adamchainz/blacken-docs
    rev: 1.18.0
    hooks:
      - id: blacken-docs
        additional_dependencies:
        - black==24.4.2
        files: 'docs/.*\.txt$'
        args: ["--rst-literal-block"]
  - repo: https://github.com/PyCQA/isort
    rev: 5.13.2
    hooks:
      - id: isort
  - repo: https://github.com/PyCQA/flake8
    rev: 7.1.0
    hooks:
      - id: flake8
  - repo: https://github.com/pre-commit/mirrors-eslint
    rev: v9.7.0
    hooks:
      - id: eslint


================================================
FILE: .readthedocs.yaml
================================================
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.12"
    # You can also specify other tool versions:
    # nodejs: "20"
    # rust: "1.70"
    # golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
  configuration: docs/conf.py
  # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
  # builder: "dirhtml"
  # Fail on all warnings to avoid broken references
  # fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
#   - pdf
#   - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
#   install:
#     - requirements: docs/requirements.txt

================================================
FILE: AUTHORS
================================================
Current or previous core committers:

* Martin Schröder
* Camille Lavayssiere

Current and previous core designers:

* Martin Schröder
* Camille Lavayssiere

Contributors (in alphabetical order):

* Shannon McCullough
* Gregor Kendzierski


================================================
FILE: CHANGELOG.txt
================================================
0.7.0b2
 - fixed modbus daemon
 - fixed modbus device
 - updated Docs
 - readded log notifications in HMI
 - added loading animation for data prefetch in HMI
 - changed id in Log model to timestame + id schema

0.7.0b3
 - removed separate handler files for daq
 - removed seperate HMIVariable model
 - added restart of daq when Variable or Device model are changed
 - added support for different byte order of aquired data
 - fixed support for U/INT64 and U/INT32 datatypes
 - removed chart_set from hmi
 - updated docs
 - removed unused code

0.7.0b4
 - fixed reinit loop in daq daemon
 - added restart of daq when Scaling model has changed
 - fixed hmi.widget save without a title
 - fixed export.handler (wrong start and end date)
 - fixed export to file, check of array index, import of numpy
 - added backend table (VariableState) for current values in the database
 - fixed crash of hmi admin when widget has no title
 - added unixtime value in web hmi (experimental)
 - fixed custom html panel variable not uptading in hmi
 - added restart_daemon field in background task model
 - added check of write permissions for pid and log file in DaemonHandler

0.7.0b5
 - added color chooser to VariableAdmin
 - fixed display bool values in charts
 - added servertime to footer of hmi
 - new register handling structure in modbus device

0.7.0b6
 - updated javascript libs
    - jquery --> 1.12.4
    - flot --> 0.8.3
    - tablesorter --> 2.0.5b
    - bootstrap --> 3.3.6
 - changed Title in HMI views
 - added pollinginterval field in device model
 - fixed chart legend template

 0.7.0b7
 - fixed data export (record starts with 0)
 - fixed RecordedData manager
 - added APC UPS status info's to systemstat device

0.7.0b8
 - added ability to add fake data to RecordedData manager
 - fixed add fake data in hmi
 - fixed query_first_value in RecordedData manager

0.7.0b9
 - updated to Django 1.10
 - changed filter in Chart Model Admin

0.7.0b10
 - added Visa and Phant Device support
 - minor fixes in the Export of Data

0.7.0b11
 - fixed Export without mean values
 - fixed managementcommand for Data Export
 - added lock for Exports to prevent running of more than one export at a time

0.7.0b12
  - fixed export
  - added datetime fields to Export
  - added pytz to the requirements

0.7.0b13
  - fixed modbus write task
  - fixed Event handling

0.7.0b14
  - fixed handling of int16 values in RecordedData Model
  - added custom admin interface
  - added filter to variable state admin view
  - added unit column to variable admin

0.7.0b15
  - added 1-Wire support (experimental)

0.7.0b16
  - fixed handling of dead tasks in data export

0.7.0b17
  - added support for custom daq devices
  - updated docs
  - some hmi changes

0.7.0b18
  - added OWFS support to onewire device
  - updated to django 1.11
  - added download link for export files to export job
  - fixed daemon handler

0.7.0b19, 0.7.0b20, 0.7.0b21
  - changed daemon handling to support multitasking
  - rearranged admin for Device and Variables
  - updated the Docs

0.7.0b22, 0.7.0b23, 0.7.0b24, 0.7.0b25
  - added BackgroundProcess restart on model change
  - fixed problem with id of ControlItems in HMI
  - updated Docker files (not working yet)
  - updated SysV-init service examples
  - updated systemd service examples

0.7.0b26
  - fixed Jofra350 Admin
  - fixed OperationalError in scheduler

0.7.0b27, 0.7.0b28, 0.7.0b29, 0.7.0b30, 0.7.0b31
  - major update to the javascript part of the HMI Client
  - added time selection bar in HMI

0.7.0rc1
  - updated Docs
  - updated systemd unit file
  - improved HMI

0.7.0rc2
  - fixed "-" bug in view link_title
  - fixed visa daq restart handler
  - fixed hmi "AutoUpdateButton" not working
  - updated docs, updated readme
  - added utils.blow_up function to convert database data from change of value to constant timestep data

0.7.0rc3
  - fixed double connect in visa device
  - moved loading animation in hmi
  - added 100 ms and 500 ms polling interval (experimental)
  - added extension compatibility
  - fixed onewire and smbus reinit handler
  - added protocol id for the new GPIO Extension

0.7.0rc4
  - added missing migration file

0.7.0rc5
  - changed the method for namespace packages to the pkg_resources-style
  - moved the version info to pyscada.core

0.7.0rc6
  - corrected typos
  - fixes of AppConfig for setup.py develop
  - added protocol id for scripting extension

0.7.0rc7
  - added admin for VariableProperty
  - added capability of reading and writing VariableProperties from the HMI and devices
  - altered arguments for device.write_data!

0.7.0rc8
  - changed VariableProperty handling in DeviceWriteTask
  - changed VariableProperty handling in HMI

0.7.0rc9
  - fixed variable and variable_property attributes in hmi.ControlItem
  - added traceback to Device.get_device_instance method
  - updated Keithley DMM2000 device in visa.devices

0.7.0rc10
  - updated docs
  - fixed no data download in pyscada.js
  - fixed default polling interval in pyscada.device

0.7.0rc11
  - changed widget model to support content from plugins
  - changed visable to visible in pyscada.hmi.models.Chart, SlidingPanelMenu, Widget
  - some changes for python 3 compatibility in pyscada.export

0.7.0rc12
  - fixed issue #13, Mismatch between event limit elif cases and the displayed limit types.
  - merged pull request #12, changing from source_format to target_format to match preceding setting of '2H' value

0.7.0rc13
  - updated docs, switching from python 2.7 to python 3
  - added redirect to https to the nginx sample config
  - fixed server error for BackgroundProcess View in Admin with python3
  - fixed HDF5 export for python 3
  - fixed ProcessFlowDiagram in HMI
  - added support for multiple SlidingSidePanels on one Side
  - added date_saved field to the RecordedData Model, renamed the RecordedData model without the field to RecordedDataOld,
    migration #48 will copy some data to the new model, the rest can be copied by using the move_data.py script

0.7.0rc14
  - update to flot 2.1.6
  - fixed process flow diagram value not displayed
  - moved x y zoom selection in HMI to each Chart
  - add option of redirecting to a custom login page
  - add framer option for modbus communication
  - add data courser in chart
  - add XYChart
  - add new form widget in HMI
  - add new drop down control element in HMI
  - fixed WidgetContent not being deleted
  - moved signal related methods to dedicated signals.py
  - added pyserial to dependency list
  - improved hmi <--> db communication to avoid data loss on slow connections

0.7.0rc15
  - fixed zombi process problem
  - fixed migrations with python3
  - changed datetime_now to now from django timezone

0.7.0rc16
  - fixed re-login after logout (#22)
  - added LINK_TARGET option to change the default behaviour of links in view overview (#23)
  - Catching exceptions if DB close while pyscada is running

0.7.0rc17, 0.7.0rc18
  - add pre_delete signals to stop the background process before deleting a device
  - move widget post_save signal to the model to remove the global receiver (not filtering by sender)
  - move device handlers to core
  - add stop in DAQ Process restart
  - move the device and variable protocol specific configuration to core
  - add protocol name in device __str__ for the variable js admin file
  - add complex events

0.7.0rc19
  - add fk_name in admin for bacnet device with 2 ForeignKey to Device model

0.7.0rc20
  - add django channels to send informations between processes

0.7.0rc21
  - Update docker config file
  - Add optional PID_FILE_NAME to settings to allow multiple instances
  - Add custom periodic auto caltulated variable

0.7.0rc22
  - Add choose_login.html to have multiple login ways
  - Add circular gauge to display control items
  - Add silent delete option in admin for VariableState and Device to delete a lot of data
  - Add grafana doc and config file to use Grafana to display data from a PyScada instance
  - Add dictionaries to store string with a key. Allows to store strings for Variables

0.7.0rc23
  - Add svg to render ProcessFlowDiagram. Allows to resize to fit the window size
  - Add OPC-UA protocol
  - close DB connection in scheduler to allow multiple instance on the same DB to run
  - Add INT8 and UINT8 variable value class
  - change the date range picker JS library
  - Add logrotate config file
  - Add a slider to change the refresh rate value of data handling

0.7.1rc1
  - Update to Django 3
  - Update docker config and doc to use pyscada repository

0.7.1rc2
  - Move group display permission items to inline and add exclude type for each item
  - fix adding a new device and activate device in protocol process list
  - fix signals for BP not done nor failed
  - add theme files validator
  - other fixes

0.7.1rc3
  - add bar chart
  - add polling intervals
  - add view theme
  - add -config2 div in html to get all infos of items used in the user interface
  - add calculated variable for aggregation
  - add install script
  - add css class arg to customize widget
  - fixes

0.7.1rc4
  - Add MBus to protocol list
  - add append and remove dictionary functions
  - Fix device write task for VP (no variable defined)
  - HTML: add span for legendLabel text
  - JS: load visible chart variable first
  - fixes

0.7.1rc5
  - add hide/show JS for fields in admin
  - add get_prev_value overwritten by child class for systemstat non logging variable
  - last_value use get_prev_value
  - add systemstat timestamps
  - add file protocol
  - fix DeviceWriteTask for variable to change in complex events
  - add value using get_prev_value in views.py for non logging variables
  - Move handler to Device model.
  - Wait 5 seconds to read the main pid (scheduler)

0.8.0
  - core : fix when no handler selected to use the GenericHandlerDevice of the selected protocol
  - systemstat : Create systemstat device (allow remote over ssh)
  - core : Fix timestamp not integer in RecordedData init
  - systemstat : process pid find in cmdline and not only in processus name
  - systemstat : fix pre_delete signal and information choice name
  - core : fix config2 and add classes
  - systemstat : add write_data to execute command
  - JS : fixes
  - core : fix protocol list for devices
  - hmi : fix color for control items
  - core : add related models to Config2
  - JS : dateTimePicker Event : send pyscadaDateTimeChange event for all objects with the class pyscadaDateTimeChange when the datetime picker value change.
  - various : replace ugettext_lazy by gettext_lazy
  - core : replacing pyscada.core in INSTALLED_APPS by pyscada
  - hmi : replace django.conf.urls.url by django.urls.path
  - all : Moving to AGPL3 License
  - core : Moving to django 4.2
  - docs : fixed urls in the docs
  - added a testscript for the instalation routine
  - core : display value option refactoring. Control items display value option code refactoring. Allows more than 3 color.
  - fix django requirements. It should be a coma separated list.
  - moved to new namespace packet format (PEP420) : this was nessesary to make the use of venv possible
  - Fix django 4.0 login : change the default value for LOGIN_REDIRECT_URL in settings.py
  - Fix django 4.0 CSRF_TRUSTED_ORIGINS : change the nginx config to forward the protocol used (http or https) because : Changed in Django 4.0: The values in older versions must only include the hostname (possibly with a leading dot) and not the scheme or an asterisk.
  - Fix when a plugin is uninstalled but the WidgetContent defined in this plugin remain and is selected in an active widget. Add an information log.
  - modbus : fix migration test
  - update install shell : system and docker options
  - modbus : fix test : remove pyvisa from settings template
  - HMI GroupDisplayPermission no groups :
    - add GroupDisplayPermission for users without any group (blank=True).
    - auto create in the hmi/0072 migration.
    - this GroupDisplayPermission cannot be deleted in the admin interface.
    - this group allow everything by default (exclude is empty for each OneToOne related model).
    - add ValidationError for duplicate GroupDisplayPermission.
    - auto collapse only empty inlines in GroupDisplayPermission admin.
    - update get_group_display_permission_list in utils.
    - use get_group_display_permission_list in read and write task.
  - CompexEvent with multiple output variables and refactoring
    - Change names :
    - * ComplexEventGroup > ComplexEvent
    - * ComplexEvent > ComplexEventLevel
    - * ComplexEventItem > ComplexEventInput
    - add ComplexEventOutput to set multiple output variable values when a ComplexEventLevel is active or when no level in active for a ComplexEvent.
  - Remove unused import
  - add informations to pyscada.mail
  - init_db for event and mail add pyscada.core to installed app in init_db
  - use concurrent_log_handler to rotate logs
  - remove django_cas_ng config from settings
  - send mails to admins and managers
  - force channel layer to be empty
    - since the version 4 of channel redis version, the channel layer is not
    - empty after the first read
    - we read it again to empty it
    - maybe it is related to
    - django/channels_redis#348
    - or to django/channels_redis#366
  - Create background process for generic device
    - use id 16 for the generic process worker as 1 is taken by the scheduler
    - but id 1 is taken for generic protocol id
    - by defaut the generic device don't do nothing
    - use the dummy handler to save
  - Allow millisecond timestamp for recorded data
    - Replace time() by time_ns / 1000000000 in
    - GenericDevice (write)
    - GenericHandlerDevice (time)
    - RecordedData (init)
    - Do not force timestamp in recorded data init to be integer beforce id calculation.
  - add handler for dummy waveforms
    - Create waveforms for a generic device.
    - Type can be sinus, square and triangle.
    - Properties are set using variable properties: type, amplitude, start_timestamp, frequency and duty cycle.
    - Variable Property type should be a string.
    - default is:
    - "type": "sinus",  # sinus, square, triangle
    - "amplitude": 1.0,  # peak to peak value
    - "start_timestamp": 0.0,  # in second from 01/01/1970 00:00:00
    - "frequency": 0.1,  # Hz
    - "duty_cycle": 0.5,  # between 0 and 1, duty cycle for square and for
    - triangle : Width of the rising ramp as a proportion of the total cycle.
    - Default is 1, producing a rising ramp, while 0 produces a falling ramp.
    - width = 0.5 produces a triangle wave. If an array, causes wave shape to
    - change over time, and must be the same length as t.
  - log for device write task : log when DWT for a variable not writeable
  - fix boolean with display option
    - use button.html for boolean with display options and for non boolean with color only display option
  - add span for display button : use this span to display the value next to the control item label
  - fix variable property control item
    - fix dictionary, color for VP
    - merge number and boolean in update data values to simplify the code
    - remove unused boolean classes
  - add offset property to generic waveform handler
  - send mail fail not silently : show the error message in a warning log
  - refactor logs
    - remove some error logs
    - replace error logs by warning logs
    - use f-strings in error logs
    - add exc_info=True to log traceback and send it to ADMINS (see settings.py)
    - log as error when a process failed 3 times (to send a mail to ADMINS) then log as warning
  - set AdminEmailHandler settings
  - update gitignore for docker
  - fix export when a filename is given

0.8.1
  - remove docker files created during the installation process
  - docker install
    - hide db password input
    - remove need of django installed in the host system
    - check if zip is installed
  - system install
    - hide db password input
    - add input informations
  - Update conf.py :
    - removed sphinx.ext.autodoc : removed sphinx.ext.autodoc and therefore the dependency of import django this will fix the rtfd build
    - added author : added Camille Lavayssiere as an author
    - removed sphinx_js : this will fix the rtfd build
  - fix license classifier for pypi
  - fix install log
  - JS : hide loading state : if the value of the loading state is >= 100 we hide the loading state.
  - HMI: set navbar as fixed : remove relative position for the top navbar, add body padding for the pages content
  - add css class to widget content models
  - cascade control item deletion on process flow diagram item
  - migration for css class length
  - allow to delete the process flow diagram background image
  - fix process flow diagram item str : if related control item label is empty, return the process flow diagram id
  - remove process flow diagram image padding top
  - add template variable to replace the site name : default to PyScada
  - Variable admin site rendering : add hideshow JS to Variable, load protocol variable fk_name, FormSet, fieldsets in the inlines
  - widget offset : now the column parameter for a widget will be respected, if a widget is in column 1 (from 0 to 3) and there is no other widget on the same page and row the widget will be offsetted this allow respecting the widget positioning with different windows size in comparaison of adding an widget with an empty html content
  - doc use main branch for install
  - pyscada installation in venv
  - add developer and plugin installation documentation
  - added pyscada-ems to the list of device protocols
  - changed plugins url handling : the url settings of pyscada plugins will be added to the global urls, config automaticly
  - Fix device read task str without variable or variable property
  - add email timeout for error log to admins
  - add traceback to error logs
  - dictionary append item function : allow to update the label or the value if exist, else create
  - add hidden variable-config for process flow diagram items
  - add h5py import error log
  - JS : timestamp conversion : if string value is a float, convert to float
  - allow to use dictionary for timestamp variable : if a value is in the dictionary it will not be converted to a datetime string
  - remove log for calculated variable
  - add info to recorded data log if it already exist
  - fix getting objects for html : fix exclude list for many2many objects
  - add class to change process flow diagram items color
  - set bool false control input display value color to grey
  - add 403 error template displaying the exception message
  - display message error on view list : on view not found (permission) and multiple views (duplicate link_title views)
  - add core urls exception : log only if pyscada plugin has an urls.py file
  - add mysqlclient dependency
  - fix python venv install : add venv path to PATH
  - add scipy to requirement for the waveform generic handler
  - missing python3-venv requirement for venv install
  - install-venv : missing PATH for django startproject
  - replace setuptools find_packages by find_namespace_packages
  - fix doc for ems protocol
  - add exclude field list for gen_hiddenConfigHtml
  - fix install in venv (partially broken by black formatting commit) :
    - add python3-venv dependency
    - add write right for settings template file to add install context
    - run django code using pyscada user and venv
    - add scipy for generic waveform handler
  - fixed page alignment problem in views : when the user clicked on the page link in a view a second time the page has been moved so that the top of the page is below the navbar, this was not intended, the page should be hirisontaly aligned at the bottom of the navbar.
  - JS : add event to anounce control item color change :
    - event is linked to the control item config2 element
    - event name is : "changePyScadaControlItemColor_" + control_item_id
    - event.detail is the color formatted as #45bc65
  - fix page anchor position to include navbar padding and border
  - group display permisson :
    - Fix for chart, custom html panel, pie, process flow diagram.
    - Make the list of objects permissions more generic to allow any WidgetContentModel to be added.
  - update tablesorter :
    - to version 2.31.3 : https://github.com/Mottie/tablesorter
    - fix sorting non working for unit
    - remove unused logos
    - create option column
  - add LOGOUT_REDIRECT_URL : redirect to site home rather than django admin logout page after logout
  - pip3 install user : use pyscada user to run install with pip
  - calendar first day : set first calendar day to monday
  - fix setting text for boolean value : check if the span field with class .boolean-value exist before writting the value for svg process flow diagram item the method is different so the span does not exist, todo : replace value by string for process diagram items
  - aggregation type : check if '#aggregation-type-all-select-' + widget_id exist before adding new option
  - Fix day name order and let first day to monday:
    - The daysOfWeek order for DateTimePicker should start on sunday, if not the days are not well labeled. Then the firstDay select the first day to start weeks in the calendar
    - The first day is set to monday untill we find how to get the browser locale and use the first week day for that country
  - fix measurement_data_dumps location : set measurement_data_dumps directory in pyscada home during the venv installation use that folder in default settings.py
  - replace save method by get_or_create for dictionary items : don't create it if it already exist
  - add JS variable to for on before reload : if ONBEFORERELOAD_ASK is true, ask the user before reload o leaving the page, else don't ask
  - fix query first value when no data found in time range : query_first_value in RecordedDataValueManager.db_data find last element from time=now when no data was found for a variable in the time range specified if data was found, time=time of first value
  - fix the 1st diagram tooltip (was hidden by overflow)
  - dispatch changePyScadaControlItemColor event on window : simplify the event catching
  - load hidden config2 after view html load : to load the view quickly load the hidden config2 after the loading the view html code
  - JS: load config2 before the pyscada hmi init then send event : Load config2, Init the pyscada hmi, send PyScadaCoreJSLoaded for plugins
  - add loading page with svg icon : can be replaced by the loading_page block, default icon color (000, black) can be change with svg_loading_color, for example: svg_loading_color="00f"
  - kill setTimeout and xhr request on page unload : store all timeouts in the PYSCADA_TIMEOUTS dictionary, store the current xhr blocking request in PYSCADA_XHR variable
  - JS: add PyScada HMI at the beginning of each console.log
  - add an event for a variable when data change to allow plugin do a custom action

0.8.2
  - prevent loading and showing data after DATA_TO_TIMESTAMP: the bug was that the timestamp_to for the data handler ajax query could be higher than DATA_TO_TIMESTAMP and then change the datepicker end value after the ajax request finish
  - fix generic device init import
  - last_element_min_time: set to 0 if no min time set
  - add transform data and template for control item display value: allow to control the data (transform data function) and graphical representation (template) of a control item set to display value
  - add sliceDATAusingTimestamps JS function to get DATA for a variable key using the daterangepicker and the timeline slinder
  - add "Template not found" template
  - fix difference percent period calculation
  - add readthedocs config file: from : https://docs.readthedocs.io/en/stable/config-file/
  - update docs
  - add operations and aggregation protocols
  - migration: update Chart WidgetContent if exist
  - plugin can add apps to INSTALLED_APPS in settings: a plugin can specify additional apps to add to INSTALLED_APPS
    - in the __init__.py file of the plugin (in pyscada/pluginName) add a list named : additional_installed_app = ["pyscada.otherAppX", "pyscada.otherAppY"]
    - exemple in the pyscada-operations plugin.
  - get_objects_for_html check if field.name is attr of obj
  - add DataSourceModel, Datasource and DjangoDatabase
    - DataSourceModel :
      - Used to define a data source type.
      - The data source base model have a foreign key to this model to specify the configuration :
        - the name,
        - can add, modify on select in the admin panel,
        - the model name of the inline having the specific config (fields, functions, manager).
    - DataSource :
      - The base model for all the data sources.
      - A data source needs to inherit from this class, and should have the basic functions :
        - last_value,
        - read_multiple,
        - write_multiple,
        - get_first_element_timestamp,
        - get_last_element_timestamp.
    - DjangoDatabase :
      - Specify a table to store the values. The table model should have a manager similar to the RecordedDataManager (functions).
    - The default data source added is the RecordedData table.
    - To add new data source, look at the example in pyscada-operations.
  - add VariableManager, rename and update RecordedDataManager
    - To switch to the data source architecture, use the VariableManager function in order to :
      - filter Variable list by datasource (_get_variables_by_datasource)
      - read values from datasources (read_multiple)
      - write values to datasources (write_multiple)
      - get first timestamp recorded for a variable list (get_first_element_timestamp)
      - get last one (get_last_element_timestamp)
    - Plugins and handlers should not use directly the RecordedDataManager but the VariableManager in order to talk to differents data sources.
    - Look at the new way to save read data from GenericDevice and GenericDeviceHandler in pyscada/device.py and in the pyscada.operations plugin.
  - Delete CalculatedVariable (moved to the pyscada.operations plugin) in order to not loose your calculated variables you should install pyscada.operations plugin before running the pyscada migration 108.
  - log ProgrammingError and OperationalError while populating models

0.8.3
  - add view timedelta option to change de default time delta
  - add control item offset option: to choose how to display or not data before the time range
  - generic function to populate inlines for device, variable, variablestate
  -  RecordedData: store uint64 as int64 shifted - unknown class as float: uint64 are shifted by -9223372036854775808 = 2**63 to be stored as a django BigIntegerField
  - handler: add erase cache option in read data all: in order to call various times read data all in a handler, allow to not erase the cached results
  - upgrade flot to 4.2.6
  - limit legend max height to the chart height
  - fixes and other small updates

0.9.0
  - fix glyficon alert and excalamation sign
  - fix append dictionary item if multiple items : keep the first item and delete the others
  - device handler found and content : show if handlers are found in the handler list, show the content of a handler or the pyscada_admin_content variable content if it exists in the handler file
  - JS: check if moment exist before daterangepicker init
  - added option to set a custom message for processes : run by the background-process scheduler, this is e.g. useful for kepping track of the state of single shot tasks.
  - JS: update control-item type-numeric if no color_only option
  - add view object to the template context
  - use fetch api for data handling (#181) : remove use of ajax for data handling, better handle timeout, deauthenticate, use JS function instead of jQuery
  - fixed all values=0 in, filename is None error, h5 timestamp format data export :
    - export jobs will be markt as faild now
    - the min and max time check is removed because it only checks the first variable
    - fixed unit mismatch timestamps from read_multiple in ms, export expected them in s
    - added more detailted status output to backgroundtask model
    - changed timestamp format for h5 output from matlab to unix timestamps
    - escape of "/" in variable name to prevent dataset generation in h5 and mat files
  - fix time max to find previous last element
  - add app init after scheduler start : in order to allow plugin to run code at start and not use the AppConfig.ready function
  - allow a plugin to add a cov notification : a plugin can define a function to custom send cov notification add it in AppConfig as: def pyscada_send_cov_notification(self, variable)
  - JS: variable to disable default data handling : Use to provide other data handling in a plugin
  - check the rights of users in a view to read or write data : any model which has a group display permission or any WidgetContentModel subclass model shoud have a data_objects function. This function return a dict of:
    - variable or variable_property the user is allowed to read data from
    - variable_write and variable_property_write the user is allowed to write to
  - add the view id to requests (get_cache_data, write_task and write_property)
  - upgrade to django >= 5.2
  - JS: compare new and old color before updating color and sending event
  - remove pkg_resources import and setuptools dependency : replaced by importlib.metadata, see https://setuptools.pypa.io/en/latest/pkg_resources.html
  - add numpy requirement and remove hdf5-103 which is in hdf5-dev
  - remove access to not visible view
  - fix variable protocol save and delete : when saving a variable, the related variable protocol (modbusvariable for example) should be saved , even if the modbus variable config is empty. When changing the device of a vaiable, if the protocol change, (modbus to visa for example), the related modbus variable should be deleted and the visa variable should be created.
  - add tests for read values : fix timestamp and date_saved_max to pass the tests
  - add js tests to add fetched data : fix fetched data fucntion to pass the tests
  - Add device and variable handler parameters
  - Allow anonymous access : use the anonymous group display permission to configure and allow in the settings using PYSCADA_ALLOW_ANONYMOUS and PYSCADA_ALLOW_ANONYMOUS_WRITE
  - home page is set in settings using PYSCADA_HOME
  - added option to add links to external urls in the view-overview
  - renamed write_multible, read_multible, last_value to write_datapoints, query_datapoints and last_datapoint to make the funktion more clear
  - added last_datapoint, query_datapoints, write_datapoints, write_raw_datapoints to Variable model as a shortcut to Variable.objects.METHOD(variable=self)
  - consolidated unit of timestamps internaly to s in python and ms in JS code
  - general code cleanup
  - removed unused filter_time and get_values_in_time_range method from RecordedDataManager
  - removed unused get_first_element_timestamp from DjangoDatabase datasource
  - moved DjangoDatasource to separate sub app -> Update of settings.py is nessesary, see update.rst
  - migrated from setup.py to pyproject.toml
  - updated device_protocol list to include MQTT and Influxdb plugins
  - added new datasource to store values only in the cache
  - added new datasource to store only the most recent value in the database



================================================
FILE: LICENSE
================================================
                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.

  A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate.  Many developers of free software are heartened and
encouraged by the resulting cooperation.  However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.

  The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community.  It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server.  Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.

  An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals.  This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU Affero General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Remote Network Interaction; Use with the GNU General Public License.

  Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software.  This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source.  For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code.  There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.


================================================
FILE: MANIFEST.in
================================================
include AUTHORS
include LICENSE
include README.rst
include CHANGELOG.txt
recursive-include pyscada/templates *
recursive-include pyscada/fixtures *
recursive-include pyscada/hmi/fixtures *
recursive-include pyscada/hmi/templates *
recursive-include pyscada/hmi/static *
recursive-include pyscada/core/*
recursive-include pyscada/django_datasource/*
recursive-include docs *
recursive-exclude * *.pyc
recursive-exclude pyscada/report *


================================================
FILE: README.rst
================================================
PyScada a open source SCADA system
==================================

A Open Source SCADA System with HTML5 HMI, build using the Django framework. If you like to setup your own SCADA system head over to http://pyscada.rtfd.io.

Features
--------

* HTML5 based HMI
* Supports the following

 * industrial Protocols

  * `Modbus <https://github.com/pyscada/PyScada-Modbus>`_ TCP/IP - RTU - ASCII - Binary (using `pyModbus <https://github.com/pymodbus-dev/pymodbus>`_)
  * `Phant <https://github.com/pyscada/PyScada-Phant>`_ (see http://phant.io/)
  * `VISA <https://github.com/pyscada/PyScada-VISA>`_ (using `pyVISA <https://pypi.python.org/pypi/PyVISA>`_)
  * `1-Wire <https://github.com/pyscada/PyScada-OneWire>`_
  * `BACNet/IP <https://github.com/pyscada/PyScada-BACNet>`_ (in development) (using `BACpypes <https://github.com/JoelBender/bacpypes>`_ and `BAC0 <https://github.com/ChristianTremblay/BAC0>`_)
  * `MeterBus (MBus) <https://github.com/pyscada/PyScada-MeterBus>`_ (in development) (using `pyMeterBus <https://github.com/ganehag/pyMeterBus/>`_)
  * `SMBus <https://github.com/pyscada/PyScada-SMBus>`_ (using `smbus2 <https://github.com/kplindegaard/smbus2>`_)
  * `GPIO <https://github.com/pyscada/PyScada-GPIO>`_ (using `RPi.GPIO <https://pypi.org/project/RPi.GPIO/>`_)
  * `SystemStat <https://github.com/pyscada/PyScada-SystemStat>`_
  * `OPC-UA <https://github.com/clavay/PyScada-OPCUA>`_ (using `opcua-asyncio <https://github.com/FreeOpcUa/opcua-asyncio>`_)
  * `SML (Smart Meter Language) <https://github.com/gkend/PyScada-SML>`_ (using `pySML <https://github.com/mtdcr/pysml>`_)
  * `File read/write <https://github.com/pyscada/PyScada-File>`_
  * `Serial <https://github.com/clavay/PyScada-Serial>`_
  * `WebService <https://github.com/clavay/PyScada-WebService>`_

 * devices

  * Generic dummy device
  * `PT104 <https://github.com/pyscada/PyScada-PT104>`_ (using `Pico PT-104 <https://www.picotech.com/data-logger/pt-104/high-accuracy-temperature-daq>`_)

 * scripts

  * `Scripting <https://github.com/pyscada/PyScada-Scripting>`_

 * system tools

  * `EMS <https://github.com/pyscada/PyScada-EMS>`_

 * event management, data export, mail notification

* very low Hardware requirements for the server

Structure
---------

.. image:: https://github.com/pyscada/PyScada/raw/master/docs/pic/PyScada_module_overview.png
    :width: 600px

Dependencies
------------

- core/HMI
	* python>=3.8
	* django==4.2
	* numpy>=1.6.0
	* pillow
	* python-daemon

What is Working
---------------

 - Modbus TCP/RTU/BIN
 - Visa (at least for the devices in the visa/devices folder)
 - Systemstat
 - OneWire (only DS18B20)
 - phant (no known issues)
 - smbus (at least for the devices in the smbus/devices folder)
 - gpio (at least for the raspberry pi)
 - webservice (json and xml parsing)
 - systemstat
 - scripting
 - event (no known issues)
 - export (no known issues)
 - hmi (no known issues)

What is not Working/Missing
---------------------------

 - Documentation
 - SysV init daemon handling
 - BACNet (due to the lack of hardware to test)
 - OPC-UA (need more tests)
 - MeterBus (need more tests)


Installation
------------

Detailed installation instruction can be found at: http://pyscada.rtfd.io .


Contribute
----------

 - Issue Tracker: https://github.com/pyscada/PyScada/issues
 - Source Code: https://github.com/pyscada/PyScada


License
-------

The project is licensed under the _GNU Affero General Public License v3 (AGPLv3).


================================================
FILE: docker/docker-compose.yml-tmp
================================================
version: '3'
services:
  pyscada:
    build: pyscada
    container_name: pyscada
    #volumes:
    tty: true
    depends_on:
      - db
    volumes:
      - "http:/src/pyscada/http"
      - "sock:/src/pyscada/tmp"

  nginx:
    image: nginx:latest
    build: nginx
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "http:/var/www/http"
      - "sock:/tmp"
    depends_on:
      - pyscada

  db:
    image: mysql
    container_name: mysql
    restart: always
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
      MYSQL_DATABASE: 'PyScada_db'
      MYSQL_USER: 'PyScada-user'
      MYSQL_PASSWORD: 'PyScada-user-password'
    volumes:
      - dbdata:/var/lib/mysql
volumes:
  http:
  sock:
  dbdata:


================================================
FILE: docker/mysql/Dockerfile-tmp
================================================

## Pull the mysql:5.6 image
FROM mysql:latest

## The maintainer name and email
LABEL maintainer="PyScada | Martin Schröder <info@martin-schroeder.net"

# Install requirement (wget)
#RUN apt-get update && apt-get install -y wget

RUN mysql -e "CREATE DATABASE PyScada_db CHARACTER SET utf8;GRANT ALL PRIVILEGES ON PyScada_db.* TO 'PyScada-user'@'localhost' IDENTIFIED BY 'PyScada-user-password';"


================================================
FILE: docker/nginx/Dockerfile
================================================
FROM nginx:latest

LABEL maintainer="PyScada | Martin Schröder <info@martin-schroeder.net"

COPY nginx.conf /etc/nginx/
COPY ssl/pyscada_server.crt /etc/nginx/ssl/
COPY ssl/pyscada_server.key /etc/nginx/ssl/
#RUN ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled
EXPOSE 80
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]


================================================
FILE: docker/nginx/nginx.conf
================================================
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##
        gzip on;

        # pyscada.conf

        # the upstream component nginx needs to connect to
        upstream app_server {
                server unix:/tmp/gunicorn.sock fail_timeout=0; # for a file socket
        }

        # configuration of the server
        #server {
        #    listen      80;
        #    listen   [::]:80;
        #    server_name _;          # substitute your machine's IP address or FQDN
        #    return 301 https://$host$request_uri;
        #}

        server {
                listen      80 default_server;
                listen   [::]:80;
                listen   443 ssl;
                listen [::]:443 ssl;

                server_name _;          # substitute your machine's IP address or FQDN

                charset utf-8;
                keepalive_timeout 5;
                client_max_body_size 75M;   # max upload size, adjust to taste
                # please comment if https is not used
                ssl_certificate     /etc/nginx/ssl/pyscada_server.crt; # The certificate file
                ssl_certificate_key /etc/nginx/ssl/pyscada_server.key; # The private key file

                # Django media
                location /media  {
                        alias /var/www/http/media;  # your Django project's media files - amend as required
                }

                location /static {
                        alias /var/www/http/static; # your Django project's static files - amend as required
                }

                location /measurement {
                        alias /var/www/http/measurement_data_dumps; # to support download of measurement files via admin backend - amend as required
                }

                location / {
                    # checks for static file, if not found proxy to app
                    try_files $uri @proxy_to_app;
                }

                location @proxy_to_app {
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $http_host;
                    proxy_redirect off;
                    proxy_pass   http://app_server;
                }
        }
}

================================================
FILE: docker/pyscada/Dockerfile
================================================
FROM python:latest
LABEL maintainer="PyScada | Martin Schröder"
ENV DEBIAN_FRONTEND noninteractive

#RUN apt-get -y update && \
#    apt-get -y upgrade && \
#    apt-get -y install python3-mysqldb libmysqlclient-dev && \
#    apt-get purge && \
#    apt-get clean && \
#    rm -rf /var/lib/apt/lists/*

ENV LANG C.UTF-8

COPY project_template.zip /src/pyscada/
COPY pyscada.zip /src/pyscada/
COPY pyscada /src/pyscada/
COPY pyscada_init /src/pyscada/
RUN touch /src/pyscada/pyscada_debug.log
WORKDIR /src/pyscada

RUN pip3 install gunicorn
RUN pip3 install mysqlclient
RUN pip3 install /src/pyscada/pyscada.zip
RUN django-admin startproject PyScadaServer /src/pyscada/ --template /src/pyscada/project_template.zip
RUN chmod +x /src/pyscada/pyscada
RUN chmod +x /src/pyscada/pyscada_init
CMD ["/src/pyscada/pyscada"]


================================================
FILE: docker/pyscada/pyscada
================================================
#!/usr/bin/env sh
echo "Wait for MySQL to Start"
while ! wget --quiet db:3306; do
    sleep 1
done
echo "Start PyScada"
python3 /src/pyscada/manage.py pyscada_daemon start
#python3 /src/pyscada/manage.py runserver "0.0.0.0:8000" --insecure
echo "Start Gunicorn"
/usr/local/bin/gunicorn -b unix:/src/pyscada/tmp/gunicorn.sock -n PyScada -w 8 -- PyScadaServer.wsgi:application

================================================
FILE: docker/pyscada/pyscada_init
================================================
#!/usr/bin/env sh
while ! wget --quiet db:3306; do
    sleep 1
done
python3 /src/pyscada/manage.py migrate
python3 /src/pyscada/manage.py collectstatic --no-input
python3 /src/pyscada/manage.py loaddata color
python3 /src/pyscada/manage.py loaddata units
python3 /src/pyscada/manage.py pyscada_daemon init

================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = PyScada
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

================================================
FILE: docs/backend.rst
================================================
Using the Backend
=================

To use the backend open the HMI in your browser by opening http://127.0.0.1
(replace 127.0.0.1 withe the IP or hostname of your PyScada server) and sign in
with your admin account defined during the :doc:`installation process <../quick_install>`
(*TODO link to createsuperuser* doc).

.. image:: pic/frontend_login.png

After successful login in your see the view overview, to open the admin panel
click on your username in the upper right corner and on *Admin*.

.. image:: pic/frontend_view_overview_admin_empty.png

Now you are in the backend or Admin panel.

.. image:: pic/backend_overview.png


Add a new Device
----------------

To add a new device (e.g. a PLC) open the *Device* Table in the *PyScada Core*
section.

.. image:: pic/backend_core_add_device.png

You will see a empty list. Click on *add device* in the upper right
corner to add a new device (e.g. a modbus device).

.. image:: pic/backend_save_device.png

* Enter a name and a description.
* Choose a pooling interval (time between two variable value read).
* Choose a protocol.
* Enter the necessary informations for that protocol.

(*TODO device protocol setup*)

.. image:: pic/backend_save_modbus_device.png

Add a new Variable
------------------

Enter to *Variables* table in the *PyScada Core* section of the admin panel.
Click on *add variable* in the upper right corner.

.. image:: pic/backend_core_add_variable.png

A Variable has a name and a description, assign the Variable to a Device and
select a Unit of measurement (*TODO* add description off adding a new unit),
activate writable if the value should be changed from the HMI, if the value has
to be scaled in order to be displayed right select the right scaling
(*TODO* add description for adding a scaling).

The *value_class* is the data type in witch the value is represented on the Device
(*TODO* add example).

The *Change Of Value (COV)* is the amount of change of the value to be stored in
the database. It will store new values for that variable if :

.. math::

	| new\_value - last\_value | > COV\_value

or if the last value is older than 1 hour.

So if you want to save all the values, set the COV to ``-1``.


.. image:: pic/backend_core_save_variable.png

Enter the necessary informations for the variable depending of the device protocol.


Short instructions to build the user HMI (frontend)
---------------------------------------------------

In the backend HMI section:

1. Charts, add a new Chart
2. Page, add a Page
3. Widget, add a Widget, select under Page the page you added in 2. and under `Content` the Chart from 1.
	A widget controls the position of every element on a Page.
	Set the position (row, column) and the width of the widget.
4. View, add a View and select the page from 2.
5. (optional) GroupDisplayPermissions, add a new GroupDisplayPermission, (if nessesary add a new Group and add your User to that Group, select all items you created in 1. to 4.)
6. open http://IP/, you should see the new View, if the DAQ is running and there is Data already in the DB, you should see the last 2 Hours of data and the current Data.


The frontend structure :

::


	+-View------------------------------------+
	|                                         |
	| +-Page--------------------------------+ |
	| |                                     | |
	| | +-Widget--------+ +-Widget--------+ | |
	| | |               | |               | | |
	| | | Row 1, Col 1  | | Row 1, Col 2  | | |
	| | | Width 1/2     | | Width 1/2     | | |
	| | | +-Chart-----+ | | +-Chart-----+ | | |
	| | | |           | | | |           | | | |
	| | | +-----------+ | | +---------- + | | |
	| | +---------------+ +---------------+ | |
	| +-------------------------------------+ |
	+-----------------------------------------+




Add a new View
--------------

to be continued...


Add a new Page
--------------

to be continued...


Add a new Chart
---------------

to be continued...

Add a new Control Panel
-----------------------

to be continued...


================================================
FILE: docs/command-line.rst
================================================
Command-line
============

Restart the PyScada Daemons
---------------------------

systemd:

.. code-block:: shell

	sudo systemctl restart pyscada

Restart Gunicorn
----------------

systemd:

.. code-block:: shell

	sudo systemctl restart gunicorn.service

Restart NGINX
-------------

systemd:

.. code-block:: shell

	sudo systemctl restart nginx

Get Installed PyScada Version
-----------------------------

.. code-block:: shell

	cd /var/www/pyscada/PyScadaServer
	sudo -u pyscada python3 manage.py shell
	import pyscada
	pyscada.core.__version__
	exit()


Export Recorded Data Tables
---------------------------

.. code-block:: shell

	sudo -u pyscada python3 manage.py PyScadaExportData # last 24 houres
	sudo -u pyscada python3 manage.py PyScadaExportData --start_time "01-03-2015 00:00:00" # from 01. of March 2015 until now
	# from 01. of March until now, with the given filename
	sudo -u pyscada python3 manage.py PyScadaExportData --start_time "01-Mar-2015 00:00:00" --filename "filename.h5"
	# from 01. of March until 10. of March, with the given filename
	sudo -u pyscada python3 manage.py PyScadaExportData --start_time "01-03-2015 00:00:00" --filename "filename.h5" --stop_time "10-03-2015 00:00:00"


================================================
FILE: docs/conf.py
================================================
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "PyScada"
copyright = "2023, Martin Schröder, Camille Lavayssiere"
author = "Martin Schröder, Camille Lavayssiere"

# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "0.8.3"


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []

# Set JavaScript source paths
js_source_path = "../pyscada/hmi/static/pyscada/js/pyscada"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "default"

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself.  Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "PyScadadoc"


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',
    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',
    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',
    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, "PyScada.tex", "PyScada Documentation", "Martin Schröder", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "pyscada", "PyScada Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (
        master_doc,
        "PyScada",
        "PyScada Documentation",
        author,
        "PyScada",
        "One line description of project.",
        "Miscellaneous",
    ),
]

html_context = {
    "display_github": True,  # Integrate GitHub
    "github_user": "pyscada",  # Username
    "github_repo": "PyScada",  # Repo name
    "github_version": "master",  # Version
    "conf_py_path": "/docs/",  # Path in the checkout to the docs root
}


================================================
FILE: docs/control_item.rst
================================================
Control item
============

Control items are elements of crontol panels which have two functions by default:

- display the last value of a variable,
- control the value of a variable.

To create one in the administration interface, you need at least to:

- enter a label,
- select a variable OR a variable property.
- chose a type : display the value or control the value of the variable/variable property,

You can also:

- select the order in the control panel using the position attribute : lower is at the top of the control panel,
- add options using display value options or control element options.

Display value options
---------------------

It allows adding options to a control item configured to display value.

To create one in the administration interface, you need at least to:

- enter a title,
- choose a template to change the graphic rendering,
- choose if you want to replace a timestamp value by a human readable format,
- transform the data before show it in the user interface: see section below,
- apply color levels: see section below.

### Transform data

#### Usage (configuration)

You can use a data transformation to pass the data through a function before displaying it (for example, display the minimum of the variable in the selected time range).

You may need to specify additional information at the bottom depending on the tranformation needs (as for the Count Value transformation).

#### Creation (developer)

A plugin can add a new transform data to the list.

To do so you can create them automatically in the *ready* function of the *AppConfig* class in *apps.py*.
Have a look at the [*hmi.apps.py*](https://github.com/pyscada/PyScada/blob/main/pyscada/hmi/apps.py).

The fields of a transform data are :
- inline_model_name : the model name to add an inline to the admin page which can add additional fields needed by the transform data function (as TransformDataCountValue for the Count Value function),
- short_name : the name displayed in the admin interface,
- js_function_name : the name of the JavaScript function which will be called to transform the data,
- js_files : a coma separated list of the JavaScript files to add,
- css_files : a coma separated list of the CSS files to add,
- need_historical_data : set to True if the transform data function needs the variable data for the whole period selected by the date time range picker, set to False if it only needs the last value.

### Template

You can choose a specific template to display you control item.

#### Creation (developer)

A plugin can add a new control item template.

To do so you can create them automatically in the *ready* function of the *AppConfig* class in *apps.py*.
Have a look at the [*hmi.apps.py*](https://github.com/pyscada/PyScada/blob/main/pyscada/hmi/apps.py).

The fields of a template are :
- label the template name to display,
- template_name : the file name to use,
- js_files : a coma separated list of the JavaScript files to add,
- css_files : a coma separated list of the CSS files to add.


================================================
FILE: docs/develop.rst
================================================
.. IMPORTANT::
    To use PyScada in developer mode, you should install it using the `pip editable mode (-e) <https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-e>`_

For developers
==============

Activate PyScada virtual environment
------------------------------------

.. code-block:: shell

    source /home/pyscada/.venv/bin/activate


Cloning the repository
----------------------

.. code-block:: shell

    git clone git@github.com:pyscada/PyScada.git

For a plugin like PyScada-Modbus :

.. code-block:: shell

    git clone git@github.com:pyscada/PyScada-Modbus.git


Pip editable installation
-------------------------

After activating the virtual environment :

.. code-block:: shell

    sudo -u pyscada -E env PATH=${PATH} pip3 install -e ./PyScada

For a plugin like PyScada-Modbus :

.. code-block:: shell

    sudo -u pyscada -E env PATH=${PATH} pip3 install -e ./PyScada-Modbus


Restarting the application
--------------------------

After activating the virtual environment, to apply you changes, depending on them, may need to :

create migrations

.. code-block:: shell

    python3 /var/www/pyscada/PyScadaServer/manage.py makemigrations

apply them

.. code-block:: shell

    python3 /var/www/pyscada/PyScadaServer/manage.py migrate

copy static files (answer yes).

.. code-block:: shell

    sudo -u pyscada -E env PATH=${PATH} python3 /var/www/pyscada/PyScadaServer/manage.py collectstatic

Then you can :

For urls, views or admin changes, restart gunicorn.

.. code-block:: shell

    sudo systemctl restart gunicorn

Otherwise restart PyScada.

.. code-block:: shell

    sudo systemctl restart pyscada


Override routes
----------------

This use case is encountered when you wish to rewrite an existing view (and therefore an existing route).

The PyScada project's ``urls.py`` file is used to load the software's routes (see `here <https://docs.djangoproject.com/en/4.2/topics/http/urls/>`_).

* python virtual environment installation: located in ``/var/www/pyscada/PyScadaServer/PyScadaServer``
* Docker installation: located in ``/src/pyscada/PyScadaServer/PyScadaServer``


By default, the project's ``urls.py`` file loads only the ``urls.py`` file from ``pyscada.core``. The ``pyscada.core.urls`` file loads all the other modules ``urls.py`` files in random order.

The route used is the first valid one encountered, so if you want to replace an existing route, you have to load your route before the others, i.e. before loading ``pyscada.core.urls`` file.

To do this, you need to modify your project's ``urls.py`` file.

For a non-docker installation :

.. code-block:: shell

    sudo -u pyscada nano /var/www/pyscada/PyScadaServer/PyScadaServer/urls.py


And include your route before pyscada.core.urls

.. code-block:: shell

    urlpatterns = [
    path('', include('pyscada.yourPlugin.urls')), #Routing file yourPlugin
    path('', include('pyscada.core.urls')),
    ]




================================================
FILE: docs/device_protocol.rst
================================================
Device Protocol IDs
--------------------


- 1: Reserved (Scheduler)
- 2: `SystemStat <https://github.com/pyscada/PyScada-SystemStat>`_
- 3: `Modbus <https://github.com/pyscada/PyScada-Modbus>`_
- 4: `BACNet <https://github.com/pyscada/PyScada-BACNet>`_
- 5: `VISA <https://github.com/pyscada/PyScada-VISA>`_
- 6: `1-Wire <https://github.com/pyscada/PyScada-OneWire>`_
- 7: `Phant <https://github.com/pyscada/PyScada-Phant>`_
- 8: `SMBus <https://github.com/pyscada/PyScada-SMBus>`_
- 9: Reserved (Jofra350)
- 10: `GPIO <https://github.com/pyscada/PyScada-GPIO>`_
- 11: `Reserved (PT104) <https://github.com/pyscada/PyScada-PT104>`_
- 12: `OPC-UA <https://github.com/clavay/PyScada-OPCUA>`_
- 13: `SML (Smart Meter Language) <https://github.com/gkend/PyScada-SML>`_
- 14: `File <https://github.com/pyscada/PyScada-File>`_
- 15: `MeterBus (MBus) <https://github.com/pyscada/PyScada-MeterBus>`_
- 16: Generic dummy device
- 17: `EMS <https://github.com/pyscada/PyScada-EMS>`_
- 18: `Operations <https://github.com/pyscada/PyScada-Operations>`_
- 19: `Aggregation <https://github.com/pyscada/PyScada-Operations>`_
- 20: `MQTT <https://github.com/pyscada/PyScada-MQTT>`_
- 21: `Influxdb-Datasource <https://github.com/pyscada/PyScada-Influxdb>`_
- 8X: Custom Worker
- 93 `Reserved (Serial) <https://github.com/clavay/PyScada-Serial>`_
- 94 `Reserved (WebService) <https://github.com/clavay/PyScada-WebService>`_
- 95: `Reserved (Scripting) <https://github.com/pyscada/PyScada-Scripting>`_
- 96: Reserved (Event)
- 97: Reserved (Mail)
- 98: Reserved (Report)
- 99: reserved (Export)
- 100+: reserved for dynamic


================================================
FILE: docs/django_settings.rst
================================================
Django Settings
===============


urls.py
-------


Open the urls configuration file and add the necessary rewrite rule to the django URL dispatcher.

::

    nano /var/www/pyscada/PyScadaServer/PyScadaServer/urls.py


::

    ...
    from django.conf.urls import url, include
    from django.contrib import admin

    urlpatterns = [
        url(r'^admin/', admin.site.urls),
        url(r'^', include('pyscada.core.urls')),
    ]
    ...



settings.py
-----------


Open the django settings file and make the following modifications. See also the `django documentation <https://docs.djangoproject.com/en/1.8/ref/settings/>`_ for more Information.

::

    nano /var/www/pyscada/PyScadaServer/PyScadaServer/settings.py


First deactivate the debugging, if debugging is active django will keep all SQL queries in the ram, the data-acquisition
runs a massive amount of queries so your system will run fast out of memory. Keep in mind to restart gunicorn and the
pysada daemons after you change the debugging state.

::

    DEBUG = False


Add the host/domain of your machine, in this case every url that point to a ip of the machine is allowed.

::

    ALLOWED_HOSTS = ['*']


Add PyScada and the PyScada sub-apps to the installed apps list of Django.

::

    INSTALLED_APPS = [
        ...
        'pyscada',
        'pyscada.modbus',
        'pyscada.phant',
        'pyscada.visa',
        'pyscada.hmi',
        'pyscada.systemstat',
        'pyscada.export',
        'pyscada.onewire',
        'pyscada.smbus',
    ]

To use the MySQL Database, fill in the database, the user and password as selected in the *create Database section*.

::

    DATABASES = {
        'default': {
            'ENGINE':   'django.db.backends.mysql',
            'NAME':     'PyScada_db',
            'USER':     'PyScada-user',
            'PASSWORD': 'PyScada-user-password',
            'OPTIONS': {
                'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
            }
        }
    }


Set the static file and media dir as follows.

::

    ...
    STATIC_URL = '/static/'

    STATIC_ROOT = '/var/www/pyscada/http/static/'

    MEDIA_URL = '/media/'

    MEDIA_ROOT = '/var/www/pyscada/http/media/'


Add all PyScada specific settings, keep in mind to set the file right file encoding in the `settings.py` file header (see also https://www.python.org/dev/peps/pep-0263/).

::

    #!/usr/bin/python
    # -*- coding: <encoding name> -*-


Append to the end of the `settings.py`:

::

    # PyScada settings
    # https://github.com/trombastic/PyScada

    # email settings
    DEFAULT_FROM_EMAIL = 'example@host.com'
    EMAIL_HOST = 'mail.host.com'
    EMAIL_PORT = 587
    EMAIL_HOST_USER = 'pyscada@host.com'
    EMAIL_USE_TLS = True
    EMAIL_USE_SSL = False
    EMAIL_HOST_PASSWORD = 'password'
    EMAIL_PREFIX = 'PREFIX' # Mail subject will be "PREFIX subjecttext"

    # meta information's about the plant site
    PYSCADA_META = {
        'name':'A SHORT NAME',
        'description':'A SHORT DESCRIPTION',
    }

    # export properties
    #
    PYSCADA_EXPORT = {
        'file_prefix':'PREFIX_',
        'output_folder':'~/measurement_data_dumps',
    }

    # View Options
    #
    LINK_TARGET = '_blank' # '_blank' for new tab or '_self' for opening it in the same window

    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'standard': {
                'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
                'datefmt' : "%d/%b/%Y %H:%M:%S"
            },
        },
        'handlers': {
            'file': {
                'level': 'DEBUG',
                'class': 'logging.FileHandler',
                'filename': BASE_DIR + '/pyscada_debug.log',
                'formatter': 'standard',
            },
        },
        'loggers': {
            'django': {
                'handlers': ['file'],
                'level': 'INFO',
                'propagate': True,
            },
            'pyscada': {
                'handlers': ['file'],
                'level': 'DEBUG',
                'propagate': True,
            },
        },
    }


================================================
FILE: docs/docker.rst
================================================
.. IMPORTANT::
    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your computer,
    automation hardware and data. It is not intended for use in production systems! You use this Software on your own risk!

Docker
======

This guide covers the basic setup of PyScada with `Docker <https://www.docker.com/>`_ and `Docker Compose <https://docs.docker.com/compose/>`_.

Download the necessary files
----------------------------

First of all download the docker config files for building your images.

Using Git.

::

    git clone https://github.com/pyscada/PyScada.git
    cd PyScada/docker

Using wget.

::

    wget -qO- -O tmp.zip https://github.com/pyscada/PyScada/archive/refs/heads/master.zip && unzip tmp.zip && rm tmp.zip
    cd PyScada-master/docker


Generating SSL Certificates
---------------------------

Generate ssl certificates for using ssl.

::

    mkdir nginx/ssl
    cd nginx/ssl
    openssl req -x509 -nodes -days 1780 -newkey rsa:2048 -keyout ./pyscada_server.key -out ./pyscada_server.crt



Build and Run the Image
-----------------------


Build the PyScada Docker Image.

::

    sudo docker-compose build

After the Images have been successfully build we need to initialize the Database and Create a superuser.

::

    sudo docker-compose run pyscada /src/pyscada/pyscada_init
    sudo docker-compose run pyscada /src/pyscada/manage.py createsuperuser

The last step is to start the Container.

::

    sudo docker-compose up -d

If you have an error or a command is stuck, run :

::

    sudo docker-compose down
    sudo docker system prune --force --volumes


================================================
FILE: docs/frontend.rst
================================================
Using the Front-End
===================

The ``settings.py`` file is usually located in ``/var/www/pyscada/PyScadaServer/PyScadaServer/``.

The home page can be defined to be a specific view in the ``settings.py`` file using:

  .. code-block::

      PYSCADA_HOME = "/view/TEST/"

Allowing anonymous access permission is defined in the ``settings.py`` file using:

  .. code-block::

      PYSCADA_ALLOW_ANONYMOUS = True
      PYSCADA_ALLOW_ANONYMOUS_WRITE = True


================================================
FILE: docs/grafana.rst
================================================
Use Grafana
===========

Mysql
-----

Add user and give SELECT rights :

.. code-block:: shell

  sudo mysql -uroot -p -e "GRANT SELECT ON PyScada_db.* TO 'Grafana-user'@'localhost' IDENTIFIED BY 'Grafana-user-password';"

Nginx
-----

Add in `/etc/nginx/nginx.conf` after ``http { ... }`` :

::

  include /etc/nginx/grafana-access.conf;

Create `/etc/nginx/grafana-access.conf` with :

::

  stream {
    # MySQL server
    server {
      listen     3305;
      proxy_pass 127.0.0.1:3306;
      proxy_timeout 60s;
      proxy_connect_timeout 30s;
    }
  }

Restart Nginx :

.. code-block:: shell

  sudo systemctl restart nginx

Grafana
-------

Add MySQL datasource :

- Host :

  - Local : `/run/mysqld/mysqld.sock`
  - Remote : SERVER_WITH_NGINX_IP:3305

- Database : ``PyScada_db``
- User : ``Grafana-user``
- Password : ``Grafana-user-password``

Create a dashboard:

- Or import the `example dashboard <https://github.com/pyscada/PyScada/blob/master/extras/Grafana-test-dashboard.json>`_.

- Or for example, add theses variables : set ``refresh on dashboard load``, ``multi-value`` and ``all option`` :

  - Add mysql datasource variable (type Datasource).
  - Add variables with type query using ``$Datasource`` :

    - Protocols : ``SELECT protocol AS __text, id AS __value FROM pyscada_deviceprotocol``
    - Devices : ``SELECT d.short_name AS __text, d.id AS __value FROM pyscada_device d WHERE d.protocol_id IN (${Protocols}) AND d.active = 1``
    - Units : ``SELECT u.unit AS __text, u.id AS __value FROM pyscada_unit u``
    - Variables : ``SELECT v.name AS __text, v.id AS __value FROM pyscada_variable v WHERE v.device_id IN (${Devices}) AND v.unit_id IN (${Units}) AND v.active = 1``
    - Time group (type Interval) : ``1s,10s,1m,10m,30m,1h,6h,12h,1d,7d,14d,30d,1M``
    - Null as (type custom) : ``0, NULL, previous``

 - Example query :

  .. code-block::

    SELECT
      $__timeGroupAlias(r.date_saved,$time_group),
      avg(IFNULL(r.value_float64, 0.0) + IFNULL(r.value_int64, 0.0) + IFNULL(r.value_int32, 0.0) + IFNULL(r.value_int16, 0.0) + IFNULL(r.value_boolean, 0.0)),
      v.name AS metric
    FROM pyscada_recordeddata as r
    JOIN pyscada_variable v ON r.variable_id = v.id
    WHERE
      $__timeFilter(r.date_saved) AND
      r.variable_id IN (${Variables})
    GROUP BY time, metric
    ORDER BY $__timeGroup(r.date_saved,$time_group,$null_as)

Embed in pyscada HMI
--------------------

Edit Grafana config file:

.. code-block:: shell

  sudo nano /etc/grafana/grafana.ini

Find and set :
  - allow_embedding = true
  - For localhost grafana : root_url = http://localhost:3000/grafana/

For localhost grafana add in `/etc/nginx/sites-enabled/pyscada.conf` :

::

  location /grafana/ {
    proxy_pass http://127.0.0.1:3000/;
  }

Restart Grafana server:

.. code-block:: shell

  sudo systemctl restart grafana-server.service

Create a custom html panel with the code from a dashboard or a panel from sharing options in grafana

Other
-----

use ssl : http://www.turbogeek.co.uk/2020/09/30/grafana-how-to-configure-ssl-https-in-grafana/


================================================
FILE: docs/index.rst
================================================
.. PyScada documentation master file, created by
   sphinx-quickstart on Mon May 27 13:14:28 2019.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to PyScada's documentation!
===================================

A Open Source SCADA System with HTML5 HMI, build using the Django framework. If you like to setup your own _SCADA_ system head over to the :doc:`installation` section.

.. toctree::
   :maxdepth: 2
   :caption: Installation and Commandline

   quick_install
   plugin_install
   update
   command-line
   frontend
   backend
   device_protocol
   grafana
   develop

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


================================================
FILE: docs/installation.rst
================================================

.. IMPORTANT::
    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your computer,
    automation hardware and data. It is not intended for use in production systems! You use this Software on your own risk!



Installation
============

This installation guide covers the installation of PyScada for `Debian 10/11 <https://www.debian.org/>`_ ,
`Raspberry Pi OS <https://www.raspberrypi.com/software/>`_, `Fedora 22/23 <https://www.fedoraproject.org/>`_ based Linux systems
using `MySQL <https://www.mysql.com/>`_ / `MariaDB <https://mariadb.com/>`_ or `SQLite <https://www.sqlite.org/>`_ as Database,
`Gunicorn <http://gunicorn.org/>`_ as WSGI HTTP Server and `nginx <http://nginx.org/>`_ as HTTP Server.

Automatic installation using a script
-------------------------------------

On the Raspberry Pi with internet connection run :

::

    wget https://raw.githubusercontent.com/clavay/PyScada-Laborem/master/extras/install.sh -O install.sh
    sudo chmod a+x install.sh
    sudo ./install.sh


Dependencies
------------

.. js:autofunction:: toggle_timeline
   :short-name:

.. autofunction:: pyscada.models.Device.__str__


Debian 9, Raspbian
^^^^^^^^^^^^^^^^^^

::

    sudo -i
    apt-get update
    apt-get -y upgrade
    # if you use MariaDB/MySQL as Database system (recommend)
    apt-get -y install mariadb-server python3-mysqldb
    apt-get install -y python3-pip libhdf5-103 libhdf5-dev python3-dev nginx

    pip3 install gunicorn
    pip3 install pyserial
    pip3 install docutils


macOS
^^^^^

 - `MySQL Server <https://www.mysql.de/>`
 - HDF5 TODO	


::

        brew install python
        export PATH=$PATH:/usr/local/mysql/bin
        pip install MySQL-python


all
^^^^

::

    sudo -i
    pip3 install https://github.com/pyscada/PyScada/archive/master.zip

    # for VISA Protocol
    pip3 install pyvisa pyvisa-py
    # for 1Wire Protocol
    apt-get install owfs #
    pip3 install pyownet
    # for smbus Protocol, install libffi-dev first!
    apt-get install libffi-dev
    pip3 install smbus-cffi




Add a new system-user for Pyscada (optional, recommend)
-------------------------------------------------------

Add a dedicated user for the pyscada server instance and add a directory for `static`/`media` files.


Linux
^^^^^

::

    sudo -i
    useradd -r pyscada
    mkdir -p /var/www/pyscada/http
    chown -R pyscada:pyscada /var/www/pyscada
    mkdir -p /home/pyscada
    chown -R pyscada:pyscada /home/pyscada


macOS
^^^^^

::

    sudo -i
    dscl . -create /Users/pyscada IsHidden 1
    dscl . -create /Users/pyscada NFSHomeDirectory /Users/pyscada
    LastID=`dscl . -list /Users UniqueID | awk '{print $2}' | sort -n | tail -1`
    NextID=$((LastID + 1))
    dscl . create /Users/pyscada UniqueID $NextID
    dscl . create /Users/pyscada PrimaryGroupID 20
    mkdir -p /var/www/pyscada/http
    chown -R pyscada:staff /var/www/pyscada/



Create a MySql Database
-----------------------

Create the Database and grand the nessesery permission. Replace `PyScada_db`, `PyScada-user` and `PyScada-user-password` as you like.

::

    mysql -uroot -p -e "CREATE DATABASE PyScada_db CHARACTER SET utf8;GRANT ALL PRIVILEGES ON PyScada_db.* TO 'PyScada-user'@'localhost' IDENTIFIED BY 'PyScada-user-password';"



Create a new Django Project
---------------------------

::

    # Linux/OSX
    cd /var/www/pyscada/
    sudo -u pyscada django-admin startproject PyScadaServer



see :doc:`django_settings` for all necessary adjustments to the django settings.py and urls.py.


Initialize Database And Copy Static Files
-----------------------------------------

::


    cd /var/www/pyscada/PyScadaServer # linux
    sudo -u pyscada python3 manage.py migrate
    sudo -u pyscada python3 manage.py collectstatic

    # load fixtures with default configuration for chart lin colors and units
    sudo -u pyscada python3 manage.py loaddata color
    sudo -u pyscada python3 manage.py loaddata units

    # initialize the background service system of pyscada
    sudo -u pyscada python3 manage.py pyscada_daemon init



Add a Admin User To Your Django Project
---------------------------------------

::

    cd /var/www/pyscada/PyScadaServer
    sudo -u pyscada python3 manage.py createsuperuser


Setup the Webserver (nginx, gunicorn)
-------------------------------------


::


    # debian
    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/nginx_sample.conf -O /etc/nginx/sites-available/pyscada.conf

    # Fedora
    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/nginx_sample.conf -O /etc/nginx/conf.d/pyscada.conf


after editing, enable the configuration and restart nginx, optionally remove the default configuration

to use ssl (https, recommend)
-----------------------------

generate ssl certificates.


::

        # for Debian, Ubuntu, Raspian
        sudo mkdir /etc/nginx/ssl
        # the certificate will be valid for 5 Years,
        sudo openssl req -x509 -nodes -days 1780 -newkey rsa:2048 -keyout /etc/nginx/ssl/pyscada_server.key -out /etc/nginx/ssl/pyscada_server.crt

::

    # debian
    sudo ln -s /etc/nginx/sites-available/pyscada.conf /etc/nginx/sites-enabled/
    sudo rm /etc/nginx/sites-enabled/default

now it's time to [re]start nginx.

::

    # systemd (Debian 8, Fedora, Ubuntu > XX.XX)
    sudo systemctl enable nginx.service # enable autostart on boot
    sudo systemctl restart nginx

    # SysV-Init (Debian 7, Ubuntu <= XX.XX, [Debian 8])
    sudo service nginx restart



for Fedora you have to allow nginx to serve the static and media folder.

::

    sudo chcon -Rt httpd_sys_content_t /var/www/pyscada/http/


add gunicorn and pyscada unit files:

::

    # systemd
    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/service/systemd/gunicorn.socket -O /etc/systemd/system/gunicorn.socket
    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/service/systemd/gunicorn.service -O /etc/systemd/system/gunicorn.service
    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/service/systemd/pyscada_daemon.service -O /etc/systemd/system/pyscada.service

    # in some installations gunicorn is not at /usr/local/bin/gunicorn but at /usr/bin/gunicorn
    # in this case you have to change the pat in the file /etc/systemd/system/gunicorn.service accordingly

    # enable the services for autostart
    sudo systemctl enable gunicorn
    sudo systemctl start gunicorn
    sudo systemctl enable pyscada


Start PyScada
-------------

::

    sudo systemctl start pyscada




================================================
FILE: docs/make.bat
================================================
@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	echo.  coverage   to run coverage check of the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)


REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 2> nul
if errorlevel 9009 goto sphinx_python
goto sphinx_ok

:sphinx_python

set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

:sphinx_ok


if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PyScada.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PyScada.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "coverage" (
	%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end


================================================
FILE: docs/nginx_setup.rst
================================================
Nginx Setup
===========


nginx configuration
-------------------


::
        
        # debian
        sudo wget https://raw.githubusercontent.com/trombastic/PyScada/dev/0.7.x/extras/nginx_sample.conf -O /etc/nginx/sites-available/pyscada.conf
        sudo nano /etc/nginx/sites-available/pyscada.conf
        # Fedora
        sudo wget https://raw.githubusercontent.com/trombastic/PyScada/dev/0.7.x/extras/nginx_sample.conf -O /etc/nginx/conf.d/pyscada.conf
        sudo nano /etc/nginx/conf.d/pyscada.conf


after editing, enable the configuration and restart nginx, optionaly remove the default configuration

::

        # debian
        sudo ln -s /etc/nginx/sites-available/pyscada.conf /etc/nginx/sites-enabled/
        sudo rm /etc/nginx/sites-enabled/default



to use ssl
----------

generate ssl certificates.



::

        # for Debian, Ubuntu, Raspian
        sudo mkdir /etc/nginx/ssl
        # the certificate will be valid for 5 Years,
        sudo openssl req -x509 -nodes -days 1780 -newkey rsa:2048 -keyout /etc/nginx/ssl/pyscada_server.key -out /etc/nginx/ssl/pyscada_server.crt





now it's time to [re]start nginx.


::


        # SysV-Init
        sudo service nginx restart
        # systemd
        systemctl enable nginx.service # enable autostart on boot
        sudo systemctl restart nginx


for Fedora you have to allow nginx to serve the static and media folder.

::
        
        sudo chcon -Rt httpd_sys_content_t /var/www/pyscada/http/

================================================
FILE: docs/phant.rst
================================================
Phant Installation
==================

add the following line to the urls.py:

::

   url(r'^', include('pyscada.phant.urls')),




================================================
FILE: docs/plugin_install.rst
================================================
PyScada plugin installation
===========================

1. Choose a method to download  the PyScada plugin (exemple using PyScada-Modbus) :

  - by cloning the repository :

  .. code-block:: shell

      sudo apt install git
      cd /home/pyscada
      sudo -u pyscada git clone https://github.com/pyscada/PyScada-Modbus.git
      cd PyScada-Modbus


  - by downloading the zip file and extracting it :

  .. code-block:: shell

      sudo apt install wget
      cd /home/pyscada
      sudo -u pyscada wget https://github.com/pyscada/PyScada-Modbus/archive/refs/heads/main.zip -O PyScada-Modbus-main.zip
      sudo apt install unzip
      sudo -u pyscada unzip ./PyScada-Modbus-main.zip
      sudo -u pyscada rm ./PyScada-Modbus-main.zip
      cd PyScada-Modbus-main

2. Install the PyScada plugin

  Run :

  .. code-block:: shell

      # activate the PyScada virtual environment
      source /home/pyscada/.venv/bin/activate
      # install the plugin
      sudo -u pyscada -E env PATH=${PATH} pip3 install .
      # run migrations
      sudo -u pyscada -E env PATH=${PATH} python3 /var/www/pyscada/PyScadaServer/manage.py migrate
      # copy static files
      sudo -u pyscada -E env PATH=${PATH} python3 /var/www/pyscada/PyScadaServer/manage.py collectstatic --no-input
      # restart gunicorn and PyScada
      sudo systemctl restart gunicorn pyscada


List PyScada plugin installed
-----------------------------

.. code-block:: shell

    # activate the PyScada virtual environment
    source /home/pyscada/.venv/bin/activate
    pip3 list | grep cada


Uninstall a plugin
----------------------

To uninstall a plugin

.. code-block:: shell

    sudo -u pyscada -E env PATH=${PATH} pip3 uninstall yourPlugin

================================================
FILE: docs/quick_install.rst
================================================
.. IMPORTANT::
    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your computer,
    automation hardware and data. It is not intended for use in production systems! You use this Software on your own risk!

Installation
============

This installation guide covers the installation of PyScada for `Debian 10/11 <https://www.debian.org/>`_ ,
`Raspberry Pi OS <https://www.raspberrypi.com/software/>`_ based Linux systems
using `MariaDB <https://mariadb.com/>`_ as Database,
`Gunicorn <http://gunicorn.org/>`_ as WSGI HTTP Server and `nginx <http://nginx.org/>`_ as HTTP Server.

Scripts available
-----------------

The script ``install.sh`` let you choose between 2 installation type : system or docker and create a log file of the installation.

Then it call the script ``install_system.sh`` or ``install_docker.sh`` depending on your choice.

Automatic installation on Debian and derivatives
------------------------------------------------

1. Choose a method to download PyScada (you need write rights in the current directory) :

  - by cloning the repository :

  .. code-block:: shell

      sudo apt install git
      git clone https://github.com/pyscada/PyScada.git
      cd PyScada


  - by downloading the zip file and extracting it :

  .. code-block:: shell

      sudo apt install wget
      wget https://github.com/pyscada/PyScada/archive/refs/heads/main.zip -O PyScada-main.zip
      sudo apt install unzip
      unzip ./PyScada-main.zip
      rm ./PyScada-main.zip
      cd PyScada-main

2. Install PyScada

  .. IMPORTANT::
      For a new installation, make sure to answer "no" to the question "Update only".

  You will have to choose :

  * if you want to install PyScada on the system or in a docker container.
  * if the system date is correct (system install only)
  * if you want to use a proxy (system install only)
  * if you want to install channels and redis to speed up communications inter pyscada processes (system install only)
  * if you want to update only, if not :

    * the DB name, user and password
    * admin name and mail to send error logs (need further django email configuration in settings.py)
    * the first pyscada user credentials
    * if you want installed pyscada plugins to be automatically loaded

  Run :

  .. code-block:: shell

      sudo ./install.sh

Troubleshooting
---------------

If you already installed PyScada using docker, you need to delete the ``db_data`` docker volume using :

.. code-block:: shell

    docker volume rm docker_dbdata


================================================
FILE: docs/raspberryPiOS.rst
================================================
Raspberry Pi OS Installation
============================

Download last Lite image from `here <https://www.raspberrypi.com/software/operating-systems/>`__

Copy the image on the SD card using (change the name of the zip file and the path to the sd card)::

    unzip -p the_zip_file.zip | sudo dd of=/dev/sdX bs=4M conv=fsync status=progress

    or

    xz -dc the_xz_file.xz | sudo dd of=/dev/sdX bs=4M conv=fsync status=progress

More informations `here <https://www.raspberrypi.com/documentation/computers/getting-started.html>`__


================================================
FILE: docs/uninstall.rst
================================================
Installation
============

Depending on what you need on your computer, you may NOT need to remove everything PyScada requires (such as django, mariaDB...).

PyScada
-------

  .. code-block:: shell

      # activate the PyScada virtual environment
      source /home/pyscada/.venv/bin/activate
      # uninstall PyScada
      sudo -u pyscada -E env PATH=${PATH} pip3 uninstall pyscada
      # clean static files
      python /var/www/pyscada/PyScadaServer/manage.py collectstatic --clear --no-input
      # drop the mariaDB database, by default called PyScada_db
      sudo  mysql -u PyScada-user -p -e "DROP DATABASE IF EXISTS database_name PyScada_db;"

Uninstall prerequisites (IMPORTANT: only if not needed by other software !)

  .. code-block:: shell

      # Uninstall prerequisites
      DEB_TO_UNINSTALL="
        libatlas-base-dev
        libffi-dev
        libhdf5-103
        libhdf5-dev
        libjpeg-dev
        libmariadb-dev
        libopenjp2-7
        mariadb-server
        nginx
        python3-dev
        python3-mysqldb
        python3-pip
        python3-venv
        zlib1g-dev
        pkg-config
      "
      sudo apt remove -y $DEB_TO_UNINSTALL

      PIP_TO_UNINSTALL="
        cffi
        Cython
        docutils
        gunicorn
        lxml
        mysqlclient
        numpy
      "
      sudo -u pyscada -E env PATH=${PATH} pip3 uninstall $PIP_TO_UNINSTALL

PyScada plugin
--------------

  .. code-block:: shell

      # activate the PyScada virtual environment
      source /home/pyscada/.venv/bin/activate
      # uninstall PyScada-Plugin
      sudo -u pyscada -E env PATH=${PATH} pip3 uninstall pyscada-plugin
      # clean static files
      python /var/www/pyscada/PyScadaServer/manage.py collectstatic --clear --no-input
      python /var/www/pyscada/PyScadaServer/manage.py collectstatic --no-input
      # clean db, may depend on the plugin
      python /var/www/pyscada/PyScadaServer/manage.py migrate pyscada-plugin zero

Depending on the plugin, you may need to uninstall some packages.


================================================
FILE: docs/update.rst
================================================
Update from old versions
========================

0.6.x to 0.7.x
--------------

Sorry a direct upgrade is not possible, you have to install 0.7.x from scratch.


0.7.0b18 to 0.7.0b19
------------------------


::

    cd /var/www/pyscada/PyScadaServer
    sudo -u pyscada python manage.py migrate
    sudo -u pyscada python manage.py collectstatic
    sudo -u pyscada python manage.py pyscada_daemon init

0.8.x to 0.9x
-------------

Befor the Upgrade:

The folowing lines must be added to the `settings.py` after the `INSTALLED_APPS` section.

::

    pyscada = __import__("pyscada.core")
    if hasattr(pyscada.core, "additional_installed_app"):
        for app in getattr(pyscada.core, "additional_installed_app"):
            INSTALLED_APPS += [
                app,
            ]

After the Upgrade:

- Remove `"pyscada.core"`, `"pyscada.hmi"`, `"pyscada.export"` from `INSTALLED_APPS` in `settings.py`
- (optinal) choose a alternative home page by adding `PYSCADA_HOME = "/view/TEST/"` to the `settings.py`
- (optinal) add `PYSCADA_ALLOW_ANONYMOUS = True` to allow access to the pyscada hmi without login or add `PYSCADA_ALLOW_ANONYMOUS_WRITE = True` to allow write access to the pyscada hmi without login
	- Managing anonymous user display permission for IHM objects (view, page, widget, chart...) is done in the admin panel using the "Group Display Permission" -> "Unauthenticated users" configuration
- Run the folowing command in your pyscada root (where `manage.py` is located) in the pyscada venv

::

    sudo -u pyscada python manage.py migrate
    sudo -u pyscada python manage.py collectstatic
    sudo -u pyscada python manage.py pyscada_daemon init


systemd
-------


::


    sudo wget https://raw.githubusercontent.com/pyscada/PyScada/master/extras/service/systemd/pyscada_daemon.service -O /etc/systemd/system/pyscada_daemon.service
    sudo systemctl enable pyscada_daemon
    sudo systemctl disable pyscada_daq
    sudo systemctl disable pyscada_event
    sudo systemctl disable pyscada_mail
    sudo systemctl disable pyscada_export
    sudo rm /lib/systemd/system/pyscada_daq.service
    sudo rm /lib/systemd/system/pyscada_mail.service
    sudo rm /lib/systemd/system/pyscada_export.service
    sudo rm /lib/systemd/system/pyscada_event.service
    sudo systemctl daemon-reload


================================================
FILE: docs/visa.rst
================================================
Discover VISA devices
=====================

To discover GPIB/USB(/LXI?) devices run:

::

    sudo python3
    import pyvisa
    rm=pyvisa.ResourceManager('@py')
    rm.list_resources()  # example : ('ASRL/dev/ttyAMA0::INSTR', 'USB0::1689::1032::C023569::0::INSTR', 'USB0::1689::851::1525638::0::INSTR')
    inst=rm.open_resource('USB0::1689::851::1525638::0::INSTR'')
    inst.query('*IDN?')  # example : 'TEKTRONIX,AFG1022,1525638,SCPI:99.0 FV:V1.1.2\n'


================================================
FILE: eslint.config.mjs
================================================
export default [
    {
        files: ["**/*.js"],
        rules: {
            "semi": "warn",
            "no-unused-vars": "warn"
        }
    }
];


================================================
FILE: extras/0.7to0.8.sh
================================================
#!/bin/bash

# check if path is passed
if [ $# -eq 0 ]
  then
    manage_path="/var/www/pyscada/PyScadaServer"
    if test -f "$manage_path/manage.py"; then
      echo "$manage_path/manage.py found."
    else
      echo "File $manage_path/manage.py not found. Please specify the path of manage.py."
      exit 1
    fi
else
  if test -f "$1/manage.py"; then
    echo "$1/manage.py found."
    manage_path=$1
  else
    echo "File $1/manage.py not found. Please specify the path of manage.py or let empty tu use the default value : /var/www/pyscada/PyScadaServer/manage.py"
    exit 1
  fi
fi

# get the pyscada protocols with at least one device
res=$(echo -e "from pyscada.models import DeviceProtocol

for dp in DeviceProtocol.objects.all():
  if len(dp.device_set.all()) > 0:
    print(dp)
  " | python3 $manage_path/manage.py shell)


# check and install plugins
if [[ $res == *"modbus"* ]]; then
  echo "Modbus It's there!"
  pip3 install pyscada-modbus
fi
if [[ $res == *"phant"* ]]; then
  echo "phant It's there!"
  pip3 install pyscada-phant
fi
if [[ $res == *"systemstat"* ]]; then
  echo "systemstat It's there!"
  pip3 install pyscada-systemstat
fi
if [[ $res == *"visa"* ]]; then
  echo "visa It's there!"
  pip3 install pyscada-visa
fi
if [[ $res == *"smbus"* ]]; then
  echo "smbus It's there!"
  pip3 install pyscada-smbus
fi
if [[ $res == *"onewire"* ]]; then
  echo "onewire It's there!"
  pip3 install pyscada-onewire
fi



================================================
FILE: extras/Grafana-test-dashboard.json
================================================
{
  "__inputs": [
    {
      "name": "DS_PYSCADA",
      "label": "PyScada",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.5"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1637571827897,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": "$Datasource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 15,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 13,
      "options": {
        "legend": {
          "calcs": [
            "last",
            "mean",
            "max"
          ],
          "displayMode": "table",
          "placement": "right"
        },
        "tooltip": {
          "mode": "multi"
        }
      },
      "pluginVersion": "8.0.3",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(r.date_saved,$time_group),\n  avg(IFNULL(r.value_float64, 0.0) + IFNULL(r.value_int64, 0.0) + IFNULL(r.value_int32, 0.0) + IFNULL(r.value_int16, 0.0) + IFNULL(r.value_boolean, 0.0)),\n  v.name AS metric\nFROM pyscada_recordeddata as r \nJOIN pyscada_variable v ON r.variable_id = v.id\nWHERE\n  $__timeFilter(r.date_saved) AND\n  r.variable_id IN (${Variables})\nGROUP BY time, metric\nORDER BY $__timeGroup(r.date_saved,$time_group,$null_as)",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "id"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "pyscada_device",
          "timeColumn": "connection_time",
          "timeColumnType": "timestamp",
          "where": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Test group by time",
      "transformations": [],
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "datasource": null,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 15
      },
      "id": 8,
      "panels": [],
      "title": "Row title",
      "type": "row"
    },
    {
      "datasource": "${DS_PYSCADA}",
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 2,
      "options": {
        "content": "# Title\n\nFor markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)\n         \nProtocoles : ${Protocols.text}\n\nIntruments : ${Devices}\n\nUnités : ${Units}\n\nVariables : ${Variables}\n\n",
        "mode": "markdown"
      },
      "pluginVersion": "8.2.5",
      "repeat": null,
      "repeatDirection": "v",
      "timeFrom": null,
      "timeShift": null,
      "title": "PyScada",
      "transformations": [
        {
          "id": "seriesToColumns",
          "options": {}
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": false,
              "id": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "text"
    }
  ],
  "refresh": "",
  "schemaVersion": 32,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": true,
          "text": "PyScada",
          "value": "PyScada"
        },
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Datasource",
        "options": [],
        "query": "mysql",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$Datasource",
        "definition": "SELECT protocol AS __text, id AS __value FROM pyscada_deviceprotocol",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Protocols",
        "options": [],
        "query": "SELECT protocol AS __text, id AS __value FROM pyscada_deviceprotocol",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$Datasource",
        "definition": "SELECT d.short_name AS __text, d.id AS __value FROM pyscada_device d WHERE d.protocol_id IN (${Protocols}) AND d.active = 1",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Devices",
        "options": [],
        "query": "SELECT d.short_name AS __text, d.id AS __value FROM pyscada_device d WHERE d.protocol_id IN (${Protocols}) AND d.active = 1",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$Datasource",
        "definition": "SELECT u.unit AS __text, u.id AS __value FROM pyscada_unit u",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Units",
        "options": [],
        "query": "SELECT u.unit AS __text, u.id AS __value FROM pyscada_unit u",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$Datasource",
        "definition": "SELECT v.name AS __text, v.id AS __value FROM pyscada_variable v WHERE v.device_id IN (${Devices}) AND v.unit_id IN (${Units}) AND v.active = 1",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Variables",
        "options": [],
        "query": "SELECT v.name AS __text, v.id AS __value FROM pyscada_variable v WHERE v.device_id IN (${Devices}) AND v.unit_id IN (${Units}) AND v.active = 1",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "auto": true,
        "auto_count": 30,
        "auto_min": "10s",
        "current": {
          "selected": true,
          "text": "1m",
          "value": "1m"
        },
        "description": null,
        "error": null,
        "hide": 0,
        "label": "Time group",
        "name": "time_group",
        "options": [
          {
            "selected": false,
            "text": "auto",
            "value": "$__auto_interval_time_group"
          },
          {
            "selected": false,
            "text": "1s",
            "value": "1s"
          },
          {
            "selected": false,
            "text": "10s",
            "value": "10s"
          },
          {
            "selected": true,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "14d",
            "value": "14d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          },
          {
            "selected": false,
            "text": "1M",
            "value": "1M"
          }
        ],
        "query": "1s,10s,1m,10m,30m,1h,6h,12h,1d,7d,14d,30d,1M",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "previous",
          "value": "previous"
        },
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Null as",
        "multi": false,
        "name": "null_as",
        "options": [
          {
            "selected": false,
            "text": "0",
            "value": "0"
          },
          {
            "selected": false,
            "text": "NULL",
            "value": "NULL"
          },
          {
            "selected": true,
            "text": "previous",
            "value": "previous"
          }
        ],
        "query": "0, NULL, previous",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "PyScada",
  "uid": "bwhhV4pnz",
  "version": 7
}

================================================
FILE: extras/nginx_sample.conf
================================================
# pyscada.conf

# the upstream component nginx needs to connect to
upstream app_server {
        server unix:/tmp/gunicorn.sock fail_timeout=0; # for a file socket
        #server 127.0.0.1:8000 fail_timeout=0; # for a file socket
}

# configuration of the server
server {
    listen      80;
    listen   [::]:80;
    server_name _;          # substitute your machine's IP address or FQDN
    #return 301 https://$server_name$request_uri;
    return 301 https://$host$request_uri;
}

server {
        listen   443 default_server ssl;
        listen [::]:443 ssl;

        server_name _;          # substitute your machine's IP address or FQDN

        charset utf-8;
        keepalive_timeout 5;
        client_max_body_size 75M;   # max upload size, adjust to taste
        # please comment if https is not used
        ssl_certificate     /etc/nginx/ssl/pyscada_server.crt; # The certificate file
        ssl_certificate_key /etc/nginx/ssl/pyscada_server.key; # The private key file

        # Django media
        location /media  {
                alias /var/www/pyscada/http/media;  # your Django project's media files - amend as required
        }

        location /static {
                alias /var/www/pyscada/http/static; # your Django project's static files - amend as required
        }

        location /measurement {
                alias /home/pyscada/measurement_data_dumps; # to support download of measurement files via admin backend - amend as required
        }

        location /favicon.ico {
            proxy_pass http://127.0.0.1/static/pyscada/img/favicon.ico;
        }

        location / {
            # checks for static file, if not found proxy to app
            try_files $uri @proxy_to_app;
        }

        location @proxy_to_app {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;

            proxy_pass   http://app_server;
        }
}

================================================
FILE: extras/pyscada-logrotate
================================================
/var/log/pyscada_debug.log
{
	rotate 4
	weekly
	missingok
	notifempty
	compress
	delaycompress
	size 1M
}


================================================
FILE: extras/service/SysV-init/gunicorn_django
================================================
#!/bin/bash

### BEGIN INIT INFO
# Provides:			 gunicorn_django
# Required-Start:	 $all
# Required-Stop:	 $all
# Default-Start:	 2 3 4 5
# Default-Stop:		 0 1 6
# Short-Description: starts the pyscada gunicorn server
# Description:		 starts pyscada gunicorn using start-stop-daemon
### END INIT INFO

# sample configfile for /etc/default/gunicorn_django
# APP_NAME='PyScadaServer'
# DJANGO_DIR='/var/www/pyscada/PyScadaServer'
# NUMBER_OF_WORKERS=10 
# RUN_AS='pyscada'

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PID_FILE=/tmp/gunicorn.pid
SOCKET_FILE=/tmp/gunicorn.sock

if [ -f /etc/default/gunicorn_django ] ; then
	. /etc/default/gunicorn_django
else
	# use default values
	APP_NAME='PyScadaServer'
	DJANGO_DIR=/var/www/pyscada/PyScadaServer/
	NUMBER_OF_WORKERS=10 
	RUN_AS='pyscada'
fi



start () {

	if [ -e $PID_FILE ]
	then
		PID=$(cat $PID_FILE)
		if ps -p $PID > /dev/null
		then
			echo "gunicorn service is already running ($PID)"
			exit 0
		fi
	fi

	echo "Spawning $APP_NAME"
	# Create the run directory if it doesn't exist
	export DJANGO_SETTINGS_MODULE=$APP_NAME.settings
	export PYTHONPATH=${data[1]}:$PYTHONPATH
	# Start your Django Unicorn
	# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
	start-stop-daemon --start --quiet -c $RUN_AS -d $DJANGO_DIR --pidfile $PID_FILE --exec /usr/local/bin/gunicorn -- $APP_NAME.wsgi:application -n $APP_NAME -w $NUMBER_OF_WORKERS -u $RUN_AS -b unix:$SOCKET_FILE -p $PID_FILE -D

	return
}

stop () {
	if [ -e $PID_FILE ]
	then
		kill -TERM $(<"$PID_FILE")
		echo "stopped service"
	else
		echo "service not running"
	fi
}

case "$1" in
  start)
		echo "Starting"
		start
		;;
  stop)
		echo "Stopping"
		stop
		;;
  restart)
		echo "Restarting"
		stop
		sleep 1
		start
		;;
  *)
		N=/etc/init.d/$NAME
		echo "Usage: $N {start|stop|restart} " >&2
		exit 1
		;;
esac

exit 0


================================================
FILE: extras/service/SysV-init/pyscada_daemon
================================================
#!/bin/bash
 
### BEGIN INIT INFO
# Provides:			 pyscada_daemon
# Required-Start:	 $all
# Required-Stop:	 $all
# Default-Start:	 2 3 4 5
# Default-Stop:		 0 1 6
# Short-Description: starts the pyscada daemon
# Description:		 starts pyscada daemon
### END INIT INFO

if [ -f /etc/default/pyscada_daemon ] ; then
	. /etc/default/pyscada_daemon
else
	# use default values
	DJANGO_DIR=/var/www/pyscada/PyScadaServer/
	RUN_AS='pyscada'
fi

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin


start () {
	echo "Spawning PyScada Daemon"
	start-stop-daemon --start -c $RUN_AS -d $DJANGODIR --exec manage.py -- pyscada_daemon start

	done
	return
}


stop () {
    echo "Stop PyScada Daemon"
	start-stop-daemon --start -c $RUN_AS -d $DJANGODIR --exec manage.py -- pyscada_daemon stop
	done
	return
}
 
case "$1" in
  start)
		echo "Starting"
		start
		;;
  stop)
		echo "Stopping"
		stop
		;;
  restart)
		echo "Restarting"
		stop
		sleep 1
		start
		;;
  *)
		N=/etc/init.d/$NAME
		echo "Usage: $N {start|stop|restart} " >&2
		exit 1
		;;
esac
 
exit 0


================================================
FILE: extras/service/systemd/gunicorn.service
================================================
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
PIDFile=/tmp/gunicorn.pid
User=pyscada
Group=pyscada
WorkingDirectory=/var/www/pyscada/PyScadaServer
#ExecStart=/usr/local/bin/gunicorn --pid /tmp/gunicorn.pid --workers 8 PyScadaServer.wsgi:application
ExecStart=/home/pyscada/.venv/bin/gunicorn --pid /tmp/gunicorn.pid --workers 8 PyScadaServer.wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target


================================================
FILE: extras/service/systemd/gunicorn.socket
================================================
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/tmp/gunicorn.sock
ListenStream=0.0.0.0:9000
#ListenStream=[::]:8000

[Install]
WantedBy=sockets.target

================================================
FILE: extras/service/systemd/owfs.service
================================================
[Unit]
Description=OWFS Daemon
After=network.target

[Service]
Type=forking
PIDFile=/tmp/owfs_daemon.pid
#User=pyscada
#Group=pyscada
#WorkingDirectory=/var/www/pyscada/PyScadaServer/
ExecStart=/usr/bin/owfs -P /tmp/owfs_daemon.pid
#ExecStop=/usr/bin/python /var/www/pyscada/PyScadaServer/manage.py pyscada_daemon stop
Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target




================================================
FILE: extras/service/systemd/pyscada_daemon.service
================================================
[Unit]
Description=PyScada Daemon
After=network.target
After=mysql.service
After=redis-server.service

[Service]
Type=forking
PIDFile=/tmp/pyscada_daemon.pid
User=pyscada
Group=pyscada
WorkingDirectory=/var/www/pyscada/PyScadaServer/
#ExecStart=/usr/bin/python3 /var/www/pyscada/PyScadaServer/manage.py pyscada_daemon start
#ExecStop=/usr/bin/python3 /var/www/pyscada/PyScadaServer/manage.py pyscada_daemon stop
ExecStart=/home/pyscada/.venv/bin/python3 /var/www/pyscada/PyScadaServer/manage.py pyscada_daemon start
ExecStop=/home/pyscada/.venv/bin/python3 /var/www/pyscada/PyScadaServer/manage.py pyscada_daemon stop
Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target


================================================
FILE: extras/service/windows/register_windows_service.py
================================================
import win32serviceutil
import win32service
import win32event
import servicemanager
import os


class AppServerSvc(win32serviceutil.ServiceFramework):
    _svc_name_ = "PyScada Daemon"
    _svc_display_name_ = "PyScada Daemon"
    _svc_description_ = "a PyScada Daemon for the detection"

    def __init__(self, args):
        win32serviceutil.ServiceFramework.__init__(self, args)
        self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)

    def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop)
        os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyScadaServer.settings")
        import django

        django.setup()
        # todo implement
        raise NotImplementedError

    def SvcDoRun(self):
        servicemanager.LogMsg(
            servicemanager.EVENTLOG_INFORMATION_TYPE,
            servicemanager.PYS_SERVICE_STARTED,
            (self._svc_name_, ""),
        )
        self.main()

    def main(self):
        os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyScadaServer.settings")
        import django

        django.setup()
        # todo implement
        raise NotImplementedError


if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyScadaServer.settings")
    win32serviceutil.HandleCommandLine(AppServerSvc)


================================================
FILE: extras/settings.py
================================================
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Django settings for PyScadaServer project.

Generated by 'django-admin startproject' using Django 2.2.9.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/

Later customized for PyScada needs
"""

import os
import pyvisa
import importlib.util
import pkg_resources

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ""

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

ALLOWED_HOSTS = ["*"]

# Application definition

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "pyscada"
]

pyscada = __import__("pyscada.core")
if hasattr(pyscada.core, "additional_installed_app"):
    for app in getattr(pyscada.core, "additional_installed_app"):
        INSTALLED_APPS += [
            app,
        ]

installed_packages = pkg_resources.working_set
for i in installed_packages:
    if "pyscada-" in str(i):
        lib = str(i).split(" ")[0].split("-")[1]
        if importlib.util.find_spec("pyscada." + str(lib)) is not None:
            INSTALLED_APPS += [
                "pyscada." + str(lib),
            ]

if importlib.util.find_spec("channels") is not None:
    INSTALLED_APPS += [
        "channels",
    ]

    CHANNEL_LAYERS = {
        "default": {
            "BACKEND": "channels_redis.core.RedisChannelLayer",
            "CONFIG": {
                "hosts": [("127.0.0.1", 6379)],
            },
        },
    }

if util.find_spec('django_redis') is not None:
    # for cache_datasource
    CACHES = {
        "default": {
            "BACKEND": "django.core.cache.backends.redis.RedisCache",
            "LOCATION": "redis://127.0.0.1:6379",
        }
    }
else:
    # as fallback setup file based cache
    CACHES = {
        "default": {
            "BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
            "LOCATION": "{{ project_root }}",
            "TIMEOUT": 3600,
            "OPTIONS": {"MAX_ENTRIES": 1000},
        }
    }

LOGIN_REDIRECT_URL = "/"

MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

AUTHENTICATION_BACKENDS = [
    "django.contrib.auth.backends.ModelBackend",
]

if importlib.util.find_spec("django_cas_ng") is not None:
    INSTALLED_APPS += [
        "django_cas_ng",
    ]
    AUTHENTICATION_BACKENDS += [
        "django_cas_ng.backends.CASBackend",
    ]
    CAS_SERVER_URL = "https://sso.univ-pau.fr/cas/"
    CAS_VERSION = "2"
    CAS_EXTRA_LOGIN_KWARGS = {
        "proxies": {"https": "http://cache.iutbayonne.univ-pau.fr:3128"},
        "timeout": 5,
    }

    LOGIN_URL = "/accounts/choose_login/"

ROOT_URLCONF = "PyScadaServer.urls"

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
            "libraries": {
                "staticfiles": "django.templatetags.static",
            },
        },
    },
]

WSGI_APPLICATION = "PyScadaServer.wsgi.application"

# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.mysql",
        "NAME": "PyScada_db",
        "USER": "PyScada-user",
        "PASSWORD": "PyScada-user-password",
        "OPTIONS": {
            "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
        }
        # 'ENGINE': 'django.db.backends.sqlite3',
        # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
    },
]

# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = "/static/"

STATIC_ROOT = "/var/www/pyscada/http/static/"

MEDIA_URL = "/media/"

MEDIA_ROOT = "/var/www/pyscada/http/media/"

# PyScada settings
# https://github.com/trombastic/PyScada

# email settings
DEFAULT_FROM_EMAIL = ""
EMAIL_HOST = ""
EMAIL_PORT = 465
EMAIL_HOST_USER = "r"
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
EMAIL_HOST_PASSWORD = ""
EMAIL_PREFIX = "PREFIX"  # Mail subject will be "PREFIX subjecttext"

# meta information's about the plant site
PYSCADA_META = {
    "name": "A SHORT NAME",
    "description": "A SHORT DESCRIPTION",
}

# export properties
PYSCADA_EXPORT = {
    "file_prefix": "PREFIX_",
    "output_folder": "~/measurement_data_dumps",
}

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "formatters": {
        "standard": {
            "format": "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
            "datefmt": "%d/%b/%Y %H:%M:%S",
        },
    },
    "handlers": {
        "file": {
            "level": "DEBUG",
            "class": "logging.FileHandler",
            "filename": "/var/log/pyscada_debug.log",
            "formatter": "standard",
        },
    },
    "loggers": {
        "": {
            "handlers": ["file"],
            "level": "ERROR",
            "propagate": True,
        },
        "django": {
            "handlers": ["file"],
            "level": "INFO",
            "propagate": False,
        },
        "pyscada": {
            "handlers": ["file"],
            "level": "DEBUG",
            "propagate": False,
        },
        "gunicorn": {
            "handlers": ["file"],
            "level": "INFO",
            "propagate": False,
        },
    },
}

VISA_DEVICE_SETTINGS = {
    "USB0": {
        "open_timeout": 5000,
        "timeout": 15000,
    },
    "GPIB0": {
        "open_timeout": 5000,
        "timeout": 15000,
    },
    "ASRL/dev/ttyAMA0": {
        "baud_rate": 9600,
        "data_bits": 8,
        "parity": pyvisa.constants.Parity.none,
        "stop_bits": pyvisa.constants.StopBits.one,
        "write_termination": "",
    },
    "ASRL/dev/ttyUSB0": {
        "open_timeout": 5000,
    },
}


================================================
FILE: extras/urls.py
================================================
"""PyScadaServer URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.urls import path, include
from django.contrib import admin

urlpatterns = [
    path("", include("pyscada.hmi.urls")),
]


================================================
FILE: install.sh
================================================
#!/bin/bash

# check if the script is run from script directory
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
  SOURCE=$(readlink "$SOURCE")
  [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )

if [[ "$DIR" != "$PWD" ]]; then
  echo "You must run this script from $DIR"
  exit 1
fi

# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
  echo "This script must be run as root" 1>&2
  exit 1
fi

# Choose the config method (venv or docker)
answer_config=""
echo "choose your installation"

while [[ "$answer_config" == "" ]]; do

read -p "1: venv, 2: docker : " answer_config
  case $answer_config in
    "1")
    #remove logs file if exist (to avoid appending)
    if [ -f logs_install.txt ]; then
      rm logs_install.txt
    fi

      #execute the install_venv.sh script and output error in logs file
      source install_venv.sh 2>&1 | tee -a logs_install.txt 1>&2 | { while IFS= read -r line; do echo "$line"; done; }
      ;;
    "2")
    #remove logs file if exist (to avoid appending)
    if [ -f logs_docker.txt ]; then
      rm logs_docker.txt
    fi
      source install_docker.sh 2>&1 | tee -a logs_docker.txt 1>&2  | { while IFS= read -r line; do echo "$line"; done; }
      ;;
    *)
      echo "choose a valid configuration"
      answer_config=""
      ;;
  esac
  #statements
done


================================================
FILE: install_docker.sh
================================================
#!/bin/bash

# VAR

answer_db_name="PyScada_db"         # Name of the database
answer_db_user="PyScada-user"         # Username for the database (not the root)
answer_db_password="PyScada-user-password"     # Password for the database (not the root)

answer_auto_add_apps="True"   # Auto add apps or manual add (in django configuration)

answer_admin_name=""      # admin name (for the system)
answer_admin_mail=""      # admin mail (for errors output)

ssl_dir="./nginx/ssl"
key_file="$ssl_dir/pyscada_server.key"
crt_file="$ssl_dir/pyscada_server.crt"

DOCKER_COMPOSE="./docker-compose.yml"
SETTINGS_TPL="../tests/project_template_tmp/project_name/settings.py-tpl"
DOCKERFILE_SQL="./mysql/Dockerfile"

# Make sure only root can run script
if [[ $EUID -ne 0 ]]; then
  >&2 echo "This script must be run as root"
  exit -1
fi

check_exit_status() {
  local message=$1
  local exit_status=$2

  if [ $exit_status -ne 0 ]; then
    >&2 echo "$message" # >&2: stderr output
    exit -1
  fi
  wait
}

function debug(){
  message=$1
  echo ""
  echo $message 1>&2
  echo ""
}

function db_setup(){
  debug "db_setup"

  # copy clean docker-compose
  cp ./docker-compose.yml-tmp $DOCKER_COMPOSE
  check_exit_status "Unable to copy docker-compose.yml" $?
  # copy template clean mysql Dockerfile
  cp ./mysql/Dockerfile-tmp $DOCKERFILE_SQL
  check_exit_status "Unable to copy Dockerfile" $?

  # add mysql Dockerfile with db informations
  sed -i "s|PyScada_db|$answer_db_name|g"  $DOCKERFILE_SQL
  sed -i "s|PyScada-user-password|$answer_db_password|g"  $DOCKERFILE_SQL
  sed -i "s|PyScada-user|$answer_db_user|g"  $DOCKERFILE_SQL

  # modify docker-compose.yml with db informations
  sed -i "s|PyScada_db|$answer_db_name|g" $DOCKER_COMPOSE
  sed -i "s|PyScada-user-password|$answer_db_password|g" $DOCKER_COMPOSE
  sed -i "s|PyScada-user|$answer_db_user|g" $DOCKER_COMPOSE

  debug "db_setup end"
}

# called in questions_clean_inst_setup
function regex_mail(){
  debug "regex_mail"

  regex='^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$';
  while true; do
    read -p "admin mail ? " answer_admin_mail
    if [[ $answer_admin_mail =~ $regex ]]; then
      break
    else
      echo "Choose a valid mail"
    fi
  done

  debug "regex_mail end"
}

function questions_setup(){
  debug "questions_setup"

  admin_name_setup
  regex_mail
  project_admins=$(echo "('${answer_admin_name}', '${answer_admin_mail}' )")
  echo $project_admins
  echo $answer_db_name

  # db params
  read -p "Database name [PyScada_db]: " answer_db_name
  read -p "Database user [PyScada-user]: " answer_db_user
  read -sp "Database password (your input is hidden) [PyScada-user-password]: " answer_db_password
  echo ""

  if [[ "$answer_db_name" == "" ]]; then
    answer_db_name="PyScada_db"
  fi
  if [[ "$answer_db_user" == "" ]]; then
    answer_db_user="PyScada-user"
  fi
  if [[ "$answer_db_password" == "" ]]; then
    answer_db_password="PyScada-user-password"
  fi

  while true; do
    read -p "Auto add pyscada plugins ? [True/False]: " answer_auto_add_apps
    if [[ "$answer_auto_add_apps" == "True" ]]; then
      echo 'You need to restart pyscada and gunicorn after (un)installing any pyscada plugin.'
      break;
    elif [[ "$answer_auto_add_apps" == "False" ]]; then
      echo 'You need manually add a plugin to the django project settings and restart pyscada and gunicorn after (un)installing any pyscada plugin.'
      break;
    else
      echo "Please answer True or False."
    fi
  done

  debug "questions_setup end"
}

# called in questions_clean_inst_setup
function admin_name_setup(){
  debug "admin_name_setup"

  while true; do
    read -p "admin name ? " answer_admin_name
    if [[ "$answer_admin_name" == "" ]]; then
      echo "Choose a valid name"
    else
      break
    fi
  done

  debug "admin_name_setup end"
}

function ssl_setup(){
  # Creation of openssl certificate
  debug "ssl_setup"
  if [ ! -d "$ssl_dir" ]; then
    mkdir "$ssl_dir"
    check_exit_status "Unable to create ssl directory" $?
    echo "SSL directory created"
  else
    echo "SSL directory already exist"
  fi

  if [ ! -f "$key_file" ] && [ ! -f "$crt_file" ]; then
    rm -f "$ssl_dir/*"
    openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout "$key_file" -out "$crt_file" -subj '/CN=www.mydom.com/O=My Company Name LTD./C=US'
    check_exit_status "SSL certificates creation failed." $?
    echo "SSL certificates created"
  else
    echo "SSL certificates already exist"
  fi
  debug "ssl_setup end"
}

function template_setup(){
  # add db informations to django template
  debug "template_setup"
  rm -r ../tests/project_template_tmp/
  cp -r ../tests/project_template ../tests/project_template_tmp

  # add mysql host name to the mysql container
  sed -i "/'PASSWORD': '/a \ \ \ \ \ \ \ \ 'HOST': 'db'," "$SETTINGS_TPL"

  # remove concurrent_log_handler config and use file handler
  sed -i "/ConcurrentRotatingFileHandler/c\ \ \ \ \ \ \ \ \ \ \ \ 'class': 'logging.FileHandler'," "$SETTINGS_TPL"
  sed -i '/maxBytes/d' "$SETTINGS_TPL"
  sed -i '/backupCount/d' "$SETTINGS_TPL"
  check_exit_status "add mysql HOST failed" $?

  # set up django settings file
  sed -i "s|{{ db_name }}|$answer_db_name|g"  $SETTINGS_TPL
  sed -i "s|{{ db_user }}|$answer_db_user|g"  $SETTINGS_TPL
  sed -i "s|{{ db_password }}|$answer_db_password|g"  $SETTINGS_TPL
  sed -i "s|{{ project_root }}|\/src\/pyscada\/|g"  $SETTINGS_TPL
  sed -i "s|{{ log_file_dir }}|\/src\/pyscada\/|g"  $SETTINGS_TPL
  sed -i "s|{{ project_admins\|safe }}|$project_admins|g"  $SETTINGS_TPL
  sed -i "s|{{ auto_add_apps }}|$answer_auto_add_apps|g"  $SETTINGS_TPL
  sed -i "s|{{ additional_apps }}||g"  $SETTINGS_TPL
  sed -i "s|{{ additional_settings }}||g"  $SETTINGS_TPL

  rm ./pyscada/project_template.zip
  cd ../tests/project_template_tmp
  zip -r ../../docker/pyscada/project_template.zip .
  check_exit_status "Unable to create project_template.zip" $?
  cd ../../docker

  rm ./pyscada/pyscada.zip
  zip -r ./pyscada/pyscada.zip .. -x "../docs/*" "../.git/*" "../tests/*" "../docker/*" "../__pycache__/*"

  debug "template_setup end"
}

# Verify if docker-compose is installed
if ! command -v docker-compose >/dev/null 2>&1; then
  >&2 echo "Docker Compose is not installed."
  exit -1
fi

systemctl is-active docker.service
check_exit_status "docker service is not running. Start it using : sudo systemctl start docker.service" $?

echo "The installation may take some time"
sleep 0

command -v zip >/dev/null 2>&1
check_exit_status "Zip is not installed, install it with : sudo apt install zip" $?

# Execute commands from ./docker
cd docker
check_exit_status "The docker directory is missing." $?

ssl_setup
wait

questions_setup
wait

db_setup

template_setup
wait

# Build the image with the --no-cache argument
docker-compose build --no-cache
check_exit_status "The image build failed." $?

# Execute pyscada init in the docker container
docker-compose run pyscada /src/pyscada/pyscada_init
check_exit_status "pyscada_init failed." $?

# Execute docker-compose up in the background
docker-compose up -d
sleep 10

# Execute into the container the superuseer creation

echo "Create admin account for the web interface : "
docker-compose run pyscada python3 /src/pyscada/manage.py createsuperuser
check_exit_status "Superuser creation failed." $?

# Verify if the containers are running
if docker ps | grep "pyscada" >/dev/null; then
  echo "PyScada installed"
  echo "Connect to http://127.0.0.1 using admin account created previously"
else
  >&2 echo "docker-compose up failed."
  exit -1
fi


================================================
FILE: install_venv.sh
================================================
#!/bin/bash

# todo : add inputs for django admin name, password

# check if the script is run from script directory
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
  SOURCE=$(readlink "$SOURCE")
  [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )

if [[ "$DIR" != "$PWD" ]]; then
  echo "You must run this script from $DIR"
  exit 1
fi

# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
  echo "This script must be run as root"
  exit 1
fi


# PATHS CONST
INSTALL_ROOT=/var/www/pyscada # files will be installed here
log_file_dir="/var/log/pyscada/" # log files will be here
SERVER_ROOT=$INSTALL_ROOT/PyScadaServer # django project root
pyscada_home=/home/pyscada
pyscada_venv=$pyscada_home/.venv

# VAR
answer_date=""            # Is the date correct
answer_proxy=""           # Setup of proxy
answer_config=""          # Will it be install on docker or on venv

answer_db_name=""         # Name of the database
answer_db_user=""         # Username for the database (not the root)
answer_db_password=""     # Password for the database (not the root)

answer_channels=""        # Install or not channels and redis
answer_update=""          # The installation is just an update or not
answer_auto_add_apps=""   # Auto add apps or manual add (in django configuration)

answer_admin_name=""      # admin name (for errors output)
answer_admin_mail=""      # admin mail (for errors output)

answer_web_name=""        # web interface admin name
answer_web_password=""    # web interface admin password

echo -e "\nPyScada python packages will be installed in the virtual environment $pyscada_venv"

function debug(){
  message=$1
  echo ""
  echo $message 1>&2
  echo ""
}

# called in questions_setup
function regex_proxy(){
  echo "regex_proxy" 1>&2
  regex='^(https?|ftp)://[0-9a-zA-Z.-]+:[0-9]+$';
  while true; do
    read -p "Use proxy? [http://proxy:port or n]: " answer_proxy
    if [[ $answer_proxy == "n" || $answer_proxy =~ $regex ]]; then
      break
    else
      echo "Choose a valid proxy"
    fi
  done
  echo "regex_proxy end" 1>&2
}

function pip3_proxy(){
  if [[ "$answer_proxy" == "n" ]]; then
    pip3 $*
  else
    echo "pip3 using" $answer_proxy "for" $* > /dev/tty
    pip3 --proxy=$answer_proxy $*
  fi
}

function pip3_proxy_not_rust(){
  if [[ "$answer_proxy" == "n" ]]; then
    CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip3 install cryptography==3.4.6 --no-cache-dir
    pip3 $*
  else
    echo "pip3 using" $answer_proxy "for" $* > /dev/tty
    CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip3 --proxy=$answer_proxy install cryptography==3.4.6 --no-cache-dir
    pip3 --proxy=$answer_proxy $*
  fi
}

function apt_proxy(){
  if [[ "$answer_proxy" == "n" ]]; then
    apt-get $*
  else
    echo "apt using" $answer_proxy "for" $* > /dev/tty
    export http_proxy=$answer_proxy
    apt-get $*
    unset http_proxy
  fi
}

# called in questions_clean_inst_setup
function regex_mail(){
  debug "regex_mail"

  regex='^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$';
  while true; do
    read -p "admin mail ? " answer_admin_mail
    if [[ $answer_admin_mail =~ $regex ]]; then
      break
    else
      echo "Choose a valid mail"
    fi
  done

  debug "regex_mail end"
}

# called in questions_clean_inst_setup
function admin_name_setup(){
  debug "admin_name_setup"

  while true; do
    read -p "admin name ? " answer_admin_name
    if [[ "$answer_admin_name" == "" ]]; then
      echo "Choose a valid name"
    else
      break
    fi
  done

  debug "admin_name_setup end"
}

# called in questions_setup
function questions_clean_install_setup(){
  debug "questions_clean_install_setup"

  read -p "DB name ? [PyScada_db]: " answer_db_name
  read -p "DB user ? [PyScada-user]: " answer_db_user
  read -sp "DB password ? [PyScada-user-password]: " answer_db_password
  echo ""

  admin_name_setup
  regex_mail
  project_admins=$(echo "('${answer_admin_name}', '${answer_admin_mail}' )")
  echo $project_admins
  echo $answer_db_name

  read -p "web interface admin name [pyscada]: " answer_web_name
  read -p "web interface admin password [password]: " answer_web_password

  if [[ "$answer_db_name" == "" ]]; then
    answer_db_name="PyScada_db"
  fi
  if [[ "$answer_db_user" == "" ]]; then
    answer_db_user="PyScada-user"
  fi
  if [[ "$answer_db_password" == "" ]]; then
    answer_db_password="PyScada-user-password"
  fi

  if [[ "$answer_web_name" == "" ]]; then
    answer_web_name="pyscada"
  fi
  if [[ "$answer_web_password" == "" ]]; then
    answer_web_password="password"
  fi

  while true; do
    read -p "Auto load pyscada plugins installed ? If False, you need to edit the settings.py file manually to load a plugin. [True/False]: " answer_auto_add_apps
    if [[ "$answer_auto_add_apps" == "True" ]]; then
      echo 'You need to restart pyscada and gunicorn after (un)installing any pyscada plugin.'
      break;
    elif [[ "$answer_auto_add_apps" == "False" ]]; then
      echo 'You need manually add a plugin to the django project settings and restart pyscada and gunicorn after (un)installing any pyscada plugin.'
      break;
    else
      echo "Please answer True or False."
    fi
  done

  debug "questions_clean_install_setup end"
}

# called in the core of the script
function questions_setup(){
  debug "questions_setup"

  # Date verification
  echo 'date :'
  echo $(date)
  read -p "Is the date and time correct ? [y/n]: " answer_date
  if [[ "$answer_date" != "y" ]]; then
    echo "please set the date correctly or enter 'y'"
    exit 1
  fi

  # Proxy setup
  regex_proxy

  # Channels and redis
  read -p "Install channels and redis to speed up inter pyscada process communications ? [y/n]: " answer_channels

  # Clean installation or not
  while true; do
    read -p "Update only : if 'y' it will not create DB, superuser, copy services, settings and urls... On a fresh install you should answer 'n' ? [y/n]: " answer_update
    if [[ "$answer_update" == "y" ]]; then
      break
    elif [[ "$answer_update" == "n" ]]; then
      break
    else
      echo "Please answer y or n."
    fi
  done

  if [[ "$answer_update" == "n" ]]; then
    questions_clean_install_setup
  fi

  debug "questions_setup end"
}

# called in the core of the script
function install_dependences(){
  debug "install_dependences"

  apt_proxy install -y python3-pip
  echo 'Some python3 packages installed:'
  # Install prerequisites
  DEB_TO_INSTALL="
    libatlas-base-dev
    libopenblas-dev
    libffi-dev
    libhdf5-dev
    libjpeg-dev
    libmariadb-dev
    libopenjp2-7
    mariadb-server
    nginx
    python3-dev
    python3-mysqldb
    python3-pip
    python3-venv
    zlib1g-dev
    pkg-config
  "
  apt_proxy install -y $DEB_TO_INSTALL

  # Create virtual environment
  sudo -u pyscada python3 -m venv $pyscada_venv
  # activate
  source $pyscada_venv/bin/activate

  PIP_TO_INSTALL="
    cffi
    Cython
    docutils
    gunicorn
    lxml
    mysqlclient
    numpy
  "
  pip3_proxy install --upgrade $PIP_TO_INSTALL

  debug "install_dependences end"
}

# called in pyscada_init
function web_setup(){
  debug "web_setup"

  (
    cd $SERVER_ROOT
  sudo -u pyscada -E env PATH=${PATH} python3 manage.py shell << EOF
try:
  from django.contrib.auth import get_user_model
  from django.db.utils import IntegrityError
  User = get_user_model()
  User.objects.create_superuser('$answer_web_name',
                                'team@pyscada.org',
                                '$answer_web_password')
except IntegrityError:
  print('User pyscada already exist')
EOF
  )
  # Nginx
  cp extras/nginx_sample.conf /etc/nginx/sites-available/pyscada.conf
  ln -sf ../sites-available/pyscada.conf /etc/nginx/sites-enabled/
  rm -f /etc/nginx/sites-enabled/default
  mkdir -p /etc/nginx/ssl
  # the certificate will be valid for 5 Years,
  openssl req -x509 -nodes -days 1780 -newkey rsa:2048 -keyout /etc/nginx/ssl/pyscada_server.key -out /etc/nginx/ssl/pyscada_server.crt -subj '/CN=www.mydom.com/O=My Company Name LTD./C=US'
  systemctl enable nginx.service # enable autostart on boot
  systemctl restart nginx

  # Gunicorn and PyScada as systemd units
  cp extras/service/systemd/{gunicorn.{socket,service},pyscada_daemon.service} /etc/systemd/system
  # Rename PyScada service file
  mv /etc/systemd/system/pyscada_daemon.service /etc/systemd/system/pyscada.service

  # Fix if gunicorn installed in /usr/bin and not /usr/local/bin -> create symbolic link
  if [[ $(which gunicorn) != /usr/local/bin/gunicorn ]] && [[ ! -f /usr/local/bin/gunicorn ]] && [[ -f /usr/bin/gunicorn ]]; then
      echo "Creating symcolic link to gunicorn" ;
      ln -s /usr/bin/gunicorn /usr/local/bin/gunicorn;
  fi

  debug "web_setup end"
}

# called in the core of the script
function install_channel_redis(){
  debug "install_channel_redis"

  apt_proxy -y install redis-server
  if grep -R "Raspberry Pi 3"  "/proc/device-tree/model" ; then
    echo "Don't install Rust for RPI3"
    pip3_proxy_not_rust install --upgrade channels channels-redis asgiref
  else
    pip3_proxy install --upgrade cryptography==3.4.6 channels channels-redis asgiref
  fi

  debug "install_channel_redis end"
}

# called in the core of the script
function pyscada_init(){
  debug "pyscada_init"

  (
      cd $SERVER_ROOT
      # Migration and static files
      sudo -u pyscada -E env PATH=${PATH} python3 manage.py migrate
      sudo -u pyscada -E env PATH=${PATH} python3 manage.py collectstatic --noinput

      # Load fixtures with default configuration for chart lin colors and units
      sudo -u pyscada -E env PATH=${PATH} python3 manage.py loaddata color
      sudo -u pyscada -E env PATH=${PATH} python3 manage.py loaddata units

      # Initialize the background service system of pyscada
      sudo -u pyscada -E env PATH=${PATH} python3 manage.py pyscada_daemon init
  )

  if [[ "$answer_update" == "n" ]]; then
    web_setup
  fi

  # enable the services for autostart
  systemctl enable gunicorn
  systemctl restart gunicorn
  systemctl enable pyscada
  systemctl restart pyscada
  sleep 1
  systemctl --quiet is-active pyscada
  if [ $? != 0 ] ; then
      echo "Can't start pyscada systemd service." > /dev/stderr
      exit 1
  fi

  if [[ "$answer_update" == "n" ]]; then
    echo "PyScada installed"
    echo "Connect to http://127.0.0.1 using :"
    echo "username : $answer_web_name"
    echo "password : $answer_web_password"
  else
    echo "PyScada updated"
  fi

  debug "pyscada_init end"
}

# called in the core of the script
function db_setup(){
  debug "db_setup"

  # Create DB
  mysql << EOF
    CREATE DATABASE IF NOT EXISTS ${answer_db_name}
      CHARACTER SET utf8;
    GRANT ALL PRIVILEGES ON ${answer_db_name}.*
      TO '${answer_db_user}'@'localhost'
      IDENTIFIED BY '${answer_db_password}';
EOF

  debug "db_setup end"
}

#called in the core of the script
function template_setup(){
  debug "template_setup"

  # add db informations to django template
  rm -r ./tests/project_template_tmp/
  cp -r ./tests/project_template ./tests/project_template_tmp/
  chmod a+w ./tests/project_template_tmp/project_name/settings.py-tpl
  sudo -u pyscada -E env PATH=${PATH} python3 << EOF
import django
from django.conf import settings
from django.template.loader import render_to_string

settings.configure(
    TEMPLATES=[{
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['./'],  # script dir
  'OPTIONS': {'string_if_invalid': '{{ %s }}'}, # prevents the other template tags to be replaced by ''
    }]
)

django.setup()
from django.template import Template, Context
with open("./tests/project_template_tmp/project_name/settings.py-tpl", "r+") as f:
  template = Template(f.read())
  context = Context({
                "db_name": "${answer_db_name}",
                "db_user": "${answer_db_user}",
                "db_password": "${answer_db_password}",
                "project_root": "${INSTALL_ROOT}",
                "pyscada_home": "${pyscada_home}",
                "log_file_dir": "${log_file_dir}",
                "project_admins": "${project_admins}",
                "auto_add_apps": "${answer_auto_add_apps}",
                "additional_apps": "",
                "additional_settings": "",
                })
  f.seek(0)
  f.write(template.render(context))
  f.truncate()
EOF

  sudo -u pyscada mkdir -p $SERVER_ROOT
  sudo -u pyscada -E env PATH=${PATH} django-admin startproject PyScadaServer $SERVER_ROOT --template ./tests/project_template_tmp
  rm -rf ./tests/project_template_tmp

  debug "template_setup end"
}

# called in the core of the script
function user_setup(){
  debug "user_setup"

  # Create pyscada user
  echo "Creating system user pyscada..."
  useradd -r pyscada
  mkdir -p $pyscada_home
  chown -R pyscada:pyscada $pyscada_home
  mkdir -p $INSTALL_ROOT
  chown -R pyscada:pyscada $INSTALL_ROOT
  mkdir -p $pyscada_home/measurement_data_dumps
  chown -R pyscada:pyscada $pyscada_home/measurement_data_dumps

  mkdir ${log_file_dir}
  chown pyscada:pyscada ${log_file_dir}
  touch ${log_file_dir}pyscada_{daemon,debug}.log
  chown pyscada:pyscada ${log_file_dir}pyscada_{daemon,debug}.log

  # Add rights for usb, i2c and serial
  adduser www-data pyscada
  adduser pyscada dialout

  debug "user_setup end"
}

# stop pyscada and show some python3 packages installed
function stop_pyscada(){
  debug "stop_pyscada"

  echo "Stopping PyScada"
  systemctl stop pyscada gunicorn gunicorn.socket
  sleep 1 # Give systemd time to shutdown
  systemctl --quiet is-active pyscada
  if [ $? == 0 ] ; then
    echo "Can't stop pyscada systemd service. Aborting."
    exit 1
  fi
  echo "PyScada stopped"

  debug "stop_pyscada end"
}

# install process: * means depending on the user answer
: <<'END'
- questions_setup
  - regex_proxy
  - *questions_clean_install_setup
    - admin_name_setup
    - regex_mail
- stop_pyscada
- user_setup
- install_dependences
  - apt_proxy
  - pip3_proxy
- pyscada install
- *install_channel_redis
  - apt_proxy
  - pip3_proxy_not_rust
  - pip3_proxy
- *db_setup
- *template_setup
- pyscada_init
  - *web_setup
END

questions_setup

stop_pyscada

user_setup

install_dependences

# Install PyScada
pip3_proxy install --upgrade .


if [[ "$answer_channels" == "y" ]]; then
  install_channel_redis
fi

if [[ "$answer_update" == "n" ]]; then
  db_setup
  template_setup
fi

pyscada_init

# fix owner in /home/pyscada
chown -R pyscada:pyscada $pyscada_home


================================================
FILE: move_data.py
================================================
# -*- coding: utf-8 -*-
"""
copies data from pyscada.models.RecordedDataOld to RecordedData
the script will terminate after 5 minutes, if you would like to copy more content change the timeout accordingly
"""

from __future__ import unicode_literals
import os

import gc
from datetime import datetime
from time import time
from pytz import UTC
import logging

logger = logging.getLogger("pyscada.core.move_data")


def queryset_iterator(queryset, chunk_size=100000):
    counter = 0
    count = chunk_size
    while count == chunk_size:
        offset = counter - counter % chunk_size
        count = 0
        for item in queryset.all()[offset : offset + chunk_size]:
            count += 1
            yield item
        counter += count
        gc.collect()


if __name__ == "__main__":
    os.chdir("/var/www/pyscada/PyScadaServer")
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyScadaServer.settings")
    import django

    django.setup()
    from pyscada.models import RecordedData, RecordedDataOld

    min_pk = RecordedData.objects.first().pk
    recoded_data_set = queryset_iterator(
        RecordedDataOld.objects.filter(pk__lt=min_pk).order_by("-pk")
    )
    # recoded_data_set = queryset_iterator(RecordedDataOld.objects.all().order_by('-pk'))
    # logger.info('%d'%min_pk)
    # logger.info('%d'%RecordedDataOld.objects.filter(pk__lt=min_pk).count())
    count = 0
    count_all = 0
    timeout = time() + 60 * 10  # <-- set the timeout in minutes
    items = []
    for item in recoded_data_set:
        # if RecordedData.objects.filter(pk=item.id):
        #    continue
        items.append(
            RecordedData(
                id=item.id,
                variable_id=item.variable_id,
                value_boolean=item.value_boolean,
                value_int16=item.value_int16,
                value_int32=item.value_int32,
                value_int64=item.value_int64,
                value_float64=item.value_float64,
                date_saved=datetime.fromtimestamp(
                    (item.pk - item.variable.pk) / 2097152 / 1000.0, UTC
                ),
            )
        )
        if time() > timeout:
            break

        count += 1
        if count >= 10000:
            RecordedData.objects.bulk_create(items)
            items = []
            count_all += count
            count = 0
            logger.info("wrote %d lines in total\n" % count_all)

    if len(items) > 0:
        RecordedData.objects.bulk_create(items)
        count_all += len(items)
        logger.info("wrote %d lines in total\n" % count_all)


================================================
FILE: pyproject.toml
================================================
[build-system]
requires = ["setuptools>=61.0.0,<69.3.0"]
build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "PyScada"
dynamic = ["version"]
requires-python = ">= 3.10"
dependencies = [
    "django>=5.2,<5.3",
    "numpy>=1.6.0",
    "h5py>=2.2.1",
    "pillow",
    "python-daemon>=2.0.0",
    "pytz",
    "python-dateutil",
    # 'channels',
    # 'channels-redis',
    "asgiref",
    "monthdelta",
    "six",
    "concurrent-log-handler",  # rotating logs for multiprocess
    "scipy",
]
authors = [
  {name = "Martin Schröder", email = "team@pyscada.org"},
  {name = "Camille Lavayssiere", email = "team@pyscada.org"}
]
description="A Python and Django based Open Source SCADA System"
readme = "README.rst"
license = {text = "AGPLv3"}
classifiers = [
    "Development Status :: 4 - Beta",
    "Environment :: Web Environment",
    "Environment :: Console",
    "Framework :: Django",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
    "Operating System :: POSIX",
    "Operating System :: MacOS :: MacOS X",
    "Programming Language :: Python",
    "Programming Language :: JavaScript",
    "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
    "Topic :: Scientific/Engineering :: Visualization",
]


[project.urls]
Homepage = "https://www.pyscada.org/"
Documentation = "https://pyscada.readthedocs.io"
Source = "https://github.com/pyscada/PyScada"
Tracker = "https://github.com/pyscada/PyScada/issues"

[tool.black]
target-version = ["py310"]
force-exclude = "tests/test_runner_apps/tagged/tests_syntax_error.py"

[tool.isort]
profile = "black"
default_section = "THIRDPARTY"
known_first_party = "pyscada"

[tool.setuptools.packages.find]
include = ["pyscada*"]


================================================
FILE: pyscada/__init__.py
================================================
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)


================================================
FILE: pyscada/admin.py
================================================
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from pyscada.models import Device, DeviceProtocol, DeviceHandler
from pyscada.models import Variable, VariableProperty, DataSource, DataSourceModel
from pyscada.models import Scaling, Color
from pyscada.models import Unit, Dictionary, DictionaryItem
from pyscada.models import DeviceWriteTask, DeviceReadTask
from pyscada.models import Log
from pyscada.models import BackgroundProcess
from pyscada.models import (
    ComplexEvent,
    ComplexEventLevel,
    ComplexEventInput,
    ComplexEventOutput,
)
from pyscada.models import Event
from pyscada.models import RecordedEvent
from pyscada.models import Mail
from pyscada.models import DeviceHandlerParameter, VariableHandlerParameter

from django.contrib import messages
from django.contrib import admin
from django import forms
from django.contrib.admin import AdminSite
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from django.utils.translation import gettext_lazy as _
from django.db.models.fields.related import OneToOneRel
from django.utils.html import mark_safe
from django.forms import BaseInlineFormSet
from django.core.exceptions import ValidationError

from django import forms
from django.db.utils import ProgrammingError, OperationalError
from django.conf import settings

import sys
import datetime
import signal
import logging

logger = logging.getLogger(__name__)


# Custom AdminSite


class PyScadaAdminSite(AdminSite):
    site_header = "PyScada Administration"


def populate_inline(items, form_model=None, output=[],
Download .txt
gitextract_2o9djmi1/

├── .flake8
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── AUTHORS
├── CHANGELOG.txt
├── LICENSE
├── MANIFEST.in
├── README.rst
├── docker/
│   ├── docker-compose.yml-tmp
│   ├── mysql/
│   │   └── Dockerfile-tmp
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── pyscada/
│       ├── Dockerfile
│       ├── pyscada
│       └── pyscada_init
├── docs/
│   ├── Makefile
│   ├── backend.rst
│   ├── command-line.rst
│   ├── conf.py
│   ├── control_item.rst
│   ├── develop.rst
│   ├── device_protocol.rst
│   ├── django_settings.rst
│   ├── docker.rst
│   ├── frontend.rst
│   ├── grafana.rst
│   ├── index.rst
│   ├── installation.rst
│   ├── make.bat
│   ├── nginx_setup.rst
│   ├── phant.rst
│   ├── plugin_install.rst
│   ├── quick_install.rst
│   ├── raspberryPiOS.rst
│   ├── uninstall.rst
│   ├── update.rst
│   └── visa.rst
├── eslint.config.mjs
├── extras/
│   ├── 0.7to0.8.sh
│   ├── Grafana-test-dashboard.json
│   ├── nginx_sample.conf
│   ├── pyscada-logrotate
│   ├── service/
│   │   ├── SysV-init/
│   │   │   ├── gunicorn_django
│   │   │   └── pyscada_daemon
│   │   ├── systemd/
│   │   │   ├── gunicorn.service
│   │   │   ├── gunicorn.socket
│   │   │   ├── owfs.service
│   │   │   └── pyscada_daemon.service
│   │   └── windows/
│   │       └── register_windows_service.py
│   ├── settings.py
│   └── urls.py
├── install.sh
├── install_docker.sh
├── install_venv.sh
├── move_data.py
├── pyproject.toml
├── pyscada/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── cache_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── core/
│   │   ├── __init__.py
│   │   └── urls.py
│   ├── device.py
│   ├── django_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── event/
│   │   ├── __init__.py
│   │   └── worker.py
│   ├── export/
│   │   ├── __init__.py
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── csv_file.py
│   │   ├── export.py
│   │   ├── hdf5_file.py
│   │   ├── management/
│   │   │   ├── __init__.py
│   │   │   └── commands/
│   │   │       ├── PyScadaExportData.py
│   │   │       └── __init__.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   ├── 0002_auto_20151201_1617.py
│   │   │   ├── 0003_auto_20160315_1140.py
│   │   │   ├── 0004_exporttask.py
│   │   │   ├── 0005_auto_20160403_1454.py
│   │   │   ├── 0006_auto_20160404_0949.py
│   │   │   ├── 0007_auto_20161124_1002.py
│   │   │   ├── 0008_auto_20161124_1003.py
│   │   │   ├── 0009_auto_20161128_0948.py
│   │   │   ├── 0010_auto_20161128_1049.py
│   │   │   ├── 0011_exporttask_filename.py
│   │   │   ├── 0012_exporttask_backgroundprocess.py
│   │   │   ├── 0013_auto_20170711_0729.py
│   │   │   ├── 0014_auto_20170711_1326.py
│   │   │   ├── 0015_remove_exporttask_backgroundtask.py
│   │   │   ├── 0016_auto_20191004_0912.py
│   │   │   └── __init__.py
│   │   ├── models.py
│   │   └── worker.py
│   ├── fixtures/
│   │   ├── color.json
│   │   └── units.json
│   ├── generic/
│   │   ├── __init__.py
│   │   ├── device.py
│   │   ├── devices/
│   │   │   ├── __init__.py
│   │   │   ├── dummy.py
│   │   │   └── waveform.py
│   │   └── worker.py
│   ├── hmi/
│   │   ├── __init__.py
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   ├── 0002_auto_20151016_1932.py
│   │   │   ├── 0003_auto_20151130_1456.py
│   │   │   ├── 0004_auto_20151130_1502.py
│   │   │   ├── 0005_auto_20160111_1822.py
│   │   │   ├── 0006_auto_20160111_1848.py
│   │   │   ├── 0007_auto_20160518_0848.py
│   │   │   ├── 0008_auto_20180620_0716.py
│   │   │   ├── 0009_controlitem_property_name.py
│   │   │   ├── 0010_auto_20180705_1341.py
│   │   │   ├── 0011_auto_20180710_1549.py
│   │   │   ├── 0012_auto_20180912_1302.py
│   │   │   ├── 0013_widget_update_20180912_1315.py
│   │   │   ├── 0014_auto_20180912_1340.py
│   │   │   ├── 0015_auto_20180913_1608.py
│   │   │   ├── 0016_auto_20181004_0831.py
│   │   │   ├── 0017_groupdisplaypermission_forms.py
│   │   │   ├── 0018_auto_20181205_0937.py
│   │   │   ├── 0019_auto_20181205_1058.py
│   │   │   ├── 0020_pie.py
│   │   │   ├── 0021_auto_20190528_0924.py
│   │   │   ├── 0022_auto_20191004_0912.py
│   │   │   ├── 0023_dropdownitem_value.py
│   │   │   ├── 0024_auto_20191212_1516.py
│   │   │   ├── 0025_widgetcontent_content_str.py
│   │   │   ├── 0026_auto_20200915_1333.py
│   │   │   ├── 0027_auto_20200915_1407.py
│   │   │   ├── 0028_auto_20200915_1540.py
│   │   │   ├── 0029_auto_20200916_0720.py
│   │   │   ├── 0030_auto_20200918_0842.py
│   │   │   ├── 0031_auto_20200918_1206.py
│   │   │   ├── 0032_auto_20200918_1408.py
│   │   │   ├── 0033_auto_20200918_1439.py
│   │   │   ├── 0034_auto_20200918_1445.py
│   │   │   ├── 0035_auto_20200918_1517.py
│   │   │   ├── 0036_auto_20200923_0850.py
│   │   │   ├── 0037_auto_20200923_0852.py
│   │   │   ├── 0038_auto_20200929_1410.py
│   │   │   ├── 0039_auto_20201002_0928.py
│   │   │   ├── 0040_dictionary_dictionaryitem.py
│   │   │   ├── 0041_auto_20201002_0934.py
│   │   │   ├── 0042_auto_20201201_1335.py
│   │   │   ├── 0043_auto_20201201_1411.py
│   │   │   ├── 0044_auto_20201201_1539.py
│   │   │   ├── 0045_auto_20201201_2100.py
│   │   │   ├── 0046_auto_20201201_2109.py
│   │   │   ├── 0047_auto_20201202_1445.py
│   │   │   ├── 0048_chartaxis_fill.py
│   │   │   ├── 0049_auto_20201202_2037.py
│   │   │   ├── 0050_auto_20201203_2101.py
│   │   │   ├── 0051_auto_20201204_0901.py
│   │   │   ├── 0052_auto_20201204_0949.py
│   │   │   ├── 0053_auto_20211118_1438.py
│   │   │   ├── 0054_displayvalueoption_type.py
│   │   │   ├── 0055_auto_20211125_1405.py
│   │   │   ├── 0056_auto_20211210_1608.py
│   │   │   ├── 0057_auto_20211214_1157.py
│   │   │   ├── 0058_auto_20220523_1639.py
│   │   │   ├── 0059_alter_view_theme.py
│   │   │   ├── 0060_chartaxis_show_bars.py
│   │   │   ├── 0061_auto_20220610_1459.py
│   │   │   ├── 0062_auto_20220616_1523.py
│   │   │   ├── 0063_move_group_display_permissions.py
│   │   │   ├── 0064_auto_20220617_1333.py
│   │   │   ├── 0065_auto_20220620_0854.py
│   │   │   ├── 0066_auto_20221205_1435.py
│   │   │   ├── 0067_alter_cssclass_options.py
│   │   │   ├── 0068_alter_displayvalueoption_timestamp_conversion.py
│   │   │   ├── 0069_displayvalueoption_color_and_more.py
│   │   │   ├── 0070_move_displayvalueoptions.py
│   │   │   ├── 0071_remove_displayvalueoption_color_1_and_more.py
│   │   │   ├── 0072_alter_groupdisplaypermission_hmi_group.py
│   │   │   ├── 0073_alter_processflowdiagramitem_control_item.py
│   │   │   ├── 0074_alter_cssclass_css_class.py
│   │   │   ├── 0075_alter_processflowdiagram_url_height_and_more.py
│   │   │   ├── 0076_displayvalueoptiontemplate_transformdata_and_more.py
│   │   │   ├── 0077_transformdatacountvalue.py
│   │   │   ├── 0078_alter_theme_base_filename_alter_theme_view_filename.py
│   │   │   ├── 0079_displayvalueoption_from_timestamp_offset.py
│   │   │   ├── 0080_view_default_time_delta.py
│   │   │   ├── 0081_groupdisplaypermission_unauthenticated_users.py
│   │   │   ├── 0082_externalview.py
│   │   │   ├── 0083_externalviewgroupdisplaypermission.py
│   │   │   └── __init__.py
│   │   ├── models.py
│   │   ├── signals.py
│   │   ├── static/
│   │   │   └── pyscada/
│   │   │       ├── css/
│   │   │       │   ├── bootstrap/
│   │   │       │   │   ├── bootstrap-theme.css
│   │   │       │   │   └── bootstrap.css
│   │   │       │   ├── daterangepicker/
│   │   │       │   │   └── daterangepicker.css
│   │   │       │   ├── fonts/
│   │   │       │   │   └── roboto/
│   │   │       │   │       └── LICENSE.txt
│   │   │       │   ├── jquery-ui/
│   │   │       │   │   ├── AUTHORS.txt
│   │   │       │   │   ├── LICENSE.txt
│   │   │       │   │   ├── jquery-ui.css
│   │   │       │   │   ├── jquery-ui.structure.css
│   │   │       │   │   ├── jquery-ui.theme.css
│   │   │       │   │   └── package.json
│   │   │       │   └── pyscada/
│   │   │       │       └── pyscada-theme.css
│   │   │       └── js/
│   │   │           ├── MIT-LICENSE.txt
│   │   │           ├── admin/
│   │   │           │   ├── display_inline_datasource.js
│   │   │           │   ├── display_inline_protocols_device.js
│   │   │           │   ├── display_inline_protocols_variable.js
│   │   │           │   ├── display_inline_transform_data_display_value_option.js
│   │   │           │   ├── handler_content_as_pre.js
│   │   │           │   └── hideshow.js
│   │   │           ├── bootstrap/
│   │   │           │   ├── affix.js
│   │   │           │   ├── alert.js
│   │   │           │   ├── bootstrap.js
│   │   │           │   ├── button.js
│   │   │           │   ├── carousel.js
│   │   │           │   ├── collapse.js
│   │   │           │   ├── dropdown.js
│   │   │           │   ├── modal.js
│   │   │           │   ├── npm.js
│   │   │           │   ├── popover.js
│   │   │           │   ├── scrollspy.js
│   │   │           │   ├── tab.js
│   │   │           │   ├── tooltip.js
│   │   │           │   └── transition.js
│   │   │           ├── dexie/
│   │   │           │   └── LICENSE.txt
│   │   │           ├── flot/
│   │   │           │   ├── LICENSE.txt
│   │   │           │   ├── jquery.event.drag.LICENSE.txt
│   │   │           │   ├── jquery.mousewheel.LICENSE.txt
│   │   │           │   ├── lib/
│   │   │           │   │   ├── globalize.culture.en-US.js
│   │   │           │   │   ├── globalize.js
│   │   │           │   │   ├── jquery.event.drag.js
│   │   │           │   │   └── jquery.mousewheel.js
│   │   │           │   └── source/
│   │   │           │       ├── jquery.canvaswrapper.js
│   │   │           │       ├── jquery.colorhelpers.js
│   │   │           │       ├── jquery.flot.axislabels.js
│   │   │           │       ├── jquery.flot.browser.js
│   │   │           │       ├── jquery.flot.categories.js
│   │   │           │       ├── jquery.flot.composeImages.js
│   │   │           │       ├── jquery.flot.crosshair.js
│   │   │           │       ├── jquery.flot.drawSeries.js
│   │   │           │       ├── jquery.flot.errorbars.js
│   │   │           │       ├── jquery.flot.fillbetween.js
│   │   │           │       ├── jquery.flot.flatdata.js
│   │   │           │       ├── jquery.flot.gauge.js
│   │   │           │       ├── jquery.flot.hover.js
│   │   │           │       ├── jquery.flot.image.js
│   │   │           │       ├── jquery.flot.js
│   │   │           │       ├── jquery.flot.legend.js
│   │   │           │       ├── jquery.flot.logaxis.js
│   │   │           │       ├── jquery.flot.navigate.js
│   │   │           │       ├── jquery.flot.pie.js
│   │   │           │       ├── jquery.flot.resize.js
│   │   │           │       ├── jquery.flot.saturated.js
│   │   │           │       ├── jquery.flot.selection.js
│   │   │           │       ├── jquery.flot.stack.js
│   │   │           │       ├── jquery.flot.symbol.js
│   │   │           │       ├── jquery.flot.threshold.js
│   │   │           │       ├── jquery.flot.time.js
│   │   │           │       ├── jquery.flot.touch.js
│   │   │           │       ├── jquery.flot.touchNavigate.js
│   │   │           │       ├── jquery.flot.uiConstants.js
│   │   │           │       └── jquery.js
│   │   │           ├── jquery/
│   │   │           │   ├── jquery.cookie.js
│   │   │           │   └── parser-input-select.js
│   │   │           ├── jquery-ui/
│   │   │           │   ├── AUTHORS.txt
│   │   │           │   ├── LICENSE.txt
│   │   │           │   ├── jquery-ui.js
│   │   │           │   └── package.json
│   │   │           ├── jquery.flot.axisvalues.js
│   │   │           ├── pyscada/
│   │   │           │   ├── TransformDataHmiPlugin.js
│   │   │           │   ├── pyscada_tests.js
│   │   │           │   └── pyscada_v0-9-0.js
│   │   │           └── tempusdominus-bootstrap-3.js
│   │   ├── templates/
│   │   │   ├── 403.html
│   │   │   ├── _chart_legend.html
│   │   │   ├── base.html
│   │   │   ├── button.html
│   │   │   ├── chart.html
│   │   │   ├── chart_legend.html
│   │   │   ├── choose_login.html
│   │   │   ├── circular_gauge.html
│   │   │   ├── content_page.html
│   │   │   ├── control_element.html
│   │   │   ├── control_panel.html
│   │   │   ├── custom_html_panel.html
│   │   │   ├── dropdown.html
│   │   │   ├── form.html
│   │   │   ├── login.html
│   │   │   ├── modelProperties.html
│   │   │   ├── password_change.html
│   │   │   ├── password_change_done.html
│   │   │   ├── pie.html
│   │   │   ├── process_flow_diagram.html
│   │   │   ├── status_element.html
│   │   │   ├── svg_loading_icon.html
│   │   │   ├── template_not_found.html
│   │   │   ├── user_dropdown.html
│   │   │   ├── user_profile_change.html
│   │   │   ├── value_field.html
│   │   │   ├── view.html
│   │   │   ├── view_overview.html
│   │   │   └── widget_row.html
│   │   ├── templatetags/
│   │   │   ├── __init__.py
│   │   │   └── views_extras.py
│   │   ├── urls.py
│   │   └── views.py
│   ├── log/
│   │   └── __init__.py
│   ├── mail/
│   │   ├── __init__.py
│   │   └── worker.py
│   ├── management/
│   │   ├── __init__.py
│   │   └── commands/
│   │       ├── __init__.py
│   │       └── pyscada_daemon.py
│   ├── migrations/
│   │   ├── 0001_initial.py
│   │   ├── 0002_event_hysteresis.py
│   │   ├── 0003_auto_20151026_1826.py
│   │   ├── 0004_unit_udunit.py
│   │   ├── 0005_merge.py
│   │   ├── 0006_auto_20151130_1449.py
│   │   ├── 0007_auto_20151201_1613.py
│   │   ├── 0008_auto_20151201_1614.py
│   │   ├── 0009_auto_20160111_1802.py
│   │   ├── 0010_auto_20160115_0918.py
│   │   ├── 0011_auto_20160115_0920.py
│   │   ├── 0012_auto_20160119_0950.py
│   │   ├── 0013_auto_20160204_0840.py
│   │   ├── 0014_auto_20160210_1152.py
│   │   ├── 0015_auto_20160215_1522.py
│   │   ├── 0016_auto_20160215_2002.py
│   │   ├── 0017_recordeddata.py
│   │   ├── 0018_auto_20160228_1623.py
│   │   ├── 0019_datamigration_20160228_1624.py
│   │   ├── 0020_auto_20160228_1641.py
│   │   ├── 0021_auto_20160228_1643.py
│   │   ├── 0022_auto_20160228_2029.py
│   │   ├── 0023_auto_20160314_1817.py
│   │   ├── 0024_auto_20160517_1047.py
│   │   ├── 0025_auto_20160517_1734.py
│   │   ├── 0026_auto_20160518_0848.py
│   │   ├── 0027_auto_20160530_1436.py
│   │   ├── 0028_auto_20160630_0831.py
│   │   ├── 0029_scaling_limit_input.py
│   │   ├── 0030_device_polling_interval.py
│   │   ├── 0031_delete_variableconfigfileimport.py
│   │   ├── 0032_auto_20161107_2206.py
│   │   ├── 0033_auto_20161107_2241.py
│   │   ├── 0034_auto_20170213_0855.py
│   │   ├── 0035_auto_20170224_1215.py
│   │   ├── 0036_auto_20170224_1245.py
│   │   ├── 0037_auto_20170418_0931.py
│   │   ├── 0038_auto_20170707_1209.py
│   │   ├── 0039_auto_20170711_1326.py
│   │   ├── 0040_auto_20170905_0942.py
│   │   ├── 0041_update_protocol_id.py
│   │   ├── 0042_auto_20180604_1240.py
│   │   ├── 0043_devicewritetask_property_name.py
│   │   ├── 0044_auto_20180704_1307.py
│   │   ├── 0045_auto_20180705_1341.py
│   │   ├── 0046_remove_devicewritetask_property_name.py
│   │   ├── 0047_recordeddatanew.py
│   │   ├── 0047_variableproperty_unit.py
│   │   ├── 0048_datamigration_20181025_0918.py
│   │   ├── 0049_auto_20181025_1049.py
│   │   ├── 0050_merge_20181130_1143.py
│   │   ├── 0051_auto_20181206_1107.py
│   │   ├── 0052_auto_20181207_1019.py
│   │   ├── 0053_auto_20190207_1526.py
│   │   ├── 0053_auto_20190307_1423.py
│   │   ├── 0054_auto_20190208_0913.py
│   │   ├── 0054_auto_20190411_0749.py
│   │   ├── 0055_auto_20190625_1752.py
│   │   ├── 0056_auto_20190625_1823.py
│   │   ├── 0057_auto_20191004_0912.py
│   │   ├── 0058_merge_20191206_1328.py
│   │   ├── 0059_auto_20200211_1049.py
│   │   ├── 0060_auto_20200914_1417.py
│   │   ├── 0061_devicereadtask.py
│   │   ├── 0062_auto_20201002_0830.py
│   │   ├── 0063_complexevent_complexeventitem_complexeventitemvariable.py
│   │   ├── 0064_auto_20201005_1443.py
│   │   ├── 0065_auto_20201005_1454.py
│   │   ├── 0066_auto_20201006_0718.py
│   │   ├── 0067_auto_20201006_0719.py
│   │   ├── 0068_auto_20201006_0826.py
│   │   ├── 0069_complexeventgroup_current_level.py
│   │   ├── 0070_auto_20201006_1327.py
│   │   ├── 0071_recordedevent_level.py
│   │   ├── 0072_auto_20201006_1408.py
│   │   ├── 0073_auto_20201007_0858.py
│   │   ├── 0074_complexeventitem_active.py
│   │   ├── 0075_auto_20201007_1609.py
│   │   ├── 0076_mail_html_message.py
│   │   ├── 0077_auto_20201104_1656.py
│   │   ├── 0078_auto_20201123_1906.py
│   │   ├── 0079_devicehandler.py
│   │   ├── 0080_variableproperty_last_modified.py
│   │   ├── 0081_calculatedvariable_periodfield_variablecalculatedfields.py
│   │   ├── 0082_auto_20211112_1043.py
│   │   ├── 0083_auto_20211115_0812.py
│   │   ├── 0084_auto_20211115_1503.py
│   │   ├── 0085_calculatedvariableselector_active.py
│   │   ├── 0086_auto_20211115_1612.py
│   │   ├── 0087_auto_20211116_1329.py
│   │   ├── 0088_auto_20211117_1023.py
│   │   ├── 0089_calculatedvariable_state.py
│   │   ├── 0090_auto_20211117_1239.py
│   │   ├── 0091_auto_20211118_1019.py
│   │   ├── 0092_auto_20211125_1054.py
│   │   ├── 0093_auto_20211125_1256.py
│   │   ├── 0094_move_dictionaries.py
│   │   ├── 0095_auto_20211203_1949.py
│   │   ├── 0096_auto_20211210_0924.py
│   │   ├── 0097_auto_20220118_1046.py
│   │   ├── 0098_alter_device_polling_interval.py
│   │   ├── 0099_alter_dictionaryitem_label.py
│   │   ├── 0100_device_instrument_handler.py
│   │   ├── 0101_complexeventchangevariable.py
│   │   ├── 0102_move_complex_event_variables.py
│   │   ├── 0103_remove_complexevent_new_value_and_more.py
│   │   ├── 0104_rename_complexeventitem_complexeventinput_and_more.py
│   │   ├── 0105_edit_generic_device_protocol.py
│   │   ├── 0106_datasource_datasourcemodel_djangodatabase_and_more.py
│   │   ├── 0107_alter_calculatedvariableselector_period_fields.py
│   │   ├── 0108_remove_calculatedvariable_period_and_more.py
│   │   ├── 0109_alter_variable_value_class.py
│   │   ├── 0110_variable_readable.py
│   │   ├── 0111_devicehandlerparameter.py
│   │   ├── 0112_alter_devicehandlerparameter_value.py
│   │   ├── 0113_variablehandlerparameter.py
│   │   ├── 0114_alter_devicehandlerparameter_value_and_more.py
│   │   ├── 0115_remove_recordeddata_variable_and_more.py
│   │   ├── 0116_variable_pause_recording.py
│   │   └── __init__.py
│   ├── models.py
│   ├── signals.py
│   ├── single_value_datasource/
│   │   ├── __init__.py
│   │   ├── apps.py
│   │   ├── migrations/
│   │   │   ├── 0001_initial.py
│   │   │   └── __init__.py
│   │   └── models.py
│   ├── tests.py
│   ├── utils/
│   │   ├── __init__.py
│   │   └── scheduler.py
│   └── views.py
├── setup.py
├── tests/
│   ├── project_template/
│   │   ├── manage.py-tpl
│   │   └── project_name/
│   │       ├── __init__.py-tpl
│   │       ├── asgi.py-tpl
│   │       ├── settings.py-tpl
│   │       ├── urls.py-tpl
│   │       └── wsgi.py-tpl
│   ├── test.sh
│   ├── test_modbus.sh
│   └── test_without_plugins.sh
└── tox.ini
Download .txt
SYMBOL INDEX (1384 symbols across 316 files)

FILE: extras/service/windows/register_windows_service.py
  class AppServerSvc (line 8) | class AppServerSvc(win32serviceutil.ServiceFramework):
    method __init__ (line 13) | def __init__(self, args):
    method SvcStop (line 17) | def SvcStop(self):
    method SvcDoRun (line 27) | def SvcDoRun(self):
    method main (line 35) | def main(self):

FILE: move_data.py
  function queryset_iterator (line 19) | def queryset_iterator(queryset, chunk_size=100000):

FILE: pyscada/admin.py
  class PyScadaAdminSite (line 49) | class PyScadaAdminSite(AdminSite):
  function populate_inline (line 53) | def populate_inline(items, form_model=None, output=[], stacked=admin.Sta...
  function restart_process (line 79) | def restart_process(_modeladmin, request, queryset):
  function stop_process (line 91) | def stop_process(_modeladmin, request, queryset):
  function kill_process (line 103) | def kill_process(_modeladmin, request, queryset):
  function silent_delete (line 115) | def silent_delete(self, _request, queryset):
  class BackgroundProcessFilter (line 123) | class BackgroundProcessFilter(admin.SimpleListFilter):
    method lookups (line 131) | def lookups(self, request, model_admin):
    method queryset (line 146) | def queryset(self, request, queryset):
  class VariableInlineAdminFrom (line 158) | class VariableInlineAdminFrom(forms.ModelForm):
    method has_changed (line 159) | def has_changed(self):
  class VariableAdminFrom (line 175) | class VariableAdminFrom(forms.ModelForm):
    method __init__ (line 176) | def __init__(self, *args, **kwargs):
  class VariableState (line 223) | class VariableState(Variable):
    class Meta (line 224) | class Meta:
  class VariableStateAdmin (line 228) | class VariableStateAdmin(admin.ModelAdmin):
    class Media (line 250) | class Media:
    method last_value (line 258) | def last_value(self, instance):
  class DeviceForm (line 273) | class DeviceForm(forms.ModelForm):
    method has_changed (line 274) | def has_changed(self):
  class DeviceHandlerParameterInlineForm (line 294) | class DeviceHandlerParameterInlineForm(forms.ModelForm):
    class Meta (line 295) | class Meta:
  class DeviceHandlerParameterInlineFormSet (line 300) | class DeviceHandlerParameterInlineFormSet(BaseInlineFormSet):
    method clean (line 301) | def clean(self):
  class DeviceAdmin (line 339) | class DeviceAdmin(admin.ModelAdmin):
    method get_form (line 383) | def get_form(self, request, obj=None, **kwargs):
    method formfield_for_foreignkey (line 398) | def formfield_for_foreignkey(self, db_field, request, **kwargs):
    class Media (line 436) | class Media:
  class DeviceHandlerAdmin (line 446) | class DeviceHandlerAdmin(admin.ModelAdmin):
    method has_module_permission (line 465) | def has_module_permission(self, request):
    method found (line 469) | def found(self, instance):
    method content (line 481) | def content(self, instance):
    method get_form (line 497) | def get_form(self, request, obj=None, **kwargs):
    method get_readonly_fields (line 508) | def get_readonly_fields(self, request, obj=None):
    class Media (line 513) | class Media:
  class VariableHandlerParameterInlineForm (line 520) | class VariableHandlerParameterInlineForm(forms.ModelForm):
    class Meta (line 521) | class Meta:
  class VariableHandlerParameterInlineFormSet (line 526) | class VariableHandlerParameterInlineFormSet(BaseInlineFormSet):
    method clean (line 527) | def clean(self):
  class VariableAdmin (line 568) | class VariableAdmin(admin.ModelAdmin):
    method get_form (line 607) | def get_form(self, request, obj=None, **kwargs):
    class Media (line 619) | class Media:
    method device_name (line 628) | def device_name(self, instance):
    method unit (line 631) | def unit(self, instance):
    method color_code (line 634) | def color_code(self, instance):
  class CoreVariableAdmin (line 638) | class CoreVariableAdmin(VariableAdmin):
    method formfield_for_foreignkey (line 660) | def formfield_for_foreignkey(self, db_field, request, **kwargs):
  class ScalingAdmin (line 671) | class ScalingAdmin(admin.ModelAdmin):
  class DeviceWriteTaskAdmin (line 693) | class DeviceWriteTaskAdmin(admin.ModelAdmin):
    method name (line 713) | def name(self, instance):
    method user_name (line 716) | def user_name(self, instance):
    method start_time (line 722) | def start_time(self, instance):
    method has_delete_permission (line 727) | def has_delete_permission(self, request, obj=None):
  class DeviceReadTaskAdmin (line 731) | class DeviceReadTaskAdmin(admin.ModelAdmin):
    method name (line 749) | def name(self, instance):
    method user_name (line 752) | def user_name(self, instance):
    method start_time (line 758) | def start_time(self, instance):
  class LogAdmin (line 764) | class LogAdmin(admin.ModelAdmin):
    method user_name (line 778) | def user_name(self, instance):
    method time (line 784) | def time(self, instance):
    method has_add_permission (line 789) | def has_add_permission(self, request):
    method has_delete_permission (line 792) | def has_delete_permission(self, request, obj=None):
  class BackgroundProcessAdmin (line 796) | class BackgroundProcessAdmin(admin.ModelAdmin):
  class RecordedEventAdmin (line 814) | class RecordedEventAdmin(admin.ModelAdmin):
  class MailAdmin (line 836) | class MailAdmin(admin.ModelAdmin):
    method last_update (line 849) | def last_update(self, instance):
  class ComplexEventOutputAdminInline (line 855) | class ComplexEventOutputAdminInline(admin.TabularInline):
  class ComplexEventLevelAdminInline (line 862) | class ComplexEventLevelAdminInline(admin.TabularInline):
  class ComplexEventInputAdminInline (line 869) | class ComplexEventInputAdminInline(admin.StackedInline):
  class ComplexEventAdmin (line 904) | class ComplexEventAdmin(admin.ModelAdmin):
  class ComplexEventLevelAdmin (line 923) | class ComplexEventLevelAdmin(admin.ModelAdmin):
    method has_module_permission (line 943) | def has_module_permission(self, request):
  class ComplexEventInputAdmin (line 947) | class ComplexEventInputAdmin(admin.ModelAdmin):
  class EventAdmin (line 967) | class EventAdmin(admin.ModelAdmin):
  class VariablePropertyAdmin (line 991) | class VariablePropertyAdmin(admin.ModelAdmin):
    method value (line 1012) | def value(self, instance):
  class DictionaryItemInline (line 1016) | class DictionaryItemInline(admin.TabularInline):
  class DictionaryAdmin (line 1021) | class DictionaryAdmin(admin.ModelAdmin):
    method has_module_permission (line 1031) | def has_module_permission(self, request):
  class DataSourceModelSelect (line 1035) | class DataSourceModelSelect(forms.Select):
    method create_option (line 1036) | def create_option(
  class DataSourceAdminChangeForm (line 1050) | class DataSourceAdminChangeForm(forms.ModelForm):
    class Meta (line 1051) | class Meta:
  class DataSourceAdminAddForm (line 1057) | class DataSourceAdminAddForm(forms.ModelForm):
    class Meta (line 1058) | class Meta:
    method __init__ (line 1062) | def __init__(self, *args, **kwargs):
  class DataSourceAdmin (line 1101) | class DataSourceAdmin(admin.ModelAdmin):
    class Media (line 1118) | class Media:
    method get_form (line 1124) | def get_form(self, request, obj=None, change=None, **kwargs):
    method get_formsets_with_inlines (line 1131) | def get_formsets_with_inlines(self, request, obj=None):
    method datasource_name (line 1146) | def datasource_name(self, obj):
    method get_deleted_objects (line 1149) | def get_deleted_objects(self, objs, request):
    method has_view_permission (line 1163) | def has_view_permission(self, request, obj=None):
    method has_add_permission (line 1166) | def has_add_permission(self, request, obj=None):
    method has_change_permission (line 1169) | def has_change_permission(self, request, obj=None):
    method has_delete_permission (line 1172) | def has_delete_permission(self, request, obj=None):
    method formfield_for_foreignkey (line 1178) | def formfield_for_foreignkey(self, db_field, request, **kwargs):

FILE: pyscada/apps.py
  class PyScadaConfig (line 15) | class PyScadaConfig(AppConfig):
    method ready (line 22) | def ready(self):
    method pyscada_app_init (line 30) | def pyscada_app_init(self):

FILE: pyscada/cache_datasource/apps.py
  class PyScadaCacheDatasourceConfig (line 12) | class PyScadaCacheDatasourceConfig(AppConfig):

FILE: pyscada/cache_datasource/migrations/0001_initial.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/cache_datasource/models.py
  class DjangoCache (line 17) | class DjangoCache(models.Model):
    method __str__ (line 21) | def __str__(self):
    method now_ms (line 25) | def now_ms() -> int:
    method _data_lifetime_ms (line 30) | def _data_lifetime_ms(self) -> int:
    method _make_key (line 34) | def _make_key(self, variable_id: int) -> str:
    method _get_data (line 45) | def _get_data(self, variable_id: int):
    method _set_data (line 56) | def _set_data(self, variable_id: int, data: list) -> bool:
    method _update_variable_data (line 68) | def _update_variable_data(self, variable_id: int, new_data=None, date_...
    method last_datapoint (line 99) | def last_datapoint(self, variable=None, use_date_saved=False, **kwargs):
    method query_datapoints (line 139) | def query_datapoints(
    method write_datapoints (line 214) | def write_datapoints(self, items=[], date_saved=None, **kwargs):
    method write_raw_datapoints (line 239) | def write_raw_datapoints(self, datapoints: dict, date_saved=None):

FILE: pyscada/core/__init__.py
  function version (line 45) | def version():

FILE: pyscada/device.py
  class GenericHandlerDevice (line 17) | class GenericHandlerDevice:
    method __init__ (line 22) | def __init__(self, pyscada_device, variables):
    method connect (line 33) | def connect(self):
    method accessibility (line 53) | def accessibility(self):
    method disconnect (line 68) | def disconnect(self):
    method before_read (line 73) | def before_read(self):
    method after_read (line 79) | def after_read(self):
    method read_data (line 85) | def read_data(self, variable_instance):
    method read_data_and_time (line 94) | def read_data_and_time(self, variable_instance):
    method read_data_all (line 101) | def read_data_all(self, variables_dict, erase_cache=False):
    method write_data (line 119) | def write_data(self, variable_id, value, task):
    method time (line 137) | def time(self):
  class GenericDevice (line 141) | class GenericDevice:
    method __init__ (line 146) | def __init__(self, device):
    method request_data (line 186) | def request_data(self):
    method write_data (line 199) | def write_data(self, variable_id, value, task):

FILE: pyscada/django_datasource/apps.py
  class PyScadaDjangoDatasourceConfig (line 11) | class PyScadaDjangoDatasourceConfig(AppConfig):

FILE: pyscada/django_datasource/migrations/0001_initial.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/django_datasource/models.py
  class RecordedDataManager (line 18) | class RecordedDataManager(models.Manager):
    method create_data_element_from_variable (line 19) | def create_data_element_from_variable(
    method last_element (line 37) | def last_element(
    method db_data (line 97) | def db_data(
  class DjangoDatabase (line 227) | class DjangoDatabase(models.Model):
    method __str__ (line 236) | def __str__(self):
    method _import_model (line 239) | def _import_model(self):
    method last_value (line 255) | def last_value(self, **kwargs):
    method last_datapoint (line 261) | def last_datapoint(self, variable=None, use_date_saved=False, **kwargs):
    method read_multiple (line 276) | def read_multiple(self, **kwargs):
    method query_datapoints (line 282) | def query_datapoints(
    method write_multiple (line 304) | def write_multiple(self, **kwargs):
    method write_datapoints (line 310) | def write_datapoints(self, items=[], date_saved=None, batch_size=1000,...
    method write_raw_datapoints (line 357) | def write_raw_datapoints(self, datapoints: dict, date_saved=None, batc...
    class Meta (line 414) | class Meta:
  class RecordedDataOld (line 418) | class RecordedDataOld(models.Model):
    method __init__ (line 438) | def __init__(self, *args, **kwargs):
    method calculate_pk (line 510) | def calculate_pk(self, timestamp=None):
    method __str__ (line 518) | def __str__(self):
    method time_value (line 521) | def time_value(self):
    method value (line 527) | def value(self, value_class=None):
    class Meta (line 556) | class Meta:
  class RecordedData (line 560) | class RecordedData(models.Model):
    method __init__ (line 585) | def __init__(self, *args, **kwargs):
    method calculate_pk (line 698) | def calculate_pk(self, timestamp=None):
    method __str__ (line 706) | def __str__(self):
    method time_value (line 709) | def time_value(self):
    method value (line 715) | def value(self, value_class=None):
    method save (line 758) | def save(self, *args, **kwargs):
    class Meta (line 763) | class Meta:

FILE: pyscada/event/worker.py
  class Process (line 12) | class Process(BaseProcess):
    method __init__ (line 13) | def __init__(self, dt=5, **kwargs):
    method loop (line 16) | def loop(self):

FILE: pyscada/export/admin.py
  class ScheduledExportTaskAdmin (line 13) | class ScheduledExportTaskAdmin(admin.ModelAdmin):
  class ExportTaskAdmin (line 17) | class ExportTaskAdmin(admin.ModelAdmin):

FILE: pyscada/export/apps.py
  class PyScadaExportConfig (line 11) | class PyScadaExportConfig(AppConfig):

FILE: pyscada/export/csv_file.py
  function unix_time_stamp_to_excel_datenum (line 9) | def unix_time_stamp_to_excel_datenum(timestamp):
  class ExcelCompatibleCSV (line 16) | class ExcelCompatibleCSV:
    method __init__ (line 17) | def __init__(self, filename, **kwargs):
    method write_data (line 25) | def write_data(self, name, data, **kwargs):
    method write_file (line 36) | def write_file(self):
    method reopen (line 62) | def reopen(self):
    method close_file (line 65) | def close_file(self):

FILE: pyscada/export/export.py
  function export_recordeddata_to_file (line 30) | def export_recordeddata_to_file(
  function _cast_value (line 382) | def _cast_value(value, _type):

FILE: pyscada/export/hdf5_file.py
  function unix_time_stamp_to_matlab_datenum (line 18) | def unix_time_stamp_to_matlab_datenum(timestamp):
  function dtype_to_matlab_class (line 25) | def dtype_to_matlab_class(dtype):
  class MatCompatibleH5 (line 51) | class MatCompatibleH5:
    method __init__ (line 52) | def __init__(self, filename, **kwargs):
    method create_file (line 72) | def create_file(self):
    method close_file (line 87) | def close_file(self):
    method reopen (line 91) | def reopen(self):
    method open_file (line 95) | def open_file(self):
    method __del__ (line 105) | def __del__(self):
    method create_dataset (line 108) | def create_dataset(self, name, dtype):
    method create_group (line 123) | def create_group(self, name):
    method create_complex_dataset (line 126) | def create_complex_dataset(self, gname, dtype):
    method write_data (line 153) | def write_data(self, name, data, **kwargs):
    method write_complex_data (line 167) | def write_complex_data(self, gname, data, times):
    method batch_write (line 175) | def batch_write(self, data_list):
    method batch_complex_write (line 179) | def batch_complex_write(self, data_list):

FILE: pyscada/export/management/commands/PyScadaExportData.py
  class Command (line 8) | class Command(BaseCommand):
    method add_arguments (line 11) | def add_arguments(self, parser):
    method handle (line 34) | def handle(self, *args, **options):

FILE: pyscada/export/migrations/0001_initial.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0002_auto_20151201_1617.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0003_auto_20160315_1140.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0004_exporttask.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0005_auto_20160403_1454.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0006_auto_20160404_0949.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0007_auto_20161124_1002.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0008_auto_20161124_1003.py
  function convert_unixtime_float_to_datetime (line 11) | def convert_unixtime_float_to_datetime(apps, schema_editor):
  class Migration (line 21) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0009_auto_20161128_0948.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0010_auto_20161128_1049.py
  class Migration (line 10) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0011_exporttask_filename.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0012_exporttask_backgroundprocess.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0013_auto_20170711_0729.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0014_auto_20170711_1326.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0015_remove_exporttask_backgroundtask.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/export/migrations/0016_auto_20191004_0912.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/export/models.py
  class ScheduledExportTask (line 25) | class ScheduledExportTask(models.Model):
    method __str__ (line 60) | def __str__(self):
  class ExportTask (line 64) | class ExportTask(models.Model):
    method __str__ (line 95) | def __str__(self):
    method time_min (line 98) | def time_min(self):
    method time_max (line 101) | def time_max(self):
    method start (line 104) | def start(self):
    method finished (line 107) | def finished(self):
    method downloadlink (line 110) | def downloadlink(self):

FILE: pyscada/export/worker.py
  class ExportProcess (line 26) | class ExportProcess(BaseProcess):
    method __init__ (line 27) | def __init__(self, dt=5, **kwargs):
    method loop (line 31) | def loop(self):
  class MasterProcess (line 93) | class MasterProcess(BaseProcess):
    method __init__ (line 98) | def __init__(self, dt=5, **kwargs):
    method loop (line 102) | def loop(self):

FILE: pyscada/generic/device.py
  class Device (line 15) | class Device(GenericDevice):
    method __init__ (line 16) | def __init__(self, device):

FILE: pyscada/generic/devices/__init__.py
  class GenericDevice (line 16) | class GenericDevice(GenericHandlerDevice):
    method __init__ (line 17) | def __init__(self, pyscada_device, variables):
    method connect (line 22) | def connect(self):
    method read_data (line 25) | def read_data(self, variable_instance):
    method write_data (line 31) | def write_data(self, variable_id, value, task):

FILE: pyscada/generic/devices/dummy.py
  class Handler (line 10) | class Handler(GenericDevice):
    method write_data (line 15) | def write_data(self, variable_id, value, task):

FILE: pyscada/generic/devices/waveform.py
  class Handler (line 16) | class Handler(GenericDevice):
    method read_data_and_time (line 21) | def read_data_and_time(self, variable_instance):
    method write_data (line 121) | def write_data(self, variable_id, value, task):

FILE: pyscada/generic/worker.py
  class Process (line 15) | class Process(SingleDeviceDAQProcessWorker):
    method __init__ (line 19) | def __init__(self, dt=5, **kwargs):

FILE: pyscada/hmi/admin.py
  class FormListFilter (line 44) | class FormListFilter(admin.SimpleListFilter):
    method lookups (line 52) | def lookups(self, request, model_admin):
    method queryset (line 67) | def queryset(self, request, queryset):
  class ChartForm (line 79) | class ChartForm(forms.ModelForm):
    method __init__ (line 80) | def __init__(self, *args, **kwargs):
  class ChartAxisInline (line 92) | class ChartAxisInline(admin.TabularInline):
    method get_extra (line 96) | def get_extra(self, request, obj=None, **kwargs):
  class ChartAdmin (line 100) | class ChartAdmin(admin.ModelAdmin):
    method name (line 119) | def name(self, instance):
    method formfield_for_foreignkey (line 122) | def formfield_for_foreignkey(self, db_field, request, **kwargs):
  class PieForm (line 130) | class PieForm(forms.ModelForm):
    method __init__ (line 131) | def __init__(self, *args, **kwargs):
  class PieAdmin (line 143) | class PieAdmin(admin.ModelAdmin):
    method name (line 156) | def name(self, instance):
  class FormAdmin (line 160) | class FormAdmin(admin.ModelAdmin):
  class DisplayValueOptionAdminFrom (line 170) | class DisplayValueOptionAdminFrom(forms.ModelForm):
    method __init__ (line 171) | def __init__(self, *args, **kwargs):
    method clean (line 212) | def clean(self):
    class Meta (line 261) | class Meta:
    class Media (line 272) | class Media:
  class DisplayValueColorOptionAdminFrom (line 276) | class DisplayValueColorOptionAdminFrom(forms.ModelForm):
    method __init__ (line 277) | def __init__(self, *args, **kwargs):
  class DisplayValueColorOptionInline (line 319) | class DisplayValueColorOptionInline(admin.TabularInline):
  class TransformDataAdmin (line 325) | class TransformDataAdmin(admin.ModelAdmin):
    method has_module_permission (line 327) | def has_module_permission(self, request):
    method has_add_permission (line 330) | def has_add_permission(self, request):
    method has_change_permission (line 333) | def has_change_permission(self, request, obj=None):
    method has_delete_permission (line 336) | def has_delete_permission(self, request, obj=None):
  class DisplayValueOptionTemplateAdmin (line 340) | class DisplayValueOptionTemplateAdmin(admin.ModelAdmin):
    method has_module_permission (line 342) | def has_module_permission(self, request):
    method has_add_permission (line 345) | def has_add_permission(self, request):
    method has_change_permission (line 348) | def has_change_permission(self, request, obj=None):
    method has_delete_permission (line 351) | def has_delete_permission(self, request, obj=None):
  class DisplayValueOptionAdmin (line 355) | class DisplayValueOptionAdmin(admin.ModelAdmin):
    method has_module_permission (line 398) | def has_module_permission(self, request):
    class Media (line 401) | class Media:
  class ControlElementOptionAdmin (line 411) | class ControlElementOptionAdmin(admin.ModelAdmin):
    method has_module_permission (line 415) | def has_module_permission(self, request):
  class ControlItemAdmin (line 419) | class ControlItemAdmin(admin.ModelAdmin):
  class SlidingPanelMenuForm (line 449) | class SlidingPanelMenuForm(forms.ModelForm):
    method __init__ (line 450) | def __init__(self, *args, **kwargs):
  class SlidingPanelMenuAdmin (line 470) | class SlidingPanelMenuAdmin(admin.ModelAdmin):
  class WidgetAdmin (line 479) | class WidgetAdmin(admin.ModelAdmin):
  class GroupDisplayPermissionForm (line 507) | class GroupDisplayPermissionForm(forms.ModelForm):
    method clean (line 508) | def clean(self):
  class GroupDisplayPermissionAdmin (line 519) | class GroupDisplayPermissionAdmin(admin.ModelAdmin):
    method get_fields (line 526) | def get_fields(self, request, obj=None):
    method get_inlines (line 533) | def get_inlines(self, request, obj=None):
    method has_delete_permission (line 559) | def has_delete_permission(self, request, obj=None):
  class ControlPanelAdmin (line 565) | class ControlPanelAdmin(admin.ModelAdmin):
  class ViewAdmin (line 574) | class ViewAdmin(admin.ModelAdmin):
  class ExternalViewAdmin (line 579) | class ExternalViewAdmin(admin.ModelAdmin):
  class CustomHTMLPanelAdmin (line 583) | class CustomHTMLPanelAdmin(admin.ModelAdmin):
  class PageAdmin (line 589) | class PageAdmin(admin.ModelAdmin):
  class ProcessFlowDiagramItemAdmin (line 607) | class ProcessFlowDiagramItemAdmin(admin.ModelAdmin):
  class ProcessFlowDiagramAdmin (line 632) | class ProcessFlowDiagramAdmin(admin.ModelAdmin):
  class ThemeForm (line 649) | class ThemeForm(forms.ModelForm):
    method clean (line 650) | def clean(self):
  class ThemeAdmin (line 664) | class ThemeAdmin(admin.ModelAdmin):
    method has_module_permission (line 669) | def has_module_permission(self, request):
  class CssClassAdmin (line 673) | class CssClassAdmin(admin.ModelAdmin):
    method has_module_permission (line 677) | def has_module_permission(self, request):

FILE: pyscada/hmi/apps.py
  class PyScadaHMIConfig (line 14) | class PyScadaHMIConfig(AppConfig):
    method ready (line 19) | def ready(self):
    method pyscada_app_init (line 22) | def pyscada_app_init(self):

FILE: pyscada/hmi/migrations/0001_initial.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0002_auto_20151016_1932.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0003_auto_20151130_1456.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0004_auto_20151130_1502.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0005_auto_20160111_1822.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0006_auto_20160111_1848.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0007_auto_20160518_0848.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0008_auto_20180620_0716.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0009_controlitem_property_name.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0010_auto_20180705_1341.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0011_auto_20180710_1549.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0012_auto_20180912_1302.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0013_widget_update_20180912_1315.py
  function forwards_func (line 8) | def forwards_func(apps, schema_editor):
  class Migration (line 88) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0014_auto_20180912_1340.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0015_auto_20180913_1608.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0016_auto_20181004_0831.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0017_groupdisplaypermission_forms.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0018_auto_20181205_0937.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0019_auto_20181205_1058.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0020_pie.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0021_auto_20190528_0924.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0022_auto_20191004_0912.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0023_dropdownitem_value.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0024_auto_20191212_1516.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0025_widgetcontent_content_str.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0026_auto_20200915_1333.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0027_auto_20200915_1407.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0028_auto_20200915_1540.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0029_auto_20200916_0720.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0030_auto_20200918_0842.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0031_auto_20200918_1206.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0032_auto_20200918_1408.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0033_auto_20200918_1439.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0034_auto_20200918_1445.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0035_auto_20200918_1517.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0036_auto_20200923_0850.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0037_auto_20200923_0852.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0038_auto_20200929_1410.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0039_auto_20201002_0928.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0040_dictionary_dictionaryitem.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0041_auto_20201002_0934.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0042_auto_20201201_1335.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0043_auto_20201201_1411.py
  function add_vars_move_wc (line 13) | def add_vars_move_wc(apps, schema_editor):
  function move_xy_chart (line 50) | def move_xy_chart(apps, schema_editor):
  class Migration (line 83) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0044_auto_20201201_1539.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0045_auto_20201201_2100.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0046_auto_20201201_2109.py
  function move_chart_vars (line 13) | def move_chart_vars(apps, schema_editor):
  function move_chart_axis (line 22) | def move_chart_axis(apps, schema_editor):
  class Migration (line 49) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0047_auto_20201202_1445.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0048_chartaxis_fill.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0049_auto_20201202_2037.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0050_auto_20201203_2101.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0051_auto_20201204_0901.py
  function move_dropdown_in_control_panel (line 14) | def move_dropdown_in_control_panel(apps, schema_editor):
  function move_dropdown (line 47) | def move_dropdown(apps, schema_editor):
  function create_control_element_option (line 77) | def create_control_element_option(apps, schema_editor):
  class Migration (line 101) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0052_auto_20201204_0949.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0053_auto_20211118_1438.py
  function radius_auto (line 10) | def radius_auto(apps, schema_editor):
  class Migration (line 26) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0054_displayvalueoption_type.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0055_auto_20211125_1405.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0056_auto_20211210_1608.py
  function add_height_width (line 11) | def add_height_width(apps, schema_editor):
  class Migration (line 32) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0057_auto_20211214_1157.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0058_auto_20220523_1639.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0059_alter_view_theme.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0060_chartaxis_show_bars.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0061_auto_20220610_1459.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0062_auto_20220616_1523.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0063_move_group_display_permissions.py
  function move_group_display_permissions (line 11) | def move_group_display_permissions(apps, schema_editor):
  class Migration (line 205) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0064_auto_20220617_1333.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0065_auto_20220620_0854.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0066_auto_20221205_1435.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0067_alter_cssclass_options.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0068_alter_displayvalueoption_timestamp_conversion.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0069_displayvalueoption_color_and_more.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0070_move_displayvalueoptions.py
  function move_dvo (line 12) | def move_dvo(apps, schema_editor):
  class Migration (line 117) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0071_remove_displayvalueoption_color_1_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0072_alter_groupdisplaypermission_hmi_group.py
  function create_empty_group_display_permission (line 12) | def create_empty_group_display_permission(apps, schema_editor):
  function delete_empty_group_display_permission (line 28) | def delete_empty_group_display_permission(apps, schema_editor):
  class Migration (line 37) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0073_alter_processflowdiagramitem_control_item.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0074_alter_cssclass_css_class.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0075_alter_processflowdiagram_url_height_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0076_displayvalueoptiontemplate_transformdata_and_more.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0077_transformdatacountvalue.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0078_alter_theme_base_filename_alter_theme_view_filename.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0079_displayvalueoption_from_timestamp_offset.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0080_view_default_time_delta.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0081_groupdisplaypermission_unauthenticated_users.py
  function create_unauthenticated_users_group_display_permission (line 12) | def create_unauthenticated_users_group_display_permission(apps, schema_e...
  function delete_unauthenticated_users_group_display_permission (line 21) | def delete_unauthenticated_users_group_display_permission(apps, schema_e...
  class Migration (line 29) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0082_externalview.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/hmi/migrations/0083_externalviewgroupdisplaypermission.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/hmi/models.py
  function _delete_widget_content (line 33) | def _delete_widget_content(sender, instance, **kwargs):
  function _create_widget_content (line 52) | def _create_widget_content(sender, instance, created=False, **kwargs):
  function validate_html (line 68) | def validate_html(value):
  function get_js_or_css_set_from_str (line 85) | def get_js_or_css_set_from_str(self, field):
  class WidgetContentModel (line 106) | class WidgetContentModel(models.Model):
    method __init_subclass__ (line 108) | def __init_subclass__(cls, **kwargs):
    method gen_html (line 113) | def gen_html(self, **kwargs):
    method _get_objects_for_html (line 121) | def _get_objects_for_html(
    method add_custom_fields_list (line 132) | def add_custom_fields_list(self, opts):
    method add_exclude_fields_list (line 135) | def add_exclude_fields_list(self, opts):
    method create_widget_content_entry (line 138) | def create_widget_content_entry(self):
    method update_widget_content_entry (line 147) | def update_widget_content_entry(self):
    method get_widget_content_entry (line 156) | def get_widget_content_entry(self):
    method delete_duplicates (line 170) | def delete_duplicates(self):
    method check_visible_object (line 185) | def check_visible_object(self, visible_models_lists):
    method data_objects (line 195) | def data_objects(self, user):
    class Meta (line 200) | class Meta:
  class Theme (line 204) | class Theme(models.Model):
    method __str__ (line 217) | def __str__(self):
    method check_all_themes (line 220) | def check_all_themes(self):
  class ControlElementOption (line 245) | class ControlElementOption(models.Model):
    method __str__ (line 257) | def __str__(self):
    method get_js (line 260) | def get_js(self):
    method get_css (line 264) | def get_css(self):
    method get_daterangepicker (line 268) | def get_daterangepicker(self):
    method get_timeline (line 271) | def get_timeline(self):
  class TransformData (line 275) | class TransformData(models.Model):
    method __str__ (line 294) | def __str__(self):
    method get_js (line 297) | def get_js(self):
    method get_css (line 300) | def get_css(self):
  class DisplayValueOptionTemplate (line 304) | class DisplayValueOptionTemplate(models.Model):
    method __str__ (line 323) | def __str__(self):
    method get_js (line 326) | def get_js(self):
    method get_css (line 329) | def get_css(self):
    method get_template_name (line 333) | def get_template_name(self):
  class DisplayValueOption (line 342) | class DisplayValueOption(models.Model):
    method __str__ (line 400) | def __str__(self):
    method _get_objects_for_html (line 403) | def _get_objects_for_html(
    method get_js (line 413) | def get_js(self):
    method get_css (line 429) | def get_css(self):
    method get_daterangepicker (line 445) | def get_daterangepicker(self):
    method get_timeline (line 449) | def get_timeline(self):
  class DisplayValueColorOption (line 454) | class DisplayValueColorOption(models.Model):
    class Meta (line 474) | class Meta:
  class TransformDataCountValue (line 484) | class TransformDataCountValue(models.Model):
    class FormSet (line 490) | class FormSet(BaseInlineFormSet):
      method clean (line 491) | def clean(self):
  class ControlItem (line 515) | class ControlItem(models.Model):
    class Meta (line 537) | class Meta:
    method __str__ (line 540) | def __str__(self):
    method web_id (line 571) | def web_id(self):
    method web_class_str (line 582) | def web_class_str(self):
    method active (line 588) | def active(self):
    method key (line 598) | def key(self):
    method name (line 604) | def name(self):
    method item_type (line 610) | def item_type(self):
    method unit (line 616) | def unit(self):
    method min (line 625) | def min(self):
    method max (line 631) | def max(self):
    method value (line 637) | def value(self):
    method value_class (line 644) | def value_class(self):
    method min_type (line 650) | def min_type(self):
    method max_type (line 656) | def max_type(self):
    method device (line 662) | def device(self):
    method threshold_values (line 668) | def threshold_values(self):
    method gauge_params (line 686) | def gauge_params(self):
    method dictionary (line 693) | def dictionary(self):
    method _get_objects_for_html (line 699) | def _get_objects_for_html(
    method get_js (line 705) | def get_js(self):
    method get_css (line 713) | def get_css(self):
    method get_daterangepicker (line 721) | def get_daterangepicker(self):
    method get_timeline (line 728) | def get_timeline(self):
    method readable (line 735) | def readable(self):
  class Chart (line 742) | class Chart(WidgetContentModel):
    method __str__ (line 759) | def __str__(self):
    method visible (line 762) | def visible(self):
    method data_objects (line 765) | def data_objects(self, user):
    method gen_html (line 775) | def gen_html(self, **kwargs):
    method _get_objects_for_html (line 815) | def _get_objects_for_html(
  class ChartAxis (line 830) | class ChartAxis(models.Model):
    class Meta (line 860) | class Meta:
  class Pie (line 865) | class Pie(WidgetContentModel):
    method __str__ (line 877) | def __str__(self):
    method visible (line 880) | def visible(self):
    method data_objects (line 883) | def data_objects(self, user):
    method gen_html (line 896) | def gen_html(self, **kwargs):
  class Form (line 934) | class Form(models.Model):
    method __str__ (line 951) | def __str__(self):
    method visible (line 954) | def visible(self):
    method web_id (line 957) | def web_id(self):
    method control_items_list (line 960) | def control_items_list(self):
    method hidden_control_items_to_true_list (line 963) | def hidden_control_items_to_true_list(self):
    method get_js (line 966) | def get_js(self):
    method get_css (line 974) | def get_css(self):
    method get_daterangepicker (line 982) | def get_daterangepicker(self):
    method get_timeline (line 990) | def get_timeline(self):
  class Page (line 999) | class Page(models.Model):
    class Meta (line 1005) | class Meta:
    method __str__ (line 1008) | def __str__(self):
    method data_objects (line 1011) | def data_objects(self, user):
  class ControlPanel (line 1027) | class ControlPanel(WidgetContentModel):
    method __str__ (line 1033) | def __str__(self):
    method data_objects (line 1036) | def data_objects(self, user):
    method gen_html (line 1079) | def gen_html(self, **kwargs):
    method add_custom_fields_list (line 1141) | def add_custom_fields_list(self, opts):
  class CustomHTMLPanel (line 1156) | class CustomHTMLPanel(WidgetContentModel):
    method __str__ (line 1163) | def __str__(self):
    method data_objects (line 1166) | def data_objects(self, user):
    method gen_html (line 1179) | def gen_html(self, **kwargs):
  class ProcessFlowDiagramItem (line 1209) | class ProcessFlowDiagramItem(models.Model):
    method __str__ (line 1221) | def __str__(self):
  class ProcessFlowDiagram (line 1231) | class ProcessFlowDiagram(WidgetContentModel):
    method __str__ (line 1257) | def __str__(self):
    method data_objects (line 1263) | def data_objects(self, user):
    method gen_html (line 1289) | def gen_html(self, **kwargs):
  class SlidingPanelMenu (line 1329) | class SlidingPanelMenu(models.Model):
    method __str__ (line 1339) | def __str__(self):
    method data_objects (line 1342) | def data_objects(self, user):
  class WidgetContent (line 1349) | class WidgetContent(models.Model):
    method create_panel_html (line 1354) | def create_panel_html(self, **kwargs):
    method get_hidden_config2 (line 1372) | def get_hidden_config2(self, **kwargs):
    method _import_content_model (line 1394) | def _import_content_model(self):
    method __str__ (line 1415) | def __str__(self):
  class CssClass (line 1423) | class CssClass(models.Model):
    method __str__ (line 1428) | def __str__(self):
    class Meta (line 1431) | class Meta:
  class Widget (line 1435) | class Widget(models.Model):
    class Meta (line 1473) | class Meta:
    method __str__ (line 1476) | def __str__(self):
    method data_objects (line 1482) | def data_objects(self, user):
    method css_class (line 1502) | def css_class(self):
  class View (line 1539) | class View(models.Model):
    method __str__ (line 1557) | def __str__(self):
    method data_objects (line 1560) | def data_objects(self, user):
    class Meta (line 1584) | class Meta:
  class ExternalView (line 1587) | class ExternalView(models.Model):
    method __str__ (line 1598) | def __str__(self):
    class Meta (line 1601) | class Meta:
  class GroupDisplayPermission (line 1605) | class GroupDisplayPermission(models.Model):
    method __str__ (line 1615) | def __str__(self):
  class PieGroupDisplayPermission (line 1624) | class PieGroupDisplayPermission(models.Model):
    method __str__ (line 1639) | def __str__(self):
  class PageGroupDisplayPermission (line 1643) | class PageGroupDisplayPermission(models.Model):
    method __str__ (line 1658) | def __str__(self):
  class SlidingPanelMenuGroupDisplayPermission (line 1662) | class SlidingPanelMenuGroupDisplayPermission(models.Model):
    method __str__ (line 1677) | def __str__(self):
  class ChartGroupDisplayPermission (line 1681) | class ChartGroupDisplayPermission(models.Model):
    method __str__ (line 1696) | def __str__(self):
  class ControlItemGroupDisplayPermission (line 1700) | class ControlItemGroupDisplayPermission(models.Model):
    method __str__ (line 1715) | def __str__(self):
  class FormGroupDisplayPermission (line 1719) | class FormGroupDisplayPermission(models.Model):
    method __str__ (line 1734) | def __str__(self):
  class WidgetGroupDisplayPermission (line 1738) | class WidgetGroupDisplayPermission(models.Model):
    method __str__ (line 1753) | def __str__(self):
  class CustomHTMLPanelGroupDisplayPermission (line 1757) | class CustomHTMLPanelGroupDisplayPermission(models.Model):
    method __str__ (line 1772) | def __str__(self):
  class ViewGroupDisplayPermission (line 1776) | class ViewGroupDisplayPermission(models.Model):
    method __str__ (line 1791) | def __str__(self):
  class ExternalViewGroupDisplayPermission (line 1794) | class ExternalViewGroupDisplayPermission(models.Model):
    method __str__ (line 1809) | def __str__(self):
  class ProcessFlowDiagramGroupDisplayPermission (line 1813) | class ProcessFlowDiagramGroupDisplayPermission(models.Model):
    method __str__ (line 1828) | def __str__(self):

FILE: pyscada/hmi/static/pyscada/js/admin/display_inline_datasource.js
  function updateTransformDataInlines (line 1) | function updateTransformDataInlines() {

FILE: pyscada/hmi/static/pyscada/js/admin/display_inline_protocols_device.js
  function display_inline_protocols_device (line 8) | function display_inline_protocols_device() {

FILE: pyscada/hmi/static/pyscada/js/admin/display_inline_protocols_variable.js
  function display_inline_protocols_variable (line 8) | function display_inline_protocols_variable() {

FILE: pyscada/hmi/static/pyscada/js/admin/display_inline_transform_data_display_value_option.js
  function updateTransformDataInlines (line 1) | function updateTransformDataInlines() {

FILE: pyscada/hmi/static/pyscada/js/admin/handler_content_as_pre.js
  function handlerContentAsPre (line 1) | function handlerContentAsPre() {

FILE: pyscada/hmi/static/pyscada/js/admin/hideshow.js
  function csvParse (line 66) | function csvParse(str) {
  function getFormRows (line 77) | function getFormRows(fields, node) {
  function fieldNameToFormRow (line 92) | function fieldNameToFormRow(fieldName, node) {
  function hide (line 98) | function hide(node) {
  function show (line 102) | function show(node) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/affix.js
  function Plugin (line 119) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/alert.js
  function removeElement (line 48) | function removeElement() {
  function Plugin (line 64) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/bootstrap.js
  function transitionEnd (line 34) | function transitionEnd() {
  function removeElement (line 127) | function removeElement() {
  function Plugin (line 143) | function Plugin(option) {
  function Plugin (line 252) | function Plugin(option) {
  function Plugin (line 478) | function Plugin(option) {
  function getTargetFromTrigger (line 705) | function getTargetFromTrigger($trigger) {
  function Plugin (line 717) | function Plugin(option) {
  function getParent (line 784) | function getParent($this) {
  function clearMenus (line 797) | function clearMenus(e) {
  function Plugin (line 890) | function Plugin(option) {
  function Plugin (line 1234) | function Plugin(option, _relatedTarget) {
  function allowedAttribute (line 1361) | function allowedAttribute(attr, allowedAttributeList) {
  function sanitizeHtml (line 1386) | function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  function complete (line 1757) | function complete() {
  function Plugin (line 1936) | function Plugin(option) {
  function Plugin (line 2060) | function Plugin(option) {
  function ScrollSpy (line 2103) | function ScrollSpy(element, options) {
  function Plugin (line 2223) | function Plugin(option) {
  function next (line 2332) | function next() {
  function Plugin (line 2378) | function Plugin(option) {
  function Plugin (line 2537) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/button.js
  function Plugin (line 74) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/carousel.js
  function Plugin (line 176) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/collapse.js
  function getTargetFromTrigger (line 157) | function getTargetFromTrigger($trigger) {
  function Plugin (line 169) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/dropdown.js
  function clearMenus (line 89) | function clearMenus(e) {
  function getParent (line 108) | function getParent($this) {
  function Plugin (line 125) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/modal.js
  function Plugin (line 292) | function Plugin(option, _relatedTarget) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/popover.js
  function Plugin (line 82) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/scrollspy.js
  function ScrollSpy (line 16) | function ScrollSpy(element, options) {
  function Plugin (line 136) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/tab.js
  function next (line 70) | function next() {
  function Plugin (line 116) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/tooltip.js
  function complete (line 298) | function complete() {
  function Plugin (line 450) | function Plugin(option) {

FILE: pyscada/hmi/static/pyscada/js/bootstrap/transition.js
  function transitionEnd (line 16) | function transitionEnd() {

FILE: pyscada/hmi/static/pyscada/js/flot/lib/globalize.js
  function padZeros (line 499) | function padZeros(num, c) {
  function hasDay (line 514) | function hasDay() {
  function getPart (line 523) | function getPart( date, part ) {

FILE: pyscada/hmi/static/pyscada/js/flot/lib/jquery.event.drag.js
  function handler (line 60) | function handler ( event ){
  function hijack (line 123) | function hijack ( event, type, elem ){
  function squared (line 130) | function squared ( value ){ return Math.pow( value, 2 ); }
  function dontStart (line 133) | function dontStart(){ return ( drag.dragging === false ); }
  function selectable (line 136) | function selectable ( elem, bool ){

FILE: pyscada/hmi/static/pyscada/js/flot/lib/jquery.mousewheel.js
  function handler (line 58) | function handler(event) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.canvaswrapper.js
  function updateTransforms (line 348) | function updateTransforms (element, transforms) {
  function generateKey (line 540) | function generateKey(text) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.colorhelpers.js
  function clamp (line 59) | function clamp(min, value, max) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.axislabels.js
  function AxisLabel (line 41) | function AxisLabel(axisName, position, padding, placeholder, axisLabel, ...
  function init (line 146) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.categories.js
  function processRawData (line 56) | function processRawData(plot, series, data, datapoints) {
  function getNextIndex (line 101) | function getNextIndex(categories) {
  function categoriesTickGenerator (line 113) | function categoriesTickGenerator(axis) {
  function setupCategoriesForAxis (line 127) | function setupCategoriesForAxis(series, axis, datapoints) {
  function transformPointsOnAxis (line 156) | function transformPointsOnAxis(datapoints, axis, categories) {
  function processDatapoints (line 186) | function processDatapoints(plot, series, datapoints) {
  function init (line 191) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.composeImages.js
  function composeImages (line 45) | function composeImages(canvasOrSvgSources, destinationCanvas) {
  function isValidSource (line 59) | function isValidSource(canvasOrSvgSource) {
  function getGenerateTempImg (line 75) | function getGenerateTempImg(tempImg, canvasOrSvgSource) {
  function getExecuteImgComposition (line 101) | function getExecuteImgComposition(destinationCanvas) {
  function copyCanvasToImg (line 108) | function copyCanvasToImg(canvas, img) {
  function getCSSRules (line 112) | function getCSSRules(document) {
  function embedCSSRulesInSVG (line 131) | function embedCSSRulesInSVG(rules, svg) {
  function copySVGToImgMostBrowsers (line 145) | function copySVGToImgMostBrowsers(svg, img) {
  function copySVGToImgSafari (line 157) | function copySVGToImgSafari(svg, img) {
  function patchSVGSource (line 188) | function patchSVGSource(svgSource) {
  function copySVGToImg (line 202) | function copySVGToImg(svg, img) {
  function adaptDestSizeToZoom (line 210) | function adaptDestSizeToZoom(destinationCanvas, sources) {
  function prepareImagesToBeComposed (line 223) | function prepareImagesToBeComposed(sources, destination) {
  function copyImgsToCanvas (line 271) | function copyImgsToCanvas(sources, destination) {
  function adnotateDestImgWithBoundingClientRect (line 285) | function adnotateDestImgWithBoundingClientRect(srcCanvasOrSvg, destImg) {
  function generateTempImageFromCanvasOrSvg (line 300) | function generateTempImageFromCanvasOrSvg(srcCanvasOrSvg, destImg) {
  function failureCallback (line 313) | function failureCallback() {
  function init (line 320) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.crosshair.js
  function init (line 70) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.drawSeries.js
  function DrawSeries (line 12) | function DrawSeries() {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.errorbars.js
  function processRawData (line 76) | function processRawData(plot, series, data, datapoints) {
  function parseErrors (line 110) | function parseErrors(series, i) {
  function drawSeriesErrors (line 175) | function drawSeriesErrors(plot, ctx, s) {
  function drawError (line 292) | function drawError(ctx, err, x, y, upper, lower, drawUpper, drawLower, r...
  function drawPath (line 341) | function drawPath(ctx, pts) {
  function draw (line 351) | function draw(plot, ctx) {
  function init (line 364) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.fillbetween.js
  function init (line 39) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.flatdata.js
  function process1DRawData (line 23) | function process1DRawData(plot, series, data, datapoints) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.gauge.js
  function calculateAutoValues (line 363) | function calculateAutoValues(gaugeOptionsi, cellWidth) {
  function getColor (line 532) | function getColor(gaugeOptionsi, data) {
  function calculateAngle (line 553) | function calculateAngle(gaugeOptionsi, layout, data) {
  function drawArcWithShadow (line 613) | function drawArcWithShadow(cx, cy, r, w, rd1, rd2, lc, lw, fc, blur) {
  function drawThresholdValue (line 708) | function drawThresholdValue(gaugeOptionsi, layout, cellLayout, i, value,...
  function drawText (line 748) | function drawText(x, y, id, text, textOptions, a) {
  function getLogger (line 795) | function getLogger(debugOptions) {
  function col (line 808) | function col(columns, i) {
  function row (line 821) | function row(columns, i) {
  function toRad (line 836) | function toRad(a) {
  function drawArc (line 856) | function drawArc(context, cx, cy, r, w, rd1, rd2, lc, lw, fc) {
  function init (line 890) | function init (plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.hover.js
  function init (line 44) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.image.js
  function drawSeries (line 122) | function drawSeries(plot, ctx, series) {
  function processRawData (line 223) | function processRawData(plot, series, data, datapoints) {
  function init (line 238) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.js
  function defaultTickGenerator (line 14) | function defaultTickGenerator(axis) {
  function defaultTickFormatter (line 37) | function defaultTickFormatter(value, axis, precision) {
  function expRepTickFormatter (line 67) | function expRepTickFormatter(value, axis, precision) {
  function recomputePrecision (line 85) | function recomputePrecision(num, precision) {
  function Plot (line 96) | function Plot(placeholder, data_, options_, plugins) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.legend.js
  function insertLegend (line 18) | function insertLegend(plot, options, placeholder, legendEntries) {
  function getEntryIconHtml (line 160) | function getEntryIconHtml(shape) {
  function getLegendEntries (line 316) | function getLegendEntries(series, labelFormatter, sorted) {
  function checkOptions (line 356) | function checkOptions(opts1, opts2) {
  function shouldRedraw (line 368) | function shouldRedraw(oldEntries, newEntries) {
  function init (line 414) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.logaxis.js
  function computePreferedLogTickValues (line 32) | function computePreferedLogTickValues(endLimit, rangeStep) {
  function setDataminRange (line 233) | function setDataminRange(plot, axis) {
  function processAxisOffset (line 243) | function processAxisOffset(plot, axis) {
  function isValid (line 261) | function isValid(a) {
  function init (line 265) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.navigate.js
  function init (line 150) | function init(plot) {
  function initNevigation (line 154) | function initNevigation(plot, options) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.pie.js
  function init (line 67) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.resize.js
  function a (line 23) | function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s....
  function h (line 23) | function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$...
  function init (line 29) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.selection.js
  function init (line 94) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.stack.js
  function init (line 43) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.symbol.js
  function init (line 89) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.threshold.js
  function init (line 50) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.time.js
  function formatDate (line 76) | function formatDate(d, fmt, monthNames, dayNames) {
  function makeUtcWrapper (line 171) | function makeUtcWrapper(d) {
  function dateGenerator (line 202) | function dateGenerator(ts, opts) {
  function dateTickGenerator (line 299) | function dateTickGenerator(axis) {
  function init (line 476) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.touch.js
  function init (line 11) | function init(plot) {
  function initTouchNavigation (line 15) | function initTouchNavigation(plot, options) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.flot.touchNavigate.js
  function init (line 21) | function init(plot) {
  function initTouchNavigation (line 25) | function initTouchNavigation(plot, options) {
  function recenterPlotOnDoubleTap (line 196) | function recenterPlotOnDoubleTap(plot, e, gestureState, navigationState) {
  function checkAxesForDoubleTap (line 214) | function checkAxesForDoubleTap(plot, e, navigationState) {
  function zoomPlot (line 233) | function zoomPlot(plot, e, gestureState, navigationState) {
  function wasPinchEvent (line 254) | function wasPinchEvent(e, gestureState) {
  function getAxis (line 258) | function getAxis(plot, e, gesture, navigationState) {
  function noAxisTouched (line 276) | function noAxisTouched(navigationState) {
  function setPrevDistance (line 280) | function setPrevDistance(e, gestureState) {
  function updateData (line 284) | function updateData(e, gesture, gestureState, navigationState) {
  function distance (line 311) | function distance(x1, y1, x2, y2) {
  function pinchDistance (line 315) | function pinchDistance(e) {
  function updatePrevPanPosition (line 321) | function updatePrevPanPosition(e, gesture, gestureState, navigationState) {
  function delta (line 338) | function delta(e, gesture, gestureState) {
  function getPoint (line 347) | function getPoint(e, gesture) {

FILE: pyscada/hmi/static/pyscada/js/flot/source/jquery.js
  function createOptions (line 912) | function createOptions( options ) {
  function dataAttr (line 1802) | function dataAttr( elem, key, data ) {
  function isEmptyDataObject (line 1834) | function isEmptyDataObject( obj ) {
  function returnFalse (line 3275) | function returnFalse() {
  function returnTrue (line 3278) | function returnTrue() {
  function Sizzle (line 3881) | function Sizzle( selector, context, results, seed ) {
  function createInputPseudo (line 3950) | function createInputPseudo( type ) {
  function createButtonPseudo (line 3958) | function createButtonPseudo( type ) {
  function createPositionalPseudo (line 3966) | function createPositionalPseudo( fn ) {
  function siblingCheck (line 4561) | function siblingCheck( a, b, ret ) {
  function tokenize (line 4684) | function tokenize( selector, parseOnly ) {
  function addCombinator (line 4747) | function addCombinator( matcher, combinator, base ) {
  function elementMatcher (line 4799) | function elementMatcher( matchers ) {
  function condense (line 4813) | function condense( unmatched, map, filter, context, xml ) {
  function setMatcher (line 4834) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
  function matcherFromTokens (line 4927) | function matcherFromTokens( tokens ) {
  function matcherFromGroupMatchers (line 4979) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  function multipleContexts (line 5103) | function multipleContexts( selector, contexts, results ) {
  function select (line 5112) | function select( selector, context, results, seed, xml ) {
  function setFilters (line 5339) | function setFilters() {}
  function isDisconnected (line 5505) | function isDisconnected( node ) {
  function sibling (line 5509) | function sibling( cur, dir ) {
  function winnow (line 5617) | function winnow( elements, qualifier, keep ) {
  function createSafeFragment (line 5650) | function createSafeFragment( document ) {
  function findOrAppend (line 6034) | function findOrAppend( elem, tag ) {
  function cloneCopyEvent (line 6038) | function cloneCopyEvent( src, dest ) {
  function cloneFixAttributes (line 6066) | function cloneFixAttributes( src, dest ) {
  function getAll (line 6209) | function getAll( elem ) {
  function fixDefaultChecked (line 6222) | function fixDefaultChecked( elem ) {
  function jQuerySub (line 6518) | function jQuerySub( selector, context ) {
  function vendorPropName (line 6564) | function vendorPropName( style, name ) {
  function isHidden (line 6586) | function isHidden( elem, el ) {
  function showHide (line 6591) | function showHide( elements, show ) {
  function setPositiveNumber (line 6901) | function setPositiveNumber( elem, value, subtract ) {
  function augmentWidthOrHeight (line 6908) | function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
  function getWidthOrHeight (line 6950) | function getWidthOrHeight( elem, name, extra ) {
  function css_defaultDisplay (line 6993) | function css_defaultDisplay( nodeName ) {
  function buildParams (line 7247) | function buildParams( prefix, obj, traditional, add ) {
  function addToPrefiltersOrTransports (line 7336) | function addToPrefiltersOrTransports( structure ) {
  function inspectPrefiltersOrTransports (line 7370) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
  function ajaxExtend (line 7412) | function ajaxExtend( target, src ) {
  function done (line 7723) | function done( status, nativeStatusText, responses, headers ) {
  function ajaxHandleResponses (line 8016) | function ajaxHandleResponses( s, jqXHR, responses ) {
  function ajaxConvert (line 8078) | function ajaxConvert( s, response ) {
  function createStandardXHR (line 8345) | function createStandardXHR() {
  function createActiveXHR (line 8351) | function createActiveXHR() {
  function createFxNow (line 8605) | function createFxNow() {
  function createTweens (line 8612) | function createTweens( animation, props ) {
  function Animation (line 8627) | function Animation( elem, properties, options ) {
  function propFilter (line 8725) | function propFilter( props, specialEasing ) {
  function defaultPrefilter (line 8792) | function defaultPrefilter( elem, props, opts ) {
  function Tween (line 8916) | function Tween( elem, options, prop, end, easing ) {
  function genFx (line 9100) | function genFx( type, includeWidth ) {
  function getWindow (line 9406) | function getWindow( elem ) {

FILE: pyscada/hmi/static/pyscada/js/jquery-ui/jquery-ui.js
  function _super (line 128) | function _super() {
  function _superApply (line 132) | function _superApply( args ) {
  function processClassString (line 512) | function processClassString( classes, checkOption ) {
  function handlerProxy (line 595) | function handlerProxy() {
  function handlerProxy (line 639) | function handlerProxy() {
  function getOffsets (line 775) | function getOffsets( offsets, width, height ) {
  function parseCss (line 782) | function parseCss( element, property ) {
  function getDimensions (line 786) | function getDimensions( elem ) {
  function visible (line 1355) | function visible( element ) {
  function reduce (line 1483) | function reduce( elem, size, border, margin ) {
  function isOverAxis (line 3483) | function isOverAxis( x, reference, size ) {
  function addItems (line 5925) | function addItems() {
  function delayEvent (line 6659) | function delayEvent( type, instance, container ) {
  function datepicker_getZindex (line 9602) | function datepicker_getZindex( elem ) {
  function Datepicker (line 9631) | function Datepicker() {
  function datepicker_bindHover (line 11597) | function datepicker_bindHover( dpDiv ) {
  function datepicker_handleMouseover (line 11611) | function datepicker_handleMouseover() {
  function datepicker_extendRemove (line 11625) | function datepicker_extendRemove( target, props ) {
  function checkFocus (line 11985) | function checkFocus() {
  function filteredUi (line 12192) | function filteredUi( ui ) {
  function filteredUi (line 12240) | function filteredUi( ui ) {
  function spinnerModifer (line 14183) | function spinnerModifer( fn ) {
  function checkFocus (line 14314) | function checkFocus() {
  function constrain (line 14965) | function constrain() {
  function complete (line 15352) | function complete() {
  function show (line 15357) | function show() {
  function position (line 15909) | function position( event ) {
  function clamp (line 16313) | function clamp( value, prop, allowEmpty ) {
  function stringParse (line 16340) | function stringParse( string ) {
  function hue2rgb (line 16594) | function hue2rgb( p, q, h ) {
  function getElementStyles (line 16868) | function getElementStyles( elem ) {
  function styleDifference (line 16896) | function styleDifference( oldStyle, newStyle ) {
  function _normalizeArguments (line 17389) | function _normalizeArguments( effect, options, speed, callback ) {
  function standardAnimationOption (line 17441) | function standardAnimationOption( option ) {
  function run (line 17518) | function run( next ) {
  function parseClip (line 17666) | function parseClip( str, element ) {
  function childComplete (line 18050) | function childComplete() {
  function animComplete (line 18100) | function animComplete() {

FILE: pyscada/hmi/static/pyscada/js/jquery.flot.axisvalues.js
  function init (line 56) | function init(plot) {

FILE: pyscada/hmi/static/pyscada/js/jquery/jquery.cookie.js
  function encode (line 20) | function encode(s) {
  function decode (line 24) | function decode(s) {
  function stringifyCookieValue (line 28) | function stringifyCookieValue(value) {
  function parseCookieValue (line 32) | function parseCookieValue(s) {
  function read (line 52) | function read(s, converter) {

FILE: pyscada/hmi/static/pyscada/js/pyscada/TransformDataHmiPlugin.js
  function PyScadaControlItemDisplayValueTransformDataMin (line 1) | function PyScadaControlItemDisplayValueTransformDataMin(key, val, contro...
  function PyScadaControlItemDisplayValueTransformDataMax (line 16) | function PyScadaControlItemDisplayValueTransformDataMax(key, val, contro...
  function PyScadaControlItemDisplayValueTransformDataTotal (line 31) | function PyScadaControlItemDisplayValueTransformDataTotal(key, val, cont...
  function PyScadaControlItemDisplayValueTransformDataDifference (line 45) | function PyScadaControlItemDisplayValueTransformDataDifference(key, val,...
  function PyScadaControlItemDisplayValueTransformDataDifferencePercent (line 86) | function PyScadaControlItemDisplayValueTransformDataDifferencePercent(ke...
  function PyScadaControlItemDisplayValueTransformDataDelta (line 101) | function PyScadaControlItemDisplayValueTransformDataDelta(key, val, cont...
  function PyScadaControlItemDisplayValueTransformDataMean (line 119) | function PyScadaControlItemDisplayValueTransformDataMean(key, val, contr...
  function PyScadaControlItemDisplayValueTransformDataFirst (line 134) | function PyScadaControlItemDisplayValueTransformDataFirst(key, val, cont...
  function PyScadaControlItemDisplayValueTransformDataCount (line 145) | function PyScadaControlItemDisplayValueTransformDataCount(key, val, cont...
  function PyScadaControlItemDisplayValueTransformDataCountValue (line 159) | function PyScadaControlItemDisplayValueTransformDataCountValue(key, val,...
  function PyScadaControlItemDisplayValueTransformDataRange (line 176) | function PyScadaControlItemDisplayValueTransformDataRange(key, val, cont...
  function PyScadaControlItemDisplayValueTransformDataStep (line 198) | function PyScadaControlItemDisplayValueTransformDataStep(key, val, contr...
  function PyScadaControlItemDisplayValueTransformDataChangeCount (line 221) | function PyScadaControlItemDisplayValueTransformDataChangeCount(key, val...
  function PyScadaControlItemDisplayValueTransformDataDistinctCount (line 240) | function PyScadaControlItemDisplayValueTransformDataDistinctCount(key, v...

FILE: pyscada/hmi/static/pyscada/js/pyscada/pyscada_tests.js
  function pyscada_test_add_data (line 12) | function pyscada_test_add_data() {

FILE: pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-9-0.js
  function add_fetched_data (line 420) | function add_fetched_data(key,value){
  function timestamp_conversion (line 552) | function timestamp_conversion(id,val){
  function msToTime (line 584) | function msToTime(duration) {
  function dictionary (line 612) | function dictionary(id, val, type){
  function colorToRgb (line 625) | function colorToRgb(color_id) {
  function rgbToHex (line 634) | function rgbToHex(rgb) {
  function update_data_colors (line 657) | function update_data_colors(id,val){
  function transform_data (line 756) | function transform_data(control_item_id, val, key) {
  function update_data_values (line 776) | function update_data_values(key,data){
  function get_config_from_hidden_configs (line 992) | function get_config_from_hidden_configs(type,filter_data='id',get_data='...
  function get_config_from_hidden_config (line 1018) | function get_config_from_hidden_config(type,filter_data,val,get_data){
  function set_config_from_hidden_config (line 1031) | function set_config_from_hidden_config(type,filter_data,val,get_data,val...
  function check_buffer (line 1042) | function check_buffer(key){
  function add_key_to_chart_vars (line 1049) | function add_key_to_chart_vars(key, var_count, vars, device_pulling_inte...
  function data_handler (line 1070) | function data_handler(){
  function data_handler_ajax (line 1216) | function data_handler_ajax(init,variable_keys,variable_property_keys,tim...
  function pad (line 1267) | function pad(value) {
  function createOffset (line 1270) | function createOffset(date) {
  function data_handler_done (line 1282) | function data_handler_done(fetched_data){
  function data_handler_fail (line 1385) | function data_handler_fail(response) {
  function increase_error_count (line 1393) | function increase_error_count() {
  function find_index (line 1431) | function find_index(a,t){
  function find_index_sub_lte (line 1446) | function find_index_sub_lte(a,t,d){
  function find_index_sub_gte (line 1461) | function find_index_sub_gte(a,t,d){
  function find_index_sub_lt (line 1477) | function find_index_sub_lt(a,t,d){
  function find_index_sub_gt (line 1492) | function find_index_sub_gt(a,t,d){
  function get_period_fields (line 1512) | function get_period_fields(key) {
  function filter_period_fields_by_type (line 1520) | function filter_period_fields_by_type(perdioFields, type) {
  function filter_aggregation_type_for_period_list (line 1546) | function filter_aggregation_type_for_period_list(period_list) {
  function get_one_field_by_period_field (line 1557) | function get_one_field_by_period_field(validPeriodFields) {
  function get_variable_keys_for_period_calculated_variables (line 1589) | function get_variable_keys_for_period_calculated_variables(periodCalcVar) {
  function get_one_variable_key_of_calculated_variable_for_duration (line 1604) | function get_one_variable_key_of_calculated_variable_for_duration(start,...
  function get_aggregated_data (line 1637) | function get_aggregated_data(key, start, stop, type=6, min_aggregate=3) {
  function Color (line 1673) | function Color(red,green,blue) {
  function PyScadaPlot (line 1687) | function PyScadaPlot(id, xaxisVarId, xaxisLinLog){
  function Gauge (line 2430) | function Gauge(id, min_value, max_value, threshold_values){
  function labelFormatter (line 2580) | function labelFormatter(label, series) {
  function Pie (line 2590) | function Pie(id, radius, innerRadius){
  function set_chart_selection_mode (line 2869) | function set_chart_selection_mode(){
  function set_x_axes (line 2918) | function set_x_axes(){
  function update_timeline (line 2932) | function update_timeline(){
  function set_datetimepicker (line 2991) | function set_datetimepicker() {
  function updatePyScadaPlots (line 3113) | function updatePyScadaPlots(force=false, update=true, resize=true) {
  function setCrosshairs (line 3132) | function setCrosshairs(flotPlot, id) {
  function delCrosshairs (line 3166) | function delCrosshairs(flotPlot) {
  function unlockCrosshairs (line 3181) | function unlockCrosshairs(flotPlot) {
  function lockCrosshairs (line 3192) | function lockCrosshairs(x, y) {
  function colorGradient (line 3215) | function colorGradient(fadeFraction, rgbColor1, rgbColor2, rgbColor3) {
  function setAggregatedLists (line 3249) | function setAggregatedLists() {
  function setAggregatedPeriodList (line 3301) | function setAggregatedPeriodList(widget_id, var_id) {
  function sliceDATAusingTimestamps (line 3310) | function sliceDATAusingTimestamps(data, display_from=DATA_DISPLAY_FROM_T...
  function show_page (line 3355) | function show_page() {
  function fix_page_anchor (line 3370) | function fix_page_anchor() {
  function progressbarSetWindow (line 3385) | function progressbarSetWindow( event, ui ) {
  function timeline_resize (line 3399) | function timeline_resize( event, ui ) {
  function timeline_drag (line 3431) | function timeline_drag( event, ui ) {
  function toggle_daterangepicker (line 3454) | function toggle_daterangepicker(){
  function toggle_timeline (line 3470) | function toggle_timeline(){
  function check_form (line 3491) | function check_form(id_form) {
  function show_init_status (line 3604) | function show_init_status(){
  function hide_init_status (line 3614) | function hide_init_status(){
  function set_loading_state (line 3631) | function set_loading_state(key, value) {
  function hide_loading_state (line 3650) | function hide_loading_state() {
  function show_update_status (line 3662) | function show_update_status(){
  function hide_update_status (line 3673) | function hide_update_status(){
  function auto_update_click (line 3686) | function auto_update_click(toggleState=true){
  function add_notification (line 3712) | function add_notification(message, level,timeout,clearable) {
  function raise_data_out_of_date_error (line 3787) | function raise_data_out_of_date_error(){
  function clear_data_out_of_date_error (line 3799) | function clear_data_out_of_date_error(){
  function update_log (line 3812) | function update_log() {
  function refresh_logo (line 3860) | function refresh_logo(key, type){
  function check_min_max (line 3903) | function check_min_max(value, min, max, min_strict, max_strict) {
  function getCookie (line 3975) | function getCookie(name) {
  function csrfSafeMethod (line 4002) | function csrfSafeMethod(method) {
  function daterange_cb (line 4015) | function daterange_cb(start, end) {
  function init_pyscada_content (line 4274) | function init_pyscada_content() {

FILE: pyscada/hmi/static/pyscada/js/tempusdominus-bootstrap-3.js
  function defineProperties (line 32) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _possibleConstructorReturn (line 34) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
  function _inherits (line 36) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
  function _classCallCheck (line 38) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function DateTimePicker (line 339) | function DateTimePicker(element, options) {
  function TempusDominusBootstrap3 (line 1623) | function TempusDominusBootstrap3(element, options) {

FILE: pyscada/hmi/templatetags/views_extras.py
  function replace (line 7) | def replace(value, arg):

FILE: pyscada/hmi/views.py
  function index (line 40) | def index(request):
  function check_anonymous (line 46) | def check_anonymous(request):
  function check_anonymous_write (line 55) | def check_anonymous_write(request):
  function view_overview (line 64) | def view_overview(request):
  function get_hidden_config2 (line 99) | def get_hidden_config2(request, link_title):
  function view (line 251) | def view(request, link_title):
  function log_data (line 641) | def log_data(request):
  function form_read_all_task (line 667) | def form_read_all_task(request):
  function form_read_task (line 684) | def form_read_task(request):
  function form_write_task (line 758) | def form_write_task(request):
  function int_filter (line 899) | def int_filter(someList):
  function get_cache_data (line 908) | def get_cache_data(request):

FILE: pyscada/log/__init__.py
  function add (line 8) | def add(
  function debug (line 54) | def debug(message, level=1, user=None, message_short=None):
  function emerg (line 58) | def emerg(message, user=None, message_short=None):
  function crit (line 62) | def crit(message, user=None, message_short=None):
  function error (line 66) | def error(message, user=None, message_short=None):
  function alert (line 70) | def alert(message, user=None, message_short=None):
  function warning (line 74) | def warning(message, user=None, message_short=None):
  function webnotice (line 78) | def webnotice(message, user=None, message_short=None):
  function webinfo (line 82) | def webinfo(message, user=None, message_short=None):
  function notice (line 86) | def notice(message, user=None, message_short=None):
  function info (line 90) | def info(message, user=None, message_short=None):

FILE: pyscada/mail/worker.py
  class Process (line 14) | class Process(BaseProcess):
    method __init__ (line 15) | def __init__(self, dt=5, **kwargs):
    method loop (line 18) | def loop(self):

FILE: pyscada/management/commands/pyscada_daemon.py
  class Command (line 10) | class Command(BaseCommand):
    method add_arguments (line 13) | def add_arguments(self, parser):
    method handle (line 21) | def handle(self, *args, **options):

FILE: pyscada/migrations/0001_initial.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0002_event_hysteresis.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0003_auto_20151026_1826.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0004_unit_udunit.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0005_merge.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0006_auto_20151130_1449.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0007_auto_20151201_1613.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0008_auto_20151201_1614.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0009_auto_20160111_1802.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0010_auto_20160115_0918.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0011_auto_20160115_0920.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0012_auto_20160119_0950.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0013_auto_20160204_0840.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0014_auto_20160210_1152.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0015_auto_20160215_1522.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0016_auto_20160215_2002.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0017_recordeddata.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0018_auto_20160228_1623.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0019_datamigration_20160228_1624.py
  function move_time_values (line 7) | def move_time_values(apps, schema_editor):
  class Migration (line 18) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0020_auto_20160228_1641.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0021_auto_20160228_1643.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0022_auto_20160228_2029.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0023_auto_20160314_1817.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0024_auto_20160517_1047.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0025_auto_20160517_1734.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0026_auto_20160518_0848.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0027_auto_20160530_1436.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0028_auto_20160630_0831.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0029_scaling_limit_input.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0030_device_polling_interval.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0031_delete_variableconfigfileimport.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0032_auto_20161107_2206.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0033_auto_20161107_2241.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0034_auto_20170213_0855.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0035_auto_20170224_1215.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0036_auto_20170224_1245.py
  function forwards_func (line 8) | def forwards_func(apps, schema_editor):
  function reverse_func (line 28) | def reverse_func(apps, schema_editor):
  class Migration (line 36) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0037_auto_20170418_0931.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0038_auto_20170707_1209.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0039_auto_20170711_1326.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0040_auto_20170905_0942.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0041_update_protocol_id.py
  function forwards_func (line 7) | def forwards_func(apps, schema_editor):
  function reverse_func (line 70) | def reverse_func(apps, schema_editor):
  class Migration (line 76) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0042_auto_20180604_1240.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0043_devicewritetask_property_name.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0044_auto_20180704_1307.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0045_auto_20180705_1341.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0046_remove_devicewritetask_property_name.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0047_recordeddatanew.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0047_variableproperty_unit.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0048_datamigration_20181025_0918.py
  function queryset_iterator (line 14) | def queryset_iterator(queryset, chunk_size=100000):
  function move_recorded_data (line 27) | def move_recorded_data(apps, schema_editor):
  class Migration (line 72) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0049_auto_20181025_1049.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0050_merge_20181130_1143.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0051_auto_20181206_1107.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0052_auto_20181207_1019.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0053_auto_20190207_1526.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0053_auto_20190307_1423.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0054_auto_20190208_0913.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0054_auto_20190411_0749.py
  class Migration (line 9) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0055_auto_20190625_1752.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0056_auto_20190625_1823.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0057_auto_20191004_0912.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0058_merge_20191206_1328.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0059_auto_20200211_1049.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0060_auto_20200914_1417.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0061_devicereadtask.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0062_auto_20201002_0830.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0063_complexevent_complexeventitem_complexeventitemvariable.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0064_auto_20201005_1443.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0065_auto_20201005_1454.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0066_auto_20201006_0718.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0067_auto_20201006_0719.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0068_auto_20201006_0826.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0069_complexeventgroup_current_level.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0070_auto_20201006_1327.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0071_recordedevent_level.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0072_auto_20201006_1408.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0073_auto_20201007_0858.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0074_complexeventitem_active.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0075_auto_20201007_1609.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0076_mail_html_message.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0077_auto_20201104_1656.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0078_auto_20201123_1906.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0079_devicehandler.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0080_variableproperty_last_modified.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0081_calculatedvariable_periodfield_variablecalculatedfields.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0082_auto_20211112_1043.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0083_auto_20211115_0812.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0084_auto_20211115_1503.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0085_calculatedvariableselector_active.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0086_auto_20211115_1612.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0087_auto_20211116_1329.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0088_auto_20211117_1023.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0089_calculatedvariable_state.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0090_auto_20211117_1239.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0091_auto_20211118_1019.py
  class Migration (line 8) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0092_auto_20211125_1054.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0093_auto_20211125_1256.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0094_move_dictionaries.py
  function move_dicts (line 11) | def move_dicts(apps, schema_editor):
  class Migration (line 80) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0095_auto_20211203_1949.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0096_auto_20211210_0924.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0097_auto_20220118_1046.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0098_alter_device_polling_interval.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0099_alter_dictionaryitem_label.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0100_device_instrument_handler.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0101_complexeventchangevariable.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0102_move_complex_event_variables.py
  function move_changed_variables (line 10) | def move_changed_variables(apps, schema_editor):
  class Migration (line 46) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0103_remove_complexevent_new_value_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0104_rename_complexeventitem_complexeventinput_and_more.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0105_edit_generic_device_protocol.py
  function forwards_func (line 8) | def forwards_func(apps, schema_editor):
  function reverse_func (line 18) | def reverse_func(apps, schema_editor):
  class Migration (line 28) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0106_datasource_datasourcemodel_djangodatabase_and_more.py
  function forwards_func (line 7) | def forwards_func(apps, schema_editor):
  class Migration (line 38) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0107_alter_calculatedvariableselector_period_fields.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0108_remove_calculatedvariable_period_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0109_alter_variable_value_class.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0110_variable_readable.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0111_devicehandlerparameter.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0112_alter_devicehandlerparameter_value.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0113_variablehandlerparameter.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0114_alter_devicehandlerparameter_value_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0115_remove_recordeddata_variable_and_more.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/migrations/0116_variable_pause_recording.py
  class Migration (line 6) | class Migration(migrations.Migration):

FILE: pyscada/models.py
  function channels_test (line 61) | async def channels_test():
  function validate_nonzero (line 86) | def validate_nonzero(value):
  function start_from_default (line 94) | def start_from_default():
  function check_datasource_method (line 100) | def check_datasource_method(func):
  class VariableManager (line 120) | class VariableManager(models.Manager):
    method _get_variables_by_datasource (line 125) | def _get_variables_by_datasource(self, **kwargs):
    method _send_cov_notification (line 142) | def _send_cov_notification(self, variable):
    method read_multiple (line 160) | def read_multiple(self, **kwargs):
    method query_datapoints (line 166) | def query_datapoints(self,
    method write_multiple (line 217) | def write_multiple(self, **kwargs):
    method write_datapoints (line 225) | def write_datapoints(self, items: list, date_saved=None, **kwargs):
    method write_raw_datapoints (line 256) | def write_raw_datapoints(self, datapoints, date_saved=None, **kwargs):
  class VariablePropertyManager (line 286) | class VariablePropertyManager(models.Manager):
    method update_or_create_property (line 289) | def update_or_create_property(
    method get_property (line 365) | def get_property(self, variable, name, **kwargs):
    method update_property (line 387) | def update_property(
    method _send_cov_notification (line 455) | def _send_cov_notification(self, vp):
  class Color (line 472) | class Color(models.Model):
    method __str__ (line 479) | def __str__(self):
    method color_code (line 484) | def color_code(self):
    method color_rect_html (line 487) | def color_rect_html(self):
  class DeviceProtocol (line 494) | class DeviceProtocol(models.Model):
    method __str__ (line 503) | def __str__(self):
  class DeviceHandler (line 507) | class DeviceHandler(models.Model):
    method __str__ (line 527) | def __str__(self):
    method save (line 530) | def save(self, *args, **kwargs):
    method get_device_parameters (line 535) | def get_device_parameters(self):
    method get_variable_parameters (line 551) | def get_variable_parameters(self):
  class Device (line 568) | class Device(models.Model):
    method __str__ (line 611) | def __str__(self):
    method get_device_instance (line 618) | def get_device_instance(self):
    method save (line 629) | def save(self, *args, **kwargs):
  class DeviceHandlerParameter (line 640) | class DeviceHandlerParameter(models.Model):
    method __str__ (line 645) | def __str__(self):
  class Unit (line 649) | class Unit(models.Model):
    method __str__ (line 655) | def __str__(self):
    class Meta (line 658) | class Meta:
  class Scaling (line 662) | class Scaling(models.Model):
    method __str__ (line 673) | def __str__(self):
    method scale_value (line 690) | def scale_value(self, input_value):
    method scale_output_value (line 697) | def scale_output_value(self, input_value):
  class Dictionary (line 705) | class Dictionary(models.Model):
    method __str__ (line 709) | def __str__(self):
    method dict_as_json (line 712) | def dict_as_json(self):
    method get_label (line 718) | def get_label(self, value):
    method append (line 732) | def append(self, label, value, silent=False, update=None):
    method remove (line 801) | def remove(self, label=None, value=None):
    method _get_objects_for_html (line 809) | def _get_objects_for_html(
  class DictionaryItem (line 822) | class DictionaryItem(models.Model):
    method __str__ (line 830) | def __str__(self):
  class VariableProperty (line 834) | class VariableProperty(models.Model):
    class Meta (line 914) | class Meta:
    method __str__ (line 917) | def __str__(self):
    method value (line 920) | def value(self):
    method web_key (line 943) | def web_key(self):
    method item_type (line 946) | def item_type(self):
    method convert_string_value (line 949) | def convert_string_value(self, value):
  class DataSourceModel (line 984) | class DataSourceModel(models.Model):
    method __str__ (line 1008) | def __str__(self):
  class DataSource (line 1012) | class DataSource(models.Model):
    method __str__ (line 1024) | def __str__(self):
    method get_related_datasource (line 1031) | def get_related_datasource(self):
    method datasource_check (line 1037) | def datasource_check(self, items, items_as_id=False, ids_model=None):
    method _send_cov_notification (line 1078) | def _send_cov_notification(self, variable):
    method last_value (line 1096) | def last_value(self, **kwargs):
    method last_datapoint (line 1103) | def last_datapoint(self, variable, use_date_saved=False, **kwargs):
    method read_multiple (line 1108) | def read_multiple(
    method query_datapoints (line 1118) | def query_datapoints(self, **kwargs):
    method write_multiple (line 1125) | def write_multiple(self, **kwargs):
    method write_datapoints (line 1132) | def write_datapoints(self, items: list, **kwargs):
    method write_raw_datapoints (line 1144) | def write_raw_datapoints(self, datapoints, date_saved=None, **kwargs):
  class Variable (line 1167) | class Variable(models.Model):
    method save (line 1257) | def save(self, *args, **kwargs):
    method datasource_model (line 1282) | def datasource_model(self):
    method get_related_datasource (line 1285) | def get_related_datasource(self):
    method hmi_name (line 1288) | def hmi_name(self):
    method chart_line_color_code (line 1294) | def chart_line_color_code(self):
    method __init__ (line 1322) | def __init__(self, *args, **kwargs):
    method erase_cache (line 1333) | def erase_cache(self):
    method __str__ (line 1337) | def __str__(self):
    method add_attr (line 1340) | def add_attr(self, **kwargs):
    method item_type (line 1344) | def item_type(self):
    method get_bits_by_class (line 1347) | def get_bits_by_class(self):
    method last_datapoint (line 1403) | def last_datapoint(self, use_date_saved=False):
    method write_datapoints (line 1411) | def write_datapoints(self, **kwargs):
    method write_raw_datapoints (line 1421) | def write_raw_datapoints(self, datapoints: list, date_saved=None, **kw...
    method query_datapoints (line 1447) | def query_datapoints(self, **kwargs):
    method query_prev_value (line 1458) | def query_prev_value(self):
    method check_last_datapoint (line 1464) | def check_last_datapoint(self):
    method update_value (line 1483) | def update_value(self, value=None, timestamp=None):
    method _update_value (line 1489) | def _update_value(self, value=None, timestamp=None):
    method update_values (line 1550) | def update_values(self, value_list, timestamp_list, erase_cache=False):
    method decode_value (line 1604) | def decode_value(self, value):
    method encode_value (line 1746) | def encode_value(self, value):
    method convert_string_value (line 1851) | def convert_string_value(self, value):
    method _get_objects_for_html (line 1894) | def _get_objects_for_html(
    method get_protocol_variable (line 1900) | def get_protocol_variable(self):
  class VariableHandlerParameter (line 1920) | class VariableHandlerParameter(models.Model):
    method __str__ (line 1925) | def __str__(self):
  class DeviceWriteTask (line 1929) | class DeviceWriteTask(models.Model):
    method __str__ (line 1944) | def __str__(self):
    method get_device_id (line 1957) | def get_device_id(self):
    method create_and_notificate (line 1965) | def create_and_notificate(self, dwts):
    method acreate_and_notificate (line 2008) | async def acreate_and_notificate(self, dwts):
  class DeviceReadTask (line 2053) | class DeviceReadTask(models.Model):
    method __str__ (line 2068) | def __str__(self):
    method get_device_id (line 2083) | def get_device_id(self):
    method create_and_notificate (line 2093) | def create_and_notificate(self, drts):
  class Log (line 2136) | class Log(models.Model):
    method __init__ (line 2147) | def __init__(self, *args, **kwargs):
    method __str__ (line 2162) | def __str__(self):
  class BackgroundProcess (line 2166) | class BackgroundProcess(models.Model):
    class Meta (line 2194) | class Meta:
    method __str__ (line 2197) | def __str__(self):
    method get_device_id (line 2200) | def get_device_id(self):
    method get_process_instance (line 2212) | def get_process_instance(self):
    method restart (line 2235) | def restart(self):
    method _stop (line 2249) | def _stop(self, signum=signal.SIGTERM):
    method stop (line 2277) | def stop(self, signum=signal.SIGTERM, cleanup=False):
  class ComplexEvent (line 2292) | class ComplexEvent(models.Model):
    method __str__ (line 2301) | def __str__(self):
    method do_event_check (line 2304) | def do_event_check(self):
    method compose_mail (line 2421) | def compose_mail(self, item_found, var_list, vp_list):
  class ComplexEventLevel (line 2612) | class ComplexEventLevel(models.Model):
    method is_valid (line 2636) | def is_valid(self):
    method __str__ (line 2665) | def __str__(self):
  class ComplexEventOutput (line 2669) | class ComplexEventOutput(models.Model):
  class ComplexEventInput (line 2688) | class ComplexEventInput(models.Model):
    method in_limit (line 2757) | def in_limit(self):
    method get_id (line 2865) | def get_id(self):
    method get_type (line 2871) | def get_type(self):
  class Event (line 2878) | class Event(models.Model):
    method __str__ (line 2934) | def __str__(self):
    method do_event_check (line 2937) | def do_event_check(self):
  class RecordedEvent (line 3085) | class RecordedEvent(models.Model):
    method __str__ (line 3093) | def __str__(self):
  class Mail (line 3100) | class Mail(models.Model):
    method send_mail (line 3110) | def send_mail(self):
    method __str__ (line 3147) | def __str__(self):

FILE: pyscada/signals.py
  function _variable (line 28) | def _variable(sender, instance, **kwargs):
  function _scaling (line 46) | def _scaling(sender, instance, **kwargs):
  function _device_handler_post_save (line 65) | def _device_handler_post_save(sender, instance, **kwargs):
  function _vp_post_save (line 81) | def _vp_post_save(sender, instance, **kwargs):
  function _reinit_daq_daemons (line 88) | def _reinit_daq_daemons(sender, instance, **kwargs):
  function _del_daq_daemons (line 134) | def _del_daq_daemons(sender, instance, **kwargs):

FILE: pyscada/single_value_datasource/apps.py
  class PyScada1SingleValueDatasourceConfig (line 12) | class PyScada1SingleValueDatasourceConfig(AppConfig):

FILE: pyscada/single_value_datasource/migrations/0001_initial.py
  class Migration (line 7) | class Migration(migrations.Migration):

FILE: pyscada/single_value_datasource/models.py
  class DjangoSingleValue (line 17) | class DjangoSingleValue(models.Model):
    method __str__ (line 20) | def __str__(self):
    method last_datapoint (line 23) | def last_datapoint(self, variable=None, use_date_saved=False, **kwargs):
    method query_datapoints (line 55) | def query_datapoints(
    method write_datapoints (line 117) | def write_datapoints(self, items=[], date_saved=None, **kwargs):
    method write_raw_datapoints (line 152) | def write_raw_datapoints(self, datapoints: dict, date_saved=None):
  class SingleValueRecordedData (line 193) | class SingleValueRecordedData(models.Model):
    method value (line 207) | def value(self):
    method value (line 249) | def value(self, value):
    method update_data (line 325) | def update_data(self, new_data:list, date_saved)-> bool:

FILE: pyscada/tests.py
  class SimpleTest (line 19) | class SimpleTest(TestCase):
    method test_basic_addition (line 20) | def test_basic_addition(self):
  class VariableTest (line 27) | class VariableTest(TestCase):
    method setUp (line 28) | def setUp(self):
    method test_variable_read_1 (line 42) | def test_variable_read_1(self):
    method test_variable_read_2 (line 48) | def test_variable_read_2(self):
    method test_variable_read_3 (line 52) | def test_variable_read_3(self):
  class ReadVariableTest (line 58) | class ReadVariableTest(TestCase):
    method setUp (line 59) | def setUp(self):
    method test_variable_read (line 79) | def test_variable_read(self):
    method test_variable_last_datapoint (line 146) | def test_variable_last_datapoint(self):
  class WriteRawVariableTest (line 155) | class WriteRawVariableTest(TestCase):
    method setUp (line 156) | def setUp(self):
    method test_variable_method_write_1 (line 169) | def test_variable_method_write_1(self):
    method test_variable_method_write_2 (line 178) | def test_variable_method_write_2(self):
    method test_variable_method_write_3 (line 192) | def test_variable_method_write_3(self):
    method test_variable_method_write_4 (line 204) | def test_variable_method_write_4(self):
    method test_variable_manager_write (line 213) | def test_variable_manager_write(self):
  class VariableCacheTest (line 225) | class VariableCacheTest(TestCase):
    method setUp (line 226) | def setUp(self):
    method test_variable_read_1 (line 240) | def test_variable_read_1(self):
    method test_variable_read_2 (line 246) | def test_variable_read_2(self):
    method test_variable_read_3 (line 250) | def test_variable_read_3(self):
  class WriteCacheVariableTest (line 256) | class WriteCacheVariableTest(TestCase):
    method setUp (line 257) | def setUp(self):
    method test_variable_method_write_1 (line 274) | def test_variable_method_write_1(self):
    method test_variable_method_write_2 (line 295) | def test_variable_method_write_2(self):
    method test_variable_method_write_3 (line 313) | def test_variable_method_write_3(self):
    method test_variable_method_write_4 (line 332) | def test_variable_method_write_4(self):
    method test_variable_manager_write (line 348) | def test_variable_manager_write(self):
  class ReadVariableCacheTest (line 364) | class ReadVariableCacheTest(TestCase):
    method setUp (line 365) | def setUp(self):
    method test_variable_read_1 (line 391) | def test_variable_read_1(self):
    method test_variable_read_2 (line 407) | def test_variable_read_2(self):
    method test_variable_read_3 (line 418) | def test_variable_read_3(self):
    method test_variable_read_4 (line 436) | def test_variable_read_4(self):
    method test_variable_read_5 (line 450) | def test_variable_read_5(self):
    method test_variable_last_datapoint (line 463) | def test_variable_last_datapoint(self):
  class WriteSingleValueVariableTest (line 471) | class WriteSingleValueVariableTest(TestCase):
    method setUp (line 472) | def setUp(self):
    method test_variable_method_write_1 (line 489) | def test_variable_method_write_1(self):
    method test_variable_method_write_2 (line 507) | def test_variable_method_write_2(self):
    method test_variable_method_write_3 (line 522) | def test_variable_method_write_3(self):
    method test_variable_method_write_4 (line 538) | def test_variable_method_write_4(self):
    method test_variable_manager_write (line 551) | def test_variable_manager_write(self):
    method test_write_multiple (line 566) | def test_write_multiple(self):
  class VariableSingleValueTest (line 596) | class VariableSingleValueTest(TestCase):
    method setUp (line 597) | def setUp(self):
    method test_variable_read_1 (line 611) | def test_variable_read_1(self):
    method test_variable_read_2 (line 617) | def test_variable_read_2(self):
    method test_variable_read_3 (line 621) | def test_variable_read_3(self):
  class ReadVariableSingleValueTest (line 627) | class ReadVariableSingleValueTest(TestCase):
    method setUp (line 628) | def setUp(self):
    method test_variable_read_1 (line 654) | def test_variable_read_1(self):
    method test_variable_read_2 (line 670) | def test_variable_read_2(self):
    method test_variable_read_3 (line 681) | def test_variable_read_3(self):
    method test_variable_read_4 (line 699) | def test_variable_read_4(self):
    method test_variable_read_5 (line 713) | def test_variable_read_5(self):
    method test_variable_last_datapoint (line 726) | def test_variable_last_datapoint(self):

FILE: pyscada/utils/__init__.py
  function _get_objects_for_html (line 20) | def _get_objects_for_html(list_to_append=None, obj=None, exclude_model_n...
  function get_group_display_permission_list (line 85) | def get_group_display_permission_list(items, groups, authenticated=True):
  function gen_hiddenConfigHtml (line 173) | def gen_hiddenConfigHtml(obj, custom_fields=None, exclude_fields_list=No...
  function extract_numbers_from_str (line 230) | def extract_numbers_from_str(value_str):
  function decode_bcd (line 239) | def decode_bcd(values):
  function validate_value_class (line 264) | def validate_value_class(class_str):
  function _cast (line 291) | def _cast(value, class_str):
  function datetime_now (line 324) | def datetime_now():
  function timestamp_to_datetime (line 328) | def timestamp_to_datetime(timestamp, tz=UTC):
  function blow_up_data (line 332) | def blow_up_data(data, timevalues, mean_value_period, no_mean_value=True):
  function min_pass (line 392) | def min_pass(my_marks, my_pass, compare="gte"):
  function max_pass (line 410) | def max_pass(my_marks, my_pass, compare="lte"):
  function set_bit (line 428) | def set_bit(v, index, x):

FILE: pyscada/utils/scheduler.py
  function channels_test (line 99) | async def channels_test():
  function check_db_connection (line 115) | def check_db_connection():
  function close_db_connection (line 130) | def close_db_connection():
  class Scheduler (line 136) | class Scheduler(object):
    method __init__ (line 149) | def __init__(
    method init_db (line 181) | def init_db(self, sig=0):
    method demonize (line 229) | def demonize(self):
    method write_pid (line 302) | def write_pid(self, pid=None):
    method read_pid (line 309) | def read_pid(self):
    method delete_pid (line 323) | def delete_pid(self, force_del=False):
    method start (line 339) | def start(self):
    method init_apps (line 415) | def init_apps(self):
    method run (line 428) | def run(self):
    method manage_processes (line 508) | def manage_processes(self):
    method handle_chld (line 584) | def handle_chld(self, sig, _frame):
    method restart (line 600) | def restart(self):
    method stop (line 615) | def stop(self, sig=signal.SIGTERM):
    method kill_process (line 664) | def kill_process(self, process_id, sig=signal.SIGTERM):
    method kill_processes (line 690) | def kill_processes(self, sig=signal.SIGTERM):
    method spawn_process (line 696) | def spawn_process(self, process=None):
    method status (line 719) | def status(self):
    method signal (line 759) | def signal(self, signum=None, _frame=None):
  class Process (line 770) | class Process(object):
    method __init__ (line 771) | def __init__(self, dt=5, **kwargs):
    method pre_init_process (line 794) | def pre_init_process(self):
    method init_process (line 812) | def init_process(self):
    method run (line 818) | def run(self):
    method waiting_action_receiver (line 955) | async def waiting_action_receiver(self, dt, message):
    method loop (line 994) | def loop(self):
    method cleanup (line 1000) | def cleanup(self):
    method signal (line 1006) | def signal(self, signum=None, _frame=None):
    method stop (line 1061) | def stop(self, signum=None, _frame=None):
    method restart (line 1084) | def restart(self):
  class SingleDeviceDAQProcessWorker (line 1091) | class SingleDeviceDAQProcessWorker(Process):
    method __init__ (line 1097) | def __init__(self, dt=5, **kwargs):
    method create_bp (line 1100) | def create_bp(self, item):
    method init_process (line 1114) | def init_process(self):
    method loop (line 1135) | def loop(self):
    method cleanup (line 1195) | def cleanup(self):
    method restart (line 1199) | def restart(self):
  class MultiDeviceDAQProcessWorker (line 1218) | class MultiDeviceDAQProcessWorker(Process):
    method __init__ (line 1224) | def __init__(self, dt=5, **kwargs):
    method create_bp (line 1227) | def create_bp(self, key, values):
    method init_process (line 1241) | def init_process(self):
    method loop (line 1269) | def loop(self):
    method cleanup (line 1338) | def cleanup(self):
    method restart (line 1342) | def restart(self):
    method gen_group_id (line 1360) | def gen_group_id(self, item):
  class SingleDeviceDAQProcess (line 1367) | class SingleDeviceDAQProcess(Process):
    method __init__ (line 1368) | def __init__(self, dt=5, **kwargs):
    method init_process (line 1375) | def init_process(self):
    method loop (line 1408) | def loop(self):
    method cleanup (line 1591) | def cleanup(self):
    method restart (line 1597) | def restart(self):
  class MultiDeviceDAQProcess (line 1607) | class MultiDeviceDAQProcess(Process):
    method __init__ (line 1608) | def __init__(self, dt=5, **kwargs):
    method init_process (line 1615) | def init_process(self):
    method loop (line 1652) | def loop(self):
    method cleanup (line 1850) | def cleanup(self):
    method restart (line 1856) | def restart(self):
Condensed preview — 462 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,532K chars).
[
  {
    "path": ".flake8",
    "chars": 133,
    "preview": "[flake8]\nexclude = \n    build,\n    .git,\n    .tox,\n    tests/.env,\n    */migrations/*\n    \nextend-ignore = E203\nmax-line"
  },
  {
    "path": ".gitignore",
    "chars": 335,
    "preview": "*.log\n*.pot\n*.pyc\nlocal_settings.py\nbuild\nPyScada.egg-info\ndist\n/.project\ndocs/_build\n/.idea/*\n\n# Emacs backup files\n*~\n"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 637,
    "preview": "repos:\n  - repo: https://github.com/psf/black-pre-commit-mirror\n    rev: 24.4.2\n    hooks:\n    - id: black\n      exclude"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 1033,
    "preview": "# Read the Docs configuration file for Sphinx projects\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html f"
  },
  {
    "path": "AUTHORS",
    "chars": 239,
    "preview": "Current or previous core committers:\n\n* Martin Schröder\n* Camille Lavayssiere\n\nCurrent and previous core designers:\n\n* M"
  },
  {
    "path": "CHANGELOG.txt",
    "chars": 31508,
    "preview": "0.7.0b2\n - fixed modbus daemon\n - fixed modbus device\n - updated Docs\n - readded log notifications in HMI\n - added loadi"
  },
  {
    "path": "LICENSE",
    "chars": 34523,
    "preview": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C)"
  },
  {
    "path": "MANIFEST.in",
    "chars": 435,
    "preview": "include AUTHORS\ninclude LICENSE\ninclude README.rst\ninclude CHANGELOG.txt\nrecursive-include pyscada/templates *\nrecursive"
  },
  {
    "path": "README.rst",
    "chars": 3461,
    "preview": "PyScada a open source SCADA system\n==================================\n\nA Open Source SCADA System with HTML5 HMI, build "
  },
  {
    "path": "docker/docker-compose.yml-tmp",
    "chars": 749,
    "preview": "version: '3'\nservices:\n  pyscada:\n    build: pyscada\n    container_name: pyscada\n    #volumes:\n    tty: true\n    depends"
  },
  {
    "path": "docker/mysql/Dockerfile-tmp",
    "chars": 398,
    "preview": "\n## Pull the mysql:5.6 image\nFROM mysql:latest\n\n## The maintainer name and email\nLABEL maintainer=\"PyScada | Martin Schr"
  },
  {
    "path": "docker/nginx/Dockerfile",
    "chars": 338,
    "preview": "FROM nginx:latest\n\nLABEL maintainer=\"PyScada | Martin Schröder <info@martin-schroeder.net\"\n\nCOPY nginx.conf /etc/nginx/\n"
  },
  {
    "path": "docker/nginx/nginx.conf",
    "chars": 3060,
    "preview": "worker_processes auto;\npid /run/nginx.pid;\ninclude /etc/nginx/modules-enabled/*.conf;\n\nevents {\n        worker_connectio"
  },
  {
    "path": "docker/pyscada/Dockerfile",
    "chars": 816,
    "preview": "FROM python:latest\nLABEL maintainer=\"PyScada | Martin Schröder\"\nENV DEBIAN_FRONTEND noninteractive\n\n#RUN apt-get -y upda"
  },
  {
    "path": "docker/pyscada/pyscada",
    "chars": 374,
    "preview": "#!/usr/bin/env sh\necho \"Wait for MySQL to Start\"\nwhile ! wget --quiet db:3306; do\n    sleep 1\ndone\necho \"Start PyScada\"\n"
  },
  {
    "path": "docker/pyscada/pyscada_init",
    "chars": 305,
    "preview": "#!/usr/bin/env sh\nwhile ! wget --quiet db:3306; do\n    sleep 1\ndone\npython3 /src/pyscada/manage.py migrate\npython3 /src/"
  },
  {
    "path": "docs/Makefile",
    "chars": 604,
    "preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHI"
  },
  {
    "path": "docs/backend.rst",
    "chars": 4030,
    "preview": "Using the Backend\n=================\n\nTo use the backend open the HMI in your browser by opening http://127.0.0.1\n(replac"
  },
  {
    "path": "docs/command-line.rst",
    "chars": 1220,
    "preview": "Command-line\n============\n\nRestart the PyScada Daemons\n---------------------------\n\nsystemd:\n\n.. code-block:: shell\n\n\tsu"
  },
  {
    "path": "docs/conf.py",
    "chars": 5167,
    "preview": "# -*- coding: utf-8 -*-\n#\n# Configuration file for the Sphinx documentation builder.\n#\n# This file does only contain a s"
  },
  {
    "path": "docs/control_item.rst",
    "chars": 3035,
    "preview": "Control item\n============\n\nControl items are elements of crontol panels which have two functions by default:\n\n- display "
  },
  {
    "path": "docs/develop.rst",
    "chars": 2925,
    "preview": ".. IMPORTANT::\n    To use PyScada in developer mode, you should install it using the `pip editable mode (-e) <https://pi"
  },
  {
    "path": "docs/device_protocol.rst",
    "chars": 1607,
    "preview": "Device Protocol IDs\n--------------------\n\n\n- 1: Reserved (Scheduler)\n- 2: `SystemStat <https://github.com/pyscada/PyScad"
  },
  {
    "path": "docs/django_settings.rst",
    "chars": 4178,
    "preview": "Django Settings\n===============\n\n\nurls.py\n-------\n\n\nOpen the urls configuration file and add the necessary rewrite rule "
  },
  {
    "path": "docs/docker.rst",
    "chars": 1634,
    "preview": ".. IMPORTANT::\n    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your com"
  },
  {
    "path": "docs/frontend.rst",
    "chars": 465,
    "preview": "Using the Front-End\n===================\n\nThe ``settings.py`` file is usually located in ``/var/www/pyscada/PyScadaServer"
  },
  {
    "path": "docs/grafana.rst",
    "chars": 3080,
    "preview": "Use Grafana\n===========\n\nMysql\n-----\n\nAdd user and give SELECT rights :\n\n.. code-block:: shell\n\n  sudo mysql -uroot -p -"
  },
  {
    "path": "docs/index.rst",
    "chars": 749,
    "preview": ".. PyScada documentation master file, created by\n   sphinx-quickstart on Mon May 27 13:14:28 2019.\n   You can adapt this"
  },
  {
    "path": "docs/installation.rst",
    "chars": 6627,
    "preview": "\n.. IMPORTANT::\n    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your co"
  },
  {
    "path": "docs/make.bat",
    "chars": 7246,
    "preview": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\n"
  },
  {
    "path": "docs/nginx_setup.rst",
    "chars": 1477,
    "preview": "Nginx Setup\n===========\n\n\nnginx configuration\n-------------------\n\n\n::\n        \n        # debian\n        sudo wget https"
  },
  {
    "path": "docs/phant.rst",
    "chars": 130,
    "preview": "Phant Installation\n==================\n\nadd the following line to the urls.py:\n\n::\n\n   url(r'^', include('pyscada.phant.u"
  },
  {
    "path": "docs/plugin_install.rst",
    "chars": 1721,
    "preview": "PyScada plugin installation\n===========================\n\n1. Choose a method to download  the PyScada plugin (exemple usi"
  },
  {
    "path": "docs/quick_install.rst",
    "chars": 2555,
    "preview": ".. IMPORTANT::\n    This Version of PyScada is BETA software and may have serious bugs which may cause damage to your com"
  },
  {
    "path": "docs/raspberryPiOS.rst",
    "chars": 536,
    "preview": "Raspberry Pi OS Installation\n============================\n\nDownload last Lite image from `here <https://www.raspberrypi."
  },
  {
    "path": "docs/uninstall.rst",
    "chars": 2036,
    "preview": "Installation\n============\n\nDepending on what you need on your computer, you may NOT need to remove everything PyScada re"
  },
  {
    "path": "docs/update.rst",
    "chars": 2308,
    "preview": "Update from old versions\n========================\n\n0.6.x to 0.7.x\n--------------\n\nSorry a direct upgrade is not possible"
  },
  {
    "path": "docs/visa.rst",
    "chars": 457,
    "preview": "Discover VISA devices\n=====================\n\nTo discover GPIB/USB(/LXI?) devices run:\n\n::\n\n    sudo python3\n    import p"
  },
  {
    "path": "eslint.config.mjs",
    "chars": 152,
    "preview": "export default [\n    {\n        files: [\"**/*.js\"],\n        rules: {\n            \"semi\": \"warn\",\n            \"no-unused-v"
  },
  {
    "path": "extras/0.7to0.8.sh",
    "chars": 1441,
    "preview": "#!/bin/bash\n\n# check if path is passed\nif [ $# -eq 0 ]\n  then\n    manage_path=\"/var/www/pyscada/PyScadaServer\"\n    if te"
  },
  {
    "path": "extras/Grafana-test-dashboard.json",
    "chars": 12103,
    "preview": "{\n  \"__inputs\": [\n    {\n      \"name\": \"DS_PYSCADA\",\n      \"label\": \"PyScada\",\n      \"description\": \"\",\n      \"type\": \"da"
  },
  {
    "path": "extras/nginx_sample.conf",
    "chars": 2036,
    "preview": "# pyscada.conf\n\n# the upstream component nginx needs to connect to\nupstream app_server {\n        server unix:/tmp/gunico"
  },
  {
    "path": "extras/pyscada-logrotate",
    "chars": 106,
    "preview": "/var/log/pyscada_debug.log\n{\n\trotate 4\n\tweekly\n\tmissingok\n\tnotifempty\n\tcompress\n\tdelaycompress\n\tsize 1M\n}\n"
  },
  {
    "path": "extras/service/SysV-init/gunicorn_django",
    "chars": 1904,
    "preview": "#!/bin/bash\n\n### BEGIN INIT INFO\n# Provides:\t\t\t gunicorn_django\n# Required-Start:\t $all\n# Required-Stop:\t $all\n# Default"
  },
  {
    "path": "extras/service/SysV-init/pyscada_daemon",
    "chars": 1061,
    "preview": "#!/bin/bash\n \n### BEGIN INIT INFO\n# Provides:\t\t\t pyscada_daemon\n# Required-Start:\t $all\n# Required-Stop:\t $all\n# Default"
  },
  {
    "path": "extras/service/systemd/gunicorn.service",
    "chars": 532,
    "preview": "[Unit]\nDescription=gunicorn daemon\nRequires=gunicorn.socket\nAfter=network.target\n\n[Service]\nPIDFile=/tmp/gunicorn.pid\nUs"
  },
  {
    "path": "extras/service/systemd/gunicorn.socket",
    "chars": 161,
    "preview": "[Unit]\nDescription=gunicorn socket\n\n[Socket]\nListenStream=/tmp/gunicorn.sock\nListenStream=0.0.0.0:9000\n#ListenStream=[::"
  },
  {
    "path": "extras/service/systemd/owfs.service",
    "chars": 388,
    "preview": "[Unit]\nDescription=OWFS Daemon\nAfter=network.target\n\n[Service]\nType=forking\nPIDFile=/tmp/owfs_daemon.pid\n#User=pyscada\n#"
  },
  {
    "path": "extras/service/systemd/pyscada_daemon.service",
    "chars": 685,
    "preview": "[Unit]\nDescription=PyScada Daemon\nAfter=network.target\nAfter=mysql.service\nAfter=redis-server.service\n\n[Service]\nType=fo"
  },
  {
    "path": "extras/service/windows/register_windows_service.py",
    "chars": 1362,
    "preview": "import win32serviceutil\nimport win32service\nimport win32event\nimport servicemanager\nimport os\n\n\nclass AppServerSvc(win32"
  },
  {
    "path": "extras/settings.py",
    "chars": 7638,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nDjango settings for PyScadaServer project.\n\nGenerated by 'django-admin sta"
  },
  {
    "path": "extras/urls.py",
    "chars": 780,
    "preview": "\"\"\"PyScadaServer URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    ht"
  },
  {
    "path": "install.sh",
    "chars": 1616,
    "preview": "#!/bin/bash\n\n# check if the script is run from script directory\nSOURCE=${BASH_SOURCE[0]}\nwhile [ -L \"$SOURCE\" ]; do # re"
  },
  {
    "path": "install_docker.sh",
    "chars": 7586,
    "preview": "#!/bin/bash\n\n# VAR\n\nanswer_db_name=\"PyScada_db\"         # Name of the database\nanswer_db_user=\"PyScada-user\"         # U"
  },
  {
    "path": "install_venv.sh",
    "chars": 14711,
    "preview": "#!/bin/bash\n\n# todo : add inputs for django admin name, password\n\n# check if the script is run from script directory\nSOU"
  },
  {
    "path": "move_data.py",
    "chars": 2578,
    "preview": "# -*- coding: utf-8 -*-\n\"\"\"\ncopies data from pyscada.models.RecordedDataOld to RecordedData\nthe script will terminate af"
  },
  {
    "path": "pyproject.toml",
    "chars": 1814,
    "preview": "[build-system]\nrequires = [\"setuptools>=61.0.0,<69.3.0\"]\nbuild-backend = \"setuptools.build_meta:__legacy__\"\n\n[project]\nn"
  },
  {
    "path": "pyscada/__init__.py",
    "chars": 76,
    "preview": "from pkgutil import extend_path\n\n__path__ = extend_path(__path__, __name__)\n"
  },
  {
    "path": "pyscada/admin.py",
    "chars": 38272,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.models import Device, DeviceProtocol, Devi"
  },
  {
    "path": "pyscada/apps.py",
    "chars": 5073,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom django.apps import AppCo"
  },
  {
    "path": "pyscada/cache_datasource/__init__.py",
    "chars": 320,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada import core\n\n__version__ = core.__version_"
  },
  {
    "path": "pyscada/cache_datasource/apps.py",
    "chars": 398,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport logging\n\nfrom django.apps import AppConfig\nfrom "
  },
  {
    "path": "pyscada/cache_datasource/migrations/0001_initial.py",
    "chars": 721,
    "preview": "# Generated by Django 5.2.10 on 2026-02-10 15:03\n\nimport django.db.models.deletion\nfrom django.db import migrations, mod"
  },
  {
    "path": "pyscada/cache_datasource/migrations/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/cache_datasource/models.py",
    "chars": 9514,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport logging\nimport time\n\nfrom django.core.cache impo"
  },
  {
    "path": "pyscada/core/__init__.py",
    "chars": 1179,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n__version__ = \"0.9.0\"\n__author__ = \"Martin Schröder, Ca"
  },
  {
    "path": "pyscada/core/urls.py",
    "chars": 551,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.apps import apps\nimport logging\n\nlogger = l"
  },
  {
    "path": "pyscada/device.py",
    "chars": 7057,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.models import DeviceProtocol, VariableProp"
  },
  {
    "path": "pyscada/django_datasource/__init__.py",
    "chars": 322,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada import core\n\n__version__ = core.__version_"
  },
  {
    "path": "pyscada/django_datasource/apps.py",
    "chars": 400,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.apps import AppConfig\nfrom django.utils.tra"
  },
  {
    "path": "pyscada/django_datasource/migrations/0001_initial.py",
    "chars": 3101,
    "preview": "# Generated by Django 5.2.10 on 2026-02-02 12:29\n\nimport django.db.models.deletion\nfrom django.db import migrations, mod"
  },
  {
    "path": "pyscada/django_datasource/migrations/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/django_datasource/models.py",
    "chars": 30464,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport logging\nimport time\n\nfrom django.core.exceptions"
  },
  {
    "path": "pyscada/event/__init__.py",
    "chars": 82,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n"
  },
  {
    "path": "pyscada/event/worker.py",
    "chars": 639,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.models import Event, Com"
  },
  {
    "path": "pyscada/export/__init__.py",
    "chars": 381,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom pyscada import core\n\n\n__version__ = core.__version_"
  },
  {
    "path": "pyscada/export/admin.py",
    "chars": 1027,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.admin import admin_site\nfrom pyscada.expor"
  },
  {
    "path": "pyscada/export/apps.py",
    "chars": 368,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.apps import AppConfig\nfrom django.utils.tra"
  },
  {
    "path": "pyscada/export/csv_file.py",
    "chars": 2062,
    "preview": "from __future__ import unicode_literals\nimport csv\nimport os\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef "
  },
  {
    "path": "pyscada/export/export.py",
    "chars": 13206,
    "preview": "# PyScada\nfrom __future__ import unicode_literals\n\nfrom pyscada.utils import validate_value_class\n\nfrom pyscada.models i"
  },
  {
    "path": "pyscada/export/hdf5_file.py",
    "chars": 5552,
    "preview": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 30 14:22:58 2013\n\n@author: Martin Schröder\n\"\"\"\nfrom __future__ import uni"
  },
  {
    "path": "pyscada/export/management/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/export/management/commands/PyScadaExportData.py",
    "chars": 1467,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport os\nfrom pyscada.export.export import export_recordeddata_to_file\nfrom d"
  },
  {
    "path": "pyscada/export/management/commands/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/export/migrations/0001_initial.py",
    "chars": 2992,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/export/migrations/0002_auto_20151201_1617.py",
    "chars": 842,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/export/migrations/0003_auto_20160315_1140.py",
    "chars": 368,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/export/migrations/0004_exporttask.py",
    "chars": 2629,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django."
  },
  {
    "path": "pyscada/export/migrations/0005_auto_20160403_1454.py",
    "chars": 1149,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django."
  },
  {
    "path": "pyscada/export/migrations/0006_auto_20160404_0949.py",
    "chars": 1298,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django."
  },
  {
    "path": "pyscada/export/migrations/0007_auto_20161124_1002.py",
    "chars": 999,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-11-24 10:02\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/export/migrations/0008_auto_20161124_1003.py",
    "chars": 974,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-11-24 10:03\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/export/migrations/0009_auto_20161128_0948.py",
    "chars": 1879,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-11-28 09:48\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/export/migrations/0010_auto_20161128_1049.py",
    "chars": 530,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-11-28 10:49\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/export/migrations/0011_exporttask_filename.py",
    "chars": 478,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2017-04-06 10:24\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/export/migrations/0012_exporttask_backgroundprocess.py",
    "chars": 708,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-07-07 14:52\nfrom __future__ import unicode_literals\n\nfrom dja"
  },
  {
    "path": "pyscada/export/migrations/0013_auto_20170711_0729.py",
    "chars": 460,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-07-11 07:29\nfrom __future__ import unicode_literals\n\nfrom dja"
  },
  {
    "path": "pyscada/export/migrations/0014_auto_20170711_1326.py",
    "chars": 1765,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-07-11 13:26\nfrom __future__ import unicode_literals\n\nfrom dja"
  },
  {
    "path": "pyscada/export/migrations/0015_remove_exporttask_backgroundtask.py",
    "chars": 401,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-09-05 09:42\nfrom __future__ import unicode_literals\n\nfrom dja"
  },
  {
    "path": "pyscada/export/migrations/0016_auto_20191004_0912.py",
    "chars": 1010,
    "preview": "# Generated by Django 2.2.6 on 2019-10-04 09:12\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/export/migrations/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/export/models.py",
    "chars": 4460,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.models import Variable, BackgroundProcess\n"
  },
  {
    "path": "pyscada/export/worker.py",
    "chars": 10004,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom pyscada.export.export import ex"
  },
  {
    "path": "pyscada/fixtures/color.json",
    "chars": 17649,
    "preview": "[\n{\n    \"fields\": {\n        \"B\": 0,\n        \"R\": 0,\n        \"name\": \"auto\",\n        \"G\": 0\n    },\n    \"model\": \"pyscada."
  },
  {
    "path": "pyscada/fixtures/units.json",
    "chars": 1826,
    "preview": "[{\"fields\": {\"description\": \"celsius\", \"unit\": \"\\u00b0C\", \"udunit\": \"celsius\"}, \"model\": \"pyscada.unit\", \"pk\": 1}, {\"fie"
  },
  {
    "path": "pyscada/generic/__init__.py",
    "chars": 328,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom pyscada import core\n\n__version__ = core.__version__"
  },
  {
    "path": "pyscada/generic/device.py",
    "chars": 714,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.device import GenericDevice\nfrom .devices "
  },
  {
    "path": "pyscada/generic/devices/__init__.py",
    "chars": 840,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom .. import PROTOCOL_ID\nfrom pyscada.models import De"
  },
  {
    "path": "pyscada/generic/devices/dummy.py",
    "chars": 397,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.generic.devices import GenericDevice\nimpor"
  },
  {
    "path": "pyscada/generic/devices/waveform.py",
    "chars": 3859,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.generic.devices import GenericDevice\nfrom "
  },
  {
    "path": "pyscada/generic/worker.py",
    "chars": 529,
    "preview": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom pyscada.utils.scheduler import "
  },
  {
    "path": "pyscada/hmi/__init__.py",
    "chars": 152,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada import core\n\n\n__version__ = core.__version"
  },
  {
    "path": "pyscada/hmi/admin.py",
    "chars": 21785,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.admin import admin_site\n\nfrom pyscada.mode"
  },
  {
    "path": "pyscada/hmi/apps.py",
    "chars": 9807,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.apps import AppConfig\nfrom django.utils.tra"
  },
  {
    "path": "pyscada/hmi/migrations/0001_initial.py",
    "chars": 15153,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport django."
  },
  {
    "path": "pyscada/hmi/migrations/0002_auto_20151016_1932.py",
    "chars": 3250,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0003_auto_20151130_1456.py",
    "chars": 930,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0004_auto_20151130_1502.py",
    "chars": 919,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0005_auto_20160111_1822.py",
    "chars": 616,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django."
  },
  {
    "path": "pyscada/hmi/migrations/0006_auto_20160111_1848.py",
    "chars": 884,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0007_auto_20160518_0848.py",
    "chars": 1010,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0008_auto_20180620_0716.py",
    "chars": 1039,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.4 on 2018-06-20 07:16\nfrom __future__ import unicode_literals\n\nfrom d"
  },
  {
    "path": "pyscada/hmi/migrations/0009_controlitem_property_name.py",
    "chars": 482,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.13 on 2018-06-29 10:15\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0010_auto_20180705_1341.py",
    "chars": 800,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.13 on 2018-07-05 13:41\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0011_auto_20180710_1549.py",
    "chars": 976,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.13 on 2018-07-10 15:49\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0012_auto_20180912_1302.py",
    "chars": 1604,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-09-12 13:02\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0013_widget_update_20180912_1315.py",
    "chars": 3403,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-09-12 13:02\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0014_auto_20180912_1340.py",
    "chars": 746,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-09-12 13:40\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0015_auto_20180913_1608.py",
    "chars": 3093,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-09-13 16:08\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0016_auto_20181004_0831.py",
    "chars": 1297,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-10-04 08:31\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0017_groupdisplaypermission_forms.py",
    "chars": 478,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-10-26 06:30\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0018_auto_20181205_0937.py",
    "chars": 1746,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-12-05 09:37\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0019_auto_20181205_1058.py",
    "chars": 1015,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-12-05 10:58\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0020_pie.py",
    "chars": 1261,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.18 on 2019-05-15 12:32\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0021_auto_20190528_0924.py",
    "chars": 725,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.18 on 2019-05-28 09:24\nfrom __future__ import unicode_literals\n\nfrom "
  },
  {
    "path": "pyscada/hmi/migrations/0022_auto_20191004_0912.py",
    "chars": 3176,
    "preview": "# Generated by Django 2.2.6 on 2019-10-04 09:12\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0023_dropdownitem_value.py",
    "chars": 397,
    "preview": "# Generated by Django 2.2.7 on 2019-11-13 16:41\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0024_auto_20191212_1516.py",
    "chars": 910,
    "preview": "# Generated by Django 2.2.8 on 2019-12-12 15:16\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0025_widgetcontent_content_str.py",
    "chars": 404,
    "preview": "# Generated by Django 2.2.8 on 2020-09-07 07:31\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0026_auto_20200915_1333.py",
    "chars": 3489,
    "preview": "# Generated by Django 2.2.8 on 2020-09-15 13:33\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0027_auto_20200915_1407.py",
    "chars": 561,
    "preview": "# Generated by Django 2.2.8 on 2020-09-15 14:07\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration"
  },
  {
    "path": "pyscada/hmi/migrations/0028_auto_20200915_1540.py",
    "chars": 454,
    "preview": "# Generated by Django 2.2.8 on 2020-09-15 15:40\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0029_auto_20200916_0720.py",
    "chars": 5867,
    "preview": "# Generated by Django 2.2.8 on 2020-09-16 07:20\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0030_auto_20200918_0842.py",
    "chars": 740,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 08:42\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0031_auto_20200918_1206.py",
    "chars": 1364,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 12:06\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0032_auto_20200918_1408.py",
    "chars": 648,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 14:08\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0033_auto_20200918_1439.py",
    "chars": 557,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 14:39\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0034_auto_20200918_1445.py",
    "chars": 579,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 14:45\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0035_auto_20200918_1517.py",
    "chars": 908,
    "preview": "# Generated by Django 2.2.8 on 2020-09-18 15:17\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0036_auto_20200923_0850.py",
    "chars": 1305,
    "preview": "# Generated by Django 2.2.8 on 2020-09-23 08:50\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0037_auto_20200923_0852.py",
    "chars": 876,
    "preview": "# Generated by Django 2.2.8 on 2020-09-23 08:52\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0038_auto_20200929_1410.py",
    "chars": 676,
    "preview": "# Generated by Django 2.2.8 on 2020-09-29 14:10\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0039_auto_20201002_0928.py",
    "chars": 2557,
    "preview": "# Generated by Django 2.2.8 on 2020-10-02 09:28\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0040_dictionary_dictionaryitem.py",
    "chars": 1175,
    "preview": "# Generated by Django 2.2.8 on 2020-10-02 09:30\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0041_auto_20201002_0934.py",
    "chars": 902,
    "preview": "# Generated by Django 2.2.8 on 2020-10-02 09:34\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0042_auto_20201201_1335.py",
    "chars": 891,
    "preview": "# Generated by Django 2.2.8 on 2020-12-01 13:35\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0043_auto_20201201_1411.py",
    "chars": 3137,
    "preview": "# Generated by Django 2.2.8 on 2020-12-01 14:11\n\nfrom django.db import migrations\nfrom pyscada.hmi.models import Chart a"
  },
  {
    "path": "pyscada/hmi/migrations/0044_auto_20201201_1539.py",
    "chars": 647,
    "preview": "# Generated by Django 2.2.8 on 2020-12-01 15:39\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0045_auto_20201201_2100.py",
    "chars": 1950,
    "preview": "# Generated by Django 2.2.17 on 2020-12-01 21:00\n\nfrom django.db import migrations, models\nimport django.db.models.delet"
  },
  {
    "path": "pyscada/hmi/migrations/0046_auto_20201201_2109.py",
    "chars": 2358,
    "preview": "# Generated by Django 2.2.17 on 2020-12-01 21:00\n\nfrom django.db import migrations\n\nfrom time import time\nimport logging"
  },
  {
    "path": "pyscada/hmi/migrations/0047_auto_20201202_1445.py",
    "chars": 623,
    "preview": "# Generated by Django 2.2.8 on 2020-12-02 14:45\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0048_chartaxis_fill.py",
    "chars": 458,
    "preview": "# Generated by Django 2.2.8 on 2020-12-02 16:21\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0049_auto_20201202_2037.py",
    "chars": 549,
    "preview": "# Generated by Django 2.2.17 on 2020-12-02 20:37\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations."
  },
  {
    "path": "pyscada/hmi/migrations/0050_auto_20201203_2101.py",
    "chars": 1616,
    "preview": "# Generated by Django 2.2.17 on 2020-12-03 21:01\n\nfrom django.db import migrations, models\nimport django.db.models.delet"
  },
  {
    "path": "pyscada/hmi/migrations/0051_auto_20201204_0901.py",
    "chars": 3355,
    "preview": "# Generated by Django 2.2.17 on 2020-12-03 21:01\n\nfrom django.db import migrations\n\nfrom time import time\nimport logging"
  },
  {
    "path": "pyscada/hmi/migrations/0052_auto_20201204_0949.py",
    "chars": 630,
    "preview": "# Generated by Django 2.2.8 on 2020-12-04 09:49\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration"
  },
  {
    "path": "pyscada/hmi/migrations/0053_auto_20211118_1438.py",
    "chars": 2070,
    "preview": "# Generated by Django 2.2.8 on 2021-11-18 14:38\n\nimport django.core.validators\nfrom django.db import migrations, models\n"
  },
  {
    "path": "pyscada/hmi/migrations/0054_displayvalueoption_type.py",
    "chars": 650,
    "preview": "# Generated by Django 2.2.8 on 2021-11-18 16:35\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0055_auto_20211125_1405.py",
    "chars": 1507,
    "preview": "# Generated by Django 2.2.8 on 2021-11-25 14:05\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0056_auto_20211210_1608.py",
    "chars": 2123,
    "preview": "# Generated by Django 2.2.8 on 2021-12-10 16:08\n\nfrom django.db import migrations, models\nfrom django.conf import settin"
  },
  {
    "path": "pyscada/hmi/migrations/0057_auto_20211214_1157.py",
    "chars": 806,
    "preview": "# Generated by Django 2.2.8 on 2021-12-14 11:57\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0058_auto_20220523_1639.py",
    "chars": 1591,
    "preview": "# Generated by Django 3.2 on 2022-05-23 16:39\n\nfrom django.db import migrations, models\nimport django.db.models.deletion"
  },
  {
    "path": "pyscada/hmi/migrations/0059_alter_view_theme.py",
    "chars": 592,
    "preview": "# Generated by Django 3.2.13 on 2022-05-24 19:48\n\nfrom django.db import migrations, models\nimport django.db.models.delet"
  },
  {
    "path": "pyscada/hmi/migrations/0060_chartaxis_show_bars.py",
    "chars": 407,
    "preview": "# Generated by Django 3.2 on 2022-05-25 16:34\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Mig"
  },
  {
    "path": "pyscada/hmi/migrations/0061_auto_20220610_1459.py",
    "chars": 965,
    "preview": "# Generated by Django 3.2 on 2022-06-10 14:59\n\nfrom django.db import migrations, models\nimport pyscada.hmi.models\n\n\nclas"
  },
  {
    "path": "pyscada/hmi/migrations/0062_auto_20220616_1523.py",
    "chars": 16577,
    "preview": "# Generated by Django 3.2 on 2022-06-16 15:23\n\nfrom django.db import migrations, models\nimport django.db.models.deletion"
  },
  {
    "path": "pyscada/hmi/migrations/0063_move_group_display_permissions.py",
    "chars": 7878,
    "preview": "# Generated by Django 2.2.8 on 2021-11-25 12:56\n\nfrom django.db import migrations, models\nimport logging\n\nlogger = loggi"
  },
  {
    "path": "pyscada/hmi/migrations/0064_auto_20220617_1333.py",
    "chars": 3960,
    "preview": "# Generated by Django 3.2 on 2022-06-17 13:33\n\nfrom django.db import migrations, models\nimport django.db.models.deletion"
  },
  {
    "path": "pyscada/hmi/migrations/0065_auto_20220620_0854.py",
    "chars": 1333,
    "preview": "# Generated by Django 3.2 on 2022-06-20 08:54\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):"
  },
  {
    "path": "pyscada/hmi/migrations/0066_auto_20221205_1435.py",
    "chars": 939,
    "preview": "# Generated by Django 3.2.13 on 2022-12-05 14:35\n\nfrom django.db import migrations, models\nimport django.db.models.delet"
  },
  {
    "path": "pyscada/hmi/migrations/0067_alter_cssclass_options.py",
    "chars": 356,
    "preview": "# Generated by Django 3.2 on 2023-01-13 09:33\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):"
  },
  {
    "path": "pyscada/hmi/migrations/0068_alter_displayvalueoption_timestamp_conversion.py",
    "chars": 941,
    "preview": "# Generated by Django 3.2 on 2023-02-02 14:50\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Mig"
  },
  {
    "path": "pyscada/hmi/migrations/0069_displayvalueoption_color_and_more.py",
    "chars": 3331,
    "preview": "# Generated by Django 4.2rc1 on 2023-03-30 07:48\n\nfrom django.db import migrations, models\nimport django.db.models.delet"
  },
  {
    "path": "pyscada/hmi/migrations/0070_move_displayvalueoptions.py",
    "chars": 4183,
    "preview": "# Generated by Django 2.2.8 on 2021-11-25 12:56\n\nfrom django.db import migrations, models\nfrom pyscada.hmi.models import"
  },
  {
    "path": "pyscada/hmi/migrations/0071_remove_displayvalueoption_color_1_and_more.py",
    "chars": 1305,
    "preview": "# Generated by Django 4.2rc1 on 2023-03-30 10:23\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migratio"
  },
  {
    "path": "pyscada/hmi/migrations/0072_alter_groupdisplaypermission_hmi_group.py",
    "chars": 1648,
    "preview": "# Generated by Django 4.2 on 2023-04-06 14:40\n\nfrom django.db import migrations, models\nimport django.db.models.deletion"
  },
  {
    "path": "pyscada/hmi/migrations/0073_alter_processflowdiagramitem_control_item.py",
    "chars": 641,
    "preview": "# Generated by Django 4.2.1 on 2023-06-05 07:57\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0074_alter_cssclass_css_class.py",
    "chars": 422,
    "preview": "# Generated by Django 4.2.1 on 2023-06-15 09:56\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0075_alter_processflowdiagram_url_height_and_more.py",
    "chars": 647,
    "preview": "# Generated by Django 4.2.1 on 2023-06-16 07:35\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0076_displayvalueoptiontemplate_transformdata_and_more.py",
    "chars": 5092,
    "preview": "# Generated by Django 4.2.5 on 2023-11-16 16:05\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0077_transformdatacountvalue.py",
    "chars": 1024,
    "preview": "# Generated by Django 4.2.5 on 2023-11-22 10:58\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0078_alter_theme_base_filename_alter_theme_view_filename.py",
    "chars": 807,
    "preview": "# Generated by Django 4.2.5 on 2024-02-22 14:37\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0079_displayvalueoption_from_timestamp_offset.py",
    "chars": 855,
    "preview": "# Generated by Django 5.0.3 on 2024-07-01 12:34\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M"
  },
  {
    "path": "pyscada/hmi/migrations/0080_view_default_time_delta.py",
    "chars": 458,
    "preview": "# Generated by Django 5.0.3 on 2024-07-02 07:53\n\nimport datetime\nfrom django.db import migrations, models\n\n\nclass Migrat"
  },
  {
    "path": "pyscada/hmi/migrations/0081_groupdisplaypermission_unauthenticated_users.py",
    "chars": 1347,
    "preview": "# Generated by Django 5.2.9 on 2026-01-13 08:55\n\nfrom django.db import migrations, models\nimport django.db.models.deleti"
  },
  {
    "path": "pyscada/hmi/migrations/0082_externalview.py",
    "chars": 990,
    "preview": "# Generated by Django 5.2.10 on 2026-02-04 11:10\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations."
  },
  {
    "path": "pyscada/hmi/migrations/0083_externalviewgroupdisplaypermission.py",
    "chars": 1034,
    "preview": "# Generated by Django 5.2.10 on 2026-02-04 17:01\n\nimport django.db.models.deletion\nfrom django.db import migrations, mod"
  },
  {
    "path": "pyscada/hmi/migrations/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pyscada/hmi/models.py",
    "chars": 66202,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom pyscada.models import Device, Variable, VariablePr"
  },
  {
    "path": "pyscada/hmi/signals.py",
    "chars": 275,
    "preview": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.dispatch import receiver\nfrom django.db.mod"
  }
]

// ... and 262 more files (download for full content)

About this extraction

This page contains the full source code of the trombastic/PyScada GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 462 files (3.1 MB), approximately 846.7k tokens, and a symbol index with 1384 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!