Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6cc419e
Guard system info requests during window teardown
Mar 24, 2026
94c4522
Merge branch 'development' into fix/system-info-window-teardown
manux81 Apr 6, 2026
33a8b2f
decouple app layout init reads
Apr 6, 2026
2247fd9
Merge upstream/development into fix/system-info-window-teardown
Apr 16, 2026
51538cf
Merge upstream/development into fix/system-info-window-teardown
May 8, 2026
0f32d5f
Merge remote-tracking branch 'upstream/development' into fix/system-i…
Jun 25, 2026
1bc576e
fix: remove stale renderer app layout
Jun 25, 2026
ccf45bc
test: cover destroyed window system info guard
Jun 25, 2026
c7e7d2b
Merge remote-tracking branch 'upstream/development' into fix/system-i…
Jun 26, 2026
ab67412
Merge pull request #702 from manux81/fix/system-info-window-teardown
JoaoGSP Jun 30, 2026
a9f5b24
Fix
JW-Control Jun 30, 2026
ee45a21
modbus fix
JW-Control Jun 30, 2026
0beb603
Merge remote-tracking branch 'origin/development' into develop/jwplc-…
JW-Control Jun 30, 2026
4accc96
Create jwplc-modbus-sidebar-search.txt
JW-Control Jun 30, 2026
47540c4
fix modbus rtu
JW-Control Jul 1, 2026
d567b92
Create jwplc-debugger-chart-search.txt
JW-Control Jul 1, 2026
5a1c8d2
Update index.tsx
JW-Control Jul 1, 2026
3160f26
fix modbus
JW-Control Jul 1, 2026
89b0b4b
Ethernet fix
JW-Control Jul 1, 2026
c6dc799
Update ModbusSlave.cpp
JW-Control Jul 1, 2026
51dfaeb
feat(jwplc): support Modbus TCP over W5500
JW-Control Jul 3, 2026
5d8aa7c
feat(jwplc): add Modbus TCP device discovery
JW-Control Jul 3, 2026
42825f8
fix name
JW-Control Jul 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions build-jwplc-editor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ============================================================================
rem OpenPLC Editor - JWPLC Edition builder
rem Ubicacion recomendada:
rem openplc-editor\build-jwplc-editor.bat
rem
rem Uso rapido:
rem build-jwplc-editor.bat
rem
rem Opciones:
rem build-jwplc-editor.bat --install
rem build-jwplc-editor.bat --clean
rem build-jwplc-editor.bat --install --clean
rem build-jwplc-editor.bat --open-output
rem
rem Requisito:
rem Node 22.x. Si fnm esta instalado, el script intenta activar Node 22.
rem ============================================================================

set "ROOT=%~dp0"
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"

set "RUN_INSTALL=0"
set "RUN_CLEAN=0"
set "OPEN_OUTPUT=0"

:parse_args
if "%~1"=="" goto args_done
if /I "%~1"=="--install" set "RUN_INSTALL=1"
if /I "%~1"=="--clean" set "RUN_CLEAN=1"
if /I "%~1"=="--open-output" set "OPEN_OUTPUT=1"
shift
goto parse_args
:args_done

echo.
echo ============================================================
echo OpenPLC Editor - JWPLC Edition builder
echo ============================================================
echo Root: "%ROOT%"
echo.

cd /d "%ROOT%" || exit /b 1

if not exist "%ROOT%\package.json" (
echo [ERROR] No se encontro package.json.
echo Coloca este .bat en la raiz del repo openplc-editor.
exit /b 1
)

where node >nul 2>nul
if errorlevel 1 (
echo [WARN] Node no esta disponible en PATH.
) else (
echo [INFO] Node actual:
node -v
)

rem Intentar activar Node 22 con fnm si esta disponible.
where fnm >nul 2>nul
if not errorlevel 1 (
echo.
echo [INFO] fnm detectado. Intentando activar Node 22...
for /f "tokens=*" %%I in ('fnm env --use-on-cd --shell cmd 2^>nul') do call %%I
fnm install 22
if errorlevel 1 (
echo [ERROR] fnm no pudo instalar Node 22.
exit /b 1
)
fnm use 22
if errorlevel 1 (
echo [ERROR] fnm no pudo activar Node 22.
exit /b 1
)
)

where node >nul 2>nul
if errorlevel 1 (
echo [ERROR] Node.js no esta disponible. Instala Node 22 o fnm.
exit /b 1
)

for /f "tokens=1 delims=." %%M in ('node -p "process.versions.node"') do set "NODE_MAJOR=%%M"

echo.
echo [INFO] Node final:
node -v
echo [INFO] npm:
call npm.cmd -v

if not "%NODE_MAJOR%"=="22" (
echo.
echo [ERROR] Este repo debe compilarse con Node 22.x.
echo Node actual major: %NODE_MAJOR%
echo.
echo Sugerencia:
echo winget install Schniz.fnm
echo fnm install 22
echo fnm use 22
exit /b 1
)

if "%RUN_CLEAN%"=="1" (
echo.
echo [1/4] Limpiando salidas previas...
if exist "%ROOT%\dist" rmdir /s /q "%ROOT%\dist"
if exist "%ROOT%\release\build" rmdir /s /q "%ROOT%\release\build"
) else (
echo.
echo [1/4] Limpieza omitida. Usa --clean si quieres borrar dist y release\build.
)

if "%RUN_INSTALL%"=="1" (
echo.
echo [2/4] Instalando dependencias...
if exist "%ROOT%\package-lock.json" (
call npm.cmd ci
) else (
call npm.cmd install
)
if errorlevel 1 (
echo [ERROR] Fallo la instalacion de dependencias.
exit /b 1
)
) else (
echo.
echo [2/4] Instalacion omitida. Usa --install si cambiaste dependencias o node_modules no existe.
)

echo.
echo [3/4] Construyendo instalador...
call npm.cmd run package
if errorlevel 1 (
echo [ERROR] Fallo npm run package.
exit /b 1
)

echo.
echo [4/4] Buscando instalador generado...
set "BUILD_DIR=%ROOT%\release\build"

if not exist "%BUILD_DIR%" (
echo [ERROR] No existe release\build.
exit /b 1
)

dir /b "%BUILD_DIR%\*.exe" 2>nul
if errorlevel 1 (
echo [WARN] No se encontro ningun .exe en "%BUILD_DIR%".
) else (
echo.
echo [OK] Instalador(es) generado(s) en:
echo "%BUILD_DIR%"
)

if "%OPEN_OUTPUT%"=="1" (
start "" "%BUILD_DIR%"
)

echo.
echo ============================================================
echo Build finalizado
echo ============================================================
echo.

endlocal
exit /b 0
5,001 changes: 5,001 additions & 0 deletions jwplc-debugger-chart-search.txt

Large diffs are not rendered by default.

2,673 changes: 2,673 additions & 0 deletions jwplc-modbus-sidebar-search.txt

Large diffs are not rendered by default.

703 changes: 703 additions & 0 deletions jwplc-vpp-field-renderer-search.txt

Large diffs are not rendered by default.

47 changes: 38 additions & 9 deletions resources/sources/Baremetal/Baremetal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
#include "defines.h"
#include "arduino_runtime_glue.h"

#if defined(JWPLC_BASIC)

#include <JWPLC_RS485.h>

#ifndef JWPLC_RS485_RX_PIN
#define JWPLC_RS485_RX_PIN 16
#endif

#ifndef JWPLC_RS485_TX_PIN
#define JWPLC_RS485_TX_PIN 17
#endif
#endif

#ifdef MODBUS_ENABLED
#include "ModbusSlave.h"
#endif
Expand Down Expand Up @@ -148,11 +161,21 @@ void setup()
{
if (pinMask_AOUT[i] == MBSERIAL_TXPIN) pinMask_AOUT[i] = 255;
}
MBSERIAL_IFACE.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&MBSERIAL_IFACE, MBSERIAL_BAUD, MBSERIAL_TXPIN);
#if defined(JWPLC_BASIC) && defined(MBSERIAL_IFACE_IS_SERIAL2)
JWPLC_RS485.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&JWPLC_RS485, MBSERIAL_BAUD, MBSERIAL_TXPIN);
#else
MBSERIAL_IFACE.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&MBSERIAL_IFACE, MBSERIAL_BAUD, MBSERIAL_TXPIN);
#endif
#else
MBSERIAL_IFACE.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&MBSERIAL_IFACE, MBSERIAL_BAUD, -1);
#if defined(JWPLC_BASIC) && defined(MBSERIAL_IFACE_IS_SERIAL2)
JWPLC_RS485.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&JWPLC_RS485, MBSERIAL_BAUD, -1);
#else
MBSERIAL_IFACE.begin(MBSERIAL_BAUD);
mbconfig_serial_iface(&MBSERIAL_IFACE, MBSERIAL_BAUD, -1);
#endif
#endif
modbus.slaveid = MBSERIAL_SLAVE;
#endif
Expand All @@ -164,16 +187,22 @@ void setup()
uint8_t gateway[] = { MBTCP_GATEWAY };
uint8_t subnet[] = { MBTCP_SUBNET };

#if defined(JWPLC_BASIC)
uint8_t *mbtcpMac = (sizeof(mac) / sizeof(uint8_t) >= 6) ? mac : NULL;
#else
uint8_t *mbtcpMac = mac;
#endif

if (sizeof(ip)/sizeof(uint8_t) < 4)
mbconfig_ethernet_iface(mac, NULL, NULL, NULL, NULL);
mbconfig_ethernet_iface(mbtcpMac, NULL, NULL, NULL, NULL);
else if (sizeof(dns)/sizeof(uint8_t) < 4)
mbconfig_ethernet_iface(mac, ip, NULL, NULL, NULL);
mbconfig_ethernet_iface(mbtcpMac, ip, NULL, NULL, NULL);
else if (sizeof(gateway)/sizeof(uint8_t) < 4)
mbconfig_ethernet_iface(mac, ip, dns, NULL, NULL);
mbconfig_ethernet_iface(mbtcpMac, ip, dns, NULL, NULL);
else if (sizeof(subnet)/sizeof(uint8_t) < 4)
mbconfig_ethernet_iface(mac, ip, dns, gateway, NULL);
mbconfig_ethernet_iface(mbtcpMac, ip, dns, gateway, NULL);
else
mbconfig_ethernet_iface(mac, ip, dns, gateway, subnet);
mbconfig_ethernet_iface(mbtcpMac, ip, dns, gateway, subnet);
#endif

init_mbregs(MAX_ANALOG_OUTPUT + MAX_MEMORY_WORD, MAX_MEMORY_DWORD, MAX_MEMORY_LWORD, MAX_DIGITAL_OUTPUT, MAX_ANALOG_INPUT, MAX_DIGITAL_INPUT);
Expand Down
Loading
Loading