Difference between revisions of "SDK"

From WowWiki
Jump to navigation Jump to search
 
(14 intermediate revisions by 3 users not shown)
Line 12: Line 12:
  
  
Installing Python
+
'''Installing Python'''
  
Go to the site https://www.python.org/downloads/windows/, click on the "Latest Python 3 Release" link, wait for the download to complete  
+
Go to the site https://www.python.org/downloads/windows/, click on the "Latest Python 3 Release" link, wait for the download to complete.
 +
[[File:Highlight_Latest_Python_3_Release_link.png]]
  
 
Run the downloaded Python installer, select the "Add Python to PATH" checkbox (without it, the path to Python will need to be specified in full), and then click "Install Now".
 
Run the downloaded Python installer, select the "Add Python to PATH" checkbox (without it, the path to Python will need to be specified in full), and then click "Install Now".
 +
[[File:Python_installation_configuration.png]]
  
 
Python 3 will be installed in "%LOCALAPPDATA%\Programs\Python". After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.
 
Python 3 will be installed in "%LOCALAPPDATA%\Programs\Python". After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.
 +
[[File:Python_disable_path_length_limit.png]]
  
  
Installing libraries
+
'''Installing libraries'''
  
Open any terminal. This can be done in different ways: by Right-clicking on the "Start" button, or by the keyboard shortcut ⊞ (Win) + X (English).
+
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.
  
Open the Windows administrative menu.
+
[[File:Start_menu_with_PowerShell.png]]
  
In it, select Windows PowerShell or Command Prompt (Command Prompt).
+
Type command "pip install intelhex pillow" and press enter.
 
+
[[File:Intelhex_and_pillow_installation.png]]
A terminal opens. In the terminal, you need to write a command "pip install intelhex pillow" and press the Enter/↵/Return button on the keyboard:
 
  
 
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed.  
 
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed.  
Line 36: Line 38:
  
 
[user: password @] proxy.server: port
 
[user: password @] proxy.server: port
 +
 
For example:
 
For example:
  
pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow
+
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''
 +
 
 +
===macOS===
 +
 
 +
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder.
 +
[[File:Installation_on_macOS.png]]
 +
 
 +
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.
 +
[[File:Error_message_macOS_emulator_installation.png]]
 +
 
 +
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.
 +
 
 +
[[File:Terminal_window_in_macOS.png]]
 +
 
 +
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.
 +
 
 +
If the following error occurs
 +
 
 +
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''
 +
 
 +
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.
 +
 
 +
 
 +
'''Installing Python'''
 +
 
 +
For macOS version below Catalina open a terminal, install and download Homebrew
 +
 
 +
''/ bin / bash -c "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"''
 +
 
 +
Homebrew is a package manager that lets you install Open Source applications.
 +
 
 +
Next, install Python 3 and Pip
 +
 
 +
''brew install python3''
 +
 
 +
''brew cask install python3''
 +
 
 +
 
 +
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.
 +
 
 +
''python3 -V''
 +
 
 +
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute
 +
 
 +
''python -V''
 +
 
 +
If it displays “Python 2.x.x”, then Python 3 is not installed.
 +
 
 +
 
 +
Install pip:
 +
 
 +
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''
 +
 
 +
[[File:Check_for_python_and_installing_pip.png]]
 +
 
 +
 
 +
'''Installing labraries'''
 +
 
 +
Install IntelHex and Pillow libraries.
 +
 
 +
''pip3 install pillow intelhex''
 +
 
 +
==Starting WOWCube Emulator==
 +
 
 +
===Windows===
 +
 
 +
Launch WOWCube Emulator by clicking on shortcut on desktop.
 +
 
 +
[[File:WOWCube_Emulator_shortcut_windows.png]]
 +
 
 +
On first launch, a warning from the firewall will appear.
 +
 
 +
[[File:Windows_security_alert_first_emulator_launch.png]]
 +
 
 +
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.
 +
 
 +
===macOS===
 +
 
 +
Open terminal and enter ''WOWCube Emulator'' then and press Enter.
 +
 
 +
==WOWCube Emulator interface==
 +
 
 +
===General view===
 +
 
 +
There are 4 main groups of widgets in the WOWCube Emulator interface.
 +
 
 +
[[File:WOWCube_Emulator_UI.png]]
 +
 
 +
===Cube model interactions===
 +
 
 +
Contains links for interacting with the cube module. Buttons from left to right:
 +
 
 +
* simulates the shaking of a cube
 +
* returns the cube module to its original state (restoring rotations and position)
 +
* open code editor (does not work in version 2.2.0 and below)
 +
* rotates a random side of the cube
 +
 
 +
===Emulation progress control===
 +
 
 +
Serves to interact with the progress of the script. Buttons from left to right:
 +
 
 +
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button
 +
* stops pawn script emulation
 +
* loading a script to a physical cube using the BT protocol (does not work in version 2.2.0 and below)
 +
 
 +
===General settings===
 +
 
 +
====Project tab====
 +
 
 +
In this tab you can choose one of two modes of operation:
 +
 
 +
* Pawn;
 +
* Projector.
 +
 +
''Projector mode''
 +
 
 +
The projector is used to transfer images from a computer or mobile device to the WOWCube via the BT protocol.
 +
 
 +
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.
 +
 
 +
''Pawn Mode''
 +
 
 +
In this mode, you can:
 +
 
 +
* select the path to the projects folder
 +
* select a startup project
 +
* view additional data for a running project
 +
 
 +
====View tab====
 +
 
 +
The Sound adjusts the overall volume.
 +
 
 +
[[File:WOWCube_Emulator_view_tab_sound.png]]
 +
 
 +
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.
 +
 
 +
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.
 +
 
 +
If necessary, it is possible to configure the simulation of lost packets during transmission.
 +
 
 +
[[File:WOWCube_Emulator_view_tab_emulation.png]]
 +
 +
In the CubeNet, the transparency and the size of the cube unfolding are configured.
 +
 
 +
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]
 +
 
 +
In the Scene, the removal of the camera, the field of view, the backdrop are configured.
 +
 
 +
ABI calls - displays abi function calls to the console.
 +
 
 +
Console follows mouse click - if you click on one of the modules of the virtual cube model, it opens the console tab corresponding to the module number.
 +
 
 +
[[File:WOWCube_Emulator_view_tab_scene.png]]
 +
 
 +
====Settings Tab====
 +
 
 +
This is where the PAWN compiler path and python path are selected.
 +
 
 +
[[File:WOWCube_Emulator_settings_tab.png]]
 +
 
 +
===Console and logs===
 +
 
 +
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.
 +
 
 +
===Controls===
 +
 
 +
LMB on a cube - rotation of the sides.
 +
 
 +
RMB (or Ctrl + LMB) on a cube - tilt the cube.
 +
 
 +
RMB (or Ctrl + LMB) past the cube - rotate the camera.
 +
 
 +
Mouse wheel - zoom out / zoom in the camera.
 +
 
 +
==Quick start==
 +
 
 +
Go to https://github.com/wowcube/WOWCube_apps_examples
 +
 
 +
Clone or download to the necessary folder.
 +
 
 +
Launch WOWCube Emulator.
 +
 
 +
In ''Project'' tab switch Pawn mode.
 +
 
 +
Specify ''Project path'' to the folder with examples.
 +
 
 +
[[File:WOWCube_emulator_path_to_examples.png]]
 +
 
 +
Under ''Run configuration'' choose example project.
 +
 
 +
[[File:WOWCube_emulator_choose_example.png]]
 +
 
 +
You can press 'i' button to watch what resources loaded for each script
 +
 
 +
[[File:WOWCube_emulator_resources_for_scripts.png]]
 +
 
 +
Press ''Start button'' to launch emulation
 +
 
 +
[[File:WOWCube_emulator_launched_first_example.png]]
 +
 
 +
In order to make changes in examples you need:
 +
 
 +
* Go to folder where your WOWCube examples located
 +
* Open file 'example1.pwn' with any text editor
 +
* make what changes you need

Latest revision as of 20:18, 1 February 2024

SDK/Framework

WOWCube Emulator installation

Windows

Launch the wowcube-sdk.exe installer and follow the steps of the installer.

Installing Dependencies (for Pawn Application Developers) To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.


Installing Python

Go to the site https://www.python.org/downloads/windows/, click on the "Latest Python 3 Release" link, wait for the download to complete. Highlight Latest Python 3 Release link.png

Run the downloaded Python installer, select the "Add Python to PATH" checkbox (without it, the path to Python will need to be specified in full), and then click "Install Now". Python installation configuration.png

Python 3 will be installed in "%LOCALAPPDATA%\Programs\Python". After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit. Python disable path length limit.png


Installing libraries

To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.

Start menu with PowerShell.png

Type command "pip install intelhex pillow" and press enter. Intelhex and pillow installation.png

This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed.

If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:

[user: password @] proxy.server: port

For example:

pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow

macOS

Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. Installation on macOS.png

If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application. Error message macOS emulator installation.png

To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.

Terminal window in macOS.png

In the terminal, write the command / Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube and press enter.

If the following error occurs

/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube

Then run the following command xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/. It will output errors Permission Denied, but they are expected.


Installing Python

For macOS version below Catalina open a terminal, install and download Homebrew

/ bin / bash -c "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Homebrew is a package manager that lets you install Open Source applications.

Next, install Python 3 and Pip

brew install python3

brew cask install python3


For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.

python3 -V

This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute

python -V

If it displays “Python 2.x.x”, then Python 3 is not installed.


Install pip:

curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3

Check for python and installing pip.png


Installing labraries

Install IntelHex and Pillow libraries.

pip3 install pillow intelhex

Starting WOWCube Emulator

Windows

Launch WOWCube Emulator by clicking on shortcut on desktop.

WOWCube Emulator shortcut windows.png

On first launch, a warning from the firewall will appear.

Windows security alert first emulator launch.png

Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.

macOS

Open terminal and enter WOWCube Emulator then and press Enter.

WOWCube Emulator interface

General view

There are 4 main groups of widgets in the WOWCube Emulator interface.

WOWCube Emulator UI.png

Cube model interactions

Contains links for interacting with the cube module. Buttons from left to right:

  • simulates the shaking of a cube
  • returns the cube module to its original state (restoring rotations and position)
  • open code editor (does not work in version 2.2.0 and below)
  • rotates a random side of the cube

Emulation progress control

Serves to interact with the progress of the script. Buttons from left to right:

  • start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button
  • stops pawn script emulation
  • loading a script to a physical cube using the BT protocol (does not work in version 2.2.0 and below)

General settings

Project tab

In this tab you can choose one of two modes of operation:

  • Pawn;
  • Projector.

Projector mode

The projector is used to transfer images from a computer or mobile device to the WOWCube via the BT protocol.

The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.

Pawn Mode

In this mode, you can:

  • select the path to the projects folder
  • select a startup project
  • view additional data for a running project

View tab

The Sound adjusts the overall volume.

WOWCube Emulator view tab sound.png

In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.

The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.

If necessary, it is possible to configure the simulation of lost packets during transmission.

WOWCube Emulator view tab emulation.png

In the CubeNet, the transparency and the size of the cube unfolding are configured.

WOWCube Emulator view tab CubeNet.png

In the Scene, the removal of the camera, the field of view, the backdrop are configured.

ABI calls - displays abi function calls to the console.

Console follows mouse click - if you click on one of the modules of the virtual cube model, it opens the console tab corresponding to the module number.

WOWCube Emulator view tab scene.png

Settings Tab

This is where the PAWN compiler path and python path are selected.

WOWCube Emulator settings tab.png

Console and logs

Contains tabs for displaying script assembly logs and tabs with the console of each module separately.

Controls

LMB on a cube - rotation of the sides.

RMB (or Ctrl + LMB) on a cube - tilt the cube.

RMB (or Ctrl + LMB) past the cube - rotate the camera.

Mouse wheel - zoom out / zoom in the camera.

Quick start

Go to https://github.com/wowcube/WOWCube_apps_examples

Clone or download to the necessary folder.

Launch WOWCube Emulator.

In Project tab switch Pawn mode.

Specify Project path to the folder with examples.

WOWCube emulator path to examples.png

Under Run configuration choose example project.

WOWCube emulator choose example.png

You can press 'i' button to watch what resources loaded for each script

WOWCube emulator resources for scripts.png

Press Start button to launch emulation

WOWCube emulator launched first example.png

In order to make changes in examples you need:

  • Go to folder where your WOWCube examples located
  • Open file 'example1.pwn' with any text editor
  • make what changes you need