An error occurs in omni.ui.plot.set_data: Plot data: unknown argument
Sequence of the work
- Create a list of 60 items where all arguments are 0.0
- Define an empty omni.ui.plot
- Define omni.ui.plot with arguments
- Defines an asynchronous function
This is the content of the asynchronous function
4-1) Get value from database
4-2) Append data to the list
4-3) Slice the list into 60 pieces
4-4) Execute set_data with a list as argument
this is my code
import omni.ui as ui
import asyncio
self.data = [for 0.0 in range(60)]
self.plot = ui.Plot()
self.plot = ui.Plot(ui.Type.LINE, 0.0, 3.0, *self.data, width=500, height=180, style={"color": cl("#F4A445"), "margin": 5})
asyncio.ensure_future(self.get_value())
async def get_value(self):
while True:
self.db.get_value() <- this is function that get value from database
self.data.append(self.db.data)
self.data = self.data[-60:]
self.plot.set_data(*self.data) <- An error occurred in this part
await asyncio.sleep(5)
There are actually 20 graphs, but I only wrote one in the code
The initial execution goes without a problem,
but an error occurs when set_data is executed when the next data is updated
If set_data is executed while the contents of the list remain unchanged, no error occurs
Does anyone know what the problem is?