diff --git a/api/command.py b/api/command.py index deed8b2..7c3dc27 100644 --- a/api/command.py +++ b/api/command.py @@ -42,12 +42,12 @@ _s11_pattern = 'patten' _s12_curve = 'curve' _s13_control = 'control' _s14_rule = 'rule' -_s15_global_energy = 'global_energy' +_s15_energy = 'energy' _s15_pump_energy = 'pump_energy' _s16_emitter = 'emitter' _s17_quality = 'quality' _s18_source = 'source' -_s19_global_reaction = 'global_reaction' +_s19_reaction = 'reaction' _s19_pipe_reaction = 'pipe_reaction' _s19_tank_reaction = 'tank_reaction' _s20_mixing = 'mixing' @@ -92,7 +92,7 @@ def execute_add_command(name: str, cs: ChangeSet) -> ChangeSet: return ChangeSet() elif type == _s14_rule: return ChangeSet() - elif type == _s15_global_energy: + elif type == _s15_energy: return ChangeSet() elif type == _s15_pump_energy: return ChangeSet() @@ -102,7 +102,7 @@ def execute_add_command(name: str, cs: ChangeSet) -> ChangeSet: return ChangeSet() elif type == _s18_source: return add_source(name, cs) - elif type == _s19_global_reaction: + elif type == _s19_reaction: return ChangeSet() elif type == _s19_pipe_reaction: return ChangeSet() @@ -161,8 +161,8 @@ def execute_update_command(name: str, cs: ChangeSet) -> ChangeSet: return set_control(name, cs) elif type == _s14_rule: return set_rule(name, cs) - elif type == _s15_global_energy: - return set_global_energy(name, cs) + elif type == _s15_energy: + return set_energy(name, cs) elif type == _s15_pump_energy: return set_pump_energy(name, cs) elif type == _s16_emitter: @@ -171,8 +171,8 @@ def execute_update_command(name: str, cs: ChangeSet) -> ChangeSet: return set_quality(name, cs) elif type == _s18_source: return set_source(name, cs) - elif type == _s19_global_reaction: - return set_global_reaction(name, cs) + elif type == _s19_reaction: + return set_reaction(name, cs) elif type == _s19_pipe_reaction: return set_pipe_reaction(name, cs) elif type == _s19_tank_reaction: @@ -230,7 +230,7 @@ def execute_delete_command(name: str, cs: ChangeSet) -> ChangeSet: return ChangeSet() elif type == _s14_rule: return ChangeSet() - elif type == _s15_global_energy: + elif type == _s15_energy: return ChangeSet() elif type == _s15_pump_energy: return ChangeSet() @@ -240,7 +240,7 @@ def execute_delete_command(name: str, cs: ChangeSet) -> ChangeSet: return ChangeSet() elif type == _s18_source: return delete_source(name, cs) - elif type == _s19_global_reaction: + elif type == _s19_reaction: return ChangeSet() elif type == _s19_pipe_reaction: return ChangeSet() @@ -317,7 +317,7 @@ def cache_add_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return None elif type == _s14_rule: return None - elif type == _s15_global_energy: + elif type == _s15_energy: return None elif type == _s15_pump_energy: return None @@ -327,7 +327,7 @@ def cache_add_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return None elif type == _s18_source: return add_source_cache(name, cs) - elif type == _s19_global_reaction: + elif type == _s19_reaction: return None elif type == _s19_pipe_reaction: return None @@ -386,8 +386,8 @@ def cache_update_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return set_control_cache(name, cs) elif type == _s14_rule: return set_rule_cache(name, cs) - elif type == _s15_global_energy: - return set_global_energy_cache(name, cs) + elif type == _s15_energy: + return set_energy_cache(name, cs) elif type == _s15_pump_energy: return set_pump_energy_cache(name, cs) elif type == _s16_emitter: @@ -396,8 +396,8 @@ def cache_update_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return set_quality_cache(name, cs) elif type == _s18_source: return set_source_cache(name, cs) - elif type == _s19_global_reaction: - return set_global_reaction_cache(name, cs) + elif type == _s19_reaction: + return set_reaction_cache(name, cs) elif type == _s19_pipe_reaction: return set_pipe_reaction_cache(name, cs) elif type == _s19_tank_reaction: @@ -455,7 +455,7 @@ def cache_delete_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return None elif type == _s14_rule: return None - elif type == _s15_global_energy: + elif type == _s15_energy: return None elif type == _s15_pump_energy: return None @@ -465,7 +465,7 @@ def cache_delete_command(name: str, cs: ChangeSet) -> SqlChangeSet | None: return None elif type == _s18_source: return delete_source_cache(name, cs) - elif type == _s19_global_reaction: + elif type == _s19_reaction: return None elif type == _s19_pipe_reaction: return None @@ -504,7 +504,6 @@ def execute_batch_command(name: str, cs: ChangeSet) -> ChangeSet: operation = op['operation'] r = None - demand = None if operation == API_ADD: r = cache_add_command(name, ChangeSet(op))