REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Any easy way to add a custom .js file to manage components in the HMI

    REXYGEN HMI Designer
    3
    13
    4.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sadilekivan
      last edited by

      Hello,

      I've been recently trying to rework the way I manage multiple screens and whilst reading the documentation I found the reference to the REX HMI library. There is a lot of useful functions and I was wondering if I could implement automatic hiding of certain components depending on the alias they have by using the get() or $i() method.

      Correct me if I'm wrong if it is even supported to use the .hide() method on most of the components because I haven't managed to try to get it working yet. But if it is as it seems, my question shortly is how could I point to a custom .js script from the generated HMI in a consistent way upon recompiles.

      Also as a side note is there any known way to tell chromium to not ask for updates or translations of a site, it kind of throws off the kiosk look of a machine.

      Thanks in advance for any and all responses!

      1 Reply Last reply Reply Quote 0
      • jaroslav_sobotaJ
        jaroslav_sobota
        last edited by

        Hello Ivan,
        do I understand it correctly you are trying to build your very own HMI webpage? Or is your question indeed related to HMI Designer (based on the forum category)? Let me know.

        As for Chromium in kiosk mode, you have to use command line parameters when launching it, e.g.

        chromium-browser --disable-translate --noerrdialogs --disable-infobars --no-first-run --kiosk --user-data-dir=/tmp/hmi-chromium --start-fullscreen --disable-component-update --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' "http://127.0.0.1:8008/hmi/index.html"
        

        Best regards
        Jaroslav

        S 1 Reply Last reply Reply Quote 0
        • S
          sadilekivan @jaroslav_sobota
          last edited by

          @jaroslav_sobota

          I am trying to keep All of the HMI elements and its settings in the HMI designer and continue on using it, I was just wondering if it's possible to add a side .js control the hide() feature of those elements. Sort of combining these two.

          For now I'm using elements in a hidden layer and their aliases to manage hide_by parameters of all other visible elements.

          My goal is to play around in JS to hopefully get aliases of all the elements in HMI, based on some prefix or suffix hide and unhide them. Ideally, then I could just add an element in the HMI designer and change its name to something like 3_$T and then it would automatically be hidden or not hidden depending on a value in the REXCORE.

          1 Reply Last reply Reply Quote 0
          • jaroslav_sobotaJ
            jaroslav_sobota
            last edited by

            Hello Ivan,
            do I understand it correctly that you are trying to hide multiple elements in HMI using a single variable in your algorithm?

            Why not just define a single alias and use it as the hide_by Data point in all the elements which you intend to hide?

            0_1582911301217_rexygen-hmi-hide-multiple.png
            0_1582911308841_rexygen-hmi-hide-element.png

            Or am I missing something?

            Jaroslav

            S 1 Reply Last reply Reply Quote 1
            • S
              sadilekivan @jaroslav_sobota
              last edited by

              @jaroslav_sobota

              I tried to use the JS custom example you sent, but after a while got back to just the HMI designer when I found out about the relation operators for the expression type connection. I don't know how I missed that before. Anyways thanks.

              I do have a follow-up question, all the components are offset in the HMI to the center by a few pixels until the page is refreshed or any element used. This doesn't happen on my previous HMI projects and only occurs if the element has a set hide_by data point. Any way to automatically refresh the HMI right after it starts?

              0_1583058966098_rexhmibug.zip

              Although it is just a tiny detail, if the solutions complicated I'd ignore this inconvenience.

              S jaroslav_sobotaJ 2 Replies Last reply Reply Quote 0
              • S
                sadilekivan @sadilekivan
                last edited by

                @sadilekivan And while being close to refreshing HMI, can I set the virtual keyboard to be enabled from start?

                1 Reply Last reply Reply Quote 0
                • cechuratC
                  cechurat
                  last edited by

                  Hi Ivan,

                  thanks for reporting this. However I'm not able to reproduce it - please, can you attach some testing example which show this bug? Which browser do you use? Chromium? Does it also happen on your host PC screen?

                  @virtualKeyboard
                  If you are using kiosk mode in Chromium just pass "virtualKeyboard" parameter along with the URL, i.e.:
                  http://127.0.0.1:8008/hmi/index.html?virtualKeyboard=true

                  Regards, Tomas

                  1 Reply Last reply Reply Quote 0
                  • S
                    sadilekivan
                    last edited by

                    @cechurat

                    Thanks for the advice with the virtual keyboard it works wonderfully. I rechecked yes the bug consistently happens on my raspberry screen and on my PC screen. I also rechecked the older projects and both raspberry and PC screens are loaded with the exact correct positions.

                    Here is a full directory of my project:
                    0_1583359112176_MotorConnector.zip

                    cechuratC 1 Reply Last reply Reply Quote 0
                    • jaroslav_sobotaJ
                      jaroslav_sobota @sadilekivan
                      last edited by jaroslav_sobota

                      Just for the reference, the example project with custom .js file can be found here: https://forum.rexygen.com/topic/93/responsive-design/4

                      Jaroslav

                      1 Reply Last reply Reply Quote 1
                      • cechuratC
                        cechurat @sadilekivan
                        last edited by

                        @sadilekivan Hi Ivan,
                        thanks for sharing your project files - I was able to get the error as you described. I handed over your source-files to our developers. Once I have some information I will let you know.

                        Regards, Tomas

                        1 Reply Last reply Reply Quote 1
                        • cechuratC
                          cechurat
                          last edited by

                          @sadilekivan
                          Hi Ivan,
                          our developers has fixed the issue with moving of the component on the edge of the screen - fix will be part of new release version.

                          However the origin of this issue is that you didn't respect the page size in your design. See following screenshot: 6bf6ca58-6504-4732-9349-f26e4952719a-image.png

                          I recommend to resize the page. You can use "Resize page to content..." feature in the Document Properties dialog.

                          Regards, Tomas

                          S 2 Replies Last reply Reply Quote 0
                          • S
                            sadilekivan @cechurat
                            last edited by

                            @cechurat

                            Thanks, I have adjusted the page size, and it worked great.

                            1 Reply Last reply Reply Quote 0
                            • S
                              sadilekivan @cechurat
                              last edited by

                              @cechurat

                              I wanted to add that it just works on the correct size sometimes, so I'm still glad and waiting for the fixes in the future version.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post

                              This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

                              There is also an outdated REXYGEN community forum.

                              Powered by NodeBB.