-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Frank Blankenburg
committed
Jan 26, 2023
1 parent
ad2d88d
commit c7439a2
Showing
8 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Demonstration for accessing add-on based resources via scripts. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"author": "Carl Zeiss GOM Metrology GmbH", | ||
"description": "Examples for accessing add-on based resources", | ||
"licensing": { | ||
"licenses": [ | ||
], | ||
"product-codes": [ | ||
] | ||
}, | ||
"software-revision": "157350", | ||
"software-version": "GOM Software 2022 Service Pack 2", | ||
"title": "Resource access example", | ||
"uuid": "040e602d-40d6-47a1-9fb4-e558b231ada9", | ||
"version": "1.0.0" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"content": [ | ||
[ | ||
{ | ||
"columns": 1, | ||
"data": "AAAAAA==", | ||
"file_name": "", | ||
"height": 0, | ||
"keep_aspect": true, | ||
"keep_original_size": true, | ||
"name": "image", | ||
"rows": 1, | ||
"system_image": "system_message_warning", | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": true | ||
}, | ||
"type": "image", | ||
"use_system_image": false, | ||
"width": 0 | ||
} | ||
] | ||
], | ||
"control": { | ||
"id": "Close" | ||
}, | ||
"embedding": "", | ||
"position": "", | ||
"size": { | ||
"height": 140, | ||
"width": 213 | ||
}, | ||
"sizemode": "", | ||
"style": "", | ||
"title": { | ||
"id": "", | ||
"text": "Display image", | ||
"translatable": true | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Resource access example/scripts/Resources/modules/modules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"modules": [ | ||
], | ||
"uuid": "47f9a632-8410-4143-8608-2d5908309e84", | ||
"wheelsfrom": "local" | ||
} |
13 changes: 13 additions & 0 deletions
13
Resource access example/scripts/Resources/resource.metainfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"display_name": "resource", | ||
"icon": "", | ||
"iinspect_condition": "", | ||
"interactive": false, | ||
"multicreation_script": false, | ||
"name": "resource", | ||
"script_check_type": "none", | ||
"script_element_type": "none", | ||
"show_in_iinspect": false, | ||
"show_in_menu": true, | ||
"uuid": "6035f426-b00d-4b6d-bd89-4fc3689f451b" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This script demonstrates reading asset or resource data from a package | ||
# | ||
|
||
import gom | ||
|
||
# | ||
# Resources are addressed with a relative or absolute file system path | ||
# | ||
data = gom.app.resource["assets/zeiss_logo.png"] | ||
|
||
print ('Type:', type (data)) | ||
print ('Size:', len (data)) | ||
|
||
# | ||
# Use script dialog to display the resource as an image. The 'data' field of | ||
# the image widget expects a displayable byte object and will render it. | ||
# | ||
DIALOG=gom.script.sys.create_user_defined_dialog (file='dialog.gdlg') | ||
|
||
DIALOG.image.data = data | ||
|
||
# | ||
# After dialog setup, it can be displayed. | ||
# | ||
gom.script.sys.show_user_defined_dialog (dialog=DIALOG) | ||
|
||
|