Beispiel #1
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

p1t1 = DeepDict()
p1t1.number = number_default
p1t1.rate = m3hour_default
p1t1.elasticity = kgsm2_default
p1t1.rate_o2 = m3hour_default
p1t1.rate_o2_prc = percent_default
p1t1.temperture_in_layer = temperature_default
p1t1.temperture_under = temperature_default
p1t1.volume = m3_default
p1t1.pressure = mmwst_default
p1t1.uio_select = dict(type="datalist", options=['-', 'Pб', 'Pт', 'Qп'])
p1t1.uio = kgsm2_default
p1t1.smoke = text_default
fa_main_table_desc = p1t1.clear_empty().get_dict()

ut = DeepDict()
ut.ks1 = number_default  # № печи
ut.val1 = tm2_day_default  # значение
ut.ks2 = number_default  # № печи
ut.val2 = tm2_day_default  # значение
ut.ks3 = number_default  # № печи
ut.val3 = tm2_day_default  # значение
udel_table_desc = ut.clear_empty().get_dict()

p1t3 = DeepDict()
p1t3.gmc4_1 = m_default
p1t3.gmc4_2 = m_default
p1t3.gmc1_1 = m_default
from datetime import time

from e_logs.core.utils.deep_dict import DeepDict
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *

# -----------------Left Table-----------------
lt = DeepDict()

rows_names_for_db = [
    "zn", "zn_mix", "h2so4", "solute1", "solute2", "mixture_temp", "bath_temp",
    "h2o_temp", "h2o_pressure", "gas_pressure", "wastewater", "point5_temp",
    "point6_temp", "point7_temp"
]

rows_names_for_view = [
    "Zn в отр., г/л", "Смеси, г/л", "H₂SO₄ отр., г/л",
    "Удельный вес хол-го раствора, г/см³",
    "Удельный вес отр-го раствора, г/см³", "Температура смеси, ᵒC",
    "Температура в ваннах, ᵒC", "Температура H₂O, ᵒC", "Давление H₂O, Па",
    "Давление пара, Па", "Сточные воды, Рh", "Температура точки 5 ВИУ, ᵒC",
    "Температура точки 6 ВИУ, ᵒC", "Температура точки 7 ВИУ, ᵒC"
]

row_names = [{
    "db": db,
    "view": view
} for db, view in zip(rows_names_for_db, rows_names_for_view)]

field_infos_for_rows = [gl_default] * 3 + [gsm3_default] * 2 + [temperature_default] * 3 +\
                       [pa_default] * 2 + [
    dict(type="number", units="Рh")] + [temperature_default] * 3
Beispiel #3
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

ts = DeepDict()
ts.date_create = date_default
ts.comments = text_default
ts.caption = dict(type="datalist",
                  min_normal=10,
                  max_normal=20000,
                  options=[
                      "ЗГОК", "Арт-ий", "Усть-ТАЛ", "Карагайлы", "Верх-Бер",
                      "Белоусовка", "Жезкент", "Н.Широкинский", "Лесосиб",
                      "Алтын-Топкан"
                  ])

ts.weight = ton_default

ts.employee = employee_default

technologial_tasks_main_desc = ts.clear_empty().get_dict()
Beispiel #4
0
from e_logs.core.utils.deep_dict import DeepDict
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *

# ------year plan schieht--------
yps = DeepDict()
yps.concentrate = dict(type="datalist",
                       options=[
                           "ЗГОК", "Арт-ий", "Усть-ТАЛ", "Карагайлы",
                           "Верх-Бер", "Белоусовка", "Жезкент",
                           "Н.Широкинский", "Лесосиб", "Алтын-Топкан"
                       ])
yps.year_plans = smt_default
yps.month_smt = smt_default
yps.day_smt = smt_default
yps.tonns_a_year = ton_default
yps.schieht_frac = percent_default
yps.empty = text_default
yps.zn = percent_default
yps.s = percent_default
yps.h2o = percent_default
yps.fe = percent_default
yps.cu = percent_default
yps.pb = percent_default
yps.sio2 = percent_default
yps.cd = percent_default
yps.cao = percent_default
yps.mgo = percent_default
yps.K = percent_default
yps.na = percent_default
yps.arsenic = percent_default
yps.co = percent_default
Beispiel #5
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

shift_info = DeepDict()
shift_info.this_master = text_default
shift_info.next_master = text_default
shift_info.out_sol_t = ton_default
shift_info.out_sol_c = ton_default
shift_info.out_pulp_cvck = ton_default
shift_info.out_cu_kek = m3_default
shift_info.out_cd_sponge = ton_default
shift_info.out_neutr = m3_default
shift_info.out_Cd = m3_default
shift_info.neutral_hmc = m3_default
shift_info.out_cu_pulp = m3_default
shift_info.in_filtrate_ls = m3_default
shift_info.in_fe = m3_default
shift_info.in_filtrate_dens = numeric_default
shift_info.in_fe_hi = m3_default
shift_info.in_poor_cd = m3_default

shift_info_table_desc = shift_info.clear_empty().get_dict()

vsns = DeepDict()
vsns.time = time_default
vsns.vsns_cobalt = mgl_default
vsns.vsns_Sb = mgl_default
vsns.vsns_Cu = mgl_default
vsns.vsns_Cd = mgl_default
vsns.vsns_solid_after = gl_default
vsns.vsns_pH = ph_default
from datetime import time

from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

# -----------------Left Table-----------------
lt = DeepDict()

rows_names_for_db = [
    "zn", "zn_mix", "h2so4", "solute1", "solute2", "mixture_temp", "bath_temp",
    "temp1", "amperage1"
    "amperage2"
]

rows_names_for_view = [
    "Zn в отр., г/л", "Смеси, г/л", "H₂SO₄ отр., г/л", "Температура смеси, ᵒC",
    "Температура в ваннах, ᵒC", "Температура нейтр. град., ᵒC", "1 серия, кА",
    "2 серия, кА"
]

row_names = [{
    "db": db,
    "view": view
} for db, view in zip(rows_names_for_db, rows_names_for_view)]

field_infos_for_rows = [gl_default] * 3 + [temperature_default
                                           ] * 3 + [amperage_default] * 2

times = [
    ":".join(str(time(hour=hour % 24)).split(":")[:-1])
    for hour in range(20, 20 + 12)
Beispiel #7
0
def compress_journal(journal: Journal):
    templates_dir = os.path.join('templates', 'tables', journal.plant.name,
                                 journal.name)

    real_journal_path = os.path.join('resources', 'journals',
                                     journal.plant.name)
    real_journal_filename = os.path.join(
        real_journal_path, journal.name + f'.{settings.JOURNAL_EXTENSION}')

    jd = DeepDict()  # creating metadata json
    jd.version = '0.1'
    jd.name = journal.name
    jd.title = journal.verbose_name
    jd.type = journal.type

    jd.tables = []
    for t in journal.tables.all():
        td = DeepDict()
        td.name = t.name
        td.title = t.verbose_name

        td.fields = []
        for f in t.fields.all():
            fd = DeepDict()
            fd.name = f.name
            fd.formula = f.formula
            fd.title = f.verbose_name
            try:
                fd.type = f.type
                if fd.type == 'number':
                    fd.units = f.units
                elif fd.type == 'datalist':
                    fd.options = f.options
            except Exception as e:
                err_logger.warning(
                    f'{(jd.name, td.name, fd.name)} failed with {e}')
                err_logger.info(
                    f'field_description='
                    f'{f.settings.get(name="field_description").val()}')

            td.fields += [fd.get_dict()]

        template_filename = os.path.join(templates_dir, t.name + '.html')
        with open(template_filename) as template_file:
            td.html = template_file.read()

        jd.tables += [td.get_dict()]

    meta_data = json.dumps(jd.get_dict(), indent=4, ensure_ascii=False)

    with open(real_journal_filename, 'w') as meta:
        meta.write(meta_data)
Beispiel #8
0
from e_logs.common.all_journals_app.fields_descriptions.tables.change_fraction import change_fraction_table_desc
from e_logs.common.all_journals_app.fields_descriptions.tables.conc_raports_tables import *
from e_logs.common.all_journals_app.fields_descriptions.tables.electrolysis_masters_reports import *
from e_logs.common.all_journals_app.fields_descriptions.tables.electrolysis_repair_report_tables import *
from e_logs.common.all_journals_app.fields_descriptions.tables.electrolysis_technical_report_4_degree_tables import *
from e_logs.common.all_journals_app.fields_descriptions.tables.furnace_repair import *
from e_logs.common.all_journals_app.fields_descriptions.tables.furnace_stove_area import *
from e_logs.common.all_journals_app.fields_descriptions.tables.input_output_report import *
from e_logs.common.all_journals_app.fields_descriptions.tables.leaching_express_analysis import *
from e_logs.common.all_journals_app.fields_descriptions.tables.leaching_repair_equipment import \
    leaching_repair_table_desc
from e_logs.common.all_journals_app.fields_descriptions.tables.metals_compute import *
from e_logs.common.all_journals_app.fields_descriptions.tables.technological_tasks import *
from e_logs.core.utils.deep_dict import DeepDict

fields_info_desc = DeepDict()

fields_info_desc.leaching_express_analysis.vsns= vsns_table_desc
fields_info_desc.leaching_express_analysis.thickeners= thickeners_table_desc
fields_info_desc.leaching_express_analysis.zinc_pulp= zinc_pulp_desc
fields_info_desc.leaching_express_analysis.appt_hydrometal= aph_table_desc
fields_info_desc.leaching_express_analysis.agitators= agitator_table_desc
fields_info_desc.leaching_express_analysis.reagents= reagents_table_desc
fields_info_desc.leaching_express_analysis.neutral_thickeners= neutral_thickeners_desc
fields_info_desc.leaching_express_analysis.tanks_availability= tanks_availability_desc
fields_info_desc.leaching_express_analysis.tanks_for_finished_products= tanks_for_finished_products_desc
fields_info_desc.leaching_express_analysis.self_protection= self_protection_desc
fields_info_desc.leaching_express_analysis.cinder= cinder_table_desc
fields_info_desc.leaching_express_analysis.sample= sample_table_desc
fields_info_desc.leaching_express_analysis.loads= loads_table_desc
fields_info_desc.leaching_express_analysis.neutral= neutral_table_desc
Beispiel #9
0
 def get_context_data(self, **kwargs):
     context = DeepDict(super().get_context_data(**kwargs))
     context.journal_title = 'Dashboard'
     context.menu_data = get_menu_data()
     return context
Beispiel #10
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

ut = DeepDict()
# ------Upper Table--------
ut.master = employee_default
ut.senior_crane_operator = employee_default

ut.storage = dict(type="text", min_normal=10, max_normal=1000, units='№')
ut.crane_operator = employee_default
ut.sling_operator = employee_default

ut.date = dict(type="date", min_normal=10, max_normal=1000)
ut.shift = dict(type="text", min_normal=10, max_normal=1000, units='№')

bt = DeepDict()

# -------Big Table-------------
bt.wagon_num = dict(type="number", min_normal=10, max_normal=1000, units='№')
bt.conc_num = dict(type="datalist",
                   options=[
                       "ЗГОК", "Арт-ий", "Усть-ТАЛ", "Карагайлы", "Верх-Бер",
                       "Белоусовка", "Жезкент", "Н.Широкинский", "Лесосиб",
                       "Алтын-Топкан"
                   ])

bt.supply_time = dict(type="time", min_normal=10, max_normal=1000)
bt.plan_cleaning_time = dict(type="time", min_normal=10, max_normal=1000)
bt.fact_cleaning_time = dict(type="time", min_normal=10, max_normal=1000)

bt.downtime = dict(type="number", min_normal=0, max_normal=1.5)
Beispiel #11
0
from datetime import time

from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

# -----------------Left Table-----------------
lt = DeepDict()

rows_names_for_db = [
    "zn",
    "zn_mix"
    "h2so4",
    "solute1",
    "solute2",
    "mixture_temp",
    "bath_temp",
    "temp1",
    "temp2",
]

rows_names_for_view = [
    "Zn в отр., г/л",
    "Смеси, г/л",
    "H₂SO₄ отр., г/л",
    "Удельный вес хол-го раствора, г/см³",
    "Удельный вес отр-го раствора, г/см³",
    "Температура смеси, ᵒC",
    "Температура в ваннах, ᵒC",
    "Температура 1, ᵒC",
    "Температура 2, ᵒC",
]
Beispiel #12
0
from e_logs.core.utils.deep_dict import DeepDict
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *

mt = DeepDict()

mt.date1 = date_default
mt.node_name = text_default
mt.date2 = date_default
mt.work_done = text_default
mt.texpl_time = text_default

repair_main_table_desc = mt.clear_empty().get_dict()
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

rt = DeepDict()

rt.equipment = dict(type="datalist",
                    options=[
                        'Агитатор «Манн» №1',
                        'Агитатор «Манн» №2',
                        'Агитатор «Манн» №3',
                        'Сгуститель №1',
                        'Сгуститель №2',
                        'Сгуститель №3',
                        'Питатель ленточный В – 500 мм',
                        'Элеватор ЦГ-400 №1',
                        'Элеватор ЦГ-400 №2',
                        'Транспортер ленточный В – 650 мм',
                    ])
rt.date_view = date_default
rt.name_equipment = text_default
rt.date_finish = date_default
rt.volume_text = text_default
rt.fact_time = text_default

leaching_repair_table_desc = rt.clear_empty().get_dict()
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

lt = DeepDict()

lt.time1 = text_default
lt.time2 = text_default
lt.time3 = text_default
lt.time4 = text_default
lt.defence1 = text_default
lt.defence2 = text_default
lt.defence3 = text_default
lt.defence4 = text_default
lt.weight1 = text_default
lt.passed_fio = text_default
lt.accepted_fio = text_default
lt.weight2 = text_default
lt.passed_sing = text_default

last_table_desc = lt.clear_empty().get_dict()

s1 = DeepDict()
s3 = DeepDict()
s4 = DeepDict()

s1.h2so4_fact = numeric_default
s1.zn_fact = numeric_default
s1.t_sm_fact = temperature_default
s1.q_fact = numeric_default
s1.h2so4_nesootv = numeric_default
s1.zn_nesootv = numeric_default
Beispiel #15
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict

contain_zn = DeepDict()
contain_zn.Zn_con = ton_default
contain_zn.Pb_con = ton_default
contain_zn.Cu_con = ton_default
contain_zn.Cd_con = ton_default
contain_zn.Au_con = gt_default
contain_zn.Ag_con = gt_default
contain_zn_table_desc = contain_zn.clear_empty().get_dict()

fs = DeepDict()
fields_p = [
    "pb", "cu", "cd", "fe1", "SiO2", "Zn_furn", "Pb2", "Pb3", "Pb4", "Pb5",
    "Cu2", "Cd2", "fe2", "S", "As", "Sb", "S_sulf"
]

for field_name in fields_p:
    fs[field_name] = percent_default

fs['vmt'] = vmt_default
fs['cmt'] = smt_default
fs['zn_end'] = ton_default

metals_main_desc = fs.clear_empty().get_dict()

sns = DeepDict()
sns.caption = dict(type="datalist",
                   options=[
                       "ЗГОК", "Арт-ий", "Усть-ТАЛ", "Карагайлы", "Верх-Бер",
Beispiel #16
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict


rt = DeepDict()
rt.position_number = number_default  # № позиции по титульному списку СУД
rt.pp = number_default  # № п/п
rt.department = text_default  # Подразделение
rt.name_of_object = text_default  # Наименование объекта
rt.inv_number = number_default  # № инв
rt.group = numeric_default  # Группа значимости
rt.work_center = text_default  # рабоч центр
rt.tax_group = number_default  # № налоговой группы
rt.description = text_default  # Описание работ
rt.executor = text_default  # Исполнитель


repair_table_desc = rt.clear_empty().get_dict()
Beispiel #17
0
from e_logs.common.all_journals_app.fields_descriptions.fields_classes import *
from e_logs.core.utils.deep_dict import DeepDict


cft = DeepDict()
cft.date_start = date_default
cft.shift_number = number_default
cft.massa_fur = dict(type="number", units='г')
cft.massa_sit = dict(type="number", units='г')
cft.fraction = percent_default
cft.executer = text_default

change_fraction_table_desc = cft.clear_empty().get_dict()