Value LED Pallete

24 views
Skip to first unread message

njp....@gmail.com

unread,
May 16, 2020, 8:58:34 AM5/16/20
to GLG Toolkit Community Edition
Hi,
  
   I am having some difficulty to include LED Value palette to my drawing, can you help what is wrong?

var slider_value = message_obj.GetDResource("ValueY" );
        
         Viewport.SetDResource("WTank1/LevelObject/Value"slider_value/100);  // WORKING
         Viewport.SetDResource("DMeter1/Value"slider_value);    // WORKING
         Viewport.SetDResource("Level1/Value",slider_value);  // WORKING
         Viewport.SetDResource("DigVal/Value",slider_value);   //WHY THIS LINE DOES NOT WORK???


  Whenever  I include the last line other palette hang up...


  

glg_support

unread,
May 18, 2020, 11:48:15 AM5/18/20
to GLG Toolkit Community Edition
You can test your drawing in the GLG Builder using a Resource Browser, where you can examine resource paths and set a resource value. For example, you should be able to select "DigVal/Value" resource in the Resource Browser and set its value.

If you still have a problem, we will need to take a look at your drawing.

glg_support

unread,
May 19, 2020, 3:18:47 PM5/19/20
to GLG Toolkit Community Edition
GLG Value LED widget has a GLG JavaScript transformation that defines JavaScript that controls the widget's behavior. This JavaScript is defined in the widget's drawing and may be edited via GLG Builder. The issue you observed was caused by the errors in this JavaScript when the widget was used on a web page, where the script was used in strict mode. The widget was working in the GLG Builder which does not use strict mode for evaluating JavaScripts.

When the widget was used on a web page using the GLG JavaScript library, the Web browser's JavaScript Console displayed error messages that pointed to the problem.

To fix the problem, we corrected errors in the JavaScript defined inside the widget's drawing by editing the drawing with the GLG Builder.

A general recommendation is to check the web browser's JavaScript Console for errors, which can help troubleshoot the problem.

njp....@gmail.com

unread,
May 20, 2020, 2:08:55 AM5/20/20
to GLG Toolkit Community Edition
The drawing is now working fine with your updated Palette(non strict mode) in the drawing using Java Script.  Due to the restrictions for Community GLG Drawing Free version I could not copy the new widget files as suggested. I hope you can update your LED Value Widgets in your GLG CE Widget library so I can redownload and try it again for other drawings. Thank you very much for your kind assistance.

glg_support

unread,
May 20, 2020, 1:19:29 PM5/20/20
to GLG Toolkit Community Edition
The new LED widgets were modified to fix errors in the JavaScript inside the widget drawing so that the script will work correctly in JavaScript strict mode when the widget is used on a web page.

The issue with copying files is not related to the restrictions of the Community Edition, but to the Windows permissions. GLG is installed as a trusted product with administrative privileges. In order to copy files into the GLG folder, you need Administrator privileges. The following links provide information on how to solve a permission problem when copying files:

  https://windows10skill.com/solved-youll-need-to-provide-administrator-permission-to-copy-this-file-windows-10/

  https://answers.microsoft.com/en-us/windows/forum/windows_10-security/youll-need-to-provide-administrator-permission-to/3f93bfb2-fb7a-4f94-a2e6-9486772af7ef

If you want to add custom widgets to the GLG Builder palette, you would also need to copy them to the widgets directory of the GLG installation, so it may be beneficial to solve the permission issue.

Alternatively, you could copy the <glg_dir>/DEMOS/widgets directory to a local folder owned by you, so that you have a complete control over it. Then set the GLG_DEMO_PALETTES_LOCATION environment variable (or GLG_PALETTES_LOCATION variable for the Licensed version) to point to the copy of the widgets directory.
Reply all
Reply to author
Forward
0 new messages