miguelmoreto / labcontrole

The LabControle is a simulation software for linear control systems. It is designed to be used as an auxiliary tool for teaching classical control system theory.
http://sites.google.com/site/controlelab/
9 stars 2 forks source link

BUG report: the application crashes while typing the controler denominator #41

Closed Felipe-noob closed 8 months ago

Felipe-noob commented 1 year ago

Steps to reproduce

  1. Select "Sistema LTI 2"
  2. Check the controller to enable it
  3. Delete everything in the denominator text input and type a 0

Observed result

The app crashes.

Traceback (most recent call last):
File "/mnt/sda1/UFSC/UFSC7/EEL7063_controle/labcontrole/LabControl3.py", line 2271, in onCdenChange
self.sysDict[self.sysCurrentName].updateSystem()
File "/mnt/sda1/UFSC/UFSC7/EEL7063_controle/labcontrole/LC3systems.py", line 203, in updateSystem
self.C_tf = ct.tf(self.Cnum,self.Cden)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/felipe/.local/lib/python3.11/site-packages/control/xferfcn.py", line 1643, in tf
return TransferFunction(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/felipe/.local/lib/python3.11/site-packages/control/xferfcn.py", line 282, in __init__
raise ValueError(
ValueError: Input 1, output 1 has a zero denominator.
./run.sh, linha 2: 34345 Abortado                (imagem do núcleo gravada)python3 LabControl3.py

Expected result

It should wait for the user to finish typing the function. I meant to type '0.3'. Also, it should display an error message instead of crashing if I try to use a zero denominator anywhere.

System Details

Manjaro Linux, running the latest commit in main.

miguelmoreto commented 8 months ago

Issue fixed in commit 595da20d.