Musson Industrial's Embr-Periscope Module

No, unfortunately there isn’t a way to do lazy loading for views.

I think the virtualized feature should work though, but I can’t say I’ve tested it; any feedback you could provide about it would be helpful.

Think I came up with a solution. Atleast it seems to work quite good.

I load images from a database stored as varbinary and I want to stop this if the Swiper contains alot of images.

  • Added "index" to params on the Embedded Views (Ignition function).
  • Added "load"-bool to params on the Embedded Views with a change script.
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue.value == True and self.view.custom.image == "":
		import base64
		sqlParams = {"imageId": self.view.params.imageId}
		image = system.db.runNamedQuery("getImage", sqlParams).getValueAt(0,0)
		self.view.custom.image = base64.b64encode(image)
  • Set "load" to true for the first 3 views and the rest to false when creating the instances.
  • Added a Custom Method to the view with Swiper.
def realIndex(self):
	component = self.getChild("Swiper")
	
	proxy = component.getJavaScriptProxy("swiper")
	currentIndex = proxy.runBlocking('''() => this.realIndex''')
	
	if currentIndex != self.view.custom.currentIndex:
		self.view.custom.currentIndex = currentIndex
		
		for i in range(3):
			self.getChild("Swiper").props.instances[currentIndex + i].viewParams.load = True
  • Calling the Custom Method through a "onPointerDown" event.
def runAction(self, event):
	self.parent.realIndex()

This seems to work fine for me. But I'm not really sure how effecient it is. And depending on the Swiper settings it could cause the message to not get triggered enough (more dots (have to preload more then +2), or with a scroll etc.). If there was a better way to get the current index it would probably work better.

EDIT: Used Message Handler on the Embedded Views to load the images but felt wrong to send out a message that ~100 views handled on each Swiper-click. This solution feels better, but I'm open for a better one :slight_smile:

Hi @bmusson,

I'm trying the chart and periscope module on ignition 8.3 beta1:
but is seems it's not compiled for 8.3.0-beta1 yet:

Error
Module "Embr Charts" requires Ignition 8.1.33 (b0) and is not compatible with Ignition 8.3.0-beta1 (b2025072515)

Do intend to release a version of the module for the 8.3 beta?

Yup. I’m out on vacation for a while, but getting Embr compiling for 8.3 is a high priority once I get back.

5 Likes

Embr-Periscope for the Ignition 8.3 beta can be found here:

4 Likes

Thank you.

1 Like

Hey @bmusson, it'd be cool if you could add a calendar component to select date ranges into this module :slight_smile:

I added an idea on the github:

Really, this should be an idea for the Ignition codebase itself...

1 Like

Mantine has a good selection of date/time selection components, thoughts?

I could see these being included together in a Mantine components module.

1 Like

That library looks really good, I haven't found the date range selection yet, but this looks really useful

I found the date range picker, doesn't include time though :thinking::

Looks like a really nice library though!

I think using the combination of the date and the time picker component they have would be more than enough for my use cases. The time grid also interests me!