summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--ldmicro/CMakeLists.txt72
-rw-r--r--ldmicro/coildialog.cpp330
-rw-r--r--ldmicro/commentdialog.cpp108
-rw-r--r--ldmicro/confdialog.cpp12
-rw-r--r--ldmicro/contactsdialog.cpp268
-rw-r--r--ldmicro/draw.cpp1868
-rw-r--r--ldmicro/helpdialog.cpp384
-rw-r--r--ldmicro/includes/naminglist.h16
-rw-r--r--ldmicro/lang.cpp3
-rw-r--r--ldmicro/obj/helptext.cpp3877
-rw-r--r--ldmicro/obj/lang-tables.h1568
-rw-r--r--ldmicro/resetdialog.cpp214
-rw-r--r--ldmicro/simpledialog.cpp740
-rw-r--r--ldmicro/simulate.cpp1455
15 files changed, 2732 insertions, 8189 deletions
diff --git a/.gitignore b/.gitignore
index 49cfd72..01a2d0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
# exclude all files in build folder
+/.vscode
/ldmicro/build/*
+/ldmicro/obj/*
+!/ldmicro/obj/dummy
/ldmicro/testMain.cpp
-/ldmicro/includes/testMain.h
-/.vscode \ No newline at end of file
+/ldmicro/includes/testMain.h \ No newline at end of file
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt
index 8c568fa..0e5dee5 100644
--- a/ldmicro/CMakeLists.txt
+++ b/ldmicro/CMakeLists.txt
@@ -13,15 +13,18 @@ IF (MSVC)
ENDIF (MSVC)
IF(UNIX)
+ MESSAGE( STATUS "Initializing.." )
add_definitions(-D__UNIX__)
+ add_definitions(-DLDLANG_EN)
+ # set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/build/")
MESSAGE( STATUS "Performing system check.." )
MESSAGE( STATUS "Identifing bitness of the platform.." )
- add_definitions(-D__UNIX32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D__UNIX64)
MESSAGE( STATUS "Bitness of the platform: " 64)
else()
+ add_definitions(-D__UNIX32)
MESSAGE( STATUS "Bitness of the platform: " 36)
endif()
MESSAGE( STATUS "Performing system check - done" )
@@ -30,38 +33,61 @@ IF(UNIX)
find_package (PkgConfig REQUIRED)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
- # Version control
+ ## Set object dir
+ set(OBJDIR ${CMAKE_CURRENT_SOURCE_DIR}/obj)
+
+ ## Set perl scripts to be run before build to generate files needed
+ MESSAGE( STATUS "Adding perl scripts to build.." )
+
+ add_custom_command(
+ OUTPUT ${OBJDIR}/lang-tables.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/lang-tables.pl > ${OBJDIR}/lang-tables.h
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lang-*.txt")
+
+ add_custom_command(
+ OUTPUT ${OBJDIR}/helptext.cpp
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND perl txt2c.pl > ${OBJDIR}/helptext.cpp
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/manual*.txt")
+
+ set(SCRIPT_GENERATED_FILES ${OBJDIR}/helptext.cpp
+ ${OBJDIR}/lang-tables.h)
+
+ add_custom_target(LDMicro_SCRIPT_GENERATED_FILES DEPENDS ${SCRIPT_GENERATED_FILES})
+
+ ## Version control
set (LDMicro_VERSION_MAJOR 1)
set (LDMicro_VERSION_MINOR 0)
- # configure a header file to pass some of the CMake settings
- # to the source code
+ ## configure a header file to pass some of the CMake settings
+ ## to the source code
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib/linuxUI")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib/freezeLD")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/includes")
+ # include_directories("${OBJDIR}")
set(PROJECT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/includes")
CONFIGURE_FILE (
"${PROJECT_INCLUDE_DIR}/ldmicroVC.h.in"
"${PROJECT_INCLUDE_DIR}/ldmicroVC.h"
)
- MESSAGE ( STATUS " PROJECT_INCLUDE_DIR: " ${PROJECT_INCLUDE_DIR} )
+ # MESSAGE ( STATUS " PROJECT_INCLUDE_DIR: " ${PROJECT_INCLUDE_DIR} )
- # Add GTK3 include files if GTK3 is found
+ ## Add GTK3 include files if GTK3 is found
IF ( GTK3_FOUND )
include_directories (${GTK3_INCLUDE_DIRS})
link_directories (${GTK3_LIBRARY_DIRS})
add_definitions (${GTK3_CFLAGS_OTHER})
link_libraries (${GTK3_LIBRARIES})
- MESSAGE ( STATUS " GTK3_INCLUDE_DIR: " ${GTK3_INCLUDE_DIRS} )
- MESSAGE ( STATUS " GTK3_LIBRARIES: " ${GTK3_LIBRARIES} )
+ # MESSAGE( STATUS " GTK3_INCLUDE_DIR: " ${GTK3_INCLUDE_DIRS} )
+ # MESSAGE( STATUS " GTK3_LIBRARIES: " ${GTK3_LIBRARIES} )
ENDIF ( GTK3_FOUND )
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/linuxUI")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/freezeLD")
## Dummy compile and install to test linuxUI
## to compile LDmicro uncomment the below 2 line2
- set (COMPILE_CPP_SOURCES #naminglist.cpp
- arduino.cpp
+ set (COMPILE_CPP_SOURCES arduino.cpp
avr.cpp
pic16.cpp
interpreted.cpp
@@ -71,28 +97,28 @@ IF(UNIX)
lang.cpp
miscutil.cpp
iolist.cpp
- #confdialog.cpp
- #lutdialog.cpp
- #resetdialog.cpp
- #simpledialog.cpp
- #coildialog.cpp
- #contactsdialog.cpp
- #commentdialog.cpp
- #simulate.cpp
+ confdialog.cpp
+ lutdialog.cpp
+ resetdialog.cpp
+ simpledialog.cpp
+ coildialog.cpp
+ contactsdialog.cpp
+ commentdialog.cpp
+ simulate.cpp
loadsave.cpp
undoredo.cpp
circuit.cpp
draw_outputdev.cpp
- #draw.cpp
+ draw.cpp
schematic.cpp
- #helpdialog.cpp
+ ${OBJDIR}/helptext.cpp
+ helpdialog.cpp
maincontrols.cpp
ldmicro.cpp)
add_executable (LDMicro ${COMPILE_CPP_SOURCES})
+ add_dependencies(LDMicro LDMicro_SCRIPT_GENERATED_FILES)
install (TARGETS LDMicro DESTINATION bin)
target_link_libraries (LDMicro LinuxUI)
target_link_libraries (LDMicro FreezeLD)
- #add_executable (testMain testMain.cpp)
- #install (TARGETS testMain DESTINATION bin)
-ENDIF(UNIX)
+ENDIF(UNIX) \ No newline at end of file
diff --git a/ldmicro/coildialog.cpp b/ldmicro/coildialog.cpp
index 070dd42..22fd10c 100644
--- a/ldmicro/coildialog.cpp
+++ b/ldmicro/coildialog.cpp
@@ -42,169 +42,169 @@ static LONG_PTR PrevNameProc;
//-----------------------------------------------------------------------------
// Don't allow any characters other than A-Za-z0-9_ in the name.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
- wParam == '\b'))
- {
- return 0;
- }
- }
-
- return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
-}
-
-static void MakeControls(void)
-{
- HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Type"),
- WS_CHILD | BS_GROUPBOX | WS_VISIBLE | WS_TABSTOP,
- 7, 3, 120, 105, CoilDialog, NULL, Instance, NULL);
- NiceFont(grouper);
-
- NormalRadio = CreateWindowEx(0, WC_BUTTON, _("( ) Normal"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE | WS_GROUP,
- 16, 21, 100, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(NormalRadio);
-
- NegatedRadio = CreateWindowEx(0, WC_BUTTON, _("(/) Negated"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 41, 100, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(NegatedRadio);
-
- SetOnlyRadio = CreateWindowEx(0, WC_BUTTON, _("(S) Set-Only"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 61, 100, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(SetOnlyRadio);
-
- ResetOnlyRadio = CreateWindowEx(0, WC_BUTTON, _("(R) Reset-Only"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 81, 105, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(ResetOnlyRadio);
-
- HWND grouper2 = CreateWindowEx(0, WC_BUTTON, _("Source"),
- WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
- 140, 3, 120, 65, CoilDialog, NULL, Instance, NULL);
- NiceFont(grouper2);
-
- SourceInternalRelayRadio = CreateWindowEx(0, WC_BUTTON, _("Internal Relay"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_VISIBLE | WS_GROUP | WS_TABSTOP,
- 149, 21, 100, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(SourceInternalRelayRadio);
-
- SourceMcuPinRadio = CreateWindowEx(0, WC_BUTTON, _("Pin on MCU"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_VISIBLE | WS_TABSTOP,
- 149, 41, 100, 20, CoilDialog, NULL, Instance, NULL);
- NiceFont(SourceMcuPinRadio);
-
- HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
- WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
- 135, 80, 50, 21, CoilDialog, NULL, Instance, NULL);
- NiceFont(textLabel);
-
- NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 190, 80, 155, 21, CoilDialog, NULL, Instance, NULL);
- FixedFont(NameTextbox);
-
- OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
- 276, 10, 70, 23, CoilDialog, NULL, Instance, NULL);
- NiceFont(OkButton);
-
- CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 276, 40, 70, 23, CoilDialog, NULL, Instance, NULL);
- NiceFont(CancelButton);
-
- PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
- (LONG_PTR)MyNameProc);
-}
-
-void ShowCoilDialog(BOOL *negated, BOOL *setOnly, BOOL *resetOnly, char *name)
-{
- CoilDialog = CreateWindowClient(0, "LDmicroDialog",
- _("Coil"), WS_OVERLAPPED | WS_SYSMENU,
- 100, 100, 359, 115, NULL, NULL, Instance, NULL);
- RECT r;
- GetClientRect(CoilDialog, &r);
-
- MakeControls();
+// static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
+// wParam == '\b'))
+// {
+// return 0;
+// }
+// }
+
+// return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
+// }
+
+// static void MakeControls(void)
+// {
+// HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Type"),
+// WS_CHILD | BS_GROUPBOX | WS_VISIBLE | WS_TABSTOP,
+// 7, 3, 120, 105, CoilDialog, NULL, Instance, NULL);
+// NiceFont(grouper);
+
+// NormalRadio = CreateWindowEx(0, WC_BUTTON, _("( ) Normal"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE | WS_GROUP,
+// 16, 21, 100, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(NormalRadio);
+
+// NegatedRadio = CreateWindowEx(0, WC_BUTTON, _("(/) Negated"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 41, 100, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(NegatedRadio);
+
+// SetOnlyRadio = CreateWindowEx(0, WC_BUTTON, _("(S) Set-Only"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 61, 100, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(SetOnlyRadio);
+
+// ResetOnlyRadio = CreateWindowEx(0, WC_BUTTON, _("(R) Reset-Only"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 81, 105, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(ResetOnlyRadio);
+
+// HWND grouper2 = CreateWindowEx(0, WC_BUTTON, _("Source"),
+// WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
+// 140, 3, 120, 65, CoilDialog, NULL, Instance, NULL);
+// NiceFont(grouper2);
+
+// SourceInternalRelayRadio = CreateWindowEx(0, WC_BUTTON, _("Internal Relay"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_VISIBLE | WS_GROUP | WS_TABSTOP,
+// 149, 21, 100, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(SourceInternalRelayRadio);
+
+// SourceMcuPinRadio = CreateWindowEx(0, WC_BUTTON, _("Pin on MCU"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_VISIBLE | WS_TABSTOP,
+// 149, 41, 100, 20, CoilDialog, NULL, Instance, NULL);
+// NiceFont(SourceMcuPinRadio);
+
+// HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
+// WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
+// 135, 80, 50, 21, CoilDialog, NULL, Instance, NULL);
+// NiceFont(textLabel);
+
+// NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
+// WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 190, 80, 155, 21, CoilDialog, NULL, Instance, NULL);
+// FixedFont(NameTextbox);
+
+// OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
+// 276, 10, 70, 23, CoilDialog, NULL, Instance, NULL);
+// NiceFont(OkButton);
+
+// CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 276, 40, 70, 23, CoilDialog, NULL, Instance, NULL);
+// NiceFont(CancelButton);
+
+// PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
+// (LONG_PTR)MyNameProc);
+// }
+
+// void ShowCoilDialog(BOOL *negated, BOOL *setOnly, BOOL *resetOnly, char *name)
+// {
+// CoilDialog = CreateWindowClient(0, "LDmicroDialog",
+// _("Coil"), WS_OVERLAPPED | WS_SYSMENU,
+// 100, 100, 359, 115, NULL, NULL, Instance, NULL);
+// RECT r;
+// GetClientRect(CoilDialog, &r);
+
+// MakeControls();
- if(name[0] == 'R') {
- SendMessage(SourceInternalRelayRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else {
- SendMessage(SourceMcuPinRadio, BM_SETCHECK, BST_CHECKED, 0);
- }
- SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
- if(*negated) {
- SendMessage(NegatedRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else if(*setOnly) {
- SendMessage(SetOnlyRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else if(*resetOnly) {
- SendMessage(ResetOnlyRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else {
- SendMessage(NormalRadio, BM_SETCHECK, BST_CHECKED, 0);
- }
-
- EnableWindow(MainWindow, FALSE);
- ShowWindow(CoilDialog, TRUE);
- SetFocus(NameTextbox);
- SendMessage(NameTextbox, EM_SETSEL, 0, -1);
-
- MSG msg;
- DWORD ret;
- DialogDone = FALSE;
- DialogCancel = FALSE;
- while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- if(msg.message == WM_KEYDOWN) {
- if(msg.wParam == VK_RETURN) {
- DialogDone = TRUE;
- break;
- } else if(msg.wParam == VK_ESCAPE) {
- DialogDone = TRUE;
- DialogCancel = TRUE;
- break;
- }
- }
-
- if(IsDialogMessage(CoilDialog, &msg)) continue;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- if(!DialogCancel) {
- if(SendMessage(SourceInternalRelayRadio, BM_GETSTATE, 0, 0)
- & BST_CHECKED)
- {
- name[0] = 'R';
- } else {
- name[0] = 'Y';
- }
- SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
-
- if(SendMessage(NormalRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
- *negated = FALSE;
- *setOnly = FALSE;
- *resetOnly = FALSE;
- } else if(SendMessage(NegatedRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
- *negated = TRUE;
- *setOnly = FALSE;
- *resetOnly = FALSE;
- } else if(SendMessage(SetOnlyRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
- *negated = FALSE;
- *setOnly = TRUE;
- *resetOnly = FALSE;
- } else if(SendMessage(ResetOnlyRadio, BM_GETSTATE, 0, 0) & BST_CHECKED)
- {
- *negated = FALSE;
- *setOnly = FALSE;
- *resetOnly = TRUE;
- }
- }
-
- EnableWindow(MainWindow, TRUE);
- DestroyWindow(CoilDialog);
- return;
-}
+// if(name[0] == 'R') {
+// SendMessage(SourceInternalRelayRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else {
+// SendMessage(SourceMcuPinRadio, BM_SETCHECK, BST_CHECKED, 0);
+// }
+// SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
+// if(*negated) {
+// SendMessage(NegatedRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else if(*setOnly) {
+// SendMessage(SetOnlyRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else if(*resetOnly) {
+// SendMessage(ResetOnlyRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else {
+// SendMessage(NormalRadio, BM_SETCHECK, BST_CHECKED, 0);
+// }
+
+// EnableWindow(MainWindow, FALSE);
+// ShowWindow(CoilDialog, TRUE);
+// SetFocus(NameTextbox);
+// SendMessage(NameTextbox, EM_SETSEL, 0, -1);
+
+// MSG msg;
+// DWORD ret;
+// DialogDone = FALSE;
+// DialogCancel = FALSE;
+// while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
+// if(msg.message == WM_KEYDOWN) {
+// if(msg.wParam == VK_RETURN) {
+// DialogDone = TRUE;
+// break;
+// } else if(msg.wParam == VK_ESCAPE) {
+// DialogDone = TRUE;
+// DialogCancel = TRUE;
+// break;
+// }
+// }
+
+// if(IsDialogMessage(CoilDialog, &msg)) continue;
+// TranslateMessage(&msg);
+// DispatchMessage(&msg);
+// }
+
+// if(!DialogCancel) {
+// if(SendMessage(SourceInternalRelayRadio, BM_GETSTATE, 0, 0)
+// & BST_CHECKED)
+// {
+// name[0] = 'R';
+// } else {
+// name[0] = 'Y';
+// }
+// SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
+
+// if(SendMessage(NormalRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
+// *negated = FALSE;
+// *setOnly = FALSE;
+// *resetOnly = FALSE;
+// } else if(SendMessage(NegatedRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
+// *negated = TRUE;
+// *setOnly = FALSE;
+// *resetOnly = FALSE;
+// } else if(SendMessage(SetOnlyRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
+// *negated = FALSE;
+// *setOnly = TRUE;
+// *resetOnly = FALSE;
+// } else if(SendMessage(ResetOnlyRadio, BM_GETSTATE, 0, 0) & BST_CHECKED)
+// {
+// *negated = FALSE;
+// *setOnly = FALSE;
+// *resetOnly = TRUE;
+// }
+// }
+
+// EnableWindow(MainWindow, TRUE);
+// DestroyWindow(CoilDialog);
+// return;
+// }
diff --git a/ldmicro/commentdialog.cpp b/ldmicro/commentdialog.cpp
index 4cfe13b..9bea08d 100644
--- a/ldmicro/commentdialog.cpp
+++ b/ldmicro/commentdialog.cpp
@@ -31,67 +31,67 @@ static HWND CommentDialog;
static HWND CommentTextbox;
-static void MakeControls(void)
-{
- CommentTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE |
- ES_MULTILINE | ES_WANTRETURN,
- 7, 10, 600, 38, CommentDialog, NULL, Instance, NULL);
- FixedFont(CommentTextbox);
+// static void MakeControls(void)
+// {
+// CommentTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
+// WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE |
+// ES_MULTILINE | ES_WANTRETURN,
+// 7, 10, 600, 38, CommentDialog, NULL, Instance, NULL);
+// FixedFont(CommentTextbox);
- OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
- 620, 6, 70, 23, CommentDialog, NULL, Instance, NULL);
- NiceFont(OkButton);
+// OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
+// 620, 6, 70, 23, CommentDialog, NULL, Instance, NULL);
+// NiceFont(OkButton);
- CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 620, 36, 70, 23, CommentDialog, NULL, Instance, NULL);
- NiceFont(CancelButton);
-}
+// CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 620, 36, 70, 23, CommentDialog, NULL, Instance, NULL);
+// NiceFont(CancelButton);
+// }
-void ShowCommentDialog(char *comment)
-{
- CommentDialog = CreateWindowClient(0, "LDmicroDialog",
- _("Comment"), WS_OVERLAPPED | WS_SYSMENU,
- 100, 100, 700, 65, NULL, NULL, Instance, NULL);
+// void ShowCommentDialog(char *comment)
+// {
+// CommentDialog = CreateWindowClient(0, "LDmicroDialog",
+// _("Comment"), WS_OVERLAPPED | WS_SYSMENU,
+// 100, 100, 700, 65, NULL, NULL, Instance, NULL);
- MakeControls();
+// MakeControls();
- SendMessage(CommentTextbox, WM_SETTEXT, 0, (LPARAM)comment);
+// SendMessage(CommentTextbox, WM_SETTEXT, 0, (LPARAM)comment);
- EnableWindow(MainWindow, FALSE);
- ShowWindow(CommentDialog, TRUE);
- SetFocus(CommentTextbox);
- SendMessage(CommentTextbox, EM_SETSEL, 0, -1);
+// EnableWindow(MainWindow, FALSE);
+// ShowWindow(CommentDialog, TRUE);
+// SetFocus(CommentTextbox);
+// SendMessage(CommentTextbox, EM_SETSEL, 0, -1);
- MSG msg;
- DWORD ret;
- DialogDone = FALSE;
- DialogCancel = FALSE;
- while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- if(msg.message == WM_KEYDOWN) {
- if(msg.wParam == VK_TAB && GetFocus() == CommentTextbox) {
- SetFocus(OkButton);
- continue;
- } else if(msg.wParam == VK_ESCAPE) {
- DialogDone = TRUE;
- DialogCancel = TRUE;
- break;
- }
- }
+// MSG msg;
+// DWORD ret;
+// DialogDone = FALSE;
+// DialogCancel = FALSE;
+// while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
+// if(msg.message == WM_KEYDOWN) {
+// if(msg.wParam == VK_TAB && GetFocus() == CommentTextbox) {
+// SetFocus(OkButton);
+// continue;
+// } else if(msg.wParam == VK_ESCAPE) {
+// DialogDone = TRUE;
+// DialogCancel = TRUE;
+// break;
+// }
+// }
- if(IsDialogMessage(CommentDialog, &msg)) continue;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
+// if(IsDialogMessage(CommentDialog, &msg)) continue;
+// TranslateMessage(&msg);
+// DispatchMessage(&msg);
+// }
- if(!DialogCancel) {
- SendMessage(CommentTextbox, WM_GETTEXT, (WPARAM)(MAX_COMMENT_LEN-1),
- (LPARAM)comment);
- }
+// if(!DialogCancel) {
+// SendMessage(CommentTextbox, WM_GETTEXT, (WPARAM)(MAX_COMMENT_LEN-1),
+// (LPARAM)comment);
+// }
- EnableWindow(MainWindow, TRUE);
- DestroyWindow(CommentDialog);
- return;
-}
+// EnableWindow(MainWindow, TRUE);
+// DestroyWindow(CommentDialog);
+// return;
+// }
diff --git a/ldmicro/confdialog.cpp b/ldmicro/confdialog.cpp
index 1b77fd0..f908893 100644
--- a/ldmicro/confdialog.cpp
+++ b/ldmicro/confdialog.cpp
@@ -64,8 +64,8 @@ static LONG_PTR PrevBaudProc;
// return CallWindowProc((WNDPROC)t, hwnd, msg, wParam, lParam);
// }
-// static void MakeControls(void)
-// {
+static void MakeControls(void)
+{
// HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Cycle Time (ms):"),
// WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
// 5, 13, 145, 21, ConfDialog, NULL, Instance, NULL);
@@ -178,10 +178,10 @@ static LONG_PTR PrevBaudProc;
// PrevBaudProc = SetWindowLongPtr(BaudTextbox, GWLP_WNDPROC,
// (LONG_PTR)MyNumberProc);
-// }
+}
-// void ShowConfDialog(void)
-// {
+void ShowConfDialog(void)
+{
// // The window's height will be resized later, to fit the explanation text.
// ConfDialog = CreateWindowClient(0, "LDmicroDialog", _("PLC Configuration"),
// WS_OVERLAPPED | WS_SYSMENU,
@@ -246,4 +246,4 @@ static LONG_PTR PrevBaudProc;
// EnableWindow(MainWindow, TRUE);
// DestroyWindow(ConfDialog);
// return;
-// }
+}
diff --git a/ldmicro/contactsdialog.cpp b/ldmicro/contactsdialog.cpp
index fe2922c..a845220 100644
--- a/ldmicro/contactsdialog.cpp
+++ b/ldmicro/contactsdialog.cpp
@@ -40,138 +40,138 @@ static LONG_PTR PrevNameProc;
//-----------------------------------------------------------------------------
// Don't allow any characters other than A-Za-z0-9_ in the name.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
- wParam == '\b'))
- {
- return 0;
- }
- }
-
- return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
-}
-
-static void MakeControls(void)
-{
- HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Source"),
- WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
- 7, 3, 120, 85, ContactsDialog, NULL, Instance, NULL);
- NiceFont(grouper);
-
- SourceInternalRelayRadio = CreateWindowEx(0, WC_BUTTON, _("Internal Relay"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 21, 100, 20, ContactsDialog, NULL, Instance, NULL);
- NiceFont(SourceInternalRelayRadio);
-
- SourceInputPinRadio = CreateWindowEx(0, WC_BUTTON, _("Input pin"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 41, 100, 20, ContactsDialog, NULL, Instance, NULL);
- NiceFont(SourceInputPinRadio);
-
- SourceOutputPinRadio = CreateWindowEx(0, WC_BUTTON, _("Output pin"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 61, 100, 20, ContactsDialog, NULL, Instance, NULL);
- NiceFont(SourceOutputPinRadio);
-
- HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
- WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
- 135, 16, 50, 21, ContactsDialog, NULL, Instance, NULL);
- NiceFont(textLabel);
-
- NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 190, 16, 115, 21, ContactsDialog, NULL, Instance, NULL);
- FixedFont(NameTextbox);
-
- NegatedCheckbox = CreateWindowEx(0, WC_BUTTON, _("|/| Negated"),
- WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE,
- 146, 44, 160, 20, ContactsDialog, NULL, Instance, NULL);
- NiceFont(NegatedCheckbox);
-
- OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
- 321, 10, 70, 23, ContactsDialog, NULL, Instance, NULL);
- NiceFont(OkButton);
-
- CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 321, 40, 70, 23, ContactsDialog, NULL, Instance, NULL);
- NiceFont(CancelButton);
-
- PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
- (LONG_PTR)MyNameProc);
-}
-
-void ShowContactsDialog(BOOL *negated, char *name)
-{
- ContactsDialog = CreateWindowClient(0, "LDmicroDialog",
- _("Contacts"), WS_OVERLAPPED | WS_SYSMENU,
- 100, 100, 404, 95, NULL, NULL, Instance, NULL);
-
- MakeControls();
+// static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
+// wParam == '\b'))
+// {
+// return 0;
+// }
+// }
+
+// return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
+// }
+
+// static void MakeControls(void)
+// {
+// HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Source"),
+// WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
+// 7, 3, 120, 85, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(grouper);
+
+// SourceInternalRelayRadio = CreateWindowEx(0, WC_BUTTON, _("Internal Relay"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 21, 100, 20, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(SourceInternalRelayRadio);
+
+// SourceInputPinRadio = CreateWindowEx(0, WC_BUTTON, _("Input pin"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 41, 100, 20, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(SourceInputPinRadio);
+
+// SourceOutputPinRadio = CreateWindowEx(0, WC_BUTTON, _("Output pin"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 61, 100, 20, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(SourceOutputPinRadio);
+
+// HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
+// WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
+// 135, 16, 50, 21, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(textLabel);
+
+// NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
+// WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 190, 16, 115, 21, ContactsDialog, NULL, Instance, NULL);
+// FixedFont(NameTextbox);
+
+// NegatedCheckbox = CreateWindowEx(0, WC_BUTTON, _("|/| Negated"),
+// WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE,
+// 146, 44, 160, 20, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(NegatedCheckbox);
+
+// OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
+// 321, 10, 70, 23, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(OkButton);
+
+// CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 321, 40, 70, 23, ContactsDialog, NULL, Instance, NULL);
+// NiceFont(CancelButton);
+
+// PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
+// (LONG_PTR)MyNameProc);
+// }
+
+// void ShowContactsDialog(BOOL *negated, char *name)
+// {
+// ContactsDialog = CreateWindowClient(0, "LDmicroDialog",
+// _("Contacts"), WS_OVERLAPPED | WS_SYSMENU,
+// 100, 100, 404, 95, NULL, NULL, Instance, NULL);
+
+// MakeControls();
- if(name[0] == 'R') {
- SendMessage(SourceInternalRelayRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else if(name[0] == 'Y') {
- SendMessage(SourceOutputPinRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else {
- SendMessage(SourceInputPinRadio, BM_SETCHECK, BST_CHECKED, 0);
- }
- if(*negated) {
- SendMessage(NegatedCheckbox, BM_SETCHECK, BST_CHECKED, 0);
- }
- SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
-
- EnableWindow(MainWindow, FALSE);
- ShowWindow(ContactsDialog, TRUE);
- SetFocus(NameTextbox);
- SendMessage(NameTextbox, EM_SETSEL, 0, -1);
-
- MSG msg;
- DWORD ret;
- DialogDone = FALSE;
- DialogCancel = FALSE;
- while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- if(msg.message == WM_KEYDOWN) {
- if(msg.wParam == VK_RETURN) {
- DialogDone = TRUE;
- break;
- } else if(msg.wParam == VK_ESCAPE) {
- DialogDone = TRUE;
- DialogCancel = TRUE;
- break;
- }
- }
-
- if(IsDialogMessage(ContactsDialog, &msg)) continue;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- if(!DialogCancel) {
- if(SendMessage(NegatedCheckbox, BM_GETSTATE, 0, 0) & BST_CHECKED) {
- *negated = TRUE;
- } else {
- *negated = FALSE;
- }
- if(SendMessage(SourceInternalRelayRadio, BM_GETSTATE, 0, 0)
- & BST_CHECKED)
- {
- name[0] = 'R';
- } else if(SendMessage(SourceInputPinRadio, BM_GETSTATE, 0, 0)
- & BST_CHECKED)
- {
- name[0] = 'X';
- } else {
- name[0] = 'Y';
- }
- SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
- }
-
- EnableWindow(MainWindow, TRUE);
- DestroyWindow(ContactsDialog);
- return;
-}
+// if(name[0] == 'R') {
+// SendMessage(SourceInternalRelayRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else if(name[0] == 'Y') {
+// SendMessage(SourceOutputPinRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else {
+// SendMessage(SourceInputPinRadio, BM_SETCHECK, BST_CHECKED, 0);
+// }
+// if(*negated) {
+// SendMessage(NegatedCheckbox, BM_SETCHECK, BST_CHECKED, 0);
+// }
+// SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
+
+// EnableWindow(MainWindow, FALSE);
+// ShowWindow(ContactsDialog, TRUE);
+// SetFocus(NameTextbox);
+// SendMessage(NameTextbox, EM_SETSEL, 0, -1);
+
+// MSG msg;
+// DWORD ret;
+// DialogDone = FALSE;
+// DialogCancel = FALSE;
+// while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
+// if(msg.message == WM_KEYDOWN) {
+// if(msg.wParam == VK_RETURN) {
+// DialogDone = TRUE;
+// break;
+// } else if(msg.wParam == VK_ESCAPE) {
+// DialogDone = TRUE;
+// DialogCancel = TRUE;
+// break;
+// }
+// }
+
+// if(IsDialogMessage(ContactsDialog, &msg)) continue;
+// TranslateMessage(&msg);
+// DispatchMessage(&msg);
+// }
+
+// if(!DialogCancel) {
+// if(SendMessage(NegatedCheckbox, BM_GETSTATE, 0, 0) & BST_CHECKED) {
+// *negated = TRUE;
+// } else {
+// *negated = FALSE;
+// }
+// if(SendMessage(SourceInternalRelayRadio, BM_GETSTATE, 0, 0)
+// & BST_CHECKED)
+// {
+// name[0] = 'R';
+// } else if(SendMessage(SourceInputPinRadio, BM_GETSTATE, 0, 0)
+// & BST_CHECKED)
+// {
+// name[0] = 'X';
+// } else {
+// name[0] = 'Y';
+// }
+// SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
+// }
+
+// EnableWindow(MainWindow, TRUE);
+// DestroyWindow(ContactsDialog);
+// return;
+// }
diff --git a/ldmicro/draw.cpp b/ldmicro/draw.cpp
index 75fcf54..f08e34c 100644
--- a/ldmicro/draw.cpp
+++ b/ldmicro/draw.cpp
@@ -55,19 +55,19 @@ BOOL ThisHighlighted;
// warn the user and undo their changes if they created something too wide.
// This is not very clean.
//-----------------------------------------------------------------------------
-static BOOL CheckBoundsUndoIfFails(int gx, int gy)
-{
- if(gx >= DISPLAY_MATRIX_X_SIZE || gx < 0 ||
- gy >= DISPLAY_MATRIX_Y_SIZE || gy < 0)
- {
- if(CanUndo()) {
- UndoUndo();
- Error(_("Too many elements in subcircuit!"));
- return TRUE;
- }
- }
- return FALSE;
-}
+// static BOOL CheckBoundsUndoIfFails(int gx, int gy)
+// {
+// if(gx >= DISPLAY_MATRIX_X_SIZE || gx < 0 ||
+// gy >= DISPLAY_MATRIX_Y_SIZE || gy < 0)
+// {
+// if(CanUndo()) {
+// UndoUndo();
+// Error(_("Too many elements in subcircuit!"));
+// return TRUE;
+// }
+// }
+// return FALSE;
+// }
//-----------------------------------------------------------------------------
// Determine the width, in leaf element units, of a particular subcircuit.
@@ -75,111 +75,111 @@ static BOOL CheckBoundsUndoIfFails(int gx, int gy)
// of the widths of its members, and the width of a parallel circuit is
// the maximum of the widths of its members.
//-----------------------------------------------------------------------------
-static int CountWidthOfElement(int which, void *elem, int soFar)
-{
- switch(which) {
- case ELEM_PLACEHOLDER:
- case ELEM_OPEN:
- case ELEM_SHORT:
- case ELEM_CONTACTS:
- case ELEM_TON:
- case ELEM_TOF:
- case ELEM_RTO:
- case ELEM_CTU:
- case ELEM_CTD:
- case ELEM_ONE_SHOT_RISING:
- case ELEM_ONE_SHOT_FALLING:
- case ELEM_EQU:
- case ELEM_NEQ:
- case ELEM_GRT:
- case ELEM_GEQ:
- case ELEM_LES:
- case ELEM_LEQ:
- case ELEM_UART_RECV:
- case ELEM_UART_SEND:
- return 1;
-
- case ELEM_FORMATTED_STRING:
- return 2;
-
- case ELEM_COMMENT: {
- if(soFar != 0) oops();
-
- ElemLeaf *l = (ElemLeaf *)elem;
- char tbuf[MAX_COMMENT_LEN];
-
- strcpy(tbuf, l->d.comment.str);
- char *b = strchr(tbuf, '\n');
-
- int len;
- if(b) {
- *b = '\0';
- len = max(strlen(tbuf)-1, strlen(b+1));
- } else {
- len = strlen(tbuf);
- }
- // round up, and allow space for lead-in
- len = (len + 7 + (POS_WIDTH-1)) / POS_WIDTH;
- return max(ColsAvailable, len);
- }
- case ELEM_CTC:
- case ELEM_RES:
- case ELEM_COIL:
- case ELEM_MOVE:
- case ELEM_SHIFT_REGISTER:
- case ELEM_LOOK_UP_TABLE:
- case ELEM_PIECEWISE_LINEAR:
- case ELEM_MASTER_RELAY:
- case ELEM_READ_ADC:
- case ELEM_SET_PWM:
- case ELEM_PERSIST:
- if(ColsAvailable - soFar > 1) {
- return ColsAvailable - soFar;
- } else {
- return 1;
- }
-
- case ELEM_ADD:
- case ELEM_SUB:
- case ELEM_MUL:
- case ELEM_DIV:
- if(ColsAvailable - soFar > 2) {
- return ColsAvailable - soFar;
- } else {
- return 2;
- }
-
- case ELEM_SERIES_SUBCKT: {
- // total of the width of the members
- int total = 0;
- int i;
- ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
- for(i = 0; i < s->count; i++) {
- total += CountWidthOfElement(s->contents[i].which,
- s->contents[i].d.any, total+soFar);
- }
- return total;
- }
-
- case ELEM_PARALLEL_SUBCKT: {
- // greatest of the width of the members
- int max = 0;
- int i;
- ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
- for(i = 0; i < p->count; i++) {
- int w = CountWidthOfElement(p->contents[i].which,
- p->contents[i].d.any, soFar);
- if(w > max) {
- max = w;
- }
- }
- return max;
- }
-
- default:
- oops();
- }
-}
+// static int CountWidthOfElement(int which, void *elem, int soFar)
+// {
+// switch(which) {
+// case ELEM_PLACEHOLDER:
+// case ELEM_OPEN:
+// case ELEM_SHORT:
+// case ELEM_CONTACTS:
+// case ELEM_TON:
+// case ELEM_TOF:
+// case ELEM_RTO:
+// case ELEM_CTU:
+// case ELEM_CTD:
+// case ELEM_ONE_SHOT_RISING:
+// case ELEM_ONE_SHOT_FALLING:
+// case ELEM_EQU:
+// case ELEM_NEQ:
+// case ELEM_GRT:
+// case ELEM_GEQ:
+// case ELEM_LES:
+// case ELEM_LEQ:
+// case ELEM_UART_RECV:
+// case ELEM_UART_SEND:
+// return 1;
+
+// case ELEM_FORMATTED_STRING:
+// return 2;
+
+// case ELEM_COMMENT: {
+// if(soFar != 0) oops();
+
+// ElemLeaf *l = (ElemLeaf *)elem;
+// char tbuf[MAX_COMMENT_LEN];
+
+// strcpy(tbuf, l->d.comment.str);
+// char *b = strchr(tbuf, '\n');
+
+// int len;
+// if(b) {
+// *b = '\0';
+// len = max(strlen(tbuf)-1, strlen(b+1));
+// } else {
+// len = strlen(tbuf);
+// }
+// // round up, and allow space for lead-in
+// len = (len + 7 + (POS_WIDTH-1)) / POS_WIDTH;
+// return max(ColsAvailable, len);
+// }
+// case ELEM_CTC:
+// case ELEM_RES:
+// case ELEM_COIL:
+// case ELEM_MOVE:
+// case ELEM_SHIFT_REGISTER:
+// case ELEM_LOOK_UP_TABLE:
+// case ELEM_PIECEWISE_LINEAR:
+// case ELEM_MASTER_RELAY:
+// case ELEM_READ_ADC:
+// case ELEM_SET_PWM:
+// case ELEM_PERSIST:
+// if(ColsAvailable - soFar > 1) {
+// return ColsAvailable - soFar;
+// } else {
+// return 1;
+// }
+
+// case ELEM_ADD:
+// case ELEM_SUB:
+// case ELEM_MUL:
+// case ELEM_DIV:
+// if(ColsAvailable - soFar > 2) {
+// return ColsAvailable - soFar;
+// } else {
+// return 2;
+// }
+
+// case ELEM_SERIES_SUBCKT: {
+// // total of the width of the members
+// int total = 0;
+// int i;
+// ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
+// for(i = 0; i < s->count; i++) {
+// total += CountWidthOfElement(s->contents[i].which,
+// s->contents[i].d.any, total+soFar);
+// }
+// return total;
+// }
+
+// case ELEM_PARALLEL_SUBCKT: {
+// // greatest of the width of the members
+// int max = 0;
+// int i;
+// ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
+// for(i = 0; i < p->count; i++) {
+// int w = CountWidthOfElement(p->contents[i].which,
+// p->contents[i].d.any, soFar);
+// if(w > max) {
+// max = w;
+// }
+// }
+// return max;
+// }
+
+// default:
+// oops();
+// }
+// }
//-----------------------------------------------------------------------------
// Determine the height, in leaf element units, of a particular subcircuit.
@@ -188,729 +188,733 @@ static int CountWidthOfElement(int which, void *elem, int soFar)
// maximum of the heights of its members. (This is the dual of the width
// case.)
//-----------------------------------------------------------------------------
-int CountHeightOfElement(int which, void *elem)
-{
- switch(which) {
- CASE_LEAF
- return 1;
-
- case ELEM_PARALLEL_SUBCKT: {
- // total of the height of the members
- int total = 0;
- int i;
- ElemSubcktParallel *s = (ElemSubcktParallel *)elem;
- for(i = 0; i < s->count; i++) {
- total += CountHeightOfElement(s->contents[i].which,
- s->contents[i].d.any);
- }
- return total;
- }
-
- case ELEM_SERIES_SUBCKT: {
- // greatest of the height of the members
- int max = 0;
- int i;
- ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
- for(i = 0; i < s->count; i++) {
- int w = CountHeightOfElement(s->contents[i].which,
- s->contents[i].d.any);
- if(w > max) {
- max = w;
- }
- }
- return max;
- }
-
- default:
- oops();
- }
-}
+// int CountHeightOfElement(int which, void *elem)
+// {
+// switch(which) {
+// CASE_LEAF
+// return 1;
+
+// case ELEM_PARALLEL_SUBCKT: {
+// // total of the height of the members
+// int total = 0;
+// int i;
+// ElemSubcktParallel *s = (ElemSubcktParallel *)elem;
+// for(i = 0; i < s->count; i++) {
+// total += CountHeightOfElement(s->contents[i].which,
+// s->contents[i].d.any);
+// }
+// return total;
+// }
+
+// case ELEM_SERIES_SUBCKT: {
+// // greatest of the height of the members
+// int max = 0;
+// int i;
+// ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
+// for(i = 0; i < s->count; i++) {
+// int w = CountHeightOfElement(s->contents[i].which,
+// s->contents[i].d.any);
+// if(w > max) {
+// max = w;
+// }
+// }
+// return max;
+// }
+
+// default:
+// oops();
+// }
+// }
//-----------------------------------------------------------------------------
// Determine the width, in leaf element units, of the widest row of the PLC
// program (i.e. loop over all the rungs and find the widest).
//-----------------------------------------------------------------------------
-int ProgCountWidestRow(void)
-{
- int i;
- int max = 0;
- int colsTemp = ColsAvailable;
- ColsAvailable = 0;
- for(i = 0; i < Prog.numRungs; i++) {
- int w = CountWidthOfElement(ELEM_SERIES_SUBCKT, Prog.rungs[i], 0);
- if(w > max) {
- max = w;
- }
- }
- ColsAvailable = colsTemp;
- return max;
-}
+// int ProgCountWidestRow(void)
+// {
+// int i;
+// int max = 0;
+// int colsTemp = ColsAvailable;
+// ColsAvailable = 0;
+// for(i = 0; i < Prog.numRungs; i++) {
+// int w = CountWidthOfElement(ELEM_SERIES_SUBCKT, Prog.rungs[i], 0);
+// if(w > max) {
+// max = w;
+// }
+// }
+// ColsAvailable = colsTemp;
+// return max;
+// }
//-----------------------------------------------------------------------------
// Draw a vertical wire one leaf element unit high up from (cx, cy), where cx
// and cy are in charcter units.
//-----------------------------------------------------------------------------
-static void VerticalWire(int cx, int cy)
-{
- int j;
- for(j = 1; j < POS_HEIGHT; j++) {
- DrawChars(cx, cy + (POS_HEIGHT/2 - j), "|");
- }
- DrawChars(cx, cy + (POS_HEIGHT/2), "+");
- DrawChars(cx, cy + (POS_HEIGHT/2 - POS_HEIGHT), "+");
-}
+// static void VerticalWire(int cx, int cy)
+// {
+// int j;
+// for(j = 1; j < POS_HEIGHT; j++) {
+// DrawChars(cx, cy + (POS_HEIGHT/2 - j), "|");
+// }
+// DrawChars(cx, cy + (POS_HEIGHT/2), "+");
+// DrawChars(cx, cy + (POS_HEIGHT/2 - POS_HEIGHT), "+");
+// }
//-----------------------------------------------------------------------------
// Convenience functions for making the text colors pretty, for DrawElement.
//-----------------------------------------------------------------------------
-static void NormText(void)
-{
- SetTextColor(Hdc, InSimulationMode ? HighlightColours.simOff :
- HighlightColours.def);
- SelectObject(Hdc, FixedWidthFont);
-}
-static void EmphText(void)
-{
- SetTextColor(Hdc, InSimulationMode ? HighlightColours.simOn :
- HighlightColours.selected);
- SelectObject(Hdc, FixedWidthFontBold);
-}
-static void NameText(void)
-{
- if(!InSimulationMode && !ThisHighlighted) {
- SetTextColor(Hdc, HighlightColours.name);
- }
-}
-static void BodyText(void)
-{
- if(!InSimulationMode && !ThisHighlighted) {
- SetTextColor(Hdc, HighlightColours.def);
- }
-}
-static void PoweredText(BOOL powered)
-{
- if(InSimulationMode) {
- if(powered)
- EmphText();
- else
- NormText();
- }
-}
+// static void NormText(void)
+// {
+// SetTextColor(Hdc, InSimulationMode ? HighlightColours.simOff :
+// HighlightColours.def);
+// SelectObject(Hdc, FixedWidthFont);
+// }
+
+// static void EmphText(void)
+// {
+// SetTextColor(Hdc, InSimulationMode ? HighlightColours.simOn :
+// HighlightColours.selected);
+// SelectObject(Hdc, FixedWidthFontBold);
+// }
+
+// static void NameText(void)
+// {
+// if(!InSimulationMode && !ThisHighlighted) {
+// SetTextColor(Hdc, HighlightColours.name);
+// }
+// }
+
+// static void BodyText(void)
+// {
+// if(!InSimulationMode && !ThisHighlighted) {
+// SetTextColor(Hdc, HighlightColours.def);
+// }
+// }
+
+// static void PoweredText(BOOL powered)
+// {
+// if(InSimulationMode) {
+// if(powered)
+// EmphText();
+// else
+// NormText();
+// }
+// }
//-----------------------------------------------------------------------------
// Count the length of a string, in characters. Nonstandard because the
// string may contain special characters to indicate formatting (syntax
// highlighting).
//-----------------------------------------------------------------------------
-static int FormattedStrlen(char *str)
-{
- int l = 0;
- while(*str) {
- if(*str > 10) {
- l++;
- }
- str++;
- }
- return l;
-}
+// static int FormattedStrlen(char *str)
+// {
+// int l = 0;
+// while(*str) {
+// if(*str > 10) {
+// l++;
+// }
+// str++;
+// }
+// return l;
+// }
//-----------------------------------------------------------------------------
// Draw a string, centred in the space of a single position, with spaces on
// the left and right. Draws on the upper line of the position.
//-----------------------------------------------------------------------------
-static void CenterWithSpaces(int cx, int cy, char *str, BOOL powered,
- BOOL isName)
-{
- int extra = POS_WIDTH - FormattedStrlen(str);
- PoweredText(powered);
- if(isName) NameText();
- DrawChars(cx + (extra/2), cy + (POS_HEIGHT/2) - 1, str);
- if(isName) BodyText();
-}
+// static void CenterWithSpaces(int cx, int cy, char *str, BOOL powered,
+// BOOL isName)
+// {
+// int extra = POS_WIDTH - FormattedStrlen(str);
+// PoweredText(powered);
+// if(isName) NameText();
+// DrawChars(cx + (extra/2), cy + (POS_HEIGHT/2) - 1, str);
+// if(isName) BodyText();
+// }
//-----------------------------------------------------------------------------
// Like CenterWithWires, but for an arbitrary width position (e.g. for ADD
// and SUB, which are double-width).
//-----------------------------------------------------------------------------
-static void CenterWithWiresWidth(int cx, int cy, char *str, BOOL before,
- BOOL after, int totalWidth)
-{
- int extra = totalWidth - FormattedStrlen(str);
-
- PoweredText(after);
- DrawChars(cx + (extra/2), cy + (POS_HEIGHT/2), str);
-
- PoweredText(before);
- int i;
- for(i = 0; i < (extra/2); i++) {
- DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
- }
- PoweredText(after);
- for(i = FormattedStrlen(str)+(extra/2); i < totalWidth; i++) {
- DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
- }
-}
+// static void CenterWithWiresWidth(int cx, int cy, char *str, BOOL before,
+// BOOL after, int totalWidth)
+// {
+// int extra = totalWidth - FormattedStrlen(str);
+
+// PoweredText(after);
+// DrawChars(cx + (extra/2), cy + (POS_HEIGHT/2), str);
+
+// PoweredText(before);
+// int i;
+// for(i = 0; i < (extra/2); i++) {
+// DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
+// }
+// PoweredText(after);
+// for(i = FormattedStrlen(str)+(extra/2); i < totalWidth; i++) {
+// DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
+// }
+// }
//-----------------------------------------------------------------------------
// Draw a string, centred in the space of a single position, with en dashes on
// the left and right coloured according to the powered state. Draws on the
// middle line.
//-----------------------------------------------------------------------------
-static void CenterWithWires(int cx, int cy, char *str, BOOL before, BOOL after)
-{
- CenterWithWiresWidth(cx, cy, str, before, after, POS_WIDTH);
-}
+// static void CenterWithWires(int cx, int cy, char *str, BOOL before, BOOL after)
+// {
+// CenterWithWiresWidth(cx, cy, str, before, after, POS_WIDTH);
+// }
//-----------------------------------------------------------------------------
// Draw an end of line element (coil, RES, MOV, etc.). Special things about
// an end of line element: we must right-justify it.
//-----------------------------------------------------------------------------
-static BOOL DrawEndOfLine(int which, ElemLeaf *leaf, int *cx, int *cy,
- BOOL poweredBefore)
-{
- int cx0 = *cx, cy0 = *cy;
-
- BOOL poweredAfter = leaf->poweredAfter;
-
- int thisWidth;
- switch(which) {
- case ELEM_ADD:
- case ELEM_SUB:
- case ELEM_MUL:
- case ELEM_DIV:
- thisWidth = 2;
- break;
-
- default:
- thisWidth = 1;
- break;
- }
-
- NormText();
- PoweredText(poweredBefore);
- while(*cx < (ColsAvailable-thisWidth)*POS_WIDTH) {
- int gx = *cx/POS_WIDTH;
- int gy = *cy/POS_HEIGHT;
-
- if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
-
- if(gx >= DISPLAY_MATRIX_X_SIZE) oops();
- DM_BOUNDS(gx, gy);
- DisplayMatrix[gx][gy] = PADDING_IN_DISPLAY_MATRIX;
- DisplayMatrixWhich[gx][gy] = ELEM_PADDING;
-
- int i;
- for(i = 0; i < POS_WIDTH; i++) {
- DrawChars(*cx + i, *cy + (POS_HEIGHT/2), "-");
- }
- *cx += POS_WIDTH;
- cx0 += POS_WIDTH;
- }
-
- if(leaf == Selected && !InSimulationMode) {
- EmphText();
- ThisHighlighted = TRUE;
- } else {
- ThisHighlighted = FALSE;
- }
-
- switch(which) {
- case ELEM_CTC: {
- char buf[256];
- ElemCounter *c = &leaf->d.counter;
- sprintf(buf, "{\x01""CTC\x02 0:%d}", c->max);
-
- CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
- break;
- }
- case ELEM_RES: {
- ElemReset *r = &leaf->d.reset;
- CenterWithSpaces(*cx, *cy, r->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, "{RES}", poweredBefore, poweredAfter);
- break;
- }
- case ELEM_READ_ADC: {
- ElemReadAdc *r = &leaf->d.readAdc;
- CenterWithSpaces(*cx, *cy, r->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, "{READ ADC}", poweredBefore,
- poweredAfter);
- break;
- }
- case ELEM_SET_PWM: {
- ElemSetPwm *s = &leaf->d.setPwm;
- CenterWithSpaces(*cx, *cy, s->name, poweredAfter, TRUE);
- char l[50];
- if(s->targetFreq >= 100000) {
- sprintf(l, "{PWM %d kHz}", (s->targetFreq+500)/1000);
- } else if(s->targetFreq >= 10000) {
- sprintf(l, "{PWM %.1f kHz}", s->targetFreq/1000.0);
- } else if(s->targetFreq >= 1000) {
- sprintf(l, "{PWM %.2f kHz}", s->targetFreq/1000.0);
- } else {
- sprintf(l, "{PWM %d Hz}", s->targetFreq);
- }
- CenterWithWires(*cx, *cy, l, poweredBefore,
- poweredAfter);
- break;
- }
- case ELEM_PERSIST:
- CenterWithSpaces(*cx, *cy, leaf->d.persist.var, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, "{PERSIST}", poweredBefore, poweredAfter);
- break;
-
- case ELEM_MOVE: {
- char top[256];
- char bot[256];
- ElemMove *m = &leaf->d.move;
-
- if((strlen(m->dest) > (POS_WIDTH - 9)) ||
- (strlen(m->src) > (POS_WIDTH - 9)))
- {
- CenterWithWires(*cx, *cy, TOO_LONG, poweredBefore,
- poweredAfter);
- break;
- }
-
- strcpy(top, "{ }");
- memcpy(top+1, m->dest, strlen(m->dest));
- top[strlen(m->dest) + 3] = ':';
- top[strlen(m->dest) + 4] = '=';
-
- strcpy(bot, "{ \x01MOV\x02}");
- memcpy(bot+2, m->src, strlen(m->src));
-
- CenterWithSpaces(*cx, *cy, top, poweredAfter, FALSE);
- CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
- break;
- }
- case ELEM_MASTER_RELAY:
- CenterWithWires(*cx, *cy, "{MASTER RLY}", poweredBefore,
- poweredAfter);
- break;
-
- case ELEM_SHIFT_REGISTER: {
- char bot[MAX_NAME_LEN+20];
- memset(bot, ' ', sizeof(bot));
- bot[0] = '{';
- sprintf(bot+2, "%s0..%d", leaf->d.shiftRegister.name,
- leaf->d.shiftRegister.stages-1);
- bot[strlen(bot)] = ' ';
- bot[13] = '}';
- bot[14] = '\0';
- CenterWithSpaces(*cx, *cy, "{\x01SHIFT REG\x02 }",
- poweredAfter, FALSE);
- CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
- break;
- }
- case ELEM_PIECEWISE_LINEAR:
- case ELEM_LOOK_UP_TABLE: {
- char top[MAX_NAME_LEN+20], bot[MAX_NAME_LEN+20];
- char *dest, *index, *str;
- if(which == ELEM_PIECEWISE_LINEAR) {
- dest = leaf->d.piecewiseLinear.dest;
- index = leaf->d.piecewiseLinear.index;
- str = "PWL";
- } else {
- dest = leaf->d.lookUpTable.dest;
- index = leaf->d.lookUpTable.index;
- str = "LUT";
- }
- memset(top, ' ', sizeof(top));
- top[0] = '{';
- sprintf(top+2, "%s :=", dest);
- top[strlen(top)] = ' ';
- top[13] = '}';
- top[14] = '\0';
- CenterWithSpaces(*cx, *cy, top, poweredAfter, FALSE);
- memset(bot, ' ', sizeof(bot));
- bot[0] = '{';
- sprintf(bot+2, " %s[%s]", str, index);
- bot[strlen(bot)] = ' ';
- bot[13] = '}';
- bot[14] = '\0';
- CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
- break;
- }
- case ELEM_COIL: {
- char buf[4];
- ElemCoil *c = &leaf->d.coil;
-
- buf[0] = '(';
- if(c->negated) {
- buf[1] = '/';
- } else if(c->setOnly) {
- buf[1] = 'S';
- } else if(c->resetOnly) {
- buf[1] = 'R';
- } else {
- buf[1] = ' ';
- }
- buf[2] = ')';
- buf[3] = '\0';
-
- CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
- break;
- }
- case ELEM_DIV:
- case ELEM_MUL:
- case ELEM_SUB:
- case ELEM_ADD: {
- char top[POS_WIDTH*2-3+2];
- char bot[POS_WIDTH*2-3];
-
- memset(top, ' ', sizeof(top)-1);
- top[0] = '{';
-
- memset(bot, ' ', sizeof(bot)-1);
- bot[0] = '{';
-
- int lt = 1;
- if(which == ELEM_ADD) {
- memcpy(top+lt, "\x01""ADD\x02", 5);
- } else if(which == ELEM_SUB) {
- memcpy(top+lt, "\x01SUB\x02", 5);
- } else if(which == ELEM_MUL) {
- memcpy(top+lt, "\x01MUL\x02", 5);
- } else if(which == ELEM_DIV) {
- memcpy(top+lt, "\x01""DIV\x02", 5);
- } else oops();
-
- lt += 7;
- memcpy(top+lt, leaf->d.math.dest, strlen(leaf->d.math.dest));
- lt += strlen(leaf->d.math.dest) + 2;
- top[lt++] = ':';
- top[lt++] = '=';
-
- int lb = 2;
- memcpy(bot+lb, leaf->d.math.op1, strlen(leaf->d.math.op1));
- lb += strlen(leaf->d.math.op1) + 1;
- if(which == ELEM_ADD) {
- bot[lb++] = '+';
- } else if(which == ELEM_SUB) {
- bot[lb++] = '-';
- } else if(which == ELEM_MUL) {
- bot[lb++] = '*';
- } else if(which == ELEM_DIV) {
- bot[lb++] = '/';
- } else oops();
- lb++;
- memcpy(bot+lb, leaf->d.math.op2, strlen(leaf->d.math.op2));
- lb += strlen(leaf->d.math.op2);
-
- int l = max(lb, lt - 2);
- top[l+2] = '}'; top[l+3] = '\0';
- bot[l] = '}'; bot[l+1] = '\0';
-
- int extra = 2*POS_WIDTH - FormattedStrlen(top);
- PoweredText(poweredAfter);
- DrawChars(*cx + (extra/2), *cy + (POS_HEIGHT/2) - 1, top);
- CenterWithWiresWidth(*cx, *cy, bot, poweredBefore, poweredAfter,
- 2*POS_WIDTH);
-
- *cx += POS_WIDTH;
-
- break;
- }
- default:
- oops();
- break;
- }
-
- *cx += POS_WIDTH;
-
- return poweredAfter;
-}
+// static BOOL DrawEndOfLine(int which, ElemLeaf *leaf, int *cx, int *cy,
+// BOOL poweredBefore)
+// {
+// int cx0 = *cx, cy0 = *cy;
+
+// BOOL poweredAfter = leaf->poweredAfter;
+
+// int thisWidth;
+// switch(which) {
+// case ELEM_ADD:
+// case ELEM_SUB:
+// case ELEM_MUL:
+// case ELEM_DIV:
+// thisWidth = 2;
+// break;
+
+// default:
+// thisWidth = 1;
+// break;
+// }
+
+// NormText();
+// PoweredText(poweredBefore);
+// while(*cx < (ColsAvailable-thisWidth)*POS_WIDTH) {
+// int gx = *cx/POS_WIDTH;
+// int gy = *cy/POS_HEIGHT;
+
+// if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
+
+// if(gx >= DISPLAY_MATRIX_X_SIZE) oops();
+// DM_BOUNDS(gx, gy);
+// DisplayMatrix[gx][gy] = PADDING_IN_DISPLAY_MATRIX;
+// DisplayMatrixWhich[gx][gy] = ELEM_PADDING;
+
+// int i;
+// for(i = 0; i < POS_WIDTH; i++) {
+// DrawChars(*cx + i, *cy + (POS_HEIGHT/2), "-");
+// }
+// *cx += POS_WIDTH;
+// cx0 += POS_WIDTH;
+// }
+
+// if(leaf == Selected && !InSimulationMode) {
+// EmphText();
+// ThisHighlighted = TRUE;
+// } else {
+// ThisHighlighted = FALSE;
+// }
+
+// switch(which) {
+// case ELEM_CTC: {
+// char buf[256];
+// ElemCounter *c = &leaf->d.counter;
+// sprintf(buf, "{\x01""CTC\x02 0:%d}", c->max);
+
+// CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_RES: {
+// ElemReset *r = &leaf->d.reset;
+// CenterWithSpaces(*cx, *cy, r->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, "{RES}", poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_READ_ADC: {
+// ElemReadAdc *r = &leaf->d.readAdc;
+// CenterWithSpaces(*cx, *cy, r->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, "{READ ADC}", poweredBefore,
+// poweredAfter);
+// break;
+// }
+// case ELEM_SET_PWM: {
+// ElemSetPwm *s = &leaf->d.setPwm;
+// CenterWithSpaces(*cx, *cy, s->name, poweredAfter, TRUE);
+// char l[50];
+// if(s->targetFreq >= 100000) {
+// sprintf(l, "{PWM %d kHz}", (s->targetFreq+500)/1000);
+// } else if(s->targetFreq >= 10000) {
+// sprintf(l, "{PWM %.1f kHz}", s->targetFreq/1000.0);
+// } else if(s->targetFreq >= 1000) {
+// sprintf(l, "{PWM %.2f kHz}", s->targetFreq/1000.0);
+// } else {
+// sprintf(l, "{PWM %d Hz}", s->targetFreq);
+// }
+// CenterWithWires(*cx, *cy, l, poweredBefore,
+// poweredAfter);
+// break;
+// }
+// case ELEM_PERSIST:
+// CenterWithSpaces(*cx, *cy, leaf->d.persist.var, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, "{PERSIST}", poweredBefore, poweredAfter);
+// break;
+
+// case ELEM_MOVE: {
+// char top[256];
+// char bot[256];
+// ElemMove *m = &leaf->d.move;
+
+// if((strlen(m->dest) > (POS_WIDTH - 9)) ||
+// (strlen(m->src) > (POS_WIDTH - 9)))
+// {
+// CenterWithWires(*cx, *cy, TOO_LONG, poweredBefore,
+// poweredAfter);
+// break;
+// }
+
+// strcpy(top, "{ }");
+// memcpy(top+1, m->dest, strlen(m->dest));
+// top[strlen(m->dest) + 3] = ':';
+// top[strlen(m->dest) + 4] = '=';
+
+// strcpy(bot, "{ \x01MOV\x02}");
+// memcpy(bot+2, m->src, strlen(m->src));
+
+// CenterWithSpaces(*cx, *cy, top, poweredAfter, FALSE);
+// CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_MASTER_RELAY:
+// CenterWithWires(*cx, *cy, "{MASTER RLY}", poweredBefore,
+// poweredAfter);
+// break;
+
+// case ELEM_SHIFT_REGISTER: {
+// char bot[MAX_NAME_LEN+20];
+// memset(bot, ' ', sizeof(bot));
+// bot[0] = '{';
+// sprintf(bot+2, "%s0..%d", leaf->d.shiftRegister.name,
+// leaf->d.shiftRegister.stages-1);
+// bot[strlen(bot)] = ' ';
+// bot[13] = '}';
+// bot[14] = '\0';
+// CenterWithSpaces(*cx, *cy, "{\x01SHIFT REG\x02 }",
+// poweredAfter, FALSE);
+// CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_PIECEWISE_LINEAR:
+// case ELEM_LOOK_UP_TABLE: {
+// char top[MAX_NAME_LEN+20], bot[MAX_NAME_LEN+20];
+// char *dest, *index, *str;
+// if(which == ELEM_PIECEWISE_LINEAR) {
+// dest = leaf->d.piecewiseLinear.dest;
+// index = leaf->d.piecewiseLinear.index;
+// str = "PWL";
+// } else {
+// dest = leaf->d.lookUpTable.dest;
+// index = leaf->d.lookUpTable.index;
+// str = "LUT";
+// }
+// memset(top, ' ', sizeof(top));
+// top[0] = '{';
+// sprintf(top+2, "%s :=", dest);
+// top[strlen(top)] = ' ';
+// top[13] = '}';
+// top[14] = '\0';
+// CenterWithSpaces(*cx, *cy, top, poweredAfter, FALSE);
+// memset(bot, ' ', sizeof(bot));
+// bot[0] = '{';
+// sprintf(bot+2, " %s[%s]", str, index);
+// bot[strlen(bot)] = ' ';
+// bot[13] = '}';
+// bot[14] = '\0';
+// CenterWithWires(*cx, *cy, bot, poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_COIL: {
+// char buf[4];
+// ElemCoil *c = &leaf->d.coil;
+
+// buf[0] = '(';
+// if(c->negated) {
+// buf[1] = '/';
+// } else if(c->setOnly) {
+// buf[1] = 'S';
+// } else if(c->resetOnly) {
+// buf[1] = 'R';
+// } else {
+// buf[1] = ' ';
+// }
+// buf[2] = ')';
+// buf[3] = '\0';
+
+// CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
+// break;
+// }
+// case ELEM_DIV:
+// case ELEM_MUL:
+// case ELEM_SUB:
+// case ELEM_ADD: {
+// char top[POS_WIDTH*2-3+2];
+// char bot[POS_WIDTH*2-3];
+
+// memset(top, ' ', sizeof(top)-1);
+// top[0] = '{';
+
+// memset(bot, ' ', sizeof(bot)-1);
+// bot[0] = '{';
+
+// int lt = 1;
+// if(which == ELEM_ADD) {
+// memcpy(top+lt, "\x01""ADD\x02", 5);
+// } else if(which == ELEM_SUB) {
+// memcpy(top+lt, "\x01SUB\x02", 5);
+// } else if(which == ELEM_MUL) {
+// memcpy(top+lt, "\x01MUL\x02", 5);
+// } else if(which == ELEM_DIV) {
+// memcpy(top+lt, "\x01""DIV\x02", 5);
+// } else oops();
+
+// lt += 7;
+// memcpy(top+lt, leaf->d.math.dest, strlen(leaf->d.math.dest));
+// lt += strlen(leaf->d.math.dest) + 2;
+// top[lt++] = ':';
+// top[lt++] = '=';
+
+// int lb = 2;
+// memcpy(bot+lb, leaf->d.math.op1, strlen(leaf->d.math.op1));
+// lb += strlen(leaf->d.math.op1) + 1;
+// if(which == ELEM_ADD) {
+// bot[lb++] = '+';
+// } else if(which == ELEM_SUB) {
+// bot[lb++] = '-';
+// } else if(which == ELEM_MUL) {
+// bot[lb++] = '*';
+// } else if(which == ELEM_DIV) {
+// bot[lb++] = '/';
+// } else oops();
+// lb++;
+// memcpy(bot+lb, leaf->d.math.op2, strlen(leaf->d.math.op2));
+// lb += strlen(leaf->d.math.op2);
+
+// int l = max(lb, lt - 2);
+// top[l+2] = '}'; top[l+3] = '\0';
+// bot[l] = '}'; bot[l+1] = '\0';
+
+// int extra = 2*POS_WIDTH - FormattedStrlen(top);
+// PoweredText(poweredAfter);
+// DrawChars(*cx + (extra/2), *cy + (POS_HEIGHT/2) - 1, top);
+// CenterWithWiresWidth(*cx, *cy, bot, poweredBefore, poweredAfter,
+// 2*POS_WIDTH);
+
+// *cx += POS_WIDTH;
+
+// break;
+// }
+// default:
+// oops();
+// break;
+// }
+
+// *cx += POS_WIDTH;
+
+// return poweredAfter;
+// }
//-----------------------------------------------------------------------------
// Draw a leaf element. Special things about a leaf: no need to recurse
// further, and we must put it into the display matrix.
//-----------------------------------------------------------------------------
-static BOOL DrawLeaf(int which, ElemLeaf *leaf, int *cx, int *cy,
- BOOL poweredBefore)
-{
- int cx0 = *cx, cy0 = *cy;
- BOOL poweredAfter = leaf->poweredAfter;
-
- switch(which) {
- case ELEM_COMMENT: {
- char tbuf[MAX_COMMENT_LEN];
- char tlbuf[MAX_COMMENT_LEN+8];
-
- strcpy(tbuf, leaf->d.comment.str);
- char *b = strchr(tbuf, '\n');
-
- if(b) {
- if(b[-1] == '\r') b[-1] = '\0';
- *b = '\0';
- sprintf(tlbuf, "\x03 ; %s\x02", tbuf);
- DrawChars(*cx, *cy + (POS_HEIGHT/2) - 1, tlbuf);
- sprintf(tlbuf, "\x03 ; %s\x02", b+1);
- DrawChars(*cx, *cy + (POS_HEIGHT/2), tlbuf);
- } else {
- sprintf(tlbuf, "\x03 ; %s\x02", tbuf);
- DrawChars(*cx, *cy + (POS_HEIGHT/2) - 1, tlbuf);
- }
-
- *cx += ColsAvailable*POS_WIDTH;
- break;
- }
- case ELEM_PLACEHOLDER: {
- NormText();
- CenterWithWiresWidth(*cx, *cy, "--", FALSE, FALSE, 2);
- *cx += POS_WIDTH;
- break;
- }
- case ELEM_CONTACTS: {
- char buf[4];
- ElemContacts *c = &leaf->d.contacts;
-
- buf[0] = ']';
- buf[1] = c->negated ? '/' : ' ';
- buf[2] = '[';
- buf[3] = '\0';
-
- CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
-
- *cx += POS_WIDTH;
- break;
- }
- {
- char *s;
- case ELEM_EQU:
- s = "=="; goto cmp;
- case ELEM_NEQ:
- s = "/="; goto cmp;
- case ELEM_GRT:
- s = ">"; goto cmp;
- case ELEM_GEQ:
- s = ">="; goto cmp;
- case ELEM_LES:
- s = "<"; goto cmp;
- case ELEM_LEQ:
- s = "<="; goto cmp;
-cmp:
- char s1[POS_WIDTH+10], s2[POS_WIDTH+10];
- int l1, l2, lmax;
-
- l1 = 2 + 1 + strlen(s) + strlen(leaf->d.cmp.op1);
- l2 = 2 + 1 + strlen(leaf->d.cmp.op2);
- lmax = max(l1, l2);
-
- if(lmax < POS_WIDTH) {
- memset(s1, ' ', sizeof(s1));
- s1[0] = '[';
- s1[lmax-1] = ']';
- s1[lmax] = '\0';
- strcpy(s2, s1);
- memcpy(s1+1, leaf->d.cmp.op1, strlen(leaf->d.cmp.op1));
- memcpy(s1+strlen(leaf->d.cmp.op1)+2, s, strlen(s));
- memcpy(s2+2, leaf->d.cmp.op2, strlen(leaf->d.cmp.op2));
- } else {
- strcpy(s1, "");
- strcpy(s2, TOO_LONG);
- }
-
- CenterWithSpaces(*cx, *cy, s1, poweredAfter, FALSE);
- CenterWithWires(*cx, *cy, s2, poweredBefore, poweredAfter);
-
- *cx += POS_WIDTH;
- break;
- }
- case ELEM_OPEN:
- CenterWithWires(*cx, *cy, "+ +", poweredBefore, poweredAfter);
- *cx += POS_WIDTH;
- break;
-
- case ELEM_SHORT:
- CenterWithWires(*cx, *cy, "+------+", poweredBefore, poweredAfter);
- *cx += POS_WIDTH;
- break;
-
- case ELEM_ONE_SHOT_RISING:
- case ELEM_ONE_SHOT_FALLING: {
- char *s1, *s2;
- if(which == ELEM_ONE_SHOT_RISING) {
- s1 = " _ ";
- s2 = "[\x01OSR\x02_/ ]";
- } else if(which == ELEM_ONE_SHOT_FALLING) {
- s1 = " _ ";
- s2 = "[\x01OSF\x02 \\_]";
- } else oops();
-
- CenterWithSpaces(*cx, *cy, s1, poweredAfter, FALSE);
- CenterWithWires(*cx, *cy, s2, poweredBefore, poweredAfter);
-
- *cx += POS_WIDTH;
- break;
- }
- case ELEM_CTU:
- case ELEM_CTD: {
- char *s;
- if(which == ELEM_CTU)
- s = "\x01""CTU\x02";
- else if(which == ELEM_CTD)
- s = "\x01""CTD\x02";
- else oops();
-
- char buf[256];
- ElemCounter *c = &leaf->d.counter;
- sprintf(buf, "[%s >=%d]", s, c->max);
-
- CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
-
- *cx += POS_WIDTH;
- break;
- }
- case ELEM_RTO:
- case ELEM_TON:
- case ELEM_TOF: {
- char *s;
- if(which == ELEM_TON)
- s = "\x01TON\x02";
- else if(which == ELEM_TOF)
- s = "\x01TOF\x02";
- else if(which == ELEM_RTO)
- s = "\x01RTO\x02";
- else oops();
-
- char buf[256];
- ElemTimer *t = &leaf->d.timer;
- if(t->delay >= 1000*1000) {
- sprintf(buf, "[%s %.3f s]", s, t->delay/1000000.0);
- } else if(t->delay >= 100*1000) {
- sprintf(buf, "[%s %.1f ms]", s, t->delay/1000.0);
- } else {
- sprintf(buf, "[%s %.2f ms]", s, t->delay/1000.0);
- }
-
- CenterWithSpaces(*cx, *cy, t->name, poweredAfter, TRUE);
- CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
-
- *cx += POS_WIDTH;
- break;
- }
- case ELEM_FORMATTED_STRING: {
- // Careful, string could be longer than fits in our space.
- char str[POS_WIDTH*2];
- memset(str, 0, sizeof(str));
- char *srcStr = leaf->d.fmtdStr.string;
- memcpy(str, srcStr, min(strlen(srcStr), POS_WIDTH*2 - 7));
-
- char bot[100];
- sprintf(bot, "{\"%s\"}", str);
-
- int extra = 2*POS_WIDTH - strlen(leaf->d.fmtdStr.var);
- PoweredText(poweredAfter);
- NameText();
- DrawChars(*cx + (extra/2), *cy + (POS_HEIGHT/2) - 1,
- leaf->d.fmtdStr.var);
- BodyText();
-
- CenterWithWiresWidth(*cx, *cy, bot, poweredBefore, poweredAfter,
- 2*POS_WIDTH);
- *cx += 2*POS_WIDTH;
- break;
- }
- case ELEM_UART_RECV:
- case ELEM_UART_SEND:
- CenterWithWires(*cx, *cy,
- (which == ELEM_UART_RECV) ? "{UART RECV}" : "{UART SEND}",
- poweredBefore, poweredAfter);
- CenterWithSpaces(*cx, *cy, leaf->d.uart.name, poweredAfter, TRUE);
- *cx += POS_WIDTH;
- break;
-
- default:
- poweredAfter = DrawEndOfLine(which, leaf, cx, cy, poweredBefore);
- break;
- }
-
- // And now we can enter the element into the display matrix so that the
- // UI routines know what element is at position (gx, gy) when the user
- // clicks there, and so that we know where to put the cursor if this
- // element is selected.
-
- // Don't use original cx0, as an end of line element might be further
- // along than that.
- cx0 = *cx - POS_WIDTH;
-
- int gx = cx0/POS_WIDTH;
- int gy = cy0/POS_HEIGHT;
- if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
- DM_BOUNDS(gx, gy);
-
- DisplayMatrix[gx][gy] = leaf;
- DisplayMatrixWhich[gx][gy] = which;
-
- int xadj = 0;
- switch(which) {
- case ELEM_ADD:
- case ELEM_SUB:
- case ELEM_MUL:
- case ELEM_DIV:
- case ELEM_FORMATTED_STRING:
- DM_BOUNDS(gx-1, gy);
- DisplayMatrix[gx-1][gy] = leaf;
- DisplayMatrixWhich[gx-1][gy] = which;
- xadj = POS_WIDTH*FONT_WIDTH;
- break;
- }
-
- if(which == ELEM_COMMENT) {
- int i;
- for(i = 0; i < ColsAvailable; i++) {
- DisplayMatrix[i][gy] = leaf;
- DisplayMatrixWhich[i][gy] = ELEM_COMMENT;
- }
- xadj = (ColsAvailable-1)*POS_WIDTH*FONT_WIDTH;
- }
-
- int x0 = X_PADDING + cx0*FONT_WIDTH;
- int y0 = Y_PADDING + cy0*FONT_HEIGHT;
-
- if(leaf->selectedState != SELECTED_NONE && leaf == Selected) {
- SelectionActive = TRUE;
- }
- switch(leaf->selectedState) {
- case SELECTED_LEFT:
- Cursor.left = x0 + FONT_WIDTH - 4 - xadj;
- Cursor.top = y0 - FONT_HEIGHT/2;
- Cursor.width = 2;
- Cursor.height = POS_HEIGHT*FONT_HEIGHT;
- break;
-
- case SELECTED_RIGHT:
- Cursor.left = x0 + (POS_WIDTH-1)*FONT_WIDTH - 5;
- Cursor.top = y0 - FONT_HEIGHT/2;
- Cursor.width = 2;
- Cursor.height = POS_HEIGHT*FONT_HEIGHT;
- break;
-
- case SELECTED_ABOVE:
- Cursor.left = x0 + FONT_WIDTH/2 - xadj;
- Cursor.top = y0 - 2;
- Cursor.width = (POS_WIDTH-2)*FONT_WIDTH + xadj;
- Cursor.height = 2;
- break;
-
- case SELECTED_BELOW:
- Cursor.left = x0 + FONT_WIDTH/2 - xadj;
- Cursor.top = y0 + (POS_HEIGHT-1)*FONT_HEIGHT +
- FONT_HEIGHT/2 - 2;
- Cursor.width = (POS_WIDTH-2)*(FONT_WIDTH) + xadj;
- Cursor.height = 2;
- break;
-
- default:
- break;
- }
-
- return poweredAfter;
-}
+// static BOOL DrawLeaf(int which, ElemLeaf *leaf, int *cx, int *cy,
+// BOOL poweredBefore)
+// {
+// int cx0 = *cx, cy0 = *cy;
+// BOOL poweredAfter = leaf->poweredAfter;
+
+// switch(which) {
+// case ELEM_COMMENT: {
+// char tbuf[MAX_COMMENT_LEN];
+// char tlbuf[MAX_COMMENT_LEN+8];
+
+// strcpy(tbuf, leaf->d.comment.str);
+// char *b = strchr(tbuf, '\n');
+
+// if(b) {
+// if(b[-1] == '\r') b[-1] = '\0';
+// *b = '\0';
+// sprintf(tlbuf, "\x03 ; %s\x02", tbuf);
+// DrawChars(*cx, *cy + (POS_HEIGHT/2) - 1, tlbuf);
+// sprintf(tlbuf, "\x03 ; %s\x02", b+1);
+// DrawChars(*cx, *cy + (POS_HEIGHT/2), tlbuf);
+// } else {
+// sprintf(tlbuf, "\x03 ; %s\x02", tbuf);
+// DrawChars(*cx, *cy + (POS_HEIGHT/2) - 1, tlbuf);
+// }
+
+// *cx += ColsAvailable*POS_WIDTH;
+// break;
+// }
+// case ELEM_PLACEHOLDER: {
+// NormText();
+// CenterWithWiresWidth(*cx, *cy, "--", FALSE, FALSE, 2);
+// *cx += POS_WIDTH;
+// break;
+// }
+// case ELEM_CONTACTS: {
+// char buf[4];
+// ElemContacts *c = &leaf->d.contacts;
+
+// buf[0] = ']';
+// buf[1] = c->negated ? '/' : ' ';
+// buf[2] = '[';
+// buf[3] = '\0';
+
+// CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
+
+// *cx += POS_WIDTH;
+// break;
+// }
+// {
+// char *s;
+// case ELEM_EQU:
+// s = "=="; goto cmp;
+// case ELEM_NEQ:
+// s = "/="; goto cmp;
+// case ELEM_GRT:
+// s = ">"; goto cmp;
+// case ELEM_GEQ:
+// s = ">="; goto cmp;
+// case ELEM_LES:
+// s = "<"; goto cmp;
+// case ELEM_LEQ:
+// s = "<="; goto cmp;
+// cmp:
+// char s1[POS_WIDTH+10], s2[POS_WIDTH+10];
+// int l1, l2, lmax;
+
+// l1 = 2 + 1 + strlen(s) + strlen(leaf->d.cmp.op1);
+// l2 = 2 + 1 + strlen(leaf->d.cmp.op2);
+// lmax = max(l1, l2);
+
+// if(lmax < POS_WIDTH) {
+// memset(s1, ' ', sizeof(s1));
+// s1[0] = '[';
+// s1[lmax-1] = ']';
+// s1[lmax] = '\0';
+// strcpy(s2, s1);
+// memcpy(s1+1, leaf->d.cmp.op1, strlen(leaf->d.cmp.op1));
+// memcpy(s1+strlen(leaf->d.cmp.op1)+2, s, strlen(s));
+// memcpy(s2+2, leaf->d.cmp.op2, strlen(leaf->d.cmp.op2));
+// } else {
+// strcpy(s1, "");
+// strcpy(s2, TOO_LONG);
+// }
+
+// CenterWithSpaces(*cx, *cy, s1, poweredAfter, FALSE);
+// CenterWithWires(*cx, *cy, s2, poweredBefore, poweredAfter);
+
+// *cx += POS_WIDTH;
+// break;
+// }
+// case ELEM_OPEN:
+// CenterWithWires(*cx, *cy, "+ +", poweredBefore, poweredAfter);
+// *cx += POS_WIDTH;
+// break;
+
+// case ELEM_SHORT:
+// CenterWithWires(*cx, *cy, "+------+", poweredBefore, poweredAfter);
+// *cx += POS_WIDTH;
+// break;
+
+// case ELEM_ONE_SHOT_RISING:
+// case ELEM_ONE_SHOT_FALLING: {
+// char *s1, *s2;
+// if(which == ELEM_ONE_SHOT_RISING) {
+// s1 = " _ ";
+// s2 = "[\x01OSR\x02_/ ]";
+// } else if(which == ELEM_ONE_SHOT_FALLING) {
+// s1 = " _ ";
+// s2 = "[\x01OSF\x02 \\_]";
+// } else oops();
+
+// CenterWithSpaces(*cx, *cy, s1, poweredAfter, FALSE);
+// CenterWithWires(*cx, *cy, s2, poweredBefore, poweredAfter);
+
+// *cx += POS_WIDTH;
+// break;
+// }
+// case ELEM_CTU:
+// case ELEM_CTD: {
+// char *s;
+// if(which == ELEM_CTU)
+// s = "\x01""CTU\x02";
+// else if(which == ELEM_CTD)
+// s = "\x01""CTD\x02";
+// else oops();
+
+// char buf[256];
+// ElemCounter *c = &leaf->d.counter;
+// sprintf(buf, "[%s >=%d]", s, c->max);
+
+// CenterWithSpaces(*cx, *cy, c->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
+
+// *cx += POS_WIDTH;
+// break;
+// }
+// case ELEM_RTO:
+// case ELEM_TON:
+// case ELEM_TOF: {
+// char *s;
+// if(which == ELEM_TON)
+// s = "\x01TON\x02";
+// else if(which == ELEM_TOF)
+// s = "\x01TOF\x02";
+// else if(which == ELEM_RTO)
+// s = "\x01RTO\x02";
+// else oops();
+
+// char buf[256];
+// ElemTimer *t = &leaf->d.timer;
+// if(t->delay >= 1000*1000) {
+// sprintf(buf, "[%s %.3f s]", s, t->delay/1000000.0);
+// } else if(t->delay >= 100*1000) {
+// sprintf(buf, "[%s %.1f ms]", s, t->delay/1000.0);
+// } else {
+// sprintf(buf, "[%s %.2f ms]", s, t->delay/1000.0);
+// }
+
+// CenterWithSpaces(*cx, *cy, t->name, poweredAfter, TRUE);
+// CenterWithWires(*cx, *cy, buf, poweredBefore, poweredAfter);
+
+// *cx += POS_WIDTH;
+// break;
+// }
+// case ELEM_FORMATTED_STRING: {
+// // Careful, string could be longer than fits in our space.
+// char str[POS_WIDTH*2];
+// memset(str, 0, sizeof(str));
+// char *srcStr = leaf->d.fmtdStr.string;
+// memcpy(str, srcStr, min(strlen(srcStr), POS_WIDTH*2 - 7));
+
+// char bot[100];
+// sprintf(bot, "{\"%s\"}", str);
+
+// int extra = 2*POS_WIDTH - strlen(leaf->d.fmtdStr.var);
+// PoweredText(poweredAfter);
+// NameText();
+// DrawChars(*cx + (extra/2), *cy + (POS_HEIGHT/2) - 1,
+// leaf->d.fmtdStr.var);
+// BodyText();
+
+// CenterWithWiresWidth(*cx, *cy, bot, poweredBefore, poweredAfter,
+// 2*POS_WIDTH);
+// *cx += 2*POS_WIDTH;
+// break;
+// }
+// case ELEM_UART_RECV:
+// case ELEM_UART_SEND:
+// CenterWithWires(*cx, *cy,
+// (which == ELEM_UART_RECV) ? "{UART RECV}" : "{UART SEND}",
+// poweredBefore, poweredAfter);
+// CenterWithSpaces(*cx, *cy, leaf->d.uart.name, poweredAfter, TRUE);
+// *cx += POS_WIDTH;
+// break;
+
+// default:
+// poweredAfter = DrawEndOfLine(which, leaf, cx, cy, poweredBefore);
+// break;
+// }
+
+// // And now we can enter the element into the display matrix so that the
+// // UI routines know what element is at position (gx, gy) when the user
+// // clicks there, and so that we know where to put the cursor if this
+// // element is selected.
+
+// // Don't use original cx0, as an end of line element might be further
+// // along than that.
+// cx0 = *cx - POS_WIDTH;
+
+// int gx = cx0/POS_WIDTH;
+// int gy = cy0/POS_HEIGHT;
+// if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
+// DM_BOUNDS(gx, gy);
+
+// DisplayMatrix[gx][gy] = leaf;
+// DisplayMatrixWhich[gx][gy] = which;
+
+// int xadj = 0;
+// switch(which) {
+// case ELEM_ADD:
+// case ELEM_SUB:
+// case ELEM_MUL:
+// case ELEM_DIV:
+// case ELEM_FORMATTED_STRING:
+// DM_BOUNDS(gx-1, gy);
+// DisplayMatrix[gx-1][gy] = leaf;
+// DisplayMatrixWhich[gx-1][gy] = which;
+// xadj = POS_WIDTH*FONT_WIDTH;
+// break;
+// }
+
+// if(which == ELEM_COMMENT) {
+// int i;
+// for(i = 0; i < ColsAvailable; i++) {
+// DisplayMatrix[i][gy] = leaf;
+// DisplayMatrixWhich[i][gy] = ELEM_COMMENT;
+// }
+// xadj = (ColsAvailable-1)*POS_WIDTH*FONT_WIDTH;
+// }
+
+// int x0 = X_PADDING + cx0*FONT_WIDTH;
+// int y0 = Y_PADDING + cy0*FONT_HEIGHT;
+
+// if(leaf->selectedState != SELECTED_NONE && leaf == Selected) {
+// SelectionActive = TRUE;
+// }
+// switch(leaf->selectedState) {
+// case SELECTED_LEFT:
+// Cursor.left = x0 + FONT_WIDTH - 4 - xadj;
+// Cursor.top = y0 - FONT_HEIGHT/2;
+// Cursor.width = 2;
+// Cursor.height = POS_HEIGHT*FONT_HEIGHT;
+// break;
+
+// case SELECTED_RIGHT:
+// Cursor.left = x0 + (POS_WIDTH-1)*FONT_WIDTH - 5;
+// Cursor.top = y0 - FONT_HEIGHT/2;
+// Cursor.width = 2;
+// Cursor.height = POS_HEIGHT*FONT_HEIGHT;
+// break;
+
+// case SELECTED_ABOVE:
+// Cursor.left = x0 + FONT_WIDTH/2 - xadj;
+// Cursor.top = y0 - 2;
+// Cursor.width = (POS_WIDTH-2)*FONT_WIDTH + xadj;
+// Cursor.height = 2;
+// break;
+
+// case SELECTED_BELOW:
+// Cursor.left = x0 + FONT_WIDTH/2 - xadj;
+// Cursor.top = y0 + (POS_HEIGHT-1)*FONT_HEIGHT +
+// FONT_HEIGHT/2 - 2;
+// Cursor.width = (POS_WIDTH-2)*(FONT_WIDTH) + xadj;
+// Cursor.height = 2;
+// break;
+
+// default:
+// break;
+// }
+
+// return poweredAfter;
+// }
//-----------------------------------------------------------------------------
// Draw a particular subcircuit with its top left corner at *cx and *cy (in
@@ -922,145 +926,145 @@ cmp:
// element, else FALSE. This is needed to colour all the wires correctly,
// since the colouring indicates whether a wire is energized.
//-----------------------------------------------------------------------------
-BOOL DrawElement(int which, void *elem, int *cx, int *cy, BOOL poweredBefore)
-{
- BOOL poweredAfter;
-
- int cx0 = *cx, cy0 = *cy;
- ElemLeaf *leaf = (ElemLeaf *)elem;
-
- SetBkColor(Hdc, InSimulationMode ? HighlightColours.simBg :
- HighlightColours.bg);
- NormText();
-
- if(elem == Selected && !InSimulationMode) {
- EmphText();
- ThisHighlighted = TRUE;
- } else {
- ThisHighlighted = FALSE;
- }
-
- switch(which) {
- case ELEM_SERIES_SUBCKT: {
- int i;
- ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
- poweredAfter = poweredBefore;
- for(i = 0; i < s->count; i++) {
- poweredAfter = DrawElement(s->contents[i].which,
- s->contents[i].d.any, cx, cy, poweredAfter);
- }
- break;
- }
- case ELEM_PARALLEL_SUBCKT: {
- int i;
- ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
- int widthMax = CountWidthOfElement(which, elem, (*cx)/POS_WIDTH);
- int heightMax = CountHeightOfElement(which, elem);
-
- poweredAfter = FALSE;
-
- int lowestPowered = -1;
- int downBy = 0;
- for(i = 0; i < p->count; i++) {
- BOOL poweredThis;
-
- poweredThis = DrawElement(p->contents[i].which,
- p->contents[i].d.any, cx, cy, poweredBefore);
-
- if(InSimulationMode) {
- if(poweredThis) poweredAfter = TRUE;
- PoweredText(poweredThis);
- }
-
- while((*cx - cx0) < widthMax*POS_WIDTH) {
- int gx = *cx/POS_WIDTH;
- int gy = *cy/POS_HEIGHT;
-
- if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
-
- DM_BOUNDS(gx, gy);
- DisplayMatrix[gx][gy] = PADDING_IN_DISPLAY_MATRIX;
- DisplayMatrixWhich[gx][gy] = ELEM_PADDING;
-
- char buf[256];
- int j;
- for(j = 0; j < POS_WIDTH; j++) {
- buf[j] = '-';
- }
- buf[j] = '\0';
- DrawChars(*cx, *cy + (POS_HEIGHT/2), buf);
- *cx += POS_WIDTH;
- }
-
- *cx = cx0;
- int justDrewHeight = CountHeightOfElement(p->contents[i].which,
- p->contents[i].d.any);
- *cy += POS_HEIGHT*justDrewHeight;
-
- downBy += justDrewHeight;
- if(poweredThis) {
- lowestPowered = downBy - 1;
- }
- }
- *cx = cx0 + POS_WIDTH*widthMax;
- *cy = cy0;
-
- int j;
- BOOL needWire;
-
- if(*cx/POS_WIDTH != ColsAvailable) {
- needWire = FALSE;
- for(j = heightMax - 1; j >= 1; j--) {
- if(j <= lowestPowered) PoweredText(poweredAfter);
- if(DisplayMatrix[*cx/POS_WIDTH - 1][*cy/POS_HEIGHT + j]) {
- needWire = TRUE;
- }
- if(needWire) VerticalWire(*cx - 1, *cy + j*POS_HEIGHT);
- }
- // stupid special case
- if(lowestPowered == 0 && InSimulationMode) {
- EmphText();
- DrawChars(*cx - 1, *cy + (POS_HEIGHT/2), "+");
- }
- }
-
- PoweredText(poweredBefore);
- needWire = FALSE;
- for(j = heightMax - 1; j >= 1; j--) {
- if(DisplayMatrix[cx0/POS_WIDTH][*cy/POS_HEIGHT + j]) {
- needWire = TRUE;
- }
- if(needWire) VerticalWire(cx0 - 1, *cy + j*POS_HEIGHT);
- }
-
- break;
- }
- default:
- poweredAfter = DrawLeaf(which, leaf, cx, cy, poweredBefore);
- break;
- }
-
-
- NormText();
- return poweredAfter;
-}
+// BOOL DrawElement(int which, void *elem, int *cx, int *cy, BOOL poweredBefore)
+// {
+// BOOL poweredAfter;
+
+// int cx0 = *cx, cy0 = *cy;
+// ElemLeaf *leaf = (ElemLeaf *)elem;
+
+// SetBkColor(Hdc, InSimulationMode ? HighlightColours.simBg :
+// HighlightColours.bg);
+// NormText();
+
+// if(elem == Selected && !InSimulationMode) {
+// EmphText();
+// ThisHighlighted = TRUE;
+// } else {
+// ThisHighlighted = FALSE;
+// }
+
+// switch(which) {
+// case ELEM_SERIES_SUBCKT: {
+// int i;
+// ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
+// poweredAfter = poweredBefore;
+// for(i = 0; i < s->count; i++) {
+// poweredAfter = DrawElement(s->contents[i].which,
+// s->contents[i].d.any, cx, cy, poweredAfter);
+// }
+// break;
+// }
+// case ELEM_PARALLEL_SUBCKT: {
+// int i;
+// ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
+// int widthMax = CountWidthOfElement(which, elem, (*cx)/POS_WIDTH);
+// int heightMax = CountHeightOfElement(which, elem);
+
+// poweredAfter = FALSE;
+
+// int lowestPowered = -1;
+// int downBy = 0;
+// for(i = 0; i < p->count; i++) {
+// BOOL poweredThis;
+
+// poweredThis = DrawElement(p->contents[i].which,
+// p->contents[i].d.any, cx, cy, poweredBefore);
+
+// if(InSimulationMode) {
+// if(poweredThis) poweredAfter = TRUE;
+// PoweredText(poweredThis);
+// }
+
+// while((*cx - cx0) < widthMax*POS_WIDTH) {
+// int gx = *cx/POS_WIDTH;
+// int gy = *cy/POS_HEIGHT;
+
+// if(CheckBoundsUndoIfFails(gx, gy)) return FALSE;
+
+// DM_BOUNDS(gx, gy);
+// DisplayMatrix[gx][gy] = PADDING_IN_DISPLAY_MATRIX;
+// DisplayMatrixWhich[gx][gy] = ELEM_PADDING;
+
+// char buf[256];
+// int j;
+// for(j = 0; j < POS_WIDTH; j++) {
+// buf[j] = '-';
+// }
+// buf[j] = '\0';
+// DrawChars(*cx, *cy + (POS_HEIGHT/2), buf);
+// *cx += POS_WIDTH;
+// }
+
+// *cx = cx0;
+// int justDrewHeight = CountHeightOfElement(p->contents[i].which,
+// p->contents[i].d.any);
+// *cy += POS_HEIGHT*justDrewHeight;
+
+// downBy += justDrewHeight;
+// if(poweredThis) {
+// lowestPowered = downBy - 1;
+// }
+// }
+// *cx = cx0 + POS_WIDTH*widthMax;
+// *cy = cy0;
+
+// int j;
+// BOOL needWire;
+
+// if(*cx/POS_WIDTH != ColsAvailable) {
+// needWire = FALSE;
+// for(j = heightMax - 1; j >= 1; j--) {
+// if(j <= lowestPowered) PoweredText(poweredAfter);
+// if(DisplayMatrix[*cx/POS_WIDTH - 1][*cy/POS_HEIGHT + j]) {
+// needWire = TRUE;
+// }
+// if(needWire) VerticalWire(*cx - 1, *cy + j*POS_HEIGHT);
+// }
+// // stupid special case
+// if(lowestPowered == 0 && InSimulationMode) {
+// EmphText();
+// DrawChars(*cx - 1, *cy + (POS_HEIGHT/2), "+");
+// }
+// }
+
+// PoweredText(poweredBefore);
+// needWire = FALSE;
+// for(j = heightMax - 1; j >= 1; j--) {
+// if(DisplayMatrix[cx0/POS_WIDTH][*cy/POS_HEIGHT + j]) {
+// needWire = TRUE;
+// }
+// if(needWire) VerticalWire(cx0 - 1, *cy + j*POS_HEIGHT);
+// }
+
+// break;
+// }
+// default:
+// poweredAfter = DrawLeaf(which, leaf, cx, cy, poweredBefore);
+// break;
+// }
+
+
+// NormText();
+// return poweredAfter;
+// }
//-----------------------------------------------------------------------------
// Draw the rung that signals the end of the program. Kind of useless but
// do it anyways, for convention.
//-----------------------------------------------------------------------------
-void DrawEndRung(int cx, int cy)
-{
- int i;
- char *str = "[END]";
- int lead = (POS_WIDTH - strlen(str))/2;
- ThisHighlighted = TRUE;
- for(i = 0; i < lead; i++) {
- DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
- }
- DrawChars(cx + i, cy + (POS_HEIGHT/2), str);
- i += strlen(str);
- for(; i < ColsAvailable*POS_WIDTH; i++) {
- DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
- }
-}
+// void DrawEndRung(int cx, int cy)
+// {
+// int i;
+// char *str = "[END]";
+// int lead = (POS_WIDTH - strlen(str))/2;
+// ThisHighlighted = TRUE;
+// for(i = 0; i < lead; i++) {
+// DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
+// }
+// DrawChars(cx + i, cy + (POS_HEIGHT/2), str);
+// i += strlen(str);
+// for(; i < ColsAvailable*POS_WIDTH; i++) {
+// DrawChars(cx + i, cy + (POS_HEIGHT/2), "-");
+// }
+// }
diff --git a/ldmicro/helpdialog.cpp b/ldmicro/helpdialog.cpp
index cf23caa..a800f61 100644
--- a/ldmicro/helpdialog.cpp
+++ b/ldmicro/helpdialog.cpp
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
//#include <commctrl.h>
-#include <richedit.h>
+//#include <richedit.h>
#include "ldmicro.h"
@@ -100,209 +100,209 @@ static int TitleHeight;
#define RICH_EDIT_HEIGHT(h) \
((((h) - 3 + (FONT_HEIGHT/2)) / FONT_HEIGHT) * FONT_HEIGHT)
-static void SizeRichEdit(int a)
-{
- RECT r;
- GetClientRect(HelpDialog[a], &r);
-
- SetWindowPos(RichEdit[a], HWND_TOP, 6, 3, r.right - 6,
- RICH_EDIT_HEIGHT(r.bottom), 0);
-}
-
-static BOOL Resizing(RECT *r, int wParam)
-{
- BOOL touched = FALSE;
- if(r->right - r->left < 650) {
- int diff = 650 - (r->right - r->left);
- if(wParam == WMSZ_RIGHT || wParam == WMSZ_TOPRIGHT ||
- wParam == WMSZ_BOTTOMRIGHT)
- {
- r->right += diff;
- } else {
- r->left -= diff;
- }
- touched = TRUE;
- }
-
- if(!(wParam == WMSZ_LEFT || wParam == WMSZ_RIGHT)) {
- int h = r->bottom - r->top - TitleHeight - 5;
- if(RICH_EDIT_HEIGHT(h) != h) {
- int diff = h - RICH_EDIT_HEIGHT(h);
- if(wParam == WMSZ_TOP || wParam == WMSZ_TOPRIGHT ||
- wParam == WMSZ_TOPLEFT)
- {
- r->top += diff;
- } else {
- r->bottom -= diff;
- }
- touched = TRUE;
- }
- }
-
- return !touched;
-}
-
-static void MakeControls(int a)
-{
- HMODULE re = LoadLibrary("RichEd20.dll");
- if(!re) oops();
-
- RichEdit[a] = CreateWindowEx(0, RICHEDIT_CLASS,
- "", WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | ES_READONLY |
- ES_MULTILINE | WS_VSCROLL,
- 0, 0, 100, 100, HelpDialog[a], NULL, Instance, NULL);
-
- SendMessage(RichEdit[a], WM_SETFONT, (WPARAM)FixedWidthFont, TRUE);
- SendMessage(RichEdit[a], EM_SETBKGNDCOLOR, (WPARAM)0, RGB(0, 0, 0));
-
- SizeRichEdit(a);
-
- int i;
- BOOL nextSubHead = FALSE;
- for(i = 0; Text[a][i]; i++) {
- char *s = Text[a][i];
-
- CHARFORMAT cf;
- cf.cbSize = sizeof(cf);
- cf.dwMask = CFM_BOLD | CFM_COLOR;
- cf.dwEffects = 0;
- if((s[0] == '=') ||
- (Text[a][i+1] && Text[a][i+1][0] == '='))
- {
- cf.crTextColor = RGB(255, 255, 110);
- } else if(s[3] == '|' && s[4] == '|') {
- cf.crTextColor = RGB(255, 110, 255);
- } else if(s[0] == '>' || nextSubHead) {
- // Need to make a copy because the strings we are passed aren't
- // mutable.
- char copy[1024];
- if(strlen(s) >= sizeof(copy)) oops();
- strcpy(copy, s);
-
- int j;
- for(j = 1; copy[j]; j++) {
- if(copy[j] == ' ' && copy[j-1] == ' ')
- break;
- }
- BOOL justHeading = (copy[j] == '\0');
- copy[j] = '\0';
- cf.crTextColor = RGB(110, 255, 110);
- SendMessage(RichEdit[a], EM_SETCHARFORMAT, SCF_SELECTION,
- (LPARAM)&cf);
- SendMessage(RichEdit[a], EM_REPLACESEL, (WPARAM)FALSE,
- (LPARAM)copy);
- SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
+// static void SizeRichEdit(int a)
+// {
+// RECT r;
+// GetClientRect(HelpDialog[a], &r);
+
+// SetWindowPos(RichEdit[a], HWND_TOP, 6, 3, r.right - 6,
+// RICH_EDIT_HEIGHT(r.bottom), 0);
+// }
+
+// static BOOL Resizing(RECT *r, int wParam)
+// {
+// BOOL touched = FALSE;
+// if(r->right - r->left < 650) {
+// int diff = 650 - (r->right - r->left);
+// if(wParam == WMSZ_RIGHT || wParam == WMSZ_TOPRIGHT ||
+// wParam == WMSZ_BOTTOMRIGHT)
+// {
+// r->right += diff;
+// } else {
+// r->left -= diff;
+// }
+// touched = TRUE;
+// }
+
+// if(!(wParam == WMSZ_LEFT || wParam == WMSZ_RIGHT)) {
+// int h = r->bottom - r->top - TitleHeight - 5;
+// if(RICH_EDIT_HEIGHT(h) != h) {
+// int diff = h - RICH_EDIT_HEIGHT(h);
+// if(wParam == WMSZ_TOP || wParam == WMSZ_TOPRIGHT ||
+// wParam == WMSZ_TOPLEFT)
+// {
+// r->top += diff;
+// } else {
+// r->bottom -= diff;
+// }
+// touched = TRUE;
+// }
+// }
+
+// return !touched;
+// }
+
+// static void MakeControls(int a)
+// {
+// HMODULE re = LoadLibrary("RichEd20.dll");
+// if(!re) oops();
+
+// RichEdit[a] = CreateWindowEx(0, RICHEDIT_CLASS,
+// "", WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | ES_READONLY |
+// ES_MULTILINE | WS_VSCROLL,
+// 0, 0, 100, 100, HelpDialog[a], NULL, Instance, NULL);
+
+// SendMessage(RichEdit[a], WM_SETFONT, (WPARAM)FixedWidthFont, TRUE);
+// SendMessage(RichEdit[a], EM_SETBKGNDCOLOR, (WPARAM)0, RGB(0, 0, 0));
+
+// SizeRichEdit(a);
+
+// int i;
+// BOOL nextSubHead = FALSE;
+// for(i = 0; Text[a][i]; i++) {
+// char *s = Text[a][i];
+
+// CHARFORMAT cf;
+// cf.cbSize = sizeof(cf);
+// cf.dwMask = CFM_BOLD | CFM_COLOR;
+// cf.dwEffects = 0;
+// if((s[0] == '=') ||
+// (Text[a][i+1] && Text[a][i+1][0] == '='))
+// {
+// cf.crTextColor = RGB(255, 255, 110);
+// } else if(s[3] == '|' && s[4] == '|') {
+// cf.crTextColor = RGB(255, 110, 255);
+// } else if(s[0] == '>' || nextSubHead) {
+// // Need to make a copy because the strings we are passed aren't
+// // mutable.
+// char copy[1024];
+// if(strlen(s) >= sizeof(copy)) oops();
+// strcpy(copy, s);
+
+// int j;
+// for(j = 1; copy[j]; j++) {
+// if(copy[j] == ' ' && copy[j-1] == ' ')
+// break;
+// }
+// BOOL justHeading = (copy[j] == '\0');
+// copy[j] = '\0';
+// cf.crTextColor = RGB(110, 255, 110);
+// SendMessage(RichEdit[a], EM_SETCHARFORMAT, SCF_SELECTION,
+// (LPARAM)&cf);
+// SendMessage(RichEdit[a], EM_REPLACESEL, (WPARAM)FALSE,
+// (LPARAM)copy);
+// SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
- // Special case if there's nothing except title on the line
- if(!justHeading) {
- copy[j] = ' ';
- }
- s += j;
- cf.crTextColor = RGB(255, 110, 255);
- nextSubHead = !nextSubHead;
- } else {
- cf.crTextColor = RGB(255, 255, 255);
- }
-
- SendMessage(RichEdit[a], EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- SendMessage(RichEdit[a], EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)s);
- SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
-
- if(Text[a][i+1]) {
- SendMessage(RichEdit[a], EM_REPLACESEL, FALSE, (LPARAM)"\r\n");
- SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
- }
- }
-
- SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)0, (LPARAM)0);
-}
+// // Special case if there's nothing except title on the line
+// if(!justHeading) {
+// copy[j] = ' ';
+// }
+// s += j;
+// cf.crTextColor = RGB(255, 110, 255);
+// nextSubHead = !nextSubHead;
+// } else {
+// cf.crTextColor = RGB(255, 255, 255);
+// }
+
+// SendMessage(RichEdit[a], EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+// SendMessage(RichEdit[a], EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)s);
+// SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
+
+// if(Text[a][i+1]) {
+// SendMessage(RichEdit[a], EM_REPLACESEL, FALSE, (LPARAM)"\r\n");
+// SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
+// }
+// }
+
+// SendMessage(RichEdit[a], EM_SETSEL, (WPARAM)0, (LPARAM)0);
+// }
//-----------------------------------------------------------------------------
// Window proc for the help dialog.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK HelpProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- int a = (hwnd == HelpDialog[0] ? 0 : 1);
- switch (msg) {
- case WM_SIZING: {
- RECT *r = (RECT *)lParam;
- return Resizing(r, wParam);
- break;
- }
- case WM_SIZE:
- SizeRichEdit(a);
- break;
-
- case WM_ACTIVATE:
- case WM_KEYDOWN:
- SetFocus(RichEdit[a]);
- break;
+// static LRESULT CALLBACK HelpProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// int a = (hwnd == HelpDialog[0] ? 0 : 1);
+// switch (msg) {
+// case WM_SIZING: {
+// RECT *r = (RECT *)lParam;
+// return Resizing(r, wParam);
+// break;
+// }
+// case WM_SIZE:
+// SizeRichEdit(a);
+// break;
+
+// case WM_ACTIVATE:
+// case WM_KEYDOWN:
+// SetFocus(RichEdit[a]);
+// break;
- case WM_DESTROY:
- case WM_CLOSE:
- HelpWindowOpen[a] = FALSE;
- // fall through
- default:
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
+// case WM_DESTROY:
+// case WM_CLOSE:
+// HelpWindowOpen[a] = FALSE;
+// // fall through
+// default:
+// return DefWindowProc(hwnd, msg, wParam, lParam);
+// }
- return 1;
-}
+// return 1;
+// }
//-----------------------------------------------------------------------------
// Create the class for the help window.
//-----------------------------------------------------------------------------
-static void MakeClass(void)
-{
- WNDCLASSEX wc;
- memset(&wc, 0, sizeof(wc));
- wc.cbSize = sizeof(wc);
-
- wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC |
- CS_DBLCLKS;
- wc.lpfnWndProc = (WNDPROC)HelpProc;
- wc.hInstance = Instance;
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
- wc.lpszClassName = "LDmicroHelp";
- wc.lpszMenuName = NULL;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hIcon = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000),
- IMAGE_ICON, 32, 32, 0);
- wc.hIconSm = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000),
- IMAGE_ICON, 16, 16, 0);
-
- RegisterClassEx(&wc);
-}
-
-void ShowHelpDialog(BOOL about)
-{
- int a = about ? 1 : 0;
- if(HelpWindowOpen[a]) {
- SetForegroundWindow(HelpDialog[a]);
- return;
- }
-
- MakeClass();
-
- char *s = about ? "About LDmicro" : "LDmicro Help";
- HelpDialog[a] = CreateWindowEx(0, "LDmicroHelp", s,
- WS_OVERLAPPED | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX |
- WS_SIZEBOX,
- 100, 100, 650, 300+10*FONT_HEIGHT, NULL, NULL, Instance, NULL);
- MakeControls(a);
+// static void MakeClass(void)
+// {
+// WNDCLASSEX wc;
+// memset(&wc, 0, sizeof(wc));
+// wc.cbSize = sizeof(wc);
+
+// wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC |
+// CS_DBLCLKS;
+// wc.lpfnWndProc = (WNDPROC)HelpProc;
+// wc.hInstance = Instance;
+// wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+// wc.lpszClassName = "LDmicroHelp";
+// wc.lpszMenuName = NULL;
+// wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+// wc.hIcon = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000),
+// IMAGE_ICON, 32, 32, 0);
+// wc.hIconSm = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000),
+// IMAGE_ICON, 16, 16, 0);
+
+// RegisterClassEx(&wc);
+// }
+
+// void ShowHelpDialog(BOOL about)
+// {
+// int a = about ? 1 : 0;
+// if(HelpWindowOpen[a]) {
+// SetForegroundWindow(HelpDialog[a]);
+// return;
+// }
+
+// MakeClass();
+
+// char *s = about ? "About LDmicro" : "LDmicro Help";
+// HelpDialog[a] = CreateWindowEx(0, "LDmicroHelp", s,
+// WS_OVERLAPPED | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX |
+// WS_SIZEBOX,
+// 100, 100, 650, 300+10*FONT_HEIGHT, NULL, NULL, Instance, NULL);
+// MakeControls(a);
- ShowWindow(HelpDialog[a], TRUE);
- SetFocus(RichEdit[a]);
+// ShowWindow(HelpDialog[a], TRUE);
+// SetFocus(RichEdit[a]);
- HelpWindowOpen[a] = TRUE;
+// HelpWindowOpen[a] = TRUE;
- RECT r;
- GetClientRect(HelpDialog[a], &r);
- TitleHeight = 300 - r.bottom;
+// RECT r;
+// GetClientRect(HelpDialog[a], &r);
+// TitleHeight = 300 - r.bottom;
- GetWindowRect(HelpDialog[a], &r);
- Resizing(&r, WMSZ_TOP);
- SetWindowPos(HelpDialog[a], HWND_TOP, r.left, r.top, r.right - r.left,
- r.bottom - r.top, 0);
-}
+// GetWindowRect(HelpDialog[a], &r);
+// Resizing(&r, WMSZ_TOP);
+// SetWindowPos(HelpDialog[a], HWND_TOP, r.left, r.top, r.right - r.left,
+// r.bottom - r.top, 0);
+// }
diff --git a/ldmicro/includes/naminglist.h b/ldmicro/includes/naminglist.h
deleted file mode 100644
index 43a7a76..0000000
--- a/ldmicro/includes/naminglist.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _NAMING_LIST
-#define _NAMING_LIST
-
-extern HWND NamingList;
-
-// void NamingListProc(NMHDR *h);
-
-int NameList_AddName(LPCTSTR Name, int Index);
-double NameList_RegisterVolt(LPCTSTR Name, double volt); //Forcefully set voltage will not be accessible outside the cpp file
-double NameList_SetVolt(int Index, double volt); //Set voltage if current voltage>specified voltage
-double NameList_DeRegisterVolt(LPCTSTR Name); //Send a message to rest of the components to set new voltage
-void NamingListProc(NMHDR *h);
-
-
-// void ConfigureNamingList(int type,int PinOnProcessor, MCUPort);
-#endif
diff --git a/ldmicro/lang.cpp b/ldmicro/lang.cpp
index 67952bc..084c766 100644
--- a/ldmicro/lang.cpp
+++ b/ldmicro/lang.cpp
@@ -42,8 +42,7 @@ typedef struct LangTag {
// These are the actual translation tables, so should be included in just
// one place.
-//#include "obj/lang-tables.h"
-#define LDLANG_EN
+#include "obj/lang-tables.h"
char *_(char *in)
{
diff --git a/ldmicro/obj/helptext.cpp b/ldmicro/obj/helptext.cpp
deleted file mode 100644
index 16d60fd..0000000
--- a/ldmicro/obj/helptext.cpp
+++ /dev/null
@@ -1,3877 +0,0 @@
-// generated by txt2c.pl from
-#include <stdlib.h>
-#ifdef LDLANG_DE
-char *HelpTextDe[] = {
- "",
- "EINF�HRUNG",
- "===========",
- "",
- "LDmicro erzeugt einen systemspezifischen Code f�r einige Microchip PIC16",
- "und Atmel AVR Mikroprozessoren. �blicherweise wird die Software f�r diese",
- "Prozessoren in Programmsprachen, wie Assembler, C oder BASIC geschrieben.",
- "Ein Programm, welches in einer dieser Sprachen abgefasst ist, enth�lt",
- "eine Anweisungsliste. Auch sind die diese Sprachen sehr leistungsf�hig",
- "und besonders gut geeignet f�r die Architektur dieser Prozessoren,",
- "welche diese Anweisungsliste intern abarbeiten.",
- "",
- "Programme f�r speicherprogrammierbare Steuerungen (SPS) andererseits,",
- "werden oftmals im Kontaktplan (KOP = ladder logic) geschrieben.",
- "Ein einfaches Programm, k�nnte wie folgt aussehen:",
- "",
- " || ||",
- " || Xbutton1 Tdon Rchatter Yred ||",
- " 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
- " || | ||",
- " || Xbutton2 Tdof | ||",
- " ||-------]/[---------[TOF 2.000 s]-+ ||",
- " || ||",
- " || ||",
- " || ||",
- " || Rchatter Ton Tneu Rchatter ||",
- " 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " ||------[END]---------------------------------------------------------||",
- " || ||",
- " || ||",
- "",
- " (TON ist eine Anzugsverz�gerung, TOF eine Abfallverz�gerung.",
- " Die --] [-- Anweisungen bedeuten Eing�nge, die sich �hnlich, wie Relais-",
- " kontakte verhalten. Die --( )-- Anweisungen bedeuten Ausg�nge, die sich",
- " �hnlich, wie Relaisspulen verhalten. Viele gute Bezugsquellen werden f�r",
- " KOP im Internet oder sonst wo angeboten; Einzelheiten zu dieser speziellen",
- " Ausf�hrung werden weiter unten angegeben.)",
- "",
- "Einige Unterschiede sind jedoch offensichtlich:",
- "",
- "* Das Programm wird in einem grafischen Format dargestellt",
- " und nicht mit einer aus Anweisungen bestehenden Textliste. Viele",
- " Anwender werden dies zun�chst als besser verst�ndlich auffassen.",
- "",
- "* Diese Programme erscheinen wie einfachste Schaltpl�ne, mit",
- " Relaiskontakten (Eing�ngen) and Spulen (Ausg�ngen). Dies ist recht",
- " intuitiv f�r Programmierer, die �ber Kenntnisse der Theorie von",
- " Elektroschaltpl�nen verf�gen.",
- "",
- "* Der �ladder logic compiler� �bernimmt was wo berechnet wird.",
- " Es ist nicht notwendig einen Code zu schreiben, um zu errechnen, wann",
- " der Status (Zustand) der Ausg�nge neu bestimmt werden muss, z.B. auf",
- " Grund einer �nderung eines Eingangs oder Timers. Auch braucht man die",
- " Reihenfolge der Berechnungen nicht anzugeben; die SPS-Hilfsprogramme",
- " �bernehmen dies.",
- "",
- "LDmicro kompiliert �ladder logic� (KOP) in PIC16- oder AVR-Code.",
- "Die folgenden Prozessoren werden unterst�tzt:",
- "",
- " * PIC16F877",
- " * PIC16F628",
- " * PIC16F876 (ungetestet)",
- " * PIC16F88 (ungetestet)",
- " * PIC16F819 (ungetestet)",
- " * PIC16F887 (ungetestet)",
- " * PIC16F886 (ungetestet)",
- " * ATmega8 (ungetestet)",
- " * ATmega16 (ungetestet)",
- " * ATmega32 (ungetestet)",
- " * ATmega128",
- " * ATmega64",
- " * ATmega162 (ungetestet)",
- "",
- "Es w�re einfach noch weitere AVR- oder PIC16-Prozessoren zu unterst�tzen,",
- "aber ich habe keine M�glichkeit diese zu testen. Falls Sie einen",
- "bestimmten ben�tigen, so nehmen Sie Kontakt mit mir auf und ich werde",
- "sehen, was ich tun kann.",
- "",
- "Mit LDmicro k�nnen Sie ein Kontaktplan-Programm zeichnen bzw. entwickeln.",
- "Auch k�nnen Sie dies in Realzeit mit Ihrem Computer simulieren. Wenn",
- "Sie dann �berzeugt sind, dass Ihr Programm korrekt ist, so k�nnen",
- "Sie die Pins, entsprechend dem Programm als Ein- oder Ausg�nge, dem",
- "Mikroprozessor zuweisen. Nach der Zuweisung der Pins k�nnen Sie den PIC-",
- "oder AVR-Code f�r Ihr Programm kompilieren. Der Compiler erzeugt eine",
- "Hex-Datei, mit dem Sie dann Ihren Mikroprozessor programmieren. Dies",
- "ist mit jedem PIC/AVR-Programmer m�glich.",
- "",
- "LDmicro wurde entworfen, um in etwa mit den meisten kommerziellen",
- "SPS-Systemen �hnlich zu sein. Es gibt einige Ausnahmen und viele Dinge",
- "sind ohnehin kein Standard in der Industrie. Lesen Sie aufmerksam die",
- "Beschreibung jeder Anweisung, auch wenn Ihnen diese vertraut erscheint.",
- "Dieses Dokument setzt ein Grundwissen an Kontaktplan-Programmierung",
- "und der Struktur von SPS-Software voraus (wie: der Ausf�hrungszyklus,",
- "Eing�nge lesen, rechnen und Ausg�nge setzen).",
- "",
- "",
- "WEITERE ZIELE",
- "=============",
- "",
- "Es ist auch m�glich einen ANSI C - Code zu erzeugen. Diesen k�nnen",
- "Sie dann f�r jeden Prozessor verwenden, f�r den Sie einen C-Compiler",
- "besitzen. Sie sind dann aber selbst verantwortlich, den Ablauf zu",
- "bestimmen. Das hei�t, LDmicro erzeugt nur ein Stammprogramm f�r einen",
- "Funktions- SPS-Zyklus. Sie m�ssen den SPS-Zyklus bei jedem Durchlauf",
- "aufrufen und auch die Ausf�hrung (Implementierung) der E/A-Funktionen,",
- "die der SPS-Zyklus abruft (wie: lesen/schreiben, digitaler Eingang usw.).",
- "F�r mehr Einzelheiten: Siehe die Kommentare in dem erzeugten Quellcode.",
- "",
- "Ganz zuletzt kann LDmicro auch f�r eine virtuelle Maschine einen",
- "prozessor-unabh�ngigen Byte-Code erzeugen, welche mit der KOP-Kodierung",
- "(ladder logic) laufen soll. Ich habe eine Beispiel-Anwendung des",
- "VM/Interpreters vorgesehen, in ziemlich gutem C geschrieben. Dieses",
- "Anwendungsziel wird halbwegs auf jeder Plattform funktionieren, so lange",
- "Sie Ihre eigene VM vorsehen. Dies k�nnte f�r solche Anwendungen n�tzlich",
- "sein, f�r die Sie KOP (ladder logic) als Datentransfer-Sprache verwenden",
- "m�chten, um ein gr��eres Programm anzupassen. F�r weitere Einzelheiten:",
- "Siehe die Kommentare in dem Beispiel-Interpreter.",
- "",
- "",
- "OPTIONEN DER BEFEHLSZEILEN ",
- "==========================",
- "",
- "ldmicro.exe l�uft normalerweise ohne eine Befehlszeilen-Option.",
- "Das hei�t, dass Sie nur ein Tastenk�rzel zu dem Programm ben�tigen",
- "oder es auf dem Desktop abspeichern und dann auf das Symbol (die Ikone)",
- "doppelklicken, um es laufen zu lassen. Danach k�nnen Sie alles ausf�hren,",
- "was das GUI (Graphical User Interface) zul�sst.",
- "",
- "Wenn man an LDmicro einen alleinstehenden Dateinamen in der Befehlszeile",
- "vergeben hat (z. B. �ldmicro.exe asd.ld�), wird LDmicro versuchen �asd.ld�",
- "zu �ffnen, falls diese existiert. Dies bedeutet, dass man ldmicro.exe",
- "mit .ld Dateien verbinden kann, sodass dies automatisch abl�uft, wenn",
- "man auf eine .ld Datei doppelklickt.",
- "",
- "Wenn man an LDmicro das Argument in der Befehlszeile in folgender Form",
- "vergeben hat: �ldmicro.exe /c src.ld dest.hex�, so wird es versuchen",
- "�src.ld� zu kompilieren und unter �dest.hex� abzuspeichern. LDmicro endet",
- "nach dem Kompilieren, unabh�ngig davon, ob die Kompilierung erfolgreich",
- "war oder nicht. Alle Meldungen werden auf der Konsole ausgegeben. Dieser",
- "Modus ist hilfreich, wenn man LDmicro von der Befehlszeile laufen",
- "aus l�sst.",
- "",
- "",
- "GRUNDLAGEN",
- "==========",
- "",
- "Wenn Sie LDmicro ohne Argumente aufrufen, so beginnt es als ein leeres",
- "Programm. Wenn Sie LDmicro mit dem Namen eines �ladder� (KOP)-Programms",
- "(z.B. xxx.ld) in der Befehlszeile �ffnen, dann wird es versuchen dieses",
- "Programm am Anfang zu laden.",
- "",
- "LDmicro verwendet sein eigenes internes Format f�r das Programm und",
- "man kann kein logisches Zeichen aus einem anderen (Fremd-)Programm",
- "importieren.",
- "",
- "Falls Sie nicht ein schon vorhandenes Programm laden, dann wird Ihnen",
- "ein Programm mit einem leeren Netzwerk geliefert. In dieses k�nnen Sie",
- "einen Befehl einf�gen; z. B. k�nnten Sie auch eine Reihe von Kontakten",
- "einf�gen (Anweisung -> Kontakte Einf�gen), die zun�chst mit �Xneu�",
- "bezeichnet werden. �X� bedeutet, dass der Kontakt auf einen Eingang",
- "des Mikroprozessors festgelegt ist. Diesen Pin k�nnen Sie sp�ter zuweisen,",
- "nachdem Sie den Mikroprozessor gew�hlt haben und die Kontakte",
- "umbenannt haben. Der erste Buchstabe zeigt an, um welche Art Objekt es",
- "sich handelt. Zum Beispiel:",
- "",
- " * XName -- Auf einen Eingang des Mikroprozessors festgelegt",
- " * YName -- Auf einen Ausgang des Mikroprozessors festgelegt",
- " * RName -- Merker: Ein Bit im Speicher (Internes Relais)",
- " * TName -- Ein Timer; Anzugs- oder Abfallverz�gerung",
- " * CName -- Ein Z�hler, Aufw�rts- oder Abw�rtsz�hler",
- " * AName -- Eine Ganzzahl, von einem A/D-Wandler eingelesen",
- " * Name -- Eine Allzweck-Variable als Ganzzahl",
- "",
- "W�hlen Sie den Rest des Namens, sodass dieser beschreibt, was das Objekt",
- "bewirkt und das dieser auch einmalig im Programm ist. Der gleiche Name",
- "bezieht sich immer auf das gleiche Objekt im Programm. Es w�re zum",
- "Beispiel falsch eine Anzugsverz�gerung (TON) �TVerz�g� zu nennen und im",
- "selben Programm eine Abfallverz�gerung �TVerz�g� (TOF), weil jeder Z�hler",
- "(oder Timer) seinen eigenen Speicher ben�tigt. Andererseits w�re es",
- "korrekt einen �Speichernden Timer� (RTO) �TVerz�g� zu nennen und eine",
- "entsprechende R�cksetz-Anweisung (RES) = �TVerz�g�, weil in diesem",
- "Fall beide Befehle dem gleichen Timer gelten.",
- "",
- "Die Namen von Variablen k�nnen aus Buchstaben, Zahlen und Unter-",
- "strichen (_) bestehen. Der Name einer Variablen darf nicht mit einer",
- "Nummer beginnen. Die Namen von Variablen sind fallabh�ngig.",
- "",
- "Ein Befehl f�r eine gew�hnliche Variable (MOV, ADD, EQU, usw.), kann",
- "mit Variablen mit jedem Namen arbeiten. Das bedeutet, dass diese Zugang",
- "zu den Timer- und Z�hler-Akkumulatoren haben. Das kann manchmal recht",
- "hilfreich sein; zum Beispiel kann man damit pr�fen, ob die Z�hlung eines",
- "Timers in einem bestimmten Bereich liegt.",
- "",
- "Die Variablen sind immer 16-Bit Ganzzahlen. Das hei�t sie k�nnen von",
- "-32768 bis 32767 reichen. Die Variablen werden immer als vorzeichen-",
- "behaftet behandelt. Sie k�nnen auch Buchstaben als Dezimalzahlen festlegen",
- "(0, 1234, -56). Auch k�nnen Sie ASCII-Zeichenwerte (�A�, �z�) festlegen,",
- "indem Sie die Zeichen in �Auslassungszeichen� einf�gen. Sie k�nnen",
- "ein ASCII-Zeichen an den meisten Stellen verwenden, an denen Sie eine",
- "Dezimalzahl verwenden k�nnen.",
- "",
- "Am unteren Ende der Maske (Bildanzeige) sehen Sie eine Liste aller",
- "Objekte (Anweisungen, Befehle) des Programms. Diese Liste wird vom",
- "Programm automatisch erzeugt; es besteht somit keine Notwendigkeit diese",
- "von Hand auf dem Laufenden zu halten. Die meisten Objekte ben�tigen",
- "keine Konfiguration. �XName�, �YName�, und �AName� Objekte allerdings,",
- "m�ssen einem Pin des Mikroprozessors zugeordnet werden. W�hlen Sie zuerst",
- "welcher Prozessor verwendet wird (Voreinstellungen -> Prozessor). Danach",
- "legen Sie Ihre E/A Pins fest, indem Sie in der Liste auf diese jeweils",
- "doppelklicken.",
- "",
- "Sie k�nnen das Programm ver�ndern, indem Sie Anweisungen (Befehle)",
- "einf�gen oder l�schen. Die Schreibmarke (cursor)im Programm blinkt,",
- "um die momentan gew�hlte Anweisung und den Einf�gungspunkt anzuzeigen.",
- "Falls diese nicht blinkt, so dr�cken Sie den <Tabulator> oder klicken",
- "Sie auf eine Anweisung. Jetzt k�nnen Sie die momentane Anweisung l�schen",
- "oder eine neue Anweisung einf�gen; links oder rechts (in Reihenschaltung)",
- "oder �ber oder unter (in Parallelschaltung) mit der gew�hlten Anweisung.",
- "Einige Handhabungen sind nicht erlaubt, so zum Beispiel weitere",
- "Anweisungen rechts von einer Spule.",
- "",
- "Das Programm beginnt mit nur einem Netzwerk. Sie k�nnen mehr Netzwerke",
- "hinzuf�gen, indem Sie �Netzwerk Einf�gen Davor/Danach� im Programm-Men�",
- "w�hlen. Den gleichen Effekt k�nnten Sie erzielen, indem Sie viele",
- "komplizierte parallele Unterschaltungen in einem einzigen Netzwerk",
- "unterbringen. Es ist aber �bersichtlicher, mehrere Netzwerke zu verwenden.",
- "",
- "Wenn Sie Ihr Programm fertig geschrieben haben, so k�nnen Sie dieses",
- "mit der Simulation testen. Danach k�nnen Sie es in eine Hex-Datei f�r",
- "den zugedachten Mikroprozessor kompilieren.",
- "",
- "",
- "SIMULATION",
- "==========",
- "",
- "Um den Simulationsbetrieb einzugeben, w�hlen Sie �Simulieren ->",
- "Simulationsbetrieb� oder dr�cken Sie <Strg+M>. Das Programm wird",
- "im Simulationsbetrieb unterschiedlich dargestellt. Es gibt keine",
- "Schreibmarke (cursor) mehr. Die �erregten� Anweisungen erscheinen hellrot,",
- "die �nicht erregten� erscheinen grau. Dr�cken Sie die Leertaste, um das",
- "SPS-Programm nur einen einzelnen Zyklus durchlaufen zu lassen. W�hlen",
- "Sie f�r einen kontinuierlichen Umlauf in Echtzeit �Simulieren -> Start",
- "Echtzeit-Simulation� oder dr�cken Sie <Strg+R>. Die Maske (Bildanzeige)",
- "des Programms wird jetzt in Echtzeit, entsprechend der �nderungen des",
- "Status (des Zustands) des Programms aktualisiert.",
- "",
- "Sie k�nnen den Status (Zustand) eines Eingangs im Programm einstellen,",
- "indem Sie auf den jeweiligen auf der Liste am unteren Ende der",
- "Maske (Bildanzeige) doppelklicken oder auf die jeweilige �XName�",
- "Kontakt-Anweisung im Programm. Wenn Sie den Status (Zustand) eines",
- "Eingangs-Pins �ndern, so wird diese �nderung nicht unmittelbar in",
- "der Maske (Bildanzeige) wiedergegeben, sondern erst wenn sich die",
- "SPS im zyklischen Umlauf befindet. Das geschieht automatisch wenn das",
- "SPS-Programm in Echtzeit-Simulation l�uft, oder wenn Sie die Leertaste",
- "dr�cken.",
- "",
- "",
- "KOMPILIEREN ZUM SYSTEMSPEZIFISCHEN CODE",
- "=======================================",
- "",
- "Letztlich ist es dann nur sinnvoll eine .hex Datei zu erzeugen, mit",
- "der Sie Ihren Mikroprozessor programmieren k�nnen. Zun�chst m�ssen",
- "Sie die Teilenummer des Mikroprozessors im Men� �Voreinstellungen ->",
- "Prozessor� w�hlen. Danach m�ssen jedem �XName� oder �YName� Objekt",
- "einen E/A-Pin zuweisen. Tun Sie dies, indem auf den Namen des Objekts",
- "doppelklicken, welcher sich in der Liste ganz unten in der Maske",
- "(Bildanzeige) befindet. Ein Dialogfenster wird dann erscheinen und Sie",
- "k�nnen daraufhin einen noch nicht vergebenen Pin von der Liste aussuchen.",
- "",
- "Als n�chstes m�ssen Sie die Zykluszeit w�hlen, mit der Sie das",
- "Programm laufen lassen wollen, auch m�ssen Sie dem Compiler mitteilen",
- "mit welcher Taktgeschwindigkeit der Prozessor arbeiten soll. Diese",
- "Einstellungen werden im Men� �Voreinstellungen -> Prozessor Parameter...�",
- "vorgenommen. �blicherweise sollten Sie die Zykluszeit nicht �ndern,",
- "denn diese ist auf 10ms voreingestellt, dies ist ein guter Wert f�r",
- "die meisten Anwendungen. Tippen Sie die Frequenz des Quarzes (oder des",
- "Keramik-Resonators) ein, mit der Sie den Prozessor betreiben wollen und",
- "klicken auf Okay.",
- "",
- "Jetzt k�nnen Sie einen Code von Ihrem Programm erzeugen. W�hlen Sie",
- "�Kompilieren -> Kompilieren� oder �Kompilieren -> Kompilieren unter...�,",
- "falls Sie vorher Ihr Programm schon kompiliert haben und einen neuen Namen",
- "f�r die Ausgangsdatei vergeben wollen. Wenn Ihr Programm fehlerfrei ist,",
- "wird LDmicro eine Intel IHEX Datei erzeugen, mit der sich Ihr Prozessor",
- "programmieren l�sst.",
- "",
- "Verwenden Sie hierzu irgendeine Programmier Soft- und Hardware, die Sie",
- "besitzen, um die Hex-Datei in den Mikroprozessor zu laden. Beachten Sie",
- "die Einstellungen f�r die Konfigurationsbits (fuses)! Bei den PIC16",
- "Prozessoren sind diese Konfigurationsbits bereits in der Hex-Datei",
- "enthalten. Die meisten Programmiersoftwares schauen automatisch nach",
- "diesen. F�r die AVR-Prozessoren m�ssen Sie die Konfigurationsbits von",
- "Hand einstellen.",
- "",
- "",
- "ANWEISUNGS-VERZEICHNIS",
- "======================",
- "",
- "> KONTAKT, SCHLIESSER XName RName YName",
- " ----] [---- ----] [---- ----] [----",
- "",
- "Wenn ein �unwahres� Signal diese Anweisung erreicht, so ist das",
- "Ausgangssignal �unwahr�. Wenn ein �wahres� Signal diese Anweisung",
- "erreicht, so ist das Ausgangssignal �wahr�. Dies nur, falls der",
- "vorliegende Eingangspin, Ausgangspin oder eines Merkers (Hilfsrelais)",
- "�wahr� ist, anderenfalls ist es unwahr. Diese Anweisung fragt den Status",
- "(Zustand) eines Eingangspins, Ausgangspins oder Merkers (Hilfsrelais) ab.",
- "",
- "",
- "> KONTAKT, �FFNER XName RName YName",
- " ----]/[---- ----]/[---- ----]/[----",
- "",
- "Wenn ein �unwahres� Signal diese Anweisung erreicht, so ist das",
- "Ausgangssignal �unwahr�. Wenn ein �wahres� Signal diese Anweisung",
- "erreicht, so ist das Ausgangssignal �wahr�. Dies nur, falls der",
- "vorliegende Eingangspin, Ausgangspin oder der Merker (= internes",
- "Hilfsrelais) �unwahr� ist, anderenfalls ist es �unwahr�. Diese Anweisung",
- "fragt den Status (Zustand) eines Eingangspins, Ausgangspins oder Merkers",
- "(Hilfsrelais) ab. Dies ist das Gegenteil eines Schlie�ers.",
- "",
- "",
- "> SPULE, NORMAL (MERKER,AUSGANG) RName YName",
- " ----( )---- ----( )----",
- "",
- "Wenn ein �unwahres� Signal diese Anweisung erreicht, so wird der",
- "vorliegende Merker (Hilfsrelais) oder Ausgangspin nicht angesteuert. Wenn",
- "ein �wahres� Signal diese Anweisung erreicht, so wird der vorliegende",
- "Merker (Hilfsrelais) oder Ausgangspin angesteuert. Es ist nicht sinnvoll",
- "dieser Spule eine Eingangsvariable zuzuweisen. Diese Anweisung muss",
- "ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> SPULE, NEGIERT (MERKER,AUSGANG) RName YName",
- " ----(/)---- ----(/)----",
- "",
- "Wenn ein �wahres� Signal diese Anweisung erreicht, so wird der vorliegende",
- "Merker (Hilfsrelais)oder Ausgangspin nicht angesteuert. Wenn ein",
- "�unwahres� Signal diese Anweisung erreicht, so wird der vorliegende Merker",
- "(Hilfsrelais) oder Ausgangspin angesteuert. Es ist nicht sinnvoll dieser",
- "Spule eine Eingangsvariable zuzuweisen. Dies ist das Gegenteil einer",
- "normalen Spule. Diese Anweisung muss im Netzwerk ganz rechts stehen.",
- "",
- "",
- "> SPULE, SETZEN RName YName",
- " ----(S)---- ----(S)----",
- "",
- "Wenn ein �wahres� Signal diese Anweisung erreicht, so wird der vorliegende",
- "Merker (Hilfsrelais)oder Ausgangspin auf �wahr� gesetzt. Anderenfalls",
- "bleibt der Status (Zustand) des Merkers (Hilfsrelais) oder Ausgangspins",
- "unver�ndert. Diese Anweisung kann nur den Status (Zustand) einer Spule",
- "von �unwahr� nach �wahr� ver�ndern, insofern wird diese �blicherweise in",
- "einer Kombination mit einer R�cksetz-Anweisung f�r eine Spule verwendet.",
- "Diese Anweisung muss ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> SPULE, R�CKSETZEN RName YName",
- " ----(R)---- ----(R)----",
- "",
- "Wenn ein �wahres� Signal diese Anweisung erreicht, so wird der vorliegende",
- "Merker (Hilfsrelais) oder Ausgangspin r�ckgesetzt. Anderenfalls bleibt der",
- "Status (Zustand) des Merkers (Hilfsrelais) oder Ausgangspins unver�ndert.",
- "Diese Anweisung kann nur den Status (Zustand) einer Spule von �wahr� nach",
- "�unwahr� ver�ndern, insofern wird diese �blicherweise in einer Kombination",
- "mit einer Setz-Anweisung f�r eine Spule verwendet. Diese Anweisung muss",
- "ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> ANZUGSVERZ�GERUNG Tdon",
- " -[TON 1.000 s]-",
- "",
- "Wenn ein Signal diese Anweisung erreicht, welches seinen Status",
- "(Zustand) von �unwahr� nach �wahr� �ndert, so bleibt das Ausgangssignal",
- "f�r 1,000 s �unwahr�, dann wird es �wahr�. Wenn ein Signal diese",
- "Anweisung erreicht, welches seinen Status (Zustand) von �wahr� nach",
- "�unwahr� �ndert, so wird das Ausgangssignal sofort �unwahr�. Der Timer",
- "wird jedes Mal r�ckgesetzt (bzw. auf Null gesetzt), wenn der Eingang",
- "�unwahr� wird. Der Eingang muss f�r 1000 aufeinanderfolgende Millisekunden",
- "�wahr� bleiben, bevor auch der Ausgang �wahr� wird. Die Verz�gerung",
- "ist konfigurierbar.",
- "",
- "Die �TName� Variable z�hlt, in der Einheit der jeweiligen Zykluszeit,",
- "von Null ab hoch. Der Ausgang der TON-Anweisung wird wahr, wenn die",
- "Z�hlervariable gr��er oder gleich der vorliegenden Verz�gerung ist.",
- "Es m�glich die Z�hlervariable an einer anderen Stelle im Programm zu",
- "bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
- "",
- "",
- "> ABFALLVERZ�GERUNG Tdoff",
- " -[TOF 1.000 s]-",
- "",
- "Wenn ein Signal diese Anweisung erreicht, welches seinen Status",
- "(Zustand) von �wahr� nach �unwahr� �ndert, so bleibt das Ausgangssignal",
- "f�r 1,000 s �wahr�, dann wird es �unwahr�. Wenn ein Signal diese",
- "Anweisung erreicht, welches seinen Status (Zustand) von �unwahr� nach",
- "�wahr� �ndert, so wird das Ausgangssignal sofort �wahr�. Der Timer wird",
- "jedes Mal r�ckgesetzt (bzw. auf Null gesetzt), wenn der Eingang �unwahr�",
- "wird. Der Eingang muss f�r 1000 aufeinanderfolgende Millisekunden �unwahr�",
- "bleiben, bevor auch der Ausgang �unwahr� wird. Die Verz�gerung ist",
- "konfigurierbar.",
- "",
- "Die �TName� Variable z�hlt, in der Einheit der jeweiligen Zykluszeit,",
- "von Null ab hoch. Der Ausgang der TOF Anweisung wird wahr, wenn die",
- "Z�hlervariable gr��er oder gleich der vorliegenden Verz�gerung ist.",
- "Es m�glich die Z�hlervariable an einer anderen Stelle im Programm zu",
- "bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
- "",
- "",
- "> SPEICHERNDER TIMER Trto",
- " -[RTO 1.000 s]-",
- "",
- "Diese Anweisung zeichnet auf, wie lange sein Eingang �wahr� gewesen",
- "ist. Wenn der Eingang f�r mindestens 1.000 s �wahr� gewesen ist, dann",
- "wird der Ausgang �wahr�. Andernfalls ist er �unwahr�. Der Eingang muss",
- "f�r 1000 aufeinanderfolgende Millisekunden �wahr� gewesen sein; wenn",
- "der Eingang f�r 0,6 s �wahr� war, dann �unwahr� f�r 2,0 s und danach f�r",
- "0,4 s wieder �wahr�, so wird sein Ausgang �wahr�. Nachdem der Ausgang",
- "�wahr� wurde, so bleibt er �wahr�, selbst wenn der Eingang �unwahr�",
- "wird, so lange der Eingang f�r l�nger als 1.000 s �wahr� gewesen ist.",
- "Der Timer muss deshalb von Hand mit Hilfe der R�cksetz-Anweisung",
- "r�ckgesetzt (auf Null gesetzt) werden.",
- "",
- "Die �TName� Variable z�hlt, in der Einheit der jeweiligen Zykluszeit,",
- "von Null ab hoch. Der Ausgang der RTO-Anweisung wird wahr, wenn die",
- "Z�hlervariable gr��er oder gleich der vorliegenden Verz�gerung ist.",
- "Es m�glich die Z�hlervariable an einer anderen Stelle im Programm zu",
- "bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
- "",
- "",
- "> R�CKSETZEN Trto Citems",
- " ----{RES}---- ----{RES}----",
- "",
- "Diese Anweisung r�cksetzt einen Timer oder Z�hler. TON oder TOF Timer",
- "werden automatisch r�ckgesetzt, wenn ihr Eingang �wahr� oder �unwahr�",
- "wird, somit ist die RES-Anweisung f�r diese Timer nicht erforderlich. RTO",
- "Timer und CTU/CTD Z�hler werden nicht automatisch r�ckgesetzt, somit",
- "m�ssen diese von Hand mit Hilfe der RES-Anweisung r�ckgesetzt (auf Null)",
- "werden. Wenn der Eingang �wahr� ist, so wird der Timer oder Z�hler",
- "r�ckgesetzt; wenn der Eingang �unwahr� ist, so erfolgt keine Aktion.",
- "Diese Anweisung muss ganz rechts im Netzwerk stehen.",
- "",
- " _",
- "> ONE-SHOT RISING, STEIGENDE FLANKE --[OSR_/ ]--",
- "",
- "Diese Anweisung wird normalerweise �unwahr� ausgewiesen. Wenn der Eingang",
- "der Anweisung w�hrend des momentanen Zyklus �wahr� ist und w�hrend des",
- "vorgehenden �unwahr� war, so wird der Ausgang �wahr�. Daher erzeugt diese",
- "Anweisung bei jeder steigenden Flanke einen Impuls f�r einen Zyklus.",
- "Diese Anweisung ist hilfreich, wenn Sie Ereignisse an der steigenden",
- "Flanke eines Signals ausl�sen wollen.",
- "",
- " _",
- "> ONE-SHOT FALLING, FALLENDE FLANKE --[OSF \\_ ]--",
- "",
- "Diese Anweisung wird normalerweise �unwahr� ausgewiesen. Wenn der Eingang",
- "der Anweisung w�hrend des momentanen Zyklus �unwahr� ist und w�hrend des",
- "vorgehenden �wahr� war, so wird der Ausgang �wahr�. Daher erzeugt diese",
- "Anweisung bei jeder fallenden Flanke einen Impuls f�r einen Zyklus.",
- "Diese Anweisung ist hilfreich, wenn Sie Ereignisse an der fallenden",
- "Flanke eines Signals ausl�sen wollen.",
- "",
- "",
- "> BR�CKE, �FFNUNG ----+----+---- ----+ +----",
- "",
- "Der Eingangszustand einer Br�cke ist immer gleich seinem Ausgangszustand.",
- "Der Ausgangszustands einer �ffnung ist immer �unwahr�. Diese Anweisungen",
- "sind bei der Fehlerbehebung (debugging) besonders hilfreich.",
- "",
- "",
- "> MASTER CONTROL RELAIS -{MASTER RLY}-",
- "",
- "",
- "Im Normalfall ist der Anfang (die linke Stromschiene) von jedem Netzwerk",
- "�wahr�. Wenn eine �Master Control Relais� Anweisung ausgef�hrt wird dessen",
- "Eingang �unwahr� ist, so werden die Anf�nge (die linke Stromschiene)",
- "aller folgenden Netzwerke �unwahr�. Das setzt sich fort bis die n�chste",
- "�Master Control Relais� Anweisung erreicht wird (unabh�ngig von dem",
- "Anfangszustand dieser Anweisung). Diese Anweisungen m�ssen daher als Paar",
- "verwendet werden: Eine (vielleicht abh�ngige), um den �gegebenenfalls",
- "gesperrten� Abschnitt zu starten und eine weitere, um diesen zu beenden.",
- "",
- "",
- "> TRANSFER, MOV {destvar := } {Tret := }",
- " -{ 123 MOV}- -{ srcvar MOV}-",
- "",
- "Wenn der Eingang dieser Anweisung �wahr� ist, so setzt diese die",
- "vorliegende Zielvariable gleich der vorliegenden Quellvariablen",
- "oder Konstanten. Wenn der Eingang dieser Anweisung �unwahr� ist, so",
- "geschieht nichts. Mit der TRANSFER-Anweisung (MOV) k�nnen Sie jede",
- "Variable zuweisen; dies schlie�t Timer und Z�hler Statusvariablen ein,",
- "welche mit einem vorgestellten �T� oder �C� unterschieden werden. Eine",
- "Anweisung zum Beispiel, die eine �0� in einen �TBewahrend� transferiert,",
- "ist �quivalent mit einer RES-Anweisung f�r diesen Timer. Diese Anweisung",
- "muss ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> ARITHMETISCHE OPERATIONEN {ADD kay :=} {SUB Ccnt :=}",
- " -{ 'a' + 10 }- -{ Ccnt - 10 }-",
- "",
- "> {MUL dest :=} {DIV dv := }",
- " -{ var * -990 }- -{ dv / -10000}-",
- "",
- "Wenn der Eingang einer dieser Anweisungen �wahr� ist, so setzt diese",
- "die vorliegende Zielvariable gleich dem vorliegenden arithmetischem",
- "Ausdruck. Die Operanden k�nnen entweder Variabelen (einschlie�lich Timer-",
- "und Z�hlervariabelen) oder Konstanten sein. Diese Anweisungen verwenden",
- "16-Bitzeichen Mathematik. Beachten Sie, dass das Ergebnis jeden Zyklus",
- "ausgewertet wird, wenn der Eingangszustand �wahr� ist. Falls Sie eine",
- "Variable inkrementieren oder dekrementieren (d.h., wenn die Zielvariable",
- "ebenfalls einer der Operanden ist), dann wollen Sie dies vermutlich",
- "nicht; normalerweise w�rden Sie einen Impuls (one-shot) verwenden,",
- "sodass die Variable nur bei einer steigenden oder fallenden Flanke des",
- "Eingangszustands ausgewertet wird. Dividieren k�rzt: D.h. 8 / 3 = 2.",
- "Diese Anweisungen m�ssen ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> VERGLEICHEN [var ==] [var >] [1 >=]",
- " -[ var2 ]- -[ 1 ]- -[ Ton]-",
- "",
- "> [var /=] [-4 < ] [1 <=]",
- " -[ var2 ]- -[ vartwo]- -[ Cup]-",
- "",
- "Wenn der Eingang dieser Anweisung �unwahr� ist, so ist der Ausgang",
- "auch �unwahr�. Wenn der Eingang dieser Anweisung �wahr� ist, dann ist",
- "Ausgang �wahr�; dies aber nur, wenn die vorliegende Bedingung �wahr�",
- "ist. Diese Anweisungen k�nnen zum Vergleichen verwendet werden, wie:",
- "Auf gleich, auf gr��er als, auf gr��er als oder gleich, auf ungleich,",
- "auf kleiner als, auf kleiner als oder gleich, eine Variable mit einer",
- "Variablen oder eine Variable mit einer 16-Bitzeichen-Konstanten.",
- "",
- "",
- "> Z�HLER CName CName",
- " --[CTU >=5]-- --[CTD >=5]�",
- "",
- "Ein Z�hler inkrementiert (CTU, aufw�rtsz�hlen) oder dekrementiert",
- "(CTD, abw�rtsz�hlen) die bezogene Z�hlung bei jeder steigenden Flanke",
- "des Eingangszustands des Netzwerks (d.h. der Eingangszustand des",
- "Netzwerks geht von �unwahr� auf �wahr� �ber). Der Ausgangszustand des",
- "Z�hlers ist �wahr�, wenn die Z�hler- variable ist gr��er oder gleich 5",
- "und andernfalls �unwahr�. Der Ausgangszustand des Netzwerks kann �wahr�",
- "sein, selbst wenn der Eingangszustand �unwahr� ist; das h�ngt lediglich",
- "von Z�hlervariablen ab. Sie k�nnen einer CTU- und CTD-Anweisung den",
- "gleichen Namen zuteilen, um den gleichen Z�hler zu inkrementieren und",
- "dekrementieren. Die RES-Anweisung kann einen Z�hler r�cksetzen oder auch",
- "eine gew�hnliche Variablen-Operation mit der Z�hlervariablen ausf�hren.",
- "",
- "",
- "> ZIRKULIERENDER Z�HLER CName",
- " --{CTC 0:7}--",
- "",
- "Ein zirkulierender Z�hler arbeitet wie ein normaler CTU-Z�hler, au�er",
- "nach der Erreichung seiner Obergrenze, r�cksetzt er seine Z�hlervariable",
- "auf Null. Zum Beispiel w�rde der oben gezeigte Z�hler, wie folgt z�hlen:",
- "0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2,.... Dies ist",
- "hilfreich in Kombination mit bedingten Anweisungen der Variablen�CName�;",
- "Sie k�nnen dies als eine Folgeschaltung verwenden. CTC-Z�hler takten",
- "mit der aufsteigenden Flanke der Eingangsbedingung des Netzwerks.",
- "Diese Anweisung muss ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> SCHIEBEREGISTER {SHIFT REG }",
- " -{ reg0..3 }-",
- "",
- "Ein Schieberegister besteht aus einer Reihe von Variablen. So best�nde",
- "zum Beispiel ein Schieberegister aus den Variablen �reg0�, �reg1�,",
- "�reg2�, and �reg3�. Der Eingang des Schieberegisters ist �reg0�. Bei",
- "jeder steigenden Flanke der Eingansbedingung des Netzwerks, schiebt das",
- "Schieberegister nach rechts. Dies bedeutet es wie folgt zuweist: �reg3�",
- "nach �reg2�, �reg2� nach �reg1� und �reg1� nach �reg0�. �reg0� bleibt",
- "unver�ndert. Ein gro�es Schieberegister kann leicht viel Speicherplatz",
- "belegen. Diese Anweisung muss ganz rechts im Netzwerk stehen.",
- "",
- "",
- "> NACHSCHLAG-TABELLE {dest := }",
- " -{ LUT[i] }-",
- "",
- "Eine Nachschlag-Tabelle ist eine Anordnung von n Werten. Wenn die",
- "Eingangsbedingung des Netzwerks �wahr� ist, so wird die Ganzzahl-Variable",
- "�dest� mit dem Eintrag in der Nachschlag-Tabelle gleichgesetzt, der der",
- "Ganzzahl-Variablen �i� entspricht. Das Verzeichnis beginnt bei Null,",
- "insofern muss sich �i� zwischen 0 und (n-1) befinden. Das Verhalten",
- "dieser Anweisung ist undefiniert, wenn sich die Werte des Verzeichnisses",
- "au�erhalb dieses Bereichs befinden.",
- "",
- "",
- "> N�HERUNGS-LINEAR-TABELLE {yvar :=}",
- " -{PWL[xvar] }-",
- "",
- "Dies ist eine gute Methode f�r die N�herungsl�sung einer komplizierten",
- "Funktion oder Kurve. Sie k�nnte zum Beispiel hilfreich sein, wenn Sie",
- "versuchen eine Eichkurve zu verwenden, um die rohe Ausgangsspannung",
- "eines F�hlers in g�nstigere Einheiten zu wandeln.",
- "",
- "Angenommen Sie versuchen eine N�herungsl�sung f�r eine Funktion zu finden,",
- "die eine Eingangs-Ganzzahlvariable �x� in Ausgangs-Ganzzahlvariable �y�",
- "wandelt. Einige Punkte der Funktion sind Ihnen bekannt; so w�rden Sie",
- "z.B. die folgenden kennen:",
- "",
- " f(0) = 2",
- " f(5) = 10",
- " f(10) = 50",
- " f(100) = 100",
- "",
- "Dies bedeutet, dass sich die Punkte",
- "",
- " (x0, y0) = ( 0, 2)",
- " (x1, y1) = ( 5, 10)",
- " (x2, y2) = ( 10, 50)",
- " (x3, y3) = (100, 100)",
- "",
- "in dieser Kurve befinden. Diese 4 Punkte k�nnen Sie in die Tabelle der",
- "�N�herungs-Linear�-Anweisung eintragen. Die �N�herungs-Linear�-Anweisung",
- "wird dann auf den Wert von �xvar� schauen und legt den Wert von �yvar�",
- "fest. Sie stellt �yvar� so ein, dass die �N�herungs-Linear�-Kurve sich",
- "durch alle Punkte bewegt, die Sie vorgegeben haben. Wenn Sie z.B. f�r",
- "�xvar� = 10 vorgegeben haben, dann stellt die Anweisung �yvar� auf gleich",
- "50 ein.",
- "",
- "Falls Sie dieser Anweisung einen Wert �xvar� zuweisen, der zwischen zwei",
- "Werten von �x� liegt, denen Sie Punkte zugeordnet haben, dann stellt die",
- "Anweisung �yvar� so ein, dass (�xvar�, �yvar�) in der geraden Linie liegt;",
- "diejenige die, die zwei Punkte in der Tabelle verbindet. Z.B. erzeugt",
- "�xvar� = 55 bei �yvar� = 75. Die beiden Punkte in der Tabelle sind (10,",
- "50) und (100, 100). 55 liegt auf halbem Weg zwischen 10 und 100 und 75",
- "liegt auf halbem Weg zwischen 50 und 100, somit liegt (55, 75) auf der",
- "Linie, die diese zwei Punkte verbindet.",
- "",
- "Die Punkte m�ssen in aufsteigender Reihenfolge der x-Koordinaten",
- "angegeben werden. Einige mathematische Operationen, erforderlich f�r",
- "bestimmte Nachschlag-Tabellen mit 16-Bit-Mathematik, kann man ggf. nicht",
- "ausf�hren. In diesem Falle gibt LDmicro eine Warnmeldung aus. So w�rde",
- "z.B. die folgende Nachschlag-Tabelle eine Fehlermeldung hervorrufen:",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (300, 300)",
- "",
- "Sie k�nnen diesen Fehler beheben, indem sie den Abstand zwischen den",
- "Punkten kleiner machen. So ist zum Beispiel die n�chste Tabelle �quivalent",
- "zur vorhergehenden, ruft aber keine Fehlermeldung hervor.",
- "",
- " (x0, y0) = ( 0, 2)",
- " (x1, y1) = (150, 150)",
- " (x2, y2) = (300, 300)",
- "",
- "Es wird kaum einmal notwendig sein, mehr als f�nf oder sechs Punkte",
- "zu verwenden. Falls Sie mehr Punkte hinzuf�gen, so vergr��ert dies",
- "Ihren Code und verlangsamt die Ausf�hrung. Falls Sie f�r �xvar� einen",
- "Wert vergeben, der gr��er ist, als die gr��te x-Koordinate der Tabelle",
- "oder kleiner, als die kleinste x-Koordinate in der Tabelle, so ist das",
- "Verhalten der Anweisung undefiniert. Diese Anweisung muss ganz rechts",
- "im Netzwerk stehen.",
- "",
- "",
- "> A/D-WANDLER EINLESEN AName",
- " --{READ ADC}--",
- "",
- "LDmicro kann einen Code erzeugen, der erm�glicht, die A/D-Wandler",
- "zu verwenden, die in manchen Mikroprozessoren vorgesehen sind.",
- "Wenn der Eingangszustand dieser Anweisung �wahr� ist, dann wird eine",
- "Einzellesung von dem A/D-Wandler entnommen und in der Variablen �AName�",
- "gespeichert. Diese Variable kann anschlie�end mit einer gew�hnlichen",
- "Ganzzahlvariablen bearbeitet werden (wie: Kleiner als, gr��er als,",
- "arithmetisch usw.). Weisen Sie �Axxx� in der gleichen Weise einen Pin",
- "zu, wie Sie einen Pin f�r einen digitalen Ein- oder Ausgang vergeben",
- "w�rden, indem auf diesen in der Liste unten in der Maske (Bildanzeige)",
- "doppelklicken. Wenn der Eingangszustand dieses Netzwerks �unwahr� ist,",
- "so wird die Variable �AName� unver�ndert belassen.",
- "",
- "F�r alle derzeitig unterst�tzten Prozessoren gilt: Eine 0 Volt Lesung",
- "am Eingang des A/D-Wandlers entspricht 0. Eine Lesung gleich der",
- "Versorgungsspannung (bzw. Referenzspannung) entspricht 1023. Falls Sie",
- "AVR-Prozessoren verwenden, so verbinden Sie AREF mit Vdd. (Siehe Atmel",
- "Datenblatt, dort wird eine Induktivit�t von 100�H empfohlen). Sie k�nnen",
- "arithmetische Operationen verwenden, um einen g�nstigeren Ma�stabfaktor",
- "festzulegen, aber beachten Sie, dass das Programm nur Ganzzahl-Arithmetik",
- "vorsieht. Allgemein sind nicht alle Pins als A/D-Wandler verwendbar. Die",
- "Software gestattet Ihnen nicht, einen Pin zuzuweisen, der kein A/D",
- "bzw. analoger Eingang ist. Diese Anweisung muss ganz rechts im Netzwerk",
- "stehen.",
- "",
- "",
- "> PULSWEITEN MODULATIONSZYKLUS FESTLEGEN duty_cycle",
- " -{PWM 32.8 kHz}-",
- "",
- "LDmicro kann einen Code erzeugen, der erm�glicht, die PWM-Peripherie",
- "zu verwenden, die in manchen Mikroprozessoren vorgesehen ist. Wenn die",
- "Eingangsbedingung dieser Anweisung �wahr� ist, so wird der Zyklus der",
- "PWM-Peripherie mit dem Wert der Variablen �duty cycle� gleichgesetzt. Der",
- "�duty cycle� muss eine Zahl zwischen 0 und 100 sein. 0 entspricht immer",
- "�low� und 100 entsprechend immer �high�. (Wenn Sie damit vertraut sind,",
- "wie die PWM-Peripherie funktioniert, so bemerken Sie, dass dies bedeutet,",
- "dass LDmicro die �duty cycle�-Variable automatisch prozentual zu den",
- "PWM-Taktintervallen skaliert [= den Ma�stabfaktor festlegt].)",
- "",
- "Sie k�nnen die PWM-Zielfrequenz in Hz definieren. Es kann vorkommen, dass",
- "die angegebene Frequenz nicht genau erreicht wird, das h�ngt davon ab,",
- "wie sich diese innerhalb der Taktfrequenz des Prozessors einteilt. LDmicro",
- "w�hlt dann die n�chst erreichbare Frequenz; falls der Fehler zu gro� ist,",
- "so wird eine Warnung ausgegeben. H�here Geschwindigkeiten k�nnen die",
- "Aufl�sung beeintr�chtigen.",
- "",
- "Diese Anweisung muss ganz rechts im Netzwerk stehen. Die �ladder",
- "logic�-Laufzeit verbraucht (schon) einen Timer, um die Zykluszeit",
- "zu messen. Dies bedeutet, dass die PWM nur bei den Mikroprozessoren",
- "verf�gbar ist, bei denen mindestens zwei geeignete Timer vorhanden sind.",
- "PWM verwendet den PIN CCP2 (nicht CCP1) bei den PIC16-Prozessoren und",
- "OC2 (nicht OC1A) bei den AVR-Prozessoren.",
- "",
- "",
- "> REMANENT MACHEN saved_var",
- " --{PERSIST}--",
- "",
- "Wenn der Eingangszustand dieser Anweisung �wahr� ist, so bewirkt",
- "dies, dass eine angegebene Ganzzahl-Variable automatisch im EEPROM",
- "gespeichert wird. Dies bedeutet, dass ihr Wert bestehen bleiben wird,",
- "auch wenn der Prozessor seine Versorgungsspannung verliert. Es ist",
- "nicht notwendig, die Variable an klarer Stelle im EEPROM zu speichern,",
- "dies geschieht automatisch, so oft sich der Wert der Variablen",
- "�ndert. Bei Spannungswiederkehr wird die Variable automatisch vom",
- "EEPROM zur�ckgespeichert. Falls eine Variable, die h�ufig ihren Wert",
- "�ndert, remanent (dauerhaft) gemacht wird, so k�nnte Ihr Prozessor sehr",
- "rasch verschlei�en, weil dieser lediglich f�r eine begrenzte Anzahl von",
- "Schreibbefehlen konstruiert ist (~100 000). Wenn der Eingangszustand des",
- "Netzwerks �unwahr� ist, so geschieht nichts. Diese Anweisung muss ganz",
- "rechts im Netzwerk stehen.",
- "",
- "",
- "> UART (SERIELL) EMPFANGEN var",
- " --{UART RECV}--",
- "",
- "LDmicro kann einen Code erzeugen, der erm�glicht UART zu verwenden,",
- "welcher in manchen Mikroprozessoren vorgesehen ist.",
- "Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
- "unterst�tzt. Konfigurieren Sie die Baudrate, indem Sie �Voreinstellungen",
- "-> Prozessor-Parameter� verwenden. Bestimmte Baudraten werden mit",
- "bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
- "LDmicro eine Warnmeldung.",
- "",
- "Wenn der Eingangszustand dieser Anweisung �unwahr� ist, so geschieht",
- "nichts. Wenn der Eingangszustand �wahr� ist, so versucht diese Anweisung",
- "ein einzelnes Schriftzeichen vom UART-Eingang zu empfangen. Wenn",
- "kein Schriftzeichen eingelesen wird, dann ist der Ausgangszustand",
- "�unwahr�. Wenn ein ASCII-Zeichen eingelesen wird, so wird sein Wert in",
- "�var� abgespeichert und der Ausgangszustand wird f�r einen einzelnen",
- "Zyklus �wahr�.",
- "",
- "",
- "> UART (SERIELL) SENDEN var",
- " --{UART SEND}--",
- "",
- "LDmicro kann einen Code erzeugen, der erm�glicht UART zu verwenden,",
- "welcher in manchen Mikroprozessoren vorgesehen ist.",
- "Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
- "unterst�tzt. Konfigurieren Sie die Baudrate, indem Sie �Voreinstellungen",
- "-> Prozessor-Parameter� verwenden. Bestimmte Baudraten werden mit",
- "bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
- "LDmicro eine Warnmeldung.",
- "",
- "Wenn der Eingangszustand dieser Anweisung �unwahr� ist, so geschieht",
- "nichts. Wenn der Eingangszustand �wahr� ist, so schreibt diese",
- "Anweisung ein einzelnes Schriftzeichen zum UART. Der ASCII-Wert des",
- "Schriftzeichens, welches gesendet werden soll, muss vorher in �var�",
- "abgespeichert worden sein. Der Ausgangszustand dieses Netzwerks ist",
- "�wahr�, wenn UART besch�ftigt ist (gerade dabei ein Schriftzeichen zu",
- "�bermitteln) und andernfalls �unwahr�.",
- "",
- "Denken Sie daran, dass einige Zeit zum Senden von Schriftzeichen",
- "beansprucht wird. �berpr�fen Sie den Ausgangszustand dieser Anweisung,",
- "sodass das erste Schriftzeichen bereits �bermittelt wurde, bevor Sie",
- "versuchen ein zweites Schriftzeichen zu �bermitteln. Oder verwenden Sie",
- "einen Timer, um eine Verz�gerung zwischen die Schriftzeichen f�gen. Sie",
- "d�rfen den Eingangszustand dieser Anweisung nur dann auf �wahr� setzen",
- "(bzw. ein Schriftzeichen �bermitteln), wenn der Ausgangszustand �unwahr�",
- "ist (bzw. UART unbesch�ftigt ist).",
- "",
- "Untersuchen Sie die �Formatierte Zeichenfolge�-Anweisung, bevor Sie",
- "diese Anweisung verwenden. Die �Formatierte Zeichenfolge�- Anweisung",
- "ist viel einfacher in der Anwendung und fast sicher f�hig, das zu tun,",
- "was Sie beabsichtigen.",
- "",
- " ",
- "> FORMATIERTE ZEICHENFOLGE �BER UART var",
- " -{\"Druck: \\3\\r\\n\"}-",
- "",
- "LDmicro kann einen Code erzeugen, der erm�glicht UART zu verwenden,",
- "welcher in manchen Mikroprozessoren vorgesehen ist.",
- "Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
- "unterst�tzt. Konfigurieren Sie die Baudrate, indem Sie �Voreinstellungen",
- "-> Prozessor-Parameter� verwenden. Bestimmte Baudraten werden mit",
- "bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
- "LDmicro eine Warnmeldung.",
- "",
- "Wenn der Eingangszustand des Netzwerks f�r diese Anweisung von �unwahr�",
- "auf �wahr� �bergeht, so beginnt diese eine vollst�ndige Zeichenfolge",
- "�ber den seriellen Anschluss zu senden. Wenn die Zeichenfolge die",
- "besondere Reihenfolge �\\3� enth�lt, dann wird diese Folge durch den Wert",
- "von �var� ersetzt, welcher automatisch in eine Zeichenfolge gewandelt",
- "wird. Die Variable wird formatiert, sodass diese exakt 3 Schriftzeichen",
- "�bernimmt. Falls die Variable zum Beispiel gleich 35 ist, dann wird die",
- "exakte ausgegebene Zeichenfolge, wie folgt aussehen: �Druck: 35\\r\\n�",
- "(beachten Sie das zus�tzliche Freizeichen). Wenn stattdessen die Variable",
- "gleich 1432 ist, so w�re das Verhalten der Anweisung undefiniert,",
- "weil 1432 mehr als drei Stellen hat. In diesem Fall w�re es notwendig",
- "stattdessen �\\4� zu verwenden.",
- "",
- "Falls die Variable negativ ist, so verwenden Sie stattdessen �\\-3d�",
- "(oder �\\-4d�). LDmicro wird hierdurch veranlasst eine vorgestellte",
- "Freistelle f�r positive Zahlen und ein vorgestelltes Minuszeichen f�r",
- "negative Zahlen auszugeben.",
- "",
- "Falls mehrere �Formatierte Zeichenfolge�-Anweisungen zugleich ausgegeben",
- "werden (oder wenn eine neue Zeichenfolge ausgegeben wird bevor die",
- "vorherige vollendet ist), oder auch wenn diese mit UART TX Anweisungen",
- "vermischt, so ist das Verhalten undefiniert.",
- "",
- "Es ist auch m�glich diese Anweisung f�r eine feste Zeichenfolge zu",
- "verwenden, die �ber den seriellen Anschluss gesendet wird, ohne den Wert",
- "einer Ganzzahlvariablen in den Text zu interpolieren. In diesem Fall",
- "f�gen Sie einfach diese spezielle Steuerungsfolge nicht ein.",
- "",
- "Verwenden Sie �\\\\� f�r einen zeichengetreuen verkehrten Schr�gstrich.",
- "Zus�tzlich zur Steuerungsfolge f�r die Interpolierung einer Ganzzahl-",
- "Variablen, sind die folgenden Steuerungszeichen erh�ltlich:",
- "",
- " * \\r -- carriage return Zeilenschaltung",
- " * \\n -- new line Zeilenwechsel",
- " * \\f -- form feed Formularvorschub",
- " * \\b -- backspace R�cksetzen",
- " * \\xAB -- character with ASCII value 0xAB (hex)",
- " -- Schriftzeichen mit ASCII-Wert 0xAB (hex)",
- "",
- "Der Ausgangszustand des Netzwerks dieser Anweisung ist �wahr�, w�hrend",
- "diese Daten �bertr�gt, ansonsten �unwahr�. Diese Anweisung ben�tigt eine",
- "gro�e Menge des Programmspeichers, insofern sollte sie sparsam verwendet",
- "werden. Die gegenw�rtige Umsetzung ist nicht besonders effizient, aber",
- "eine bessere w�rde �nderungen an s�mtlichen Ausl�ufern des Programms",
- "ben�tigen.",
- "",
- "",
- "EIN HINWEIS ZUR VERWENDUNG DER MATHEMATIK",
- "=========================================",
- "",
- "Denken Sie daran, dass LDmicro nur 16-Bit mathematische Operationen",
- "ausf�hrt. Dies bedeutet, dass das Endresultat jeder Berechnung,",
- "die Sie vornehmen, eine Ganzzahl zwischen -32768 und 32767 sein muss.",
- "Dies bedeutet auch, dass die Zwischenergebnisse Ihrer Berechnungen alle",
- "in diesem Bereich liegen m�ssen.",
- "",
- "Wollen wir zum Beispiel annehmen, dass Sie folgendes berechnen m�chten",
- "y = (1/x) * 1200, in der x zwischen 1 und 20 liegt.",
- "Dann liegt y zwischen 1200 und 60, was in eine 16-Bit Ganzzahl passt,",
- "so w�re es zumindest theoretisch m�glich diese Berechnung auszuf�hren.",
- "Es gibt zwei M�glichkeiten, wie Sie dies codieren k�nnten: Sie k�nnen",
- "die Reziproke (Kehrwert) ausf�hren and dann multiplizieren:",
- "",
- " || {DIV temp :=} ||",
- " ||---------{ 1 / x }----------||",
- " || ||",
- " || {MUL y := } ||",
- " ||----------{ temp * 1200}----------||",
- " || ||",
- "",
- "Oder Sie k�nnten einfach die Division in einem Schritt direkt vornehmen.",
- "",
- " || {DIV y :=} ||",
- " ||-----------{ 1200 / x }-----------||",
- "",
- "",
- "Mathematisch sind die zwei �quivalent; aber wenn Sie diese ausprobieren,",
- "so werden Sie herausfinden, dass die erste ein falsches Ergebnis von",
- "y = 0 liefert. Dies geschieht, weil die Variable einen Unterlauf",
- "[= resultatabh�ngige Kommaverschiebung] ergibt. So sei zum Beispiel x = 3,",
- "(1 / x) = 0.333, dies ist aber keine Ganzzahl; die Divisionsoperation",
- "n�hert dies, als 'temp = 0'. Dann ist y = temp * 1200 = 0. Im zweiten",
- "Fall gibt es kein Zwischenergebnis, welches einen Unterlauf [= resultats-",
- "abh�ngige Kommaverschiebung] ergibt, somit funktioniert dann alles.",
- "",
- "Falls Sie Probleme bei Ihren mathematischen Operationen erkennen,",
- "dann �berpr�fen Sie die Zwischenergebnisse auf Unterlauf [eine",
- "resultatabh�ngige Kommaverschiebung] (oder auch auf �berlauf, der dann",
- "im Programm in Umlauf kommt; wie zum Beispiel 32767 + 1 = -32768).",
- "Wann immer m�glich, w�hlen Sie Einheiten, deren Werte in einem Bereich",
- "von -100 bis 100 liegen.",
- "",
- "Falls Sie eine Variable um einen bestimmten Faktor vergr��ern m�ssen, tun",
- "Sie dies, indem Sie eine Multiplikation und eine Division verwenden. Um",
- "zum Beispiel y = 1.8 * x zu vergr��ern, berechnen Sie y = (9/5) * x,",
- "(was dasselbe ist, weil 1,8 = 9/5 ist), und codieren Sie dies als",
- "y = (9 * x)/5, indem Sie die Multiplikation zuerst ausf�hren.",
- "",
- " || {MUL temp :=} ||",
- " ||---------{ x * 9 }----------||",
- " || ||",
- " || {DIV y :=} ||",
- " ||-----------{ temp / 5 }-----------||",
- "",
- "",
- "Dies funktioniert mit allen x < (32767 / 9), oder x < 3640. Bei h�heren",
- "Werten w�rde die Variable �temp� �berflie�en. F�r x gibt es eine",
- "�hnliche Untergrenze.",
- "",
- "",
- "KODIER-STIL",
- "===========",
- "",
- "Ich gestatte mehrere Spulen in Parallelschaltung in einem einzigen",
- "Netzwerk unterzubringen. Das bedeutet, sie k�nnen ein Netzwerk, wie",
- "folgt schreiben:",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || Xb Yb ||",
- " ||-------] [------+-------( )-------||",
- " || | ||",
- " || | Yc ||",
- " || +-------( )-------||",
- " || ||",
- " ",
- "Anstatt diesem:",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yb ||",
- " 2 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yc ||",
- " 3 ||-------] [--------------( )-------||",
- " || ||",
- "",
- "Rein theoretisch bedeutet das, dass Sie irgendein Programm, als ein",
- "gigantisches Netzwerk, schreiben k�nnten. Und es best�nde �berhaupt",
- "keine Notwendigkeit mehrere Netzwerke zu verwenden. In der Praxis ist",
- "dies aber eine schlechte Idee, denn wenn Netzwerke komplexer werden, so",
- "werden sie auch schwieriger zu editieren, ohne L�schen und neu Schreiben",
- "von Anweisungen.",
- "",
- "Jedoch, ist es manchmal ein guter Einfall, verwandte Logik in einem",
- "einzelnen Netzwerk zusammenzufassen. Dies erzeugt einen beinahe",
- "identischen Code, als ob sie getrennte Netzwerke entworfen h�tten, es",
- "zeigt aber, dass diese Anweisungen (Logik) verwandt ist, wenn man diese",
- "im Netzwerk-Diagramm betrachtet.",
- "",
- " * * *",
- "",
- "Im Allgemeinen h�lt man es f�r eine schlechte Form, den Code in einer",
- "solchen Weise zu schreiben, dass sein Ergebnis von einer Folge von",
- "Netzwerken abh�ngt. So zum Beispiel ist der folgende Code nicht besonders",
- "gut, falls �xa� und �xb� jemals �wahr� w�rden.",
- "",
- " || Xa {v := } ||",
- " 1 ||-------] [--------{ 12 MOV}--||",
- " || ||",
- " || Xb {v := } ||",
- " ||-------] [--------{ 23 MOV}--||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || [v >] Yc ||",
- " 2 ||------[ 15]-------------( )-------||",
- " || ||",
- "",
- "Ich werde diese Regel brechen und indem ich dies so mache, entwerfe ich",
- "einen Code-Abschnitt, der erheblich kompakter ist. Hier zum Beispiel,",
- "zeige ich auf, wie ich eine 4-Bit bin�re Gr��e von �xb3:0� in eine",
- "Ganzzahl wandeln w�rde.",
- "",
- " || {v := } ||",
- " 3 ||-----------------------------------{ 0 MOV}--||",
- " || ||",
- " || Xb0 {ADD v :=} ||",
- " ||-------] [------------------{ v + 1 }-----------||",
- " || ||",
- " || Xb1 {ADD v :=} ||",
- " ||-------] [------------------{ v + 2 }-----------||",
- " || ||",
- " || Xb2 {ADD v :=} ||",
- " ||-------] [------------------{ v + 4 }-----------||",
- " || ||",
- " || Xb3 {ADD v :=} ||",
- " ||-------] [------------------{ v + 8 }-----------||",
- " || ||",
- "",
- "Falls die TRANSFER-Anweisung (MOV) an das untere Ende des Netzwerks",
- "gebracht w�rde, anstatt auf das obere, so w�rde der Wert von �v�, an",
- "anderer Stelle im Programm gelesen, gleich Null sein. Das Ergebnis dieses",
- "Codes h�ngt daher von der Reihenfolge ab, in welcher die Anweisungen",
- "ausgewertet werden. Im Hinblick darauf, wie hinderlich es w�re, diesen",
- "Code auf eine andere Weise zu schreiben, nehme ich dies so hin.",
- "",
- "",
- "BUGS",
- "====",
- "",
- "LDmicro erzeugt keinen sehr effizienten Code; es ist langsam in der",
- "Ausf�hrung und geht verschwenderisch mit dem Flash- und RAM-Speicher",
- "um. Trotzdem kann ein mittelgro�er PIC- oder AVR-Prozessor alles, was",
- "eine kleine SPS kann, somit st�rt dies mich nicht besonders.",
- "",
- "Die maximale L�nge der Variabelen-Bezeichnungen (-Namen) ist sehr",
- "begrenzt. Dies ist so, weil diese so gut in das KOP-Programm (ladder)",
- "passen. Somit sehe ich keine gute L�sung f�r diese Angelegenheit.",
- "",
- "Falls Ihr Programm zu gro� f�r die Zeit-, Programmspeicher- oder",
- "Datenspeicher-Beschr�nkungen des Prozessors ist, den Sie gew�hlt haben,",
- "so erhalten Sie keine Fehlermeldung. Es wird einfach irgendwo anders alles",
- "vermasseln. (Anmerkung: Das AVR STK500 gibt hierzu Fehlermeldungen aus.)",
- "",
- "Unsorgf�ltiges Programmieren bei den Datei �ffnen/Abspeichern-Routinen",
- "f�hren wahrscheinlich zu der M�glichkeit eines Absturzes oder es wird",
- "ein willk�rlicher Code erzeugt, der eine besch�digte oder b�sartige .ld",
- "Datei ergibt.",
- "",
- "Bitte berichten Sie zus�tzliche Bugs oder richten Sie Anfragen f�r neue",
- "Programm-Bestandteile an den Autor (in Englisch).",
- "",
- "Thanks to:",
- " * Marcelo Solano, for reporting a UI bug under Win98",
- " * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
- " PIC16F628 didn't work but also telling me how to fix it",
- " * Maxim Ibragimov, for reporting and diagnosing major problems",
- " with the till-then-untested ATmega16 and ATmega162 targets",
- " * Bill Kishonti, for reporting that the simulator crashed when the",
- " ladder logic program divided by zero",
- " * Mohamed Tayae, for reporting that persistent variables were broken",
- " on the PIC16F628",
- " * David Rothwell, for reporting several user interface bugs and a",
- " problem with the \"Export as Text\" function",
- "",
- "Particular thanks to Heinz Ullrich Noell, for this translation (of both",
- "the manual and the program's user interface) into German.",
- "",
- "",
- "COPYING, AND DISCLAIMER",
- "=======================",
- "",
- "DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
- "FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
- "AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
- "OF LDMICRO OR CODE GENERATED BY LDMICRO.",
- "",
- "This program is free software: you can redistribute it and/or modify it",
- "under the terms of the GNU General Public License as published by the",
- "Free Software Foundation, either version 3 of the License, or (at your",
- "option) any later version.",
- "",
- "This program is distributed in the hope that it will be useful, but",
- "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
- "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
- "for more details.",
- "",
- "You should have received a copy of the GNU General Public License along",
- "with this program. If not, see <http://www.gnu.org/licenses/>.",
- "",
- "",
- "Jonathan Westhues",
- "",
- "Rijswijk -- Dec 2004",
- "Waterloo ON -- Jun, Jul 2005",
- "Cambridge MA -- Sep, Dec 2005",
- " Feb, Mar 2006",
- "",
- "Email: user jwesthues, at host cq.cx",
- "",
- "",
- NULL
-};
-#endif
-
-#ifdef LDLANG_FR
-char *HelpTextFr[] = {
- "INTRODUCTION",
- "============",
- "",
- "LDmicro g�n�re du code natif pour certains microcontroleurs Microchip",
- "PIC16F et Atmel AVR. Usuellement les programmes de developpement pour ces",
- "microcontrolleurs sont �crits dans des langages comme l'assembleur , le",
- "C ou le Basic. Un programme qui utilise un de ces langages est une suite",
- "de commandes. Ces programmes sont puissants et adapt�s � l'architecture",
- "des processeurs, qui de fa�on interne ex�cutent une liste d'instructions.",
- "",
- "Les API (Automates Programmables Industriels, PLC en anglais, SPS en",
- "allemand) utilisent une autre voie et sont programm�s en Langage �",
- "Contacts (ou LADDER). Un programme simple est repr�sent� comme ceci :",
- "",
- "",
- " || ||",
- " || Xbutton1 Tdon Rchatter Yred ||",
- " 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
- " || | ||",
- " || Xbutton2 Tdof | ||",
- " ||-------]/[---------[TOF 2.000 s]-+ ||",
- " || ||",
- " || ||",
- " || ||",
- " || Rchatter Ton Tnew Rchatter ||",
- " 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " ||------[END]---------------------------------------------------------||",
- " || ||",
- " || ||",
- "",
- "(TON est une tempo travail; TOF est une tempo repos. les commandes --] [-- ",
- "repr�sentent des Entr�es, qui peuvent �tre des contacts de relais. Les ",
- "commandes --( )-- sont des Sorties, qui peuvent repr�senter des bobines de ",
- "relais. Beaucoup de r�f�rences de programmes de langage � contacts (LADDER) ",
- "existent sur Internet et sont � quelques d�tails pr�s, identiques � ",
- "l'impl�mentation repr�sent�e ci-dessus.",
- "",
- "Un certain nombre de diff�rences apparaissent entre les programmes en",
- "langage �volu�s ( C, Basic, Etc..) et les programmes pour API:",
- "",
- " * Le programme est repr�sent� dans un format graphique, et non",
- " comme une liste de commandes en format texte. Beaucoup de personnes",
- " trouve cela plus facile � comprendre.",
- "",
- " * Au niveau de base, le programme apparait comme un diagramme",
- " de circuit avec des contacts de relais (Entr�es) et des bobines",
- " (Sorties). Ceci est intuitif pour les programmeurs qui connaissent",
- " la th�orie des circuits �lectriques.",
- "",
- " * Le compilateur de langage � contacts v�rifie tout ceci lors",
- " de la compilation. Vous n'avez pas � �crire de code quand une",
- " Sortie est remplac�e et est remise en Entr�e ou si une temporisation",
- " est modifi�e, vous n'avez pas non plus � sp�cifier l'ordre o� les",
- " calculs doivent �tre effectu�s. L'outil API (PLC) s'occupe de cela",
- " pour vous.",
- "",
- "",
- "LDmicro compile le langage � contact (ladder) en code pour PIC16F ou",
- "AVR. Les processeurs suivants sont support�s:",
- "",
- " * PIC16F877",
- " * PIC16F628",
- " * PIC16F876 (non test�)",
- " * PIC16F88 (non test�)",
- " * PIC16F819 (non test�)",
- " * PIC16F887 (non test�)",
- " * PIC16F886 (non test�)",
- " * ATmega128",
- " * ATmega64",
- " * ATmega162 (non test�)",
- " * ATmega32 (non test�)",
- " * ATmega16 (non test�)",
- " * ATmega8 (non test�)",
- "",
- "Il doit �tre facile de supporter d'autres PIC ou AVR, mais je n'est",
- "aucun moyen pour les tester. Si vous en voulez un en particulier faites",
- "moi parvenir votre demande et je verrai ce que je peux faire.",
- "",
- "En utilisant LDmicro, vous dessinez un diagramme � contacts pour votre",
- "programme. Vous pouvez simuler le fonctionnement logique en temps r�el sur",
- "votre PC. Quand vous �tes convaincu que le fonctionnement est correct,",
- "vous pouvez affecter les broches du microcontroleur pour les Entr�es et",
- "Sorties, ensuite vous compilez votre programmeen code AVR ou PIC. Le",
- "fichier de sortie du compilateur est un fichier .HEX que vous devrez",
- "mettre dans le microcontroleur en utilisant un programmateur pour PIC",
- "ou AVR.",
- "",
- "",
- "LDmicro est con�u pour �tre similaire � la majorit� des API commerciaux.",
- "Il y a quelques exceptions, et une partie des possibilit�s n'est",
- "pas standard avec le mat�riel industriel. Lire attentivement la",
- "description de chaque instruction m�me si elle parait famili�re. Ce",
- "document consid�re que vous avez une connaisance de base du langage �",
- "contact et de la structure des logiciels pour automates programmables.",
- "Cycle d'ex�cution : Lecture des Entr�es -> Calculs -> Ecriture des Sorties",
- "",
- "",
- "CIBLES ADDITIONNELLES ",
- "=====================",
- "",
- "Il est aussi possible de g�n�rer du code ANSI C . Vous pouvez utiliser",
- "ceci pour n'importe quel processeur dont vous avez un compilateur C,",
- "mais le runtime est de votre responsabilit�. LDmicro g�r�re uniquement",
- "le source pour le cycle de l'API. Vous �tes responsable de l'appel de",
- "chaque s�quence du cycle et de l'impl�mentation de toutes les Entr�es",
- "/ Sorties (Lecture/Ecriture des Entr�es digitales, etc ...). Voir les",
- "commentaires dans le code source pour plus de d�tails.",
- "",
- "Finalement, LDmicro peut g�n�rer un code byte ind�pendant du processeur",
- "pour une machine virtuelle pr�vue pour faire fonctionner ce type de code.",
- "J'ai pr�vu un exemple simple d'impl�mentation d'un interpr�teur /VM",
- "�crit en code C le plus portable possible. La cible fonctionne juste sur",
- "quelques plateformes ou vous pouvez pr�voir votre VM. Ceci peut �tre utile",
- "pour des applications ou vous pouvez utiliser le languages � contacts",
- "comme du langage script pour customiser un programme important. Voir",
- "les commentaires dans l'exemple pour les d�tails.",
- "",
- "",
- "OPTIONS LIGNE DE COMMANDE",
- "=========================",
- "",
- "LDmicro.exe fonctionne normallement sans options de ligne de commande.",
- "Vous pouvez faire un raccourci vers le programme et le sauvegarder sur",
- "l'�cran , il suffit alors de faire un double clic pour le faire d�marrer",
- "et vous vous retrouvez ainsi dans l'interface utilisateur.",
- "",
- "Si un nom de fichier est pass� en ligne de de commande de LDmicro, (ex:",
- "`ldmicro.exe asd.ld'), alors LDmicro va essayer d'ouvrir `asd.ld', si",
- "il existe. Une erreur se produira si `asd.ld' n'existe pas. Vous avez",
- "la possibilit� d'associer LDmicro avec les fichiers d'extention .ld.",
- "Ceci permet � LDmicro de d�marrer automatiquement lors d'un double clic",
- "sur un fichier xxx.ld.",
- "",
- "Si les arguments de la ligne de commande sont pass�s sous la forme:",
- "`ldmicro.exe /c src.ld dest.hex', LDmicro compilera le programme`src.ld',",
- "et sauvegardera le fichier compil� sous`dest.hex'. Apr�s compilation",
- "LDmicro se termine, que la compilation soit correcte ou pas. Aucun",
- "message n'est affich� sur la console. Ce mode est pratique uniquement",
- "lorsque vous ex�cutez LDmicro en ligne de commande.",
- "",
- "",
- "BASES",
- "=====",
- "",
- "Si vous ex�cutez LDmicro sans arguments de ligne de commande, il d�marre",
- "avec un programme vide. Si vous d�marrer avec le nom d'un programme",
- "langage � contacts (xxx.ld) en ligne de commande, il va essayer de",
- "charger le programme au d�marrage. LDmicro utilise son format interne",
- "pour le programme , il ne peut pas importer de programmes �dit�s par",
- "d'autres outils.",
- "",
- "Si vous ne chargez pas un programme existant, LDmicro d�marre en ins�rant",
- "une ligne vide. Vous pouvez ajouter les instructions pour votre programme:",
- "par exemple ajouter un jeu de contacts (Instruction -> Ins�rer Contact)",
- "qui sera nomm� `Xnew'. `X' d�signe un contact qui peut �tre li� � une",
- "broche d'entr�e du microcontroleur, vous pouvez affecter la broche pour",
- "ce contact plus tard apr�s avoir choisi le microcontroleur et renomm�",
- "les contacts. La premi�re lettre indique de quel type de composants il",
- "s'agit par exemple :",
- "",
- " * Xnom -- Reli� � une broche d'entr�e du microcontroleur",
- " * Ynom -- Reli� � une broche de sortie du microcontroleur",
- " * Rnom -- `Relais interne': un bit en m�moire",
- " * Tnom -- Temporisation; Tempo travail, tempo repos, ou totalisatrice",
- " * Cnom -- Compteur, Compteur ou d�compteur",
- " * Anom -- Un entier lu sur un comvertisseur A/D ",
- " * nom -- Variable g�n�rique (Entier : Integer)",
- "",
- "Choisir le reste du nom pour d�crire l'utilisation de ce que fait cet",
- "objet et qui doit �tre unique dans tout le programme. Un m�me nom doit",
- "toujours se r�f�rer au m�me objet dans le programme en entier.Par",
- "exemple , vous aurez une erreur si vous utilisez une tempo travail",
- "(TON) appell�e TDelai et une tempo repos (TOF) appell�e aussi TDelai",
- "dans le m�me programme, le comptage effectu� par ces tempo utilisera le",
- "m�me emplacement en m�moire, mais il est acceptable d'avoir une tempo",
- "sauvegard�e (RTO) Tdelai m�me nom avec une instruction de RES, dans ce",
- "cas l'instruction fonctionne avec le m�me timer.",
- "",
- "Les noms de variables peuvent �tre des lettres, chiffres ou le",
- "caract�re _. Un nom de variable ne doit pas commencer par un chiffre.",
- "Les noms de variables sont sensibles � la casse (majuscule/minuscules).",
- "",
- "Les instructions de manipulation de variables (MOV, ADD, EQU,",
- "etc.) peuvent travailler avec des variables de n'importe quel nom. Elles",
- "peuvent avoir acc�s aux accumulateurs des temporisations ou des",
- "compteurs. Cela peut quelquefois �tre tr�s utile, par exemple si vous",
- "voulez contr�ler la valeur d'un compteur ou d'une temporisation dans",
- "une ligne particuli�re.",
- "",
- "Les variables sont toujours des entiers 16 bits. Leur valeur peut",
- "donc �tre comprise entre -32768 et 32767 inclus. Les variables sont",
- "toujours sign�es. Vous pouvez les sp�cifier de fa�on litt�rale comme",
- "des nombres d�cimaux normaux (0, 1234, -56), vous pouvez aussi les",
- "sp�cifier en caract�res ASCII ('A', 'z') en mettant le caract�re entre",
- "des guillemets simples. Vous pouvez utiliser un caract�re ASCII dans la",
- "majorit� des endroits o� vous pouvez utiliser les nombres d�cimaux.",
- "",
- "En bas de l'�cran, vous pouvez voir la liste de tous les objets",
- "utilis�s dans votre programme. La liste est automatiquement g�n�r�e",
- "� partir du programme. La majorit� des objets ne necessitent aucune",
- "configuration. Seuls : les objets `Xnom', `Ynom', and `Anom' doivent �tre",
- "affect�s � une broche du micro La premi�re chose � faire est de choisir",
- "la microcontroleur utilis� : Param�res -> Microcontroleur ensuite vous",
- "affectez les broches en faisant un double clic dans la liste.",
- "",
- "Vous pouvez modifier le programme en ins�rant ou supprimant des",
- "instructions. Le curseur clignote dans la programme pour indiquer",
- "l'instruction courante s�lectionn�e et le point d'insertion. S'il ne",
- "clignote pas pressez <Tab> ou cliquer sur une instruction, ou vous",
- "pouvez ins�rer une nouvelle instruction � la droite ou � la gauche",
- "(en s�rie avec), ou au dessous ou au dessus (en parall�le avec) de",
- "l'instruction s�lectionn�e. Quelques op�rations ne sont pas permises ,",
- "par exemple aucune instruction permise � droite de la bobine.",
- "",
- "Le programme d�marre avec uniquement une ligne. Vous pouvez ajouter",
- "plusieurs lignes en s�lectionnant Insertion -> Ligne avant ou apr�s",
- "dans le menu. Vous pouvez faire un circuit complexe en pla�ant plusieurs",
- "branches en parall�le ou en s�rie avec une ligne, mais il est plus clair",
- "de faire plusieurs lignes.",
- "",
- "Une fois votre programme �crit, vous pouvez le tester par simulation,",
- "et le compiler dans un fichier HEX pour le microcontroleur de destination.",
- "",
- "SIMULATION",
- "==========",
- "",
- "Pour entrer dans la mode simulation choisir Simulation -> Simuler",
- "ou presser <Ctrl+M> le programme est affich� diff�remment en mode",
- "simulation. Les instructions activ�es sont affich�es en rouge vif, les",
- "instructions qui ne le sont pas sont affich�es en gris�. Appuyer sur la",
- "barre d'espace pour d�marrer l'API pour 1 cycle. Pour faire fonctionner",
- "continuellement en temps r�el choisir Simulation ->D�marrer la simulation",
- "en temps r�el ou presser <Ctrl+R> L'affichage du programme est mise �",
- "jour en temps r�el en fonction des changements d'�tat des entr�es.",
- "",
- "Vous pouvez valider l'�tat des entr�es du programme en faisant un",
- "double clic sur l'entr�e dans la liste au bas de l'�cran, ou sur le",
- "contact `Xnom' de l'instruction dans le programme, pour avoir le reflet",
- "automatiquement de la validation d'une entr�e dans le programme, il",
- "faut que le programme soit en cycle.(le d�marrer par <Ctrl+R> ou barre",
- "d'espace pour un seul cycle).",
- "",
- "COMPILER EN CODE NATIF",
- "======================",
- "",
- "Le point final est de g�n�rer un fichier .HEX qui sera programm� dans le",
- "microcontroleur que vous avez choisi par Param�tres -> Microcontroleur",
- "Vous devez affecter les broches d'entr�es sorties pour chaque 'Xnom'",
- "et 'Ynom'. Vous pouvez faire cela en faisant un double clic sur la nom",
- "de l'objet dans la liste au bas de l'�cran. Une boite de dialogue vous",
- "demande de choisir une des broches non affect�es dans la liste.",
- "",
- "Vous devez aussi choisir la temps de cycle que voulez utiliser pour",
- "votre application, vous devez aussi choisir la fr�quence d'horloge du",
- "processeur. Faire Param�tres -> Param�tres MCU dans le menu. En g�n�ral,",
- "le temps de cycle peut �tre laiss� � la valeur par d�faut (10 ms) qui est",
- "une bonne valeur pour la majorit� des applications. Indiquer la fr�quence",
- "du quartz utilis� (ou du r�sonateur c�ramique ou autres..) et cliquer OK.",
- "",
- "Maintenant vous pouvez cr�er le fichier pour int�grer dans le",
- "microcontroleur. Choisir Compilation -> Compiler, ou compiler sous...",
- "Si vous avez pr�c�demment compil� votre programme, vous pouvez sp�cifier",
- "un nom diff�rent de fichier de sortie. Si votre programme ne comporte",
- "pas d'erreur (li� � la structure du programme), LDmicro g�n�re un fichier",
- "IHEX pr�t � �tre programm� dans le chip.",
- "",
- "Utilisez votre logiciel et mat�riel de programmation habituel pour",
- "charger le fichier HEX dans la microcontroleur. V�rifiez et validez",
- "les bits de configuration (fuses), pour les processeurs PIC16Fxxx ces",
- "bits sont inclus dans le fichier HEX, et la majorit� des logiciels de",
- "programmation les valident automatiquement, pour les processeurs AVR ,",
- "vous devez le faire manuellement.",
- "",
- "REFERENCE DES INSTRUCTIONS ",
- "==========================",
- "",
- "> CONTACT, NORMALLEMENT OUVERT Xnom Rnom Ynom",
- " ----] [---- ----] [---- ----] [----",
- "",
- " Si le signal arrivant � cette instruction est FAUX (0) le signal",
- " de sortie est aussi faux (0), s'il est vrai , il sera aussi vrai",
- " en sortie si et uniquement si la broche d'Entr�e ou de Sortie",
- " ou de Relais interne est vraie, sinon l'instruction sera fausse.",
- " Cette instruction peut v�rifier l'�tat d'une broche d'entr�e, d'une",
- " broche de sortie ou d'un relais interne",
- "",
- " ",
- "> CONTACT, NORMALLEMENT FERME Xnom Rnom Ynom",
- " ----]/[---- ----]/[---- ----]/[----",
- "",
- " Si le signal arrivant � cette instruction est FAUX (0) le signal",
- " de sortie est vrai (1), s'il est vrai , il sera faux en sortie .",
- " Cette instruction peut v�rifier l'�tat d'une broche d'entr�e, d'une",
- " broche de sortie ou d'un relais interne. Fonctionne en opposition",
- " par rapport au contact normallement ouvert.",
- "",
- "",
- "> BOBINE, NORMALE Rnom Ynom",
- " ----( )---- ----( )----",
- "",
- " Si le signal arrivant � cette instruction est faux, alors le relais ",
- " interne ou la broche de sortie est faux (mise � z�ro). Si le signal",
- " arrivant � cette instruction est vrai(1), alors le relais interne ou",
- " la broche de sortie est valid�e (mise � 1). Il n'est pas important",
- " d'affecter une variable � une bobine.",
- " Cette instruction est plac�e le plus � droite dans une s�quence.",
- " ",
- "",
- "> BOBINE, INVERSE Rnom Ynom",
- " ----(/)---- ----(/)----",
- "",
- " Si le signal arrivant � cette instruction est vrai, alors le relais ",
- " interne ou la broche de sortie est faux (mise � z�ro). Si le signal",
- " arrivant � cette instruction est faux(0), alors le relais interne ou",
- " la broche de sortie est valid�e (mise � 1). Il n'est pas important ",
- " d'affecter une variable � une bobine.",
- " Cette instruction est plac�e le plus � droite dans une s�quence.",
- "",
- "",
- "> BOBINE, ACCROCHAGE Rnom Ynom",
- " ----(S)---- ----(S)----",
- "",
- " Si le signal arrivant � cette instruction est vrai, alors le",
- " relais interne ou la broche de sortie est valid�e (mise � 1). Cette",
- " instruction permet de changer l'�tat d'un relais ou d'une sortie :",
- " uniquement passe � vrai, ou reste vrai si elle �tait d�j� � 1,",
- " elle est typiquement utilis�e en combinaison avec une Bobine REMISE",
- " A ZERO.",
- " Cette instruction est plac�e le plus � droite dans une s�quence.",
- "",
- "",
- "> BOBINE, REMISE A ZERO Rnom Ynom",
- " ----(R)---- ----(R)----",
- "",
- " Si le signal arrivant � cette instruction est vrai, alors le relais ",
- " interne ou la sortie est mise � z�ro (0), si elle �tait d�j� � 0, ",
- " il n'y a aucun changement, cette instruction change l'�tat d'une ",
- " sortie uniquement si elle �tait � 1, cette instruction fonctionne en ",
- " combinaison avec l'instruction ci-dessus Bobine � ACCROCHAGE.",
- " Cette instruction est plac�e le plus � droite dans une s�quence.",
- "",
- "",
- "> TEMPORISATION TRAVAIL Tdon ",
- " -[TON 1.000 s]-",
- "",
- " Quand la signal arrivant � cette instruction passe de faux � vrai",
- " (0 � 1), le signal de sortie attend 1.000 seconde avant de passer",
- " � 1. Quand le signal de commande de cette instruction passe ZERO,",
- " le signal de sortie passe imm�diatement � z�ro. La tempo est remise",
- " � z�ro � chaque fois que l'entr�e repasse � z�ro. L'entr�e doit �tre",
- " maintenue vraie � 1 pendant au moins 1000 millisecondes cons�cutives",
- " avant que la sortie ne devienne vraie. le d�lai est configurable.",
- "",
- " La variable `Tnom' compte depuis z�ro en unit�s de temps de scan.",
- " L'instruction Ton devient vraie en sortie quand la variable du",
- " compteur est plus grande ou �gale au delai fix�. Il est possible",
- " de manipuler la variable du compteur en dehors, par exemple par une",
- " instruction MOVE.",
- "",
- "",
- "> TEMPORISATION REPOS Tdoff ",
- " -[TOF 1.000 s]-",
- "",
- " Quand le signal qui arrive � l'instruction passe de l'�tat vrai",
- " (1) � l'�tat faux (0), la sortie attend 1.000 s avant de d�venir",
- " faux (0) Quand le signal arrivant � l'instruction passe de l'�tat",
- " faux � l'�tat vrai, le signal passe � vrai imm�diatement. La",
- " temporisation est remise � z�ro � chaque fois que l'entr�e devient",
- " fausse. L'entr�e doit �tre maintenue � l'�tat faux pendant au moins",
- " 1000 ms cons�cutives avant que la sortie ne passe � l'�tat faux. La",
- " temporisation est configurable.",
- "",
- " La variable `Tname' compte depuis z�ro en unit�s de temps de scan.",
- " L'instruction Ton devient vraie en sortie quand la variable du",
- " compteur est plus grande ou �gale au delai fix�. Il est possible",
- " de manipuler la variable du compteur en dehors, par exemple par une",
- " instruction MOVE.",
- "",
- "",
- "> TEMPORISATION TOTALISATRICE Trto ",
- " -[RTO 1.000 s]-",
- "",
- " Cette instruction prend en compte le temps que l'entr�e a �t� � l'�tat",
- " vrai (1). Si l'entr�e a �t� vraie pendant au moins 1.000s la sortie",
- " devient vraie (1).L'entr�e n'a pas besoin d'�tre vraie pendant 1000 ms",
- " cons�cutives. Si l'entr�e est vraie pendant 0.6 seconde puis fausse",
- " pendant 2.0 secondes et ensuite vraie pendant 0.4 seconde, la sortie",
- " va devenir vraie. Apr�s �tre pass� � l'�tat vrai, la sortie reste",
- " vraie quelque soit la commande de l'instruction. La temporisation",
- " doit �tre remise � z�ro par une instruction de RES (reset).",
- "",
- " La variable `Tnom' compte depuis z�ro en unit�s de temps de scan.",
- " L'instruction Ton devient vraie en sortie quand la variable du",
- " compteur est plus grande ou �gale au delai fix�. Il est possible",
- " de manipuler la variable du compteur en dehors, par exemple par une",
- " instruction MOVE.",
- "",
- "",
- "> RES Remise � Z�ro Trto Citems",
- " ----{RES}---- ----{RES}----",
- "",
- " Cette instruction fait un remise � z�ro d'une temporisation ou d'un",
- " compteur. Les tempos TON et TOF sont automatiquement remisent � z�ro",
- " lorsque leurs entr�es deviennent respectivement fausses ou vraies,",
- " RES n'est pas donc pas n�cessaire pour ces tempos. Les tempos RTO",
- " et les compteurs d�compteurs CTU / CTD ne sont pas remis � z�ro",
- " automatiquement, il faut donc utiliser cette instruction. Lorsque",
- " l'entr�e est vraie , le compteur ou la temporisation est remis �",
- " z�ro. Si l'entr�e reste � z�ro, aucune action n'est prise.",
- " Cette instruction est plac�e le plus � droite dans une s�quence.",
- "",
- "",
- "> FRONT MONTANT _",
- " --[OSR_/ ]--",
- "",
- " La sortie de cette instruction est normallement fausse. Si",
- " l'instruction d'entr�e est vraie pendant ce scan et qu'elle �tait",
- " fausse pendant le scan pr�c�dent alors la sortie devient vraie. Elle",
- " g�n�re une impulsion � chaque front montant du signal d'entr�e. Cette",
- " instruction est utile si vous voulez intercepter le front montant",
- " du signal.",
- "",
- "",
- "> FRONT DESCENDANT _",
- " --[OSF \\_]--",
- "",
- " La sortie de cette instruction est normallement fausse. Si",
- " l'instruction d'entr�e est fausse (0) pendant ce scan et qu'elle",
- " �tait vraie (1) pendant le scan pr�c�dent alors la sortie devient",
- " vraie. Elle g�n�re une impulsion � chaque front descendant du signal",
- " d'entr�e. Cette instruction est utile si vous voulez intercepter le",
- " front descendant d'un signal.",
- "",
- "",
- "> COURT CIRCUIT (SHUNT), CIRCUIT OUVERT",
- " ----+----+---- ----+ +----",
- "",
- " Une instruction shunt donne en sortie une condition qui est toujours ",
- " �gale � la condition d'entr�e. Une instruction Circuit Ouvert donne ",
- " toujours une valeur fausse en sortie.",
- " Ces instructions sont en g�n�ral utilis�es en phase de test.",
- "",
- "",
- "> RELAIS DE CONTROLE MAITRE",
- " -{MASTER RLY}-",
- "",
- " Par d�faut, la condition d'entr�e d'une ligne est toujours vraie. Si",
- " une instruction Relais de contr�le maitre est ex�cut�e avec une",
- " valeur d'entr�e fausse, alors toutes les lignes suivantes deviendront",
- " fausses. Ceci va continuer jusqu'� la rencontre de la prochaine",
- " instruction relais de contr�le maitre qui annule l'instruction de",
- " d�part. Ces instructions doivent toujours �tre utilis�es par paires:",
- " une pour commencer (qui peut �tre sous condition) qui commence la",
- " partie d�activ�e et une pour la terminer.",
- "",
- "",
- "> MOUVOIR {destvar := } {Tret := }",
- " -{ 123 MOV}- -{ srcvar MOV}-",
- "",
- " Lorsque l'entr�e de cette instruction est vraie, elle va mettre la",
- " variable de destination � une valeur �gale � la variable source ou �",
- " la constante source. Quand l'entr�e de cette instruction est fausse",
- " rien ne se passe. Vous pouvez affecter n'importe quelle variable",
- " � une instruction de d�placement, ceci inclu l'�tat de variables",
- " compteurs ou temporisateurs qui se distinguent par l'ent�te T ou",
- " C. Par exemple mettre 0 dans Tsauvegard� �quivaut � faire une RES",
- " de la temporisation. Cette instruction doit �tre compl�tement �",
- " droite dans une s�quence.",
- "",
- "",
- "> OPERATIONS ARITHMETIQUES {ADD kay :=} {SUB Ccnt :=}",
- " -{ 'a' + 10 }- -{ Ccnt - 10 }-",
- "",
- "> {MUL dest :=} {DIV dv := }",
- " -{ var * -990 }- -{ dv / -10000}-",
- "",
- " Quand l'entr�e de cette instruction est vraie, elle place en",
- " destination la variable �gale � l'expression calcul�e. Les op�randes",
- " peuvent �tre des variables (en incluant les variables compteurs et",
- " tempos) ou des constantes. Ces instructions utilisent des valeurs 16",
- " bits sign�es. Il faut se souvenir que le r�sultat est �valu� � chaque",
- " cycle tant que la condition d'entr�e est vraie. Si vous incr�mentez",
- " ou d�cr�mentez une variable (si la variable de destination est",
- " aussi une des op�randes), le r�sultat ne sera pas celui escompt�,",
- " il faut utiliser typiquement un front montant ou descendant de la",
- " condition d'entr�e qui ne sera �valu� qu'une seule fois. La valeur",
- " est tronqu�e � la valeur enti�re. Cette instruction doit �tre",
- " compl�tement � droite dans une s�quence.",
- "",
- "",
- "> COMPARER [var ==] [var >] [1 >=]",
- " -[ var2 ]- -[ 1 ]- -[ Ton]-",
- "",
- "> [var /=] [-4 < ] [1 <=]",
- " -[ var2 ]- -[ vartwo]- -[ Cup]-",
- "",
- " Si l'entr�e de cette instruction est fausse alors la sortie est",
- " fausse. Si l'entr�e est vraie, alors la sortie sera vraie si et",
- " uniquement si la condition de sortie est vraie. Cette instruction",
- " est utilis�e pour comparer (Egalit�, plus grand que,plus grand ou",
- " �gal �, in�gal, plus petit que, plus petit ou �gal �) une variable �",
- " une autre variable, ou pour comparer une variable avec une constante",
- " 16 bits sign�e.",
- "",
- "",
- "> COMPTEUR DECOMPTEUR Cnom Cnom",
- " --[CTU >=5]-- --[CTD >=5]--",
- "",
- " Un compteur incr�mente ( Compteur CTU, count up) ou d�cr�mente",
- " (D�compteur CTD, count down) une variable � chaque front montant de",
- " la ligne en condition d'entr�e (CAD quand la signal passe de l'�tat",
- " 0 � l'�tat 1. La condition de sortie du compteur est vraie si la",
- " variable du compteur est �gale ou plus grande que 5 (dans l'exemple),",
- " et faux sinon. La condition de sortie de la ligne peut �tre vraie,",
- " m�me si la condition d'entr�e est fausse, cela d�pend uniquement de la",
- " valeur de la variable du compteur. Vous pouvez avoir un compteur ou",
- " un d�compteur avec le m�me nom, qui vont incr�m�nter ou decr�menter",
- " une variable. L'instruction Remise � Z�ro permet de resetter un",
- " compteur (remettre � z�ro), il est possible de modifier par des",
- " op�rations les variables des compteurs d�compteurs.",
- "",
- "",
- "> COMPTEUR CYCLIQUE Cnom",
- " --{CTC 0:7}--",
- "",
- " Un compteur cyclique fonctionne comme un compteur normal",
- " CTU, exception faite, lorsque le compteur arrive � sa",
- " limite sup�rieure, la variable du compteur revient � 0. dans",
- " l'exemple la valeur du compteur �volue de la fa�on suivante :",
- " 0,1,2,4,5,6,7,0,1,2,3,4,5,6,7,0,1,3,4,5,etc. Ceci est tr�s pratique",
- " en conbinaison avec des intructions conditionnelles sur la variable",
- " Cnom. On peut utiliser ceci comme un s�quenceur, l'horloge du compteur",
- " CTC est valid�e par la condition d'entr�e associ�e � une instruction",
- " de front montant.",
- " Cette instruction doit �tre compl�tement � droite dans une s�quence.",
- " ",
- "",
- "> REGISTRE A DECALAGE {SHIFT REG }",
- " -{ reg0..3 }-",
- "",
- " Un registre � d�calage est associ� avec un jeu de variables. Le",
- " registre � d�calage de l'exemple donn� est associ� avec les",
- " variables`reg0', `reg1', `reg2', and `reg3'. L'entr�e du registre �",
- " d�calage est `reg0'. A chaque front montant de la condition d'entr�e",
- " de la ligne, le registre � d�calage va d�caler d'une position �",
- " droite. Ce qui donne `reg3 := reg2', `reg2 := reg1'. et `reg1 :=",
- " reg0'.`reg0' est � gauche sans changement. Un registre � d�calage",
- " de plusieurs �l�ments peut consommer beaucoup de place en m�moire.",
- " Cette instruction doit �tre compl�tement � droite dans une s�quence.",
- "",
- "",
- "> TABLEAU INDEXE {dest := }",
- " -{ LUT[i] }-",
- "",
- " Un tableau index� et un groupe ordonn� de n valeurs Quand la condition",
- " d'entr�e est vraie, la variable enti�re `dest' est mise � la valeur",
- " correspondand � l'index i du tableau. L'index est compris entre 0 et",
- " (n-1). Le comportement de cette instruction est ind�fini si l'index",
- " est en dehors du tableau",
- " Cette instruction doit �tre compl�tement � droite dans une s�quence.",
- "",
- "",
- "> TABLEAU ELEMENTS LINEAIRES {yvar := }",
- " -{ PWL[xvar] }-",
- "",
- " C'est une bonne m�thode pour �valuer de fa�on approximative une",
- " fonction compliqu�e ou une courbe. Tr�s pratique par exemple pour",
- " appliquer une courbe de calibration pour lin�ariser tension de sortie",
- " d'un capteur dans une unit� convenable.",
- "",
- " Supposez que vous essayez de faire une fonction pour convertir une",
- " variable d'entr�e enti�re, x, en une variable de sortie enti�re, y,",
- " vous connaissez la fonction en diff�rents points, par exemple vous",
- " connaissez :",
- "",
- " f(0) = 2",
- " f(5) = 10",
- " f(10) = 50",
- " f(100) = 100",
- "",
- " Ceci donne les points",
- "",
- " (x0, y0) = ( 0, 2)",
- " (x1, y1) = ( 5, 10)",
- " (x2, y2) = ( 10, 50)",
- " (x3, y3) = (100, 100)",
- "",
- " li�s � cette courbe. Vous pouvez entrer ces 4 points dans un",
- " tableau associ� � l'instruction tableau d'�l�ments lin�aires. Cette",
- " instruction regarde la valeur de xvar et fixe la valeur de yvar",
- " correspondante. Par exemple si vous mettez xvar = 10 , l'instruction",
- " validera yvar = 50.",
- "",
- " Si vous mettez une instruction avec une valeur xvar entre deux valeurs",
- " de x du tableau (et par cons�quence aussi de yvar). Une moyenne",
- " proportionnelle entre les deux valeurs , pr�c�dente et suivante de",
- " xvar et de la valeur li�e yvar, est effectu�e. Par exemple xvar =",
- " 55 donne en sortie yvar = 75 Les deux points xvar (10.50) et yvar",
- " (50,75) , 55 est la moyenne entre 10 et 100 et 75 est la moyenne",
- " entre 50 et 100, donc (55,75) sont li�s ensemble par une ligne de",
- " connection qui connecte ces deux points.",
- "",
- " Ces points doivent �tre sp�cifi�s dans l'ordre ascendant des",
- " coordonn�es x. Il peut �tre impossible de faire certaines op�rations",
- " math�matiques n�cessaires pour certains tableaux, utilisant des",
- " entiers 16 bits. Dans ce LDmicro va provoquer une alarme. Ce tableau",
- " va provoquer une erreur :",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (300, 300)",
- "",
- " Vous pouvez supprimer ces erreurs en diminuant l'�cart entre les",
- " points du tableau, par exemple ce tableau est �quivalent � celui ci",
- " dessus , mais ne provoque pas d'erreur:",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (150, 150)",
- " (x2, y2) = (300, 300)",
- "",
- " Il n'est pratiquement jamais n�cessaire d'utiliser plus de 5 ou",
- " 6 points. Ajouter des points augmente la taille du code et diminue",
- " sa vitesse d'ex�cution. Le comportement, si vous passez une valeur",
- " � xvar plus grande que la plus grande valeur du tableau , ou plus",
- " petit que la plus petite valeur, est ind�fini.",
- " Cette instruction doit �tre compl�tement � droite dans une s�quence.",
- "",
- "",
- "> LECTURE CONVERTISSEUR A/D Anom",
- " --{READ ADC}--",
- "",
- " LDmicro peut g�n�rer du code pour utiliser les convertisseurs A/D",
- " contenus dans certains microcontroleurs. Si la condition d'entr�e",
- " de l'instruction est vraie, alors une acquisition du convertisseur",
- " A/D est �ffectu�e et stock�e dans la variable Anom. Cette variable",
- " peut �tre par la suite trait�e comme les autres variables par les",
- " diff�rentes op�rations arithm�tiques ou autres. Vous devez affecter",
- " une broche du micro � la variable Anom de la m�me fa�on que pour",
- " les entr�es et sorties digitales par un double clic dans la list",
- " affich�e au bas de l'�cran. Si la condition d'entr�e de la s�quence",
- " est fausse la variable Anom reste inchang�e.",
- "",
- " Pour tous les circuits support�s actuellement, 0 volt en entr�e",
- " correspond � une lecture ADC de 0, et une valeur �gale � VDD (la",
- " tension d'alimentation ) correspond � une lecture ADC de 1023. Si",
- " vous utilisez un circuit AVR, vous devez connecter Aref � VDD.",
- "",
- " Vous pouvez utiliser les op�rations arithm�tiques pour mettre � ",
- " l'�chelle les lectures effectu�es dans l'unit� qui vous est la plus ",
- " appropri�e. Mais souvenez vous que tous les calculs sont faits en ",
- " utilisant les entiers.",
- "",
- " En g�n�ral, toutes les broches ne sont pas utilisables pour les ",
- " lecture de convertisseur A/D. Le logiciel ne vous permet pas ",
- " d'affecter une broche non A/D pour une entr�e convertisseur.",
- " Cette instruction doit �tre compl�tement � droite dans une s�quence.",
- "",
- "",
- "> FIXER RAPPORT CYCLE PWM duty_cycle",
- " -{PWM 32.8 kHz}-",
- "",
- " LDmicro peut g�n�rer du code pour utiliser les p�riph�riques PWM",
- " contenus dans certains microcontroleurs. Si la condition d'entr�e",
- " de cette instruction est vraie, le rapport de cycle du p�riph�rique",
- " PWM va �tre fix� � la valeur de la variable Rapport de cycle PWM.",
- " Le rapport de cycle est un nombre compris entre 0 (toujours au",
- " niveau bas) et 100 (toujours au niveau haut). Si vous connaissez la",
- " mani�re dont les p�riph�riques fonctionnent vous noterez que LDmicro",
- " met automatiquement � l'�chelle la variable du rapport de cycle en",
- " pourcentage de la p�riode d'horloge PWM.",
- "",
- " Vous pouvez sp�cifier la fr�quence de sortie PWM, en Hertz. Le",
- " fr�quence que vous sp�cifiez peut ne pas �tre exactement accomplie, en",
- " fonction des divisions de la fr�quence d'horloge du microcontroleur,",
- " LDmicro va choisir une fr�quence approch�e. Si l'erreur est trop",
- " importante, il vous avertit.Les vitesses rapides sont au d�triment",
- " de la r�solution. Cette instruction doit �tre compl�tement � droite",
- " dans une s�quence.",
- "",
- " Le runtime du language � contacts consomme un timers (du micro) pour",
- " le temps de cycle, ce qui fait que le PWM est uniquement possible",
- " avec des microcontroleurs ayant au moins deux timers utilisables.",
- " PWM utilise CCP2 (pas CCP1) sur les PIC16F et OC2(pas OC1) sur les",
- " Atmel AVR.",
- "",
- "> METTRE PERSISTANT saved_var",
- " --{PERSIST}--",
- "",
- " Quand la condition d'entr�e de cette instruction est vraie, la",
- " variable enti�re sp�cifi�e va �tre automatiquement sauvegard�e en",
- " EEPROM, ce qui fait que cette valeur persiste m�me apr�s une coupure",
- " de l'alimentation du micro. Il n'y a pas � sp�cifier ou elle doit",
- " �tre sauvegard�e en EEPROM, ceci est fait automatiquement, jusqu'a",
- " ce quelle change � nouveau. La variable est automatiquement charg�e",
- " � partir de l'EEPROM suite � un reset � la mise sous tension.",
- "",
- " Si une variables, mise persistante, change fr�quemment, l'EEPROM de",
- " votre micro peut �tre d�truite tr�s rapidement, Le nombre de cycles",
- " d'�criture dans l'EEPROM est limit� � environ 100 000 cycles Quand",
- " la condition est fausse, rien n'apparait. Cette instruction doit",
- " �tre compl�tement � droite dans une s�quence.",
- "",
- "",
- "> RECEPTION UART (SERIE) var",
- " --{UART RECV}--",
- "",
- " LDmicro peut g�n�rer du code pour utiliser l'UART, existant dans",
- " certains microcontroleurs. Sur les AVR, avec de multiples UART,",
- " uniquement l'UART1 est utilisable (pas l'UART0). Configurer la",
- " vitesse en utilisant -> Param�tres -> Param�tres MCU. Toutes les",
- " vitesses de liaison ne sont pas utilisables avec tous les quartz de",
- " toutyes les fr�quences. Ldmicro vous avertit dans ce cas.",
- "",
- " Si la condition d'entr�e de cette instruction est fausse, rien ne se",
- " passe. Si la condition d'entr�e est vraie, elle essaie de recevoir",
- " un caract�re en provenance de l'UART. Si aucun caract�re n'est lu",
- " alors la condition de sortie devient fausse. Si un caract�re est",
- " lu la valeur ASCII est stock�e dans 'var' et la condition de sortie",
- " est vraie pour un seul cycle API.",
- "",
- "",
- "> EMMISION UART (SERIE) var",
- " --{UART SEND}--",
- "",
- " LDmicro peut g�n�rer du code pour utiliser l'UART, existant dans ",
- " certains microcontroleurs. Sur les AVR, avec de multiples UART, ",
- " uniquement l'UART1 est utilisable (pas l'UART0). Configurer la ",
- " vitesse en utilisant -> Param�tres -> Param�tres MCU. Toutes les ",
- " vitesses de liaison ne sont pas utilisables avec tous les quartz ",
- " de toutyes les fr�quences. Ldmicro vous avertit dans ce cas.",
- "",
- " Si la condition d'entr�e de cette instruction est fausse, rien ne",
- " se passe. Si la condition d'entr�e est vraie alors cette instruction",
- " �crit un seul caract�re vers l'UART. La valeur ASCII du caract�re �",
- " transmettre doit avoir �t� stock� dans 'var' par avance. La condition",
- " de sortie de la s�quence est vraie, si l'UART est occup�e (en cours",
- " de transmission d'un caract�re), et fausse sinon.",
- "",
- " Rappelez vous que les caract�res mettent un certain temps pour �tre",
- " transmis. V�rifiez la condition de sortie de cette instruction pour",
- " vous assurer que le premier caract�re � bien �t� transmis, avant",
- " d'essayer d'envoyer un second caract�re, ou utiliser une temporisation",
- " pour ins�rer un d�lai entre caract�res; Vous devez uniquement v�rifier",
- " que la condition d'entr�e est vraie (essayez de transmettre un",
- " caract�re) quand la condition de sortie est fausse(UART non occupp�e).",
- "",
- " Regardez l'instruction Chaine formatt�e(juste apr�s) avant d'utiliser",
- " cette instruction, elle est plus simple � utiliser, et dans la",
- " majorit� des cas, est capable de faire ce dont on a besoin.",
- "",
- "",
- "> CHAINE FORMATTEE SUR UART var",
- " -{\"Pression: \\3\\r\\n\"}-",
- "",
- " LDmicro peut g�n�rer du code pour utiliser l'UART, existant dans ",
- " certains microcontroleurs. Sur les AVR, avec de multiples UART, ",
- " uniquement l'UART1 est utilisable (pas l'UART0). Configurer la ",
- " vitesse en utilisant -> Param�tres -> Param�tres MCU. Toutes les ",
- " vitesses de liaison ne sont pas utilisables avec tous les quartz ",
- " de toutyes les fr�quences. Ldmicro vous avertit dans ce cas.",
- "",
- " Quand la condition d'entr�e de cette instruction passe de faux � vrai,",
- " elle commence � envoyer une chaine compl�te vers le port s�rie. Si",
- " la chaine comporte la s�quence sp�ciale '3', alors cette s�quence",
- " va �tre remplac�e par la valeur de 'var', qui est automatiquement",
- " converti en une chaine. La variable va �tre formatt�e pour prendre",
- " exactement trois caract�res; par exemple si var = 35, la chaine",
- " exacte qui va �tre \"imprim�e\" sera 'Pression: 35\\r\\n' (notez les",
- " espaces suppl�mentaires). Si au lieu de cela var = 1432 , la sortie",
- " est ind�finie parceque 1432 comporte plus de 3 digits. Dans ce cas",
- " vous devez n�cessairement utiliser '\\4' � la place.",
- "",
- " Si la variable peut �tre n�gative, alors utilisez '\\-3d' (ou `\\-4d'",
- " etc.) � la place. Ceci oblige LDmicro � imprimer un espace d'ent�te",
- " pour les nombres positifs et un signe moins d'ent�te pour les chiffres",
- " n�gatifs.",
- "",
- " Si de multiples instructions de chaines formatt�es sont activ�es au",
- " m�me moment (ou si une est activ�e avant de finir la pr�c�dente)",
- " ou si ces instructions sont imbriqu�es avec des instructions TX",
- " (transmission), le comportement est ind�fini.",
- "",
- " Il est aussi possible d'utiliser cette instruction pour sortie une",
- " chaine fixe, sans l'intervention d'une variable en valeur enti�re",
- " dans le texte qui est envoy�e sur la ligne s�rie. Dans ce cas,",
- " simplement ne pas inclure de s�quence sp�ciale Escape.",
- "",
- " Utiliser `\\\\' pour l'anti-slash. en addition � une s�quence escape ",
- " pour intervenir sue une variables enti�re, les caract�res de ",
- " contr�les suivants sont utilisables :",
- " ",
- " * \\r -- retour en d�but de ligne",
- " * \\n -- nouvelle ligne",
- " * \\f -- saut de page",
- " * \\b -- retour arri�re",
- " * \\xAB -- caract�re avec valeur ASCII 0xAB (hex)",
- "",
- " La condition de sortie de cette instruction est vraie quand elle",
- " transmet des donn�es, sinon elle est fausse. Cette instruction",
- " consomme une grande quantit� de m�moire, elle doit �tre utilis�e",
- " avec mod�ration. L'impl�mentation pr�sente n'est pas efficace, mais",
- " une meilleure impl�mentation demanderait une modification de tout",
- " le reste.",
- "",
- "NOTE CONCERNANT LES MATHS",
- "=========================",
- "",
- "Souvenez vous que LDmicro travaille uniquement en math�matiques entiers",
- "16 bits. Ce qui fait que le r�sultat final de m�me que tous les calculs",
- "m�mes interm�diaires seront compris entre -32768 et 32767.",
- "",
- "Par exemple, si vous voulez calculer y = (1/x)*1200,ou x est compris",
- "entre 1 et 20, ce qui donne un r�sultat entre 1200 et 60,le r�sultat est",
- "bien � l'int�rieur d'un entier 16 bits, il doit donc �tre th�oriquement",
- "possible de faire le calcul. Nous pouvons faire le calcul de deux fa�ons",
- "d'abord faire 1/x et ensuite la multiplication:",
- "",
- " || {DIV temp :=} ||",
- " ||---------{ 1 / x }----------||",
- " || ||",
- " || {MUL y := } ||",
- " ||----------{ temp * 1200}----------||",
- " || ||",
- "",
- "Ou uniquement faire simplement la division en une seule ligne :",
- "",
- " || {DIV y :=} ||",
- " ||-----------{ 1200 / x }-----------||",
- "",
- "Math�matiquement c'est identique, la premi�re donne y = 0 , c'est � dire",
- "une mauvais r�sultat, si nous prenons par exemple x = 3 , 1/x = 0.333 mais",
- "comme il s'agit d'un entier, la valeur pour Temp est de 0 et 0*1200 = 0 ",
- "donc r�sultat faux.Dans le deuxi�me cas, il n'y a pas de r�sultat ",
- "interm�diaire et le r�sultat est correct dans tous les cas.",
- "",
- "Si vous trouvez un probl�me avec vos calculs math�matiques, v�rifiez les",
- "r�sultats interm�diaires, si il n'y a pas de d�passement de capacit�s par",
- "rapports aux valeurs enti�res. (par exemple 32767 + 1 = -32768). Quand",
- "cela est possible essayer de choisir des valeurs entre -100 et 100.",
- "",
- "Vous pouvez utiliser un certain facteur de multiplication ou division pour ",
- "mettre � l'echelle les variables lors de calculs par exemple : pour mettre",
- "mettre � l'echelle y = 1.8*x , il est possible de faire y =(9/5)*x ",
- "(9/5 = 1.8) et coder ainsi y = (9*x)/5 en faisant d'abord la multiplication",
- "",
- " || {MUL temp :=} ||",
- " ||---------{ x * 9 }----------||",
- " || ||",
- " || {DIV y :=} ||",
- " ||-----------{ temp / 5 }-----------||",
- "",
- "Ceci fonctionne tant que x < (32767 / 9), or x < 3640. Pour les grandes ",
- "valeurs de x,la variable `temp' va se mettre en d�passement. Ceci est ",
- "similaire vers la limite basse de x.",
- "",
- "",
- "STYLE DE CODIFICATION",
- "=====================",
- "",
- "Il est permis d'avoir plusieurs bobines en parall�le, contr�l�es par",
- "une simple ligne comme ci-dessous :",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || Xb Yb ||",
- " ||-------] [------+-------( )-------||",
- " || | ||",
- " || | Yc ||",
- " || +-------( )-------||",
- " || ||",
- "",
- "� la place de ceci :",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yb ||",
- " 2 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yc ||",
- " 3 ||-------] [--------------( )-------||",
- " || ||",
- "",
- "Il est permis th�oriquement d'�crire un programme avec une s�quence tr�s",
- "importante et de ne pas utiliser plusieurs lignes pour la faire. En",
- "pratique c'est une mauvaise id�e, � cause de la compl�xit� que cela",
- "peut engendrer et plus difficile � �diter sans effacer et redessiner un",
- "certain nombre d'�l�ments de logique.",
- "",
- "N�anmoins, c'est une bonne id�e de regrouper diff�rents �l�ments d'un bloc",
- "logique dans une seule s�quence. Le code g�n�r� est identique dans les",
- "deux cas, et vous pouvez voir ce que fait la s�quence dans le diagramme",
- "� contacts.",
- "",
- " * * *",
- "",
- "En g�n�ral, il est consid�r� comme mauvais d'�crire du code dont la",
- "sortie d�pend de l'ordre d'ex�cution. Exemple : ce code n'est pas tr�s",
- "bon lorsque xa et xb sont vrai en m�me temps :",
- "",
- " || Xa {v := } ||",
- " 1 ||-------] [--------{ 12 MOV}--||",
- " || ||",
- " || Xb {v := } ||",
- " ||-------] [--------{ 23 MOV}--||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || [v >] Yc ||",
- " 2 ||------[ 15]-------------( )-------||",
- " || ||",
- "",
- "Ci-dessous un exemple pour convertir 4 bits Xb3:0 en un entier :",
- "",
- " || {v := } ||",
- " 3 ||-----------------------------------{ 0 MOV}--||",
- " || ||",
- " || Xb0 {ADD v :=} ||",
- " ||-------] [------------------{ v + 1 }-----------||",
- " || ||",
- " || Xb1 {ADD v :=} ||",
- " ||-------] [------------------{ v + 2 }-----------||",
- " || ||",
- " || Xb2 {ADD v :=} ||",
- " ||-------] [------------------{ v + 4 }-----------||",
- " || ||",
- " || Xb3 {ADD v :=} ||",
- " ||-------] [------------------{ v + 8 }-----------||",
- " || ||",
- "",
- "Si l'instruction MOV est d�plac�e en dessous des instructions ADD, la",
- "valeur de la variable v, quand elle est lue autrepart dans le programme,",
- "serait toujours 0. La sortie du code d�pend alors de l'ordre d'�valuations",
- "des instructions. Ce serait possible de modifier ce code pour �viter cela,",
- "mais le code deviendrait tr�s encombrant.",
- "",
- "DEFAUTS",
- "=======",
- "",
- "LDmicro ne g�n�re pas un code tr�s efficace; il est lent � ex�cuter et",
- "il est gourmand en Flash et RAM. Un PIC milieu de gamme ou un AVR peut",
- "tout de m�me faire ce qu'un petit automate peut faire.",
- "",
- "La longueur maximum des noms de variables est tr�s limit�e, ceci pour",
- "�tre int�gr�e correctement dans le diagramme logique, je ne vois pas de",
- "solution satisfaisante pour solutionner ce probl�me.",
- "",
- "Si votre programme est trop important, vitesse ex�cution, m�moire",
- "programme ou contraintes de m�moire de donn�es pour le processeur que vous",
- "avez choisi, il n'indiquera probablement pas d'erreur. Il se blocquera",
- "simplement quelque part.",
- "",
- "Si vous �tes programmeur n�gligent dans les sauvegardes et les",
- "chargements, il est possible qu'un crash se produise ou ex�cute un code",
- "arbitraire corrompu ou un mauvais fichier .ld .",
- "",
- "SVP, faire un rapport sur les bogues et les demandes de modifications.",
- "",
- "Thanks to:",
- " * Marcelo Solano, for reporting a UI bug under Win98",
- " * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
- " PIC16F628 didn't work but also telling me how to fix it",
- " * Maxim Ibragimov, for reporting and diagnosing major problems",
- " with the till-then-untested ATmega16 and ATmega162 targets",
- " * Bill Kishonti, for reporting that the simulator crashed when the",
- " ladder logic program divided by zero",
- " * Mohamed Tayae, for reporting that persistent variables were broken",
- " on the PIC16F628",
- " * David Rothwell, for reporting several user interface bugs and a",
- " problem with the \"Export as Text\" function",
- "",
- "Particular thanks to Marcel Vaufleury, for this translation (of both",
- "the manual and the program's user interface) into French.",
- "",
- "",
- "COPYING, AND DISCLAIMER",
- "=======================",
- "",
- "DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
- "FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
- "AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
- "OF LDMICRO OR CODE GENERATED BY LDMICRO.",
- "",
- "This program is free software: you can redistribute it and/or modify it",
- "under the terms of the GNU General Public License as published by the",
- "Free Software Foundation, either version 3 of the License, or (at your",
- "option) any later version.",
- "",
- "This program is distributed in the hope that it will be useful, but",
- "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
- "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
- "for more details.",
- "",
- "You should have received a copy of the GNU General Public License along",
- "with this program. If not, see <http://www.gnu.org/licenses/>.",
- "",
- "",
- "Jonathan Westhues",
- "",
- "Rijswijk -- Dec 2004",
- "Waterloo ON -- Jun, Jul 2005",
- "Cambridge MA -- Sep, Dec 2005",
- " Feb, Mar 2006",
- "",
- "Email: user jwesthues, at host cq.cx",
- "",
- "",
- NULL
-};
-#endif
-
-#ifdef LDLANG_TR
-char *HelpTextTr[] = {
- "",
- "KULLANIM K�TAP�I�I",
- "==================",
- "LDMicro desteklenen MicroChip PIC16 ve Atmel AVR mikrokontrolc�ler i�in ",
- "gerekli kodu �retir. Bu i� i�in kullan�labilecek de�i�ik programlar vard�r.",
- "�rne�in BASIC, C, assembler gibi. Bu programlar kendi dillerinde yaz�lm��",
- "programlar� i�lemcilerde �al��abilecek dosyalar haline getirirler.",
- "",
- "PLC'de kullan�lan dillerden biri ladder diyagram�d�r. A�a��da LDMicro ile",
- "yaz�lm�� basit bir program g�r�lmektedir.",
- "",
- " || ||",
- " || Xbutton1 Tdon Rchatter Yred ||",
- " 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
- " || | ||",
- " || Xbutton2 Tdof | ||",
- " ||-------]/[---------[TOF 2.000 s]-+ ||",
- " || ||",
- " || ||",
- " || ||",
- " || Rchatter Ton Tnew Rchatter ||",
- " 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " ||------[END]---------------------------------------------------------||",
- " || ||",
- " || ||",
- "",
- "(TON=turn-on gecikme; TOF-turn-off gecikme. --] [-- giri�ler, di�er bir ",
- "deyi�le kontaklard�r. --( )-- ise ��k��lard�r. Bunlar bir r�lenin bobini ",
- "gibi davran�rlar. Ladder diyagram� ile ilgili bol miktarda kaynak internet",
- "�zerinde bulunmaktad�r. Burada LDMicro'ya has �zelliklerden bahsedece�iz.",
- "",
- "LDmicro ladder diyagram�n� PIC16 veya AVR koduna �evirir. A�a��da desteklenen",
- "i�lemcilerin listesi bulunmaktad�r:",
- " * PIC16F877",
- " * PIC16F628",
- " * PIC16F876 (denenmedi)",
- " * PIC16F88 (denenmedi)",
- " * PIC16F819 (denenmedi)",
- " * PIC16F887 (denenmedi)",
- " * PIC16F886 (denenmedi)",
- " * ATmega128",
- " * ATmega64",
- " * ATmega162 (denenmedi)",
- " * ATmega32 (denenmedi)",
- " * ATmega16 (denenmedi)",
- " * ATmega8 (denenmedi)",
- "",
- "Asl�nda daha fazla PIC16 ve AVR i�lemci desteklenebilir. Ancak test ettiklerim",
- "ve destekledi�ini d���nd�klerimi yazd�m. �rne�in PIC16F648 ile PIC16F628 ",
- "aras�nda fazla bir fark bulunmamaktad�r. E�er bir i�lemcinin desteklenmesini",
- "istiyorsan�z ve bana bildirirseniz ilgilenirim.",
- "",
- "LDMicro ile ladder diyagram�n� �izebilir, devrenizi denemek i�in ger�ek zamanl� ",
- "sim�lasyon yapabilirsiniz. Program�n�z�n �al��t���ndan eminseniz programdaki ",
- "giri� ve ��k��lara mikrokontrol�r�n bacaklar�n� atars�n�z. ��lemci bacaklar� ",
- "belli olduktan sonra program�n�z� derleyebilirsiniz. Derleme sonucunda olu�an",
- "dosya .hex dosyas�d�r. Bu dosyay� PIC/AVR programlay�c� ile i�lemcinize kaydedersiniz.",
- "PIC/AVR ile u�ra�anlar konuya yabanc� de�ildir.",
- "",
- "",
- "LDMicro ticari PLC programlar� gibi tasarlanm��t�r. Baz� eksiklikler vard�r. ",
- "Kitap���� dikkatlice okuman�z� tavsiye ederim. Kullan�m esnas�nda PLC ve ",
- "PIC/AVR hakk�nda temel bilgilere sahip oldu�unuz d���n�lm��t�r.",
- "",
- "D��ER AMA�LAR",
- "==================",
- "",
- "ANSI C kodunu olu�turmak m�mk�nd�r. C derleyicisi olan herhangi bir",
- "i�lemci i�in bu �zellikten faydalanabilirsiniz. Ancak �al��t�rmak i�in ",
- "gerekli dosyalar� siz sa�lamal�s�n�z. Yani, LDMicro sadece PlcCycle()",
- "isimli fonksiyonu �retir. Her d�ng�de PlcCycle fonksiyonunu �a��rmak, ve",
- "PlcCycle() fonksiyonunun �a��rd��� dijital giri�i yazma/okuma vs gibi",
- "G/� fonksiyonlar� sizin yapman�z gereken i�lemlerdir.",
- "Olu�turulan kodu incelerseniz faydal� olur.",
- "",
- "KOMUT SATIRI SE�ENEKLER�",
- "========================",
- "",
- "Normal �artlarda ldmicro.exe komut sat�r�ndan se�enek almadan �al���r.",
- "LDMicro'ya komut sat�r�ndan dosya ismi verebilirsiniz. �rne�in;komut",
- "sat�r�ndan 'ldmicro.exe asd.ld' yazarsan�z bu dosya a��lmaya �al���rl�r.",
- "Dosya varsa a��l�r. Yoksa hata mesaj� al�rs�n�z. �sterseniz .ld uzant�s�n�",
- "ldmicro.exe ile ili�kilendirirseniz .ld uzant�l� bir dosyay� �ift t�klatt���n�zda",
- "bu dosya otomatik olarak a��l�r. Bkz. Klas�r Se�enekleri (Windows).",
- "",
- "`ldmicro.exe /c src.ld dest.hex', �eklinde kullan�l�rsa src.ld derlenir",
- "ve haz�rlanan derleme dest.hex dosyas�na kaydedilir. ��lem bitince LDMicro kapan�r.",
- "Olu�abilecek t�m mesajlar konsoldan g�r�n�r.",
- "",
- "TEMEL B�LG�LER",
- "==============",
- "",
- "LDMicro a��ld���nda bo� bir program ile ba�lar. Varolan bir dosya ile ba�lat�rsan�z",
- "bu program a��l�r. LDMicro kendi dosya bi�imini kulland���ndan di�er dosya",
- "bi�imlerinden dosyalar� a�amazs�n�z.",
- "",
- "Bo� bir dosya ile ba�larsan�z ekranda bir tane bo� sat�r g�r�rs�n�z. Bu sat�ra",
- "komutlar� ekleyebilir, sat�r say�s�n� art�rabilirsiniz. Sat�rlara Rung denilir.",
- "�rne�in; Komutlar->Kontak Ekle diyerek bir kontak ekleyebilirsiniz. Bu konta�a",
- "'Xnew' ismi verilir. 'X' bu konta��n i�lemcinin baca��na denk geldi�ini g�sterir.",
- "Bu konta�a derlemeden �nce isim vermeli ve mikrokontrol�r�n bir baca�� ile",
- "e�le�tirmelisiniz. E�le�tirme i�lemi i�inde �nce i�lemciyi se�melisiniz.",
- "Elemanlar�n ilk harfi o eleman�n ne oldu�u ile ilgilidir. �rnekler:",
- "",
- " * Xname -- mikrokontrol�rdeki bir giri� baca��",
- " * Yname -- mikrokontrol�rdeki bir ��k�� baca��",
- " * Rname -- `dahili r�le': haf�zada bir bit.",
- " * Tname -- zamanlay�c�; turn-on, turn-off yada retentive ",
- " * Cname -- say�c�, yukar� yada a�a�� say�c�",
- " * Aname -- A/D �eviriciden okunan bir tamsay� de�er",
- " * name -- genel de�i�ken (tamsay�)",
- "",
- "�stedi�iniz ismi se�ebilirsiniz. Se�ilen bir isim nerede kullan�l�rsa",
- "kullan�ls�n ayn� yere denk gelir. �rnekler; bir sat�rda Xasd kulland���n�zda",
- "bir ba�ka sat�rda Xasd kullan�rsan�z ayn� de�ere sahiptirler. ",
- "Bazen bu mecburi olarak kullan�lmaktad�r. Ancak baz� durumlarda hatal� olabilir.",
- "Mesela bir (TON) Turn-On Gecikmeye Tgec ismini verdikten sonra bir (TOF)",
- "Turn_Off gecikme devresine de Tgec ismini verirseniz hata yapm�� olursunuz.",
- "Dikkat ederseniz yapt���n�z bir mant�k hatas�d�r. Her gecikme devresi kendi",
- "haf�zas�na sahip olmal�d�r. Ama Tgec (TON) turn-on gecikme devresini s�f�rlamak",
- "i�in kullan�lan RES komutunda Tgec ismini kullanmak gerekmektedir.",
- "",
- "De�i�ken isimleri harfleri, say�lar�, alt �izgileri ihtiva edebilir.",
- "(_). De�i�ken isimleri say� ile ba�lamamal�d�r. De�i�ken isimleri b�y�k-k���k harf duyarl�d�r.",
- "�rne�in; TGec ve Tgec ayn� zamanlay�c�lar de�ildir.",
- "",
- "",
- "Genel de�i�kenlerle ilgili komutlar (MOV, ADD, EQU vs) herhangi bir",
- "isimdeki de�i�kenlerle �al���r. Bunun anlam� bu komutlar zamanlay�c�lar",
- "ve say�c�larla �al���r. Zaman zaman bu faydal� olabilir. �rne�in; bir ",
- "zamanlay�c�n�n de�eri ile ilgili bir kar��la�t�rma yapabilirsiniz.",
- "",
- "De�i�kenler hr zaman i�in 16 bit tamsay�d�r. -32768 ile 32767 aras�nda",
- "bir de�ere sahip olabilirler. Her zaman i�in i�aretlidir. (+ ve - de�ere",
- "sahip olabilirler) Onluk say� sisteminde say� kullanabilirsiniz. T�rnak",
- "aras�na koyarak ('A', 'z' gibi) ASCII karakterler kullanabilirsiniz.",
- "",
- "Ekran�n alt taraf�ndaki k�s�mda kullan�lan t�m elemanlar�n bir listesi g�r�n�r.",
- "Bu liste program taraf�ndan otomatik olarak olu�turulur ve kendili�inden",
- "g�ncelle�tirilir. Sadece 'Xname', 'Yname', 'Aname' elemanlar� i�in",
- "mikrokontrol�r�n bacak numaralar� belirtilmelidir. �nce Ayarlar->��lemci Se�imi",
- "men�s�nden i�lemciyi se�iniz. Daha sonra G/� u�lar�n� �ift t�klatarak a��lan",
- "pencereden se�iminizi yap�n�z.",
- "",
- "Komut ekleyerek veya ��kararak program�n�z� de�i�tirebilirsiniz. Programdaki",
- "kurs�r eleman eklenecek yeri veya hakk�nda i�lem yap�lacak eleman� g�stermek",
- "amac�yla yan�p s�ner. Elemanlar aras�nda <Tab> tu�u ile gezinebilirsiniz. Yada",
- "eleman� fare ile t�klatarak i�lem yap�lacak eleman� se�ebilirsiniz. Kurs�r eleman�n",
- "solunda, sa��nda, alt�nda ve �st�nde olabilir. Solunda ve sa��nda oldu�unda",
- "ekleme yapt���n�zda eklenen eleman o tarafa eklenir. �st�nde ve alt�nda iken",
- "eleman eklerseniz eklenen eleman se�ili elemana paralel olarak eklenir.",
- "Baz� i�lemleri yapamazs�n�z. �rne�in bir bobinin sa��na eleman ekleyemezsiniz.",
- "LDMicro buna izin vermeyecektir.",
- "",
- "Program bo� bir sat�rla ba�lar. Kendiniz alta ve �ste sat�r ekleyerek diledi�iniz",
- "gibi diyagram�n�z� olu�turabilirsiniz. Yukar�da bahsedildi�i gibi alt devreler",
- "olu�turabilirsiniz.",
- "",
- "Program�n�z yazd���n�zda sim�lasyon yapabilir, .hex dosyas�n� olu�turabilirsiniz.",
- "",
- "S�M�LASYON",
- "==========",
- "",
- "Sim�lasyon moduna ge�mek i�in Sim�lasyon->Sim�lasyon modu men�s�n� t�klatabilir,",
- "yada <Ctrl+M> tu� kombinasyonuna basabilirsiniz. Sim�lasyon modunda program",
- "farkl� bir g�r�nt� al�r. Kurs�r g�r�nmez olur. Enerji alan yerler ve elemanlar",
- "parlak k�rm�z�, enerji almayan yerler ve elemanlar gri g�r�n�r. Bo�luk tu�una",
- "basarak bir �evrim ilerleyebilir yada men�den Sim�lasyon->Ger�ek Zamanl� Sim�lasyonu Ba�lat",
- "diyerek (veya <Ctrl+R>) devaml� bir �evrim ba�latabilirsiniz. Ladder diyagram�n�n",
- "�al��mas�na g�re ger�ek zamanl� olarak elemanlar ve yollar program taraf�ndan de�i�tirilir.",
- "",
- "Giri� elemanlar�n�n durumunu �ift t�klatarak de�i�tirebilirsiniz. Mesela, 'Xname'",
- "konta��n� �ift t�klat�ran�z a��ktan kapal�ya veya kapal�dan a���a ge�i� yapar.",
- "",
- "DERLEME",
- "=======",
- "",
- "Ladder diyagram�n�n yap�lmas�ndaki ama� i�lemciye y�klenecek .hex dosyas�n�n",
- "olu�turulmas�d�r. Buna 'derleme' denir. Derlemeden �nce �u a�amalar tamamlanmal�d�r:",
- " 1- ��lemci se�ilmelidir. Ayarlar->��lemci Se�imi men�s�nden yap�l�r.",
- " 2- G/� u�lar�n�n mikrokontrol�rdeki hangi bacaklara ba�lanaca�� se�ilmelidir.",
- " Eleman�n �zerine �ift t�klan�r ve ��kan listeden se�im yap�l�r.",
- " 3- �evrim s�resi tan�mlanmal�d�r. Ayarlar->��lemci Ayarlar� men�s�nden yap�l�r.",
- " Bu s�re i�lemcinin �al��t��� frekansa ba�l�d�r. �o�u uygulamalar i�in 10ms",
- " uygun bir se�imdir. Ayn� yerden kristal frekans�n� ayarlamay� unutmay�n�z.",
- "",
- "Art�k kodu �retebilirsiniz. Derle->Derle yada Derle->Farkl� Derle se�eneklerinden",
- "birini kullanacaks�n�z. Aradaki fark Kaydet ve Farkl� Kaydet ile ayn�d�r. Sonu�ta",
- "Intel IHEX dosyan�z program�n�zda hata yoksa �retilecektir. Program�n�zda hata varsa",
- "uyar� al�rs�n�z.",
- "",
- "Progamlay�c�n�z ile bu dosyay� i�lemcinize y�klemelisiniz. Buradaki en �nemli nokta",
- "i�lemcinin konfig�rasyon bitlerinin ayarlanmas�d�r. PIC16 i�lemciler i�in gerekli ",
- "ayar bilgileri hex dosyas�na kaydedildi�inden programlay�c�n�z bu ayarlar� alg�layacakt�r.",
- "Ancak AVR i�lemciler i�in gerekli ayarlar� siz yapmal�s�n�z.",
- "",
- "KOMUTLAR ve ELEMANLAR",
- "=====================",
- "",
- "> KONTAK, NORMALDE A�IK Xname Rname Yname",
- " ----] [---- ----] [---- ----] [----",
- "",
- " Normalde a��k bir anahtar gibi davran�r. Komutu kontrol eden sinyal 0 ise ",
- " ��k���ndaki sinyalde 0 olur. E�er kontrol eden sinyal 1 olursa ��k��� da 1",
- " olur ve ��k��a ba�l� bobin aktif olur. Bu kontak i�lemci baca��ndan al�nan",
- " bir giri�, ��k�� baca�� yada dahili bir r�le olabilir.",
- "",
- "",
- "> KONTAK, NORMALDE KAPALI Xname Rname Yname",
- " ----]/[---- ----]/[---- ----]/[----",
- "",
- " Normalde kapal� bir anahtar gibi davran�r. Komutun kontrol eden sinyal 0 ise",
- " ��k��� 1 olur. E�er kontrol eden sinyal 1 olursa ��k��� 0 olur ve ��k��a",
- " ba�l� elemanlar pasif olur. Normalde ��k��a gerilim verilir, ancak bu konta�� ",
- " kontrol eden sinyal 1 olursa konta��n ��k���nda gerilim olmaz. Bu kontak ",
- " i�lemci baca��ndan al�nan bir giri�, ��k�� baca�� yada dahili bir r�le olabilir",
- "",
- "",
- "> BOB�N, NORMAL Rname Yname",
- " ----( )---- ----( )----",
- "",
- " Elemana giren sinyal 0 ise dahili r�le yada ��k�� baca�� 0 yap�l�r.",
- " Elemana giren sinyal 1 ise dahili r�le yada ��k�� baca�� 1 yap�l�r.",
- " Bobine giri� de�i�keni atamak mant�ks�zd�r. Bu eleman bir sat�rda",
- " sa�daki en son eleman olmal�d�r.",
- "",
- "",
- "> BOB�N, TERSLENM�� Rname Yname",
- " ----(/)---- ----(/)----",
- "",
- " Elemana giren sinyal 0 ise dahili r�le yada ��k�� baca�� 1 yap�l�r.",
- " Elemana giren sinyal 1 ise dahili r�le yada ��k�� baca�� 0 yap�l�r.",
- " Bobine giri� de�i�keni atamak mant�ks�zd�r. Bu eleman bir sat�rda",
- " sa�daki en son eleman olmal�d�r. Normal bobinin tersi �al���r.",
- " ",
- "",
- "> BOB�N, SET Rname Yname",
- " ----(S)---- ----(S)----",
- "",
- " Elemana giren sinyal 1 ise dahili r�le yada ��k�� baca�� 1 yap�l�r.",
- " Di�er durumlarda bu bobinin durumunda bir de�i�iklik olmaz. Bu komut",
- " bobinin durumunu sadece 0'dan 1'e �evirir. Bu nedenle �o�unlukla",
- " BOB�N-RESET ile beraber �al���r. Bu eleman bir sat�rda sa�daki en",
- " son eleman olmal�d�r.",
- "",
- "",
- "> BOB�N, RESET Rname Yname",
- " ----(R)---- ----(R)----",
- "",
- " Elemana giren sinyal 1 ise dahili r�le yada ��k�� baca�� 0 yap�l�r.",
- " Di�er durumlarda bu bobinin durumunda bir de�i�iklik olmaz. Bu komut",
- " bobinin durumunu sadece 1'dEn 0'a �evirir. Bu nedenle �o�unlukla",
- " BOB�N-SET ile beraber �al���r. Bu eleman bir sat�rda sa�daki en",
- " son eleman olmal�d�r.",
- "",
- "",
- "> TURN-ON GEC�KME Tdon ",
- " -[TON 1.000 s]-",
- "",
- " Bir zamanlay�c�d�r. Giri�indeki sinyal 0'dan 1'e ge�erse ayarlanan",
- " s�re kadar s�rede ��k�� 0 olarak kal�r, s�re bitince ��k��� 1 olur. ",
- " Giri�indeki sinyal 1'den 0'a ge�erse ��k�� hemen 0 olur.",
- " Giri�i 0 oldu�u zaman zamanlay�c� s�f�rlan�r. Ayr�ca; ayarlanan s�re",
- " boyunca giri� 1 olarak kalmal�d�r.",
- "",
- " Zamanlay�c� 0'dan ba�layarak her �evrim s�resinde 1 artarak sayar.",
- " Say� ayarlanan s�reye e�it yada b�y�kse ��k�� 1 olur. Zamanlay�c�",
- " de�i�keni �zerinde i�lem yapmak m�mk�nd�r. (�rne�in MOV komutu ile)",
- "",
- "",
- "> TURN-OFF GEC�KME Tdoff ",
- " -[TOF 1.000 s]-",
- "",
- " Bir zamanlay�c�d�r. Giri�indeki sinyal 1'den 0'a ge�erse ayarlanan",
- " s�re kadar s�rede ��k�� 1 olarak kal�r, s�re bitince ��k��� 0 olur. ",
- " Giri�indeki sinyal 0'dan 1'e ge�erse ��k�� hemen 1 olur.",
- " Giri�i 0'dan 1'e ge�ti�inde zamanlay�c� s�f�rlan�r. Ayr�ca; ayarlanan",
- " s�re boyunca giri� 0 olarak kalmal�d�r.",
- "",
- " Zamanlay�c� 0'dan ba�layarak her �evrim s�resinde 1 artarak sayar.",
- " Say� ayarlanan s�reye e�it yada b�y�kse ��k�� 1 olur. Zamanlay�c�",
- " de�i�keni �zerinde i�lem yapmak m�mk�nd�r. (�rne�in MOV komutu ile)",
- "",
- "",
- "> S�RE SAYAN TURN-ON GEC�KME Trto ",
- " -[RTO 1.000 s]-",
- "",
- " Bu zamanlay�c� giri�indeki sinyalin ne kadar s�re ile 1 oldu�unu",
- " �l�er. Ayaralanan s�re boyunca giri� 1 ise ��k��� 1 olur. Aksi halde",
- " ��k��� 0 olur. Ayarlanan s�re devaml� olmas� gerekmez. �rne�in; s�re ",
- " 1 saniyeye ayarlanm��sa ve giri� �nce 0.6 sn 1 olmu�sa, sonra 2.0 sn",
- " boyunca 0 olmu�sa daha sonra 0.4 sn boyunca giri� tekrar 1 olursa",
- " 0.6 + 0.4 = 1sn oldu�undan ��k�� 1 olur. ��k�� 1 olduktan sonra",
- " giri� 0 olsa dahi ��k�� 0'a d�nmez. Bu nedenle zamanlay�c� RES reset",
- " komutu ile resetlenmelidir.",
- "",
- " Zamanlay�c� 0'dan ba�layarak her �evrim s�resinde 1 artarak sayar.",
- " Say� ayarlanan s�reye e�it yada b�y�kse ��k�� 1 olur. Zamanlay�c�",
- " de�i�keni �zerinde i�lem yapmak m�mk�nd�r. (�rne�in MOV komutu ile)",
- "",
- "",
- "> RESET (SAYICI SIFIRLAMASI) Trto Citems",
- " ----{RES}---- ----{RES}----",
- "",
- " Bu komut bir zamanlay�c� veya say�c�y� s�f�rlar. TON ve TOF zamanlay�c�",
- " komutlar� kendili�inden s�f�rland���ndan bu komuta ihtiya� duymazlar.",
- " RTO zamanlay�c�s� ve CTU/CTD say�c�lar� kendili�inden s�f�rlanmad���ndan",
- " s�f�rlanmalar� i�in kullan�c� taraf�ndan bu komutile s�f�rlanmas�",
- " gerekir. Bu komutun giri�i 1 oldu�unda say�c�/zamanlay�c� s�f�rlan�r.",
- " Bu komut bir sat�r�n sa��ndaki son komut olmal�d�r.",
- "",
- "",
- "> Y�KSELEN KENAR _",
- " --[OSR_/ ]--",
- "",
- " Bu komutun ��k��� normalde 0'd�r. Bu komutun ��k���n�n 1 olabilmesi",
- " i�in bir �nceki �evrimde giri�inin 0 �imdiki �evrimde giri�inin 1 ",
- " olmas� gerekir. Komutun ��k��� bir �evrimlik bir pals �retir.",
- " Bu komut bir sinyalin y�kselen kenar�nda bir tetikleme gereken",
- " uygulamalarda faydal�d�r.",
- " ",
- "",
- "> D��EN KENAR _",
- " --[OSF \\_]--",
- "",
- " Bu komutun ��k��� normalde 0'd�r. Bu komutun ��k���n�n 1 olabilmesi",
- " i�in bir �nceki �evrimde giri�inin 1 �imdiki �evrimde giri�inin 0 ",
- " olmas� gerekir. Komutun ��k��� bir �evrimlik bir pals �retir.",
- " Bu komut bir sinyalin d��en kenar�nda bir tetikleme gereken",
- " uygulamalarda faydal�d�r.",
- "",
- "",
- "> KISA DEVRE, A�IK DEVRE",
- " ----+----+---- ----+ +----",
- "",
- " K�sa devrenin ��k��� her zaman giri�inin ayn�s�d�r.",
- " A��k devrenin ��k��� her zaman 0'd�r. Bildi�imiz a��k/k�sa devrenin",
- " ayn�s�d�r. Genellikle hata aramada kullan�l�rlar.",
- "",
- "> ANA KONTROL R�LES�",
- " -{MASTER RLY}-",
- "",
- " Normalde her sat�r�n ilk giri�i 1'dir. Birden fazla sat�r�n tek bir �art ile ",
- " kontrol edilmesi gerekti�inde paralel ba�lant� yapmak gerekir. Bu ise zordur.",
- " Bu i�lemi kolayca yapabilmek i�in ana kontrol r�lesini kullanabiliriz.",
- " Ana kontrol r�lesi eklendi�inde kendisinden sonraki sat�rlar bu r�leye ba�l�",
- " hale gelir. B�ylece; birden fazla sat�r tek bir �art ile kontrol� sa�lan�r.",
- " Bir ana kontrol r�lesi kendisinden sonra gelen ikinci bir ana kontrol",
- " r�lesine kadar devam eder. Di�er bir deyi�le birinci ana kontrol r�lesi",
- " ba�lang�c� ikincisi ise biti�i temsil eder. Ana kontrol r�lesi kulland�ktan",
- " sonra i�levini bitirmek i�in ikinci bir ana kontrol r�lesi eklemelisiniz.",
- "",
- "> MOVE {destvar := } {Tret := }",
- " -{ 123 MOV}- -{ srcvar MOV}-",
- "",
- " Giri�i 1 oldu�unda verilen sabit say�y� (123 gibi) yada verilen de�i�kenin",
- " i�eri�ini (srcvar) belirtilen de�i�kene (destvar) atar. Giri� 0 ise herhangi",
- " bir i�lem olmaz. Bu komut ile zamanlay�c� ve say�c�lar da dahil olmak �zere",
- " t�m de�i�kenlere de�er atayabilirsiniz. �rne�in Tsay zamanlay�c�s�na MOVE ile",
- " 0 atamak ile RES ile s�f�rlamak ayn� sonucu do�urur. Bu komut bir sat�r�n",
- " sa��ndaki en son komut olmal�d�r.",
- "",
- "> MATEMAT�K ��LEMLER {ADD kay :=} {SUB Ccnt :=}",
- " -{ 'a' + 10 }- -{ Ccnt - 10 }-",
- "",
- "> {MUL dest :=} {DIV dv := }",
- " -{ var * -990 }- -{ dv / -10000}-",
- "",
- " Bu komutun giri�i do�ru ise belirtilen hedef de�i�kenine verilen matematik",
- " i�lemin sonucunu kaydeder. ��lenen bilgi zamanlay�c� ve say�c�lar dahil",
- " olmak �zere de�i�kenler yada sabit say�lar olabilir. ��lenen bilgi 16 bit",
- " i�aretli say�d�r. Her �evrimde i�lemin yeniden yap�ld��� unutulmamal�d�r.",
- " �rne�in art�rma yada eksiltme yap�yorsan�z y�kselen yada d��en kenar",
- " kullanman�z gerekebilir. B�lme (DIV) virg�lden sonras�n� keser. �rne�in;",
- " 8 / 3 = 2 olur. Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- "",
- "> KAR�ILA�TIRMA [var ==] [var >] [1 >=]",
- " -[ var2 ]- -[ 1 ]- -[ Ton]-",
- "",
- "> [var /=] [-4 < ] [1 <=]",
- " -[ var2 ]- -[ vartwo]- -[ Cup]-",
- "",
- " De�i�ik kar��la�t�rma komutlar� vard�r. Bu komutlar�n giri�i do�ru (1)",
- " ve verilen �art da do�ru ise ��k��lar� 1 olur.",
- "",
- "",
- "> SAYICI Cname Cname",
- " --[CTU >=5]-- --[CTD >=5]--",
- "",
- " Say�c�lar giri�lerinin 0'dan 1'e her ge�i�inde yani y�kselen kenar�nda",
- " de�erlerini 1 art�r�r (CTU) yada eksiltirler (CTD). Verilen �art do�ru ise",
- " ��k��lar� aktif (1) olur. CTU ve CTD say�c�lar�na ayn� ismi erebilirsiniz.",
- " B�ylece ayn� say�c�y� art�rm�� yada eksiltmi� olursunuz. RES komutu say�c�lar�",
- " s�f�rlar. Say�c�lar ile genel de�i�kenlerle kulland���n�z komutlar� kullanabilirsiniz.",
- "",
- "",
- "> DA�RESEL SAYICI Cname",
- " --{CTC 0:7}--",
- "",
- " Normal yukar� say�c�dan fark� belirtilen limite ula��nca say�c� tekrar 0'dan ba�lar",
- " �rne�in say�c� 0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 2,.... �eklinde",
- " sayabilir. Yani bir dizi say�c� olarak d���n�lebilir. CTC say�c�lar giri�lerinin",
- " y�kselen kenar�nda de�er de�i�tirirler. Bu komut bir sat�r�n sa��ndaki",
- " en son komut olmal�d�r.",
- " ",
- "",
- "> SHIFT REGISTER {SHIFT REG }",
- " -{ reg0..3 }-",
- "",
- " Bir dizi de�i�ken ile beraber �al���r. �sim olarak reg verdi�inizi ve a�ama ",
- " say�s�n� 3 olarak tan�mlad�ysan�z reg0, reg1, reg2 de�ikenleri ile �al���rs�n�z.",
- " Kaydedicinin giri�i reg0 olur. Giri�in her y�kselen kenar�nda de�erler kaydedicide",
- " bir sa�a kayar. Mesela; `reg2 := reg1'. and `reg1 := reg0'. `reg0' de�i�mez.",
- " Geni� bir kaydedici haf�zada �ok yer kaplar.",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- "",
- "> DE�ER TABLOSU {dest := }",
- " -{ LUT[i] }-",
- "",
- " De�er tablosu s�ralanm�� n adet de�er i�eren bir tablodur. Giri�i do�ru oldu�unda",
- " `dest' tamsay� de�i�keni `i' tamsay� de�i�kenine kar��l�k gelen de�eri al�r. S�ra",
- " 0'dan ba�lar. bu nedenle `i' 0 ile (n-1) aras�nda olabilir. `i' bu de�erler ",
- " aras�nda de�ilse komutun ne yapaca�� tan�ml� de�ildir.",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- "",
- "> PIECEWISE LINEAR TABLE {yvar := }",
- " -{ PWL[xvar] }-",
- "",
- " Bir matris tablo olarak d���n�lebilir. Bir de�ere ba�l� olarak de�erin �nceden",
- " belirlenen bir ba�ka de�er ile de�i�tirilmesi i�i olu�turulan bir tablodur.",
- " Bu bir e�ri olu�turmak, sens�rden al�nan de�ere g�re ��k��ta ba�ka bir e�ri",
- " olu�turmak gibi ama�lar i�in kullan�labilir.",
- "",
- " Farzedelimki x tamsay� giri� de�erini y tamsay� ��k�� de�erine yakla�t�rmak ",
- " istiyoruz. De�erlerin belirli noktalarda oldu�unu biliyoruz. �rne�in;",
- "",
- " f(0) = 2",
- " f(5) = 10",
- " f(10) = 50",
- " f(100) = 100",
- "",
- " Bu �u noktalar�n e�ride oldu�unu g�sterir:",
- "",
- " (x0, y0) = ( 0, 2)",
- " (x1, y1) = ( 5, 10)",
- " (x2, y2) = ( 10, 50)",
- " (x3, y3) = (100, 100)",
- "",
- " D�rt de�eri par�al� lineer tabloya gireriz. Komut, xvar'�n de�erine bakarak",
- " yvar'a de�er verir. �rne�in, yukar�daki �rne�e bakarak, xvar = 10 ise",
- " yvar = 50 olur.",
- " ",
- " Tabloya kay�tl� iki de�erin aras�nda bir de�er verirseniz verilen de�er de",
- " al�nmas� gereken iki de�erin aras�nda uygun gelen yerde bir de�er olur.",
- " Mesela; xvar=55 yazarsan�z yvar=75 olur. (Tablodaki de�erler (10,50) ve",
- " (100,100) oldu�una g�re). 55, 10 ve 100 de�erlerinin ortas�ndad�r. Bu",
- " nedenle 55 ve 75 de�erlerinin ortas� olan 75 de�eri al�n�r.",
- " ",
- " De�erler x koordinat�nda artan de�erler olarak yaz�lmal�d�r. 16 bit tamsay�",
- " kullanan baz� de�erler i�in arama tablosu �zerinde matematik i�lemler",
- " ger�ekle�meyebilir. Bu durumda LDMicro sizi uyaracakt�r. �rne�in a�a��daki",
- " tablo bir hata olu�turacakt�r:",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (300, 300)",
- "",
- " Bu tip hatalar� noktalar ars�nda ara de�erler olu�turarak giderebilirsiniz.",
- " �rne�in a�a��daki tablo yukar�dakinin ayn�s� olmas�na ra�men hata ",
- " olu�turmayacakt�r.",
- " ",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (150, 150)",
- " (x2, y2) = (300, 300)",
- "",
- " Genelde 5 yada 6 noktadan daha fazla de�er kullanmak gerekmeyecektir.",
- " Daha fazla nokta demek daha fazla kod ve daha yava� �al��ma demektir.",
- " En fazla 10 nokta olu�turabilirsiniz. xvar de�i�kenine x koordinat�nda",
- " tablonun en y�ksek de�erinden daha b�y�k bir de�er girmenin ve en d���k",
- " de�erinden daha k���k bir de�er girmenin sonucu tan�ml� de�ildir.",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- "> A/D �EV�R�C�DEN OKUMA Aname",
- " --{READ ADC}--",
- "",
- " LDmicro A/D �eviriciden de�er okumak i�in gerekli kodlar� destekledi�i",
- " i�lemciler i�in olu�turabilir. Komutun giri�i 1 oldu�unda A/D �eviriciden ",
- " de�er okunur ve okunan de�er `Aname' de�i�kenine aktar�l�r. Bu de�i�ken",
- " �zerinde genel de�i�kenlerle kullan�labilen i�lemler kullan�labilir.",
- " (b�y�k, k���k, b�y�k yada e�it gibi). Bu de�i�kene i�lemcinin bacaklar�ndan",
- " uygun biri tan�mlanmal�d�r. Komutun giri�i 0 ise `Aname'de�i�keninde bir",
- " de�i�iklik olmaz.",
- " ",
- " �u an desteklenen i�lemciler i�in; 0 Volt i�in ADC'den okunan de�er 0, ",
- " Vdd (besleme gerilimi) de�erine e�it gerilim de�eri i�in ADC'den okunan de�er",
- " 1023 olmaktad�r. AVR kullan�yorsan�z AREF ucunu Vdd besleme gerilimine ",
- " ba�lay�n�z.",
- " ",
- " Aritmetik i�lemler ADC de�i�keni i�in kullan�labilir. Ayr�ca bacak tan�mlarken",
- " ADC olmayan bacaklar�n tan�mlanmas�n� LDMicro engelleyecektir.",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- " > PWM PALS GEN��L��� AYARI duty_cycle",
- " -{PWM 32.8 kHz}-",
- "",
- " LDmicro destekledi�i mikrokontrol�rler i�in gerekli PWM kodlar�n� �retebilir.",
- " Bu komutun giri�i do�ru (1) oldu�unda PWM sinyalinin pals geni�li�i duty_cycle",
- " de�i�keninin de�erine ayarlan�r. Bu de�er 0 ile 100 aras�nda de�i�ir. Pals",
- " geni�li�i y�zde olarak ayarlan�r. Bir periyot 100 birim kabul edilirse bu",
- " geni�li�in y�zde ka��n�n palsi olu�turaca�� ayarlan�r. 0 periyodun t�m� s�f�r",
- " 100 ise periyodun tamam� 1 olsun anlam�na gelir. 10 de�eri palsin %10'u 1 geri",
- " kalan %90'� s�f�r olsun anlam�na gelir.",
- "",
- " PWM frekans�n� ayarlayabilirsiniz. Verilen de�er Hz olarak verilir.",
- " Verdi�iniz frekans kesinlikle ayarlanabilir olmal�d�r. LDMicro verdi�iniz de�eri",
- " olabilecek en yak�n de�erle de�i�tirir. Y�ksek h�zlarda do�ruluk azal�r.",
- " ",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- " Periyodun s�resinin �l��lebilmesi i�in i�lemcinin zamanlay�c�lar�n�n bir tanesi",
- " kullan�l�r. Bu nedenle PWM en az iki tane zamanlay�c�s� olan i�lemcilerde kullan�l�r.",
- " PWM PIC16 i�lemcilerde CCP2'yi, AVR'lerde ise OC2'yi kullan�r.",
- "",
- "",
- "> EEPROMDA SAKLA saved_var",
- " --{PERSIST}--",
- "",
- " Bu komut ile belirtilen de�i�kenin EEPROM'da saklanmas� gereken bir de�i�ken oldu�unu",
- " belirmi� olursunuz. Komutun giri�i do�ru ise belirtilen de�i�kenin i�eri�i EEPROM'a",
- " kaydedilir. Enerji kesildi�inde kaybolmamas� istenen de�erler i�in bu komut kullan�l�r.",
- " De�i�kenin i�eri�i gerilim geldi�inde tekrar EEPROM'dan y�klenir. Ayr�ca;",
- " de�i�kenin i�eri�i her de�i�ti�inde yeni de�er tekrar EEPROM'a kaydedilir.",
- " Ayr�ca bir i�lem yap�lmas� gerekmez.",
- " Bu komut bir sat�r�n sa��ndaki en son komut olmal�d�r.",
- "",
- "************************",
- "> UART (SER� B�LG�) AL var",
- " --{UART RECV}--",
- "",
- " LDmicro belirli i�lemciler i�in gerekli UART kodlar�n� �retebilir. AVR i�lemcilerde",
- " sadece UART1 (UART0) de�il) desteklenmektedir. �leti�im h�z� (baudrate) ayarlar�n� ",
- " Ayarlar->��lemci Ayarlar� men�s�nden yapmal�s�n�z. H�z kristal frekans�na ba�l� olup,",
- " baz� h�zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt�r. ",
- " ",
- " Bu komutun giri�i yanl��sa herhangi bir i�lem yap�lmaz. Do�ru ise UART'dan 1 karakter",
- " al�nmaya �al���l�r. Okuma yap�lamaz ise komutun ��k��� yanl�� (0) olur. Karakter",
- " okunursa okunan karakter `var' de�i�keninde saklan�r ve komutun ��k��� do�ru (1) olur.",
- " ��k���n do�ru olmas� sadece bir PLC �evrimi s�rer.",
- "",
- "",
- "> UART (SER� B�LG�) G�NDER var",
- " --{UART SEND}--",
- "",
- " LDmicro belirli i�lemciler i�in gerekli UART kodlar�n� �retebilir. AVR i�lemcilerde",
- " sadece UART1 (UART0) de�il) desteklenmektedir. �leti�im h�z� (baudrate) ayarlar�n� ",
- " Ayarlar->��lemci Ayarlar� men�s�nden yapmal�s�n�z. H�z kristal frekans�na ba�l� olup,",
- " baz� h�zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt�r.",
- " ",
- " Bu komutun giri�i yanl��sa herhangi bir i�lem yap�lmaz. Do�ru ise UART'dan 1 karakter",
- " g�nderilir. G�nderilecek karakter g�nderme i�leminden �nce `var' de�i�keninde sakl�",
- " olmal�d�r. Komutun ��k��� UART me�gulse (bir karakterin g�nderildi�i s�rece)",
- " do�ru (1) olur. Aksi halde yanl�� olur.",
- " ��k���n do�ru olmas� sadece bir PLC �evrimi s�rer.",
- " ",
- " Karakterin g�nderilmesi belirli bir zaman al�r. Bu nedenle ba�ka bir karakter",
- " g�ndermeden �nce �nceki karakterin g�nderildi�ini kontrol ediniz veya g�nderme",
- " i�lemlerinin aras�na geikme ekleyiniz. Komutun giri�ini sadece ��k�� yanl��",
- " (UART me�gul de�ilse)ise do�ru yap�n�z.",
- "",
- " Bu komut yerine bi�imlendirilmi� kelime komutunu (bir sonraki komut) inceleyiniz.",
- " Bi�imlendirilmi� kelime komutunun kullan�m� daha kolayd�r. �stedi�iniz i�lemleri",
- " daha rahat ger�ekle�tirebilirsiniz.",
- "",
- "",
- "> UART �ZER�NDEN B���MLEND�R�LM�� KEL�ME var",
- " -{\"Pressure: \\3\\r\\n\"}-",
- "",
- " LDmicro belirli i�lemciler i�in gerekli UART kodlar�n� �retebilir. AVR i�lemcilerde",
- " sadece UART1 (UART0) de�il) desteklenmektedir. �leti�im h�z� (baudrate) ayarlar�n� ",
- " Ayarlar->��lemci Ayarlar� men�s�nden yapmal�s�n�z. H�z kristal frekans�na ba�l� olup,",
- " baz� h�zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt�r.",
- "",
- " Bu komutun giri�i yanl��tan do�ruya ge�erse (y�kselen kenar) ise seri port �zerinden",
- " t�m kelimeyi g�nderir. E�er kelime `\\3' �zel kodunu i�eriyorsa dizi i�eri�i ",
- " `var' de�i�kenin i�eri�i otomatik olarak kelimeye (string) �evrilerek`var'",
- " de�i�keninin i�eri�i ile de�i�tirilir. De�i�kenin uzunlu�u 3 karakter olacak �ekilde",
- " de�i�tirilir. Mesela; `var' de�i�keninin i�eri�i 35 ise kelime 35 rakam�n�n ba��na bir",
- " adet bo�ul eklenerek `Pressure: 35\\r\\n' haline getirilir. Veya `var'de�i�keninin",
- " i�eri�i 1453 ise yap�lacak i�lem belli olmaz. Bu durumda `\\4' kullanmak gerekebilir.",
- "",
- " De�i�ken negatif bir say� olabilecekse `\\-3d' (veya `\\-4d') gibi uygun bir de�er",
- " kullanmal�s�n�z. Bu durumda LDMicro negatif say�lar�n �n�ne eksi i�areti, pozitif say�lar�n",
- " �n�ne ise bir bo�luk karakteri yerle�tirecektir.",
- "",
- " Ayn� anda birka� i�lem tan�mlan�rsa, yada UART ile ilgili i�lemler birbirine",
- " kar���k hale getirilirse program�n davran��� belirli olmayacakt�r. Bu nedenle",
- " dikkatli olmal�s�n�z.",
- "",
- " Kullan�labilecek �zel karakterler (escape kodlar�) �unlard�r:",
- " * \\r -- sat�r ba��na ge�",
- " * \\n -- yeni sat�r",
- " * \\f -- ka��d� ilerlet (formfeed)",
- " * \\b -- bir karakter geri gel (backspace)",
- " * \\xAB -- ASCII karakter kodu 0xAB (hex)",
- "",
- " Bu komutun ��k��� bilgi g�nderiyorken do�ru di�er durumlarda yanl�� olur.",
- " Bu komut program haf�zas�nda �ok yer kaplar.",
- "",
- "",
- "MATEMAT�KSEL ��LEMLER �LE �LG�L� B�LG�",
- "======================================",
- "",
- "Unutmay�n ki, LDMicro 16-bit tamsay� matematik komutlar�na sahiptir.",
- "Bu i�lemlerde kullan�lan de�erler ve hesaplaman�n sonucu -32768 ile",
- "32767 aras�nda bir tamsay� olabilir.",
- "",
- "Mesela y = (1/x)*1200 form�l�n� hesaplamaya �al��al�m. x 1 ile 20",
- "aras�nda bir say�d�r. Bu durumda y 1200 ile 60 aras�nda olur. Bu say�",
- "16-bit bir tamsay� s�n�rlar� i�indedir. Ladder diyagram�m�z� yazal�m.",
- "�nce b�lelim, sonra �arpma i�lemini yapal�m:",
- "",
- " || {DIV temp :=} ||",
- " ||---------{ 1 / x }----------||",
- " || ||",
- " || {MUL y := } ||",
- " ||----------{ temp * 1200}----------||",
- " || ||",
- "",
- "Yada b�lmeyi do�rudan yapal�m:",
- "",
- " || {DIV y :=} ||",
- " ||-----------{ 1200 / x }-----------||",
- "",
- "Matematiksel olarak iki i�lem ayn�d sonucu vermelidir. Ama birinci i�lem",
- "yanl�� sonu� verecektir. (y=0 olur). Bu hata `temp' de�i�keninin 1'den",
- "k���k sonu� vermesindendir.Mesela x = 3 iken (1 / x) = 0.333 olur. Ama",
- "0.333 bir tamsay� de�ildir. Bu nedenle sonu� 0 olur. �kinci ad�mda ise",
- "y = temp * 1200 = 0 olur. �kinci �ekilde ise b�len bir tamsay� oldu�undan",
- "sonu� do�ru ��kacakt�r.",
- "",
- "��lemlerinizde bir sorun varsa dikkatle kontrol ediniz. Ayr�ca sonucun",
- "ba�a d�nmemesine de dikkat ediniz. Mesela 32767 + 1 = -32768 olur.",
- "32767 s�n�r� a��lm�� olacakt�r. ",
- "",
- "Hesaplamalar�n�zda mant�ksal de�i�imler yaparak do�ru sonu�lar elde edebilirsiniz.",
- "�rne�in; y = 1.8*x ise form�l�n�z� y = (9/5)*x �eklinde yaz�n�z.(1.8 = 9/5)",
- "y = (9*x)/5 �eklindeki bir kod sonucu daha tutarl� hale getirecektir.",
- "performing the multiplication first:",
- "",
- " || {MUL temp :=} ||",
- " ||---------{ x * 9 }----------||",
- " || ||",
- " || {DIV y :=} ||",
- " ||-----------{ temp / 5 }-----------||",
- "",
- "",
- "KODALAMA �EKL�",
- "==============",
- "",
- "Program�n sa�lad��� kolayl�klardan faydalan�n. Mesela:",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || Xb Yb ||",
- " ||-------] [------+-------( )-------||",
- " || | ||",
- " || | Yc ||",
- " || +-------( )-------||",
- " || ||",
- "",
- "yazmak a�a��dakinden daha kolay olacakt�r.",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yb ||",
- " 2 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yc ||",
- " 3 ||-------] [--------------( )-------||",
- " || ||",
- "",
- " * * *",
- "",
- "Yazd���n�z kodlar�n sonu�lar�na dikkat ediniz. A�a��daki sat�rlarda",
- "mant�ks�z bir programlama yap�lm��t�r. ��nk� hem Xa hemde Xb ayn�",
- "anda do�ru olabilir.",
- "",
- " || Xa {v := } ||",
- " 1 ||-------] [--------{ 12 MOV}--||",
- " || ||",
- " || Xb {v := } ||",
- " ||-------] [--------{ 23 MOV}--||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || [v >] Yc ||",
- " 2 ||------[ 15]-------------( )-------||",
- " || ||",
- "",
- "A�a��daki sat�rlar yukarda bahsi ge�en tarzdad�r. Ancak yap�lan",
- "i�lem 4-bit binary say� tamsay�ya �evrilmektedir.",
- "",
- " || {v := } ||",
- " 3 ||-----------------------------------{ 0 MOV}--||",
- " || ||",
- " || Xb0 {ADD v :=} ||",
- " ||-------] [------------------{ v + 1 }-----------||",
- " || ||",
- " || Xb1 {ADD v :=} ||",
- " ||-------] [------------------{ v + 2 }-----------||",
- " || ||",
- " || Xb2 {ADD v :=} ||",
- " ||-------] [------------------{ v + 4 }-----------||",
- " || ||",
- " || Xb3 {ADD v :=} ||",
- " ||-------] [------------------{ v + 8 }-----------||",
- " || ||",
- "",
- "",
- "HATALAR (BUG)",
- "=============",
- "",
- "LDmicro taraf�ndan �retilen kodlar �ok verimli kodlar de�ildir. Yava� �al��an",
- "ve haf�zada fazla yer kaplayan kodlar olabilirler. Buna ra�men orta b�y�kl�kte",
- "bir PIC veya AVR k���k bir PLC'nin yapt��� i�i yapar. Bu nedenle di�er sorunlar",
- "yer yer g�zard� edlebilir.",
- "",
- "De�i�ken isimleri �ok uzun olmamal�d�r. ",
- "",
- "Program�n�z yada kulland���n�z haf�za se�ti�iniz i�lemcinin sahip oldu�undan",
- "b�y�kse LDMicro hata vermeyebilir. Dikkat etmezseniz program�n�z hatal� �al��acakt�r.",
- "",
- "Buldu�unuz hatalar� yazara bildiriniz.",
- "",
- "Te�ekk�rler:",
- " * Marcelo Solano, Windows 98'deki UI problemini bildirdi�i i�in,",
- " * Serge V. Polubarjev, PIC16F628 i�lemcisi se�ildi�inde RA3:0'�n �al��mad���",
- " ve nas�l d�zeltece�imi bildirdi�i i�in,",
- " * Maxim Ibragimov, ATmega16 ve ATmega162 i�lemcileri test ettikleri, problemleri",
- " bulduklar� ve bildirdikleri i�in,",
- " * Bill Kishonti, s�f�ra b�l�m hatas� oldu�unda sim�lasyonun ��kt���n� bildirdikleri",
- " i�in,",
- " * Mohamed Tayae, PIC16F628 i�lemcisinde EEPROM'da saklanmas� gereken de�i�kenlerin",
- " asl�nda saklanmad���n� bildirdi�i i�in,",
- " * David Rothwell, kullan�c� aray�z�ndeki birka� problemi ve \"Metin Dosyas� Olarak Kaydet\"",
- " fonksiyonundaki problemi bildirdi�i i�in.",
- "",
- "",
- "KOPYALAMA VE KULLANIM �ARTLARI",
- "==============================",
- "",
- "LDMICRO TARAFINDAN �RET�LEN KODU �NSAN HAYATI VE �NSAN HAYATINI ETK�LEYEB�LECEK",
- "PROJELERDE KULLANMAYINIZ. LDMICRO PROGRAMCISI LDMICRO'NUN KEND�NDEN VE LDMICRO",
- "�LE �RET�LEN KODDAN KAYNAKLANAN H��B�R PROBLEM ���N SORUMLULUK KABUL ETMEMEKTED�R.",
- "",
- "Bu program �cretsiz bir program olup, diledi�iniz gibi da��tabilirsiniz,",
- "kaynak kodda de�i�iklik yapabilirsiniz. Program�n kullan�m� Free Software Foundation",
- "taraf�ndan yaz�lan GNU General Public License (version 3 ve sonras�)�artlar�na ba�l�d�r.",
- "",
- "Program faydal� olmas� �midiyle da��t�lm��t�r. Ancak hi�bir garanti verilmemektedir.",
- "Detaylar i�in GNU General Public License i�eri�ine bak�n�z.",
- "",
- "S�z konusu s�zle�menin bir kopyas� bu programla beraber gelmi� olmas� gerekmektedir.",
- "Gelmediyse <http://www.gnu.org/licenses/> adresinde bulabilirsiniz.",
- "",
- "",
- "Jonathan Westhues",
- "",
- "Rijswijk -- Dec 2004",
- "Waterloo ON -- Jun, Jul 2005",
- "Cambridge MA -- Sep, Dec 2005",
- " Feb, Mar 2006",
- " Feb 2007",
- "",
- "Email: user jwesthues, at host cq.cx",
- "",
- "T�rk�e Versiyon : <http://tekelektirik.com/public/ldmicro.rar>",
- NULL
-};
-#endif
-
-#if defined(LDLANG_EN) || defined(LDLANG_ES) || defined(LDLANG_IT) || defined(LDLANG_PT)
-char *HelpText[] = {
- "",
- "INTRODUCTION",
- "============",
- "",
- "LDmicro generates native code for certain Microchip PIC16 and Atmel AVR",
- "microcontrollers. Usually software for these microcontrollers is written",
- "in a programming language like assembler, C, or BASIC. A program in one",
- "of these languages comprises a list of statements. These languages are",
- "powerful and well-suited to the architecture of the processor, which",
- "internally executes a list of instructions.",
- "",
- "PLCs, on the other hand, are often programmed in `ladder logic.' A simple",
- "program might look like this:",
- "",
- " || ||",
- " || Xbutton1 Tdon Rchatter Yred ||",
- " 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
- " || | ||",
- " || Xbutton2 Tdof | ||",
- " ||-------]/[---------[TOF 2.000 s]-+ ||",
- " || ||",
- " || ||",
- " || ||",
- " || Rchatter Ton Tnew Rchatter ||",
- " 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " ||------[END]---------------------------------------------------------||",
- " || ||",
- " || ||",
- "",
- "(TON is a turn-on delay; TOF is a turn-off delay. The --] [-- statements",
- "are inputs, which behave sort of like the contacts on a relay. The",
- "--( )-- statements are outputs, which behave sort of like the coil of a",
- "relay. Many good references for ladder logic are available on the Internet",
- "and elsewhere; details specific to this implementation are given below.)",
- "",
- "A number of differences are apparent:",
- "",
- " * The program is presented in graphical format, not as a textual list",
- " of statements. Many people will initially find this easier to",
- " understand.",
- "",
- " * At the most basic level, programs look like circuit diagrams, with",
- " relay contacts (inputs) and coils (outputs). This is intuitive to",
- " programmers with knowledge of electric circuit theory.",
- "",
- " * The ladder logic compiler takes care of what gets calculated",
- " where. You do not have to write code to determine when the outputs",
- " have to get recalculated based on a change in the inputs or a",
- " timer event, and you do not have to specify the order in which",
- " these calculations must take place; the PLC tools do that for you.",
- "",
- "LDmicro compiles ladder logic to PIC16 or AVR code. The following",
- "processors are supported:",
- " * PIC16F877",
- " * PIC16F628",
- " * PIC16F876 (untested)",
- " * PIC16F88 (untested)",
- " * PIC16F819 (untested)",
- " * PIC16F887 (untested)",
- " * PIC16F886 (untested)",
- " * ATmega128",
- " * ATmega64",
- " * ATmega162 (untested)",
- " * ATmega32 (untested)",
- " * ATmega16 (untested)",
- " * ATmega8 (untested)",
- "",
- "It would be easy to support more AVR or PIC16 chips, but I do not have",
- "any way to test them. If you need one in particular then contact me and",
- "I will see what I can do.",
- "",
- "Using LDmicro, you can draw a ladder diagram for your program. You can",
- "simulate the logic in real time on your PC. Then when you are convinced",
- "that it is correct you can assign pins on the microcontroller to the",
- "program inputs and outputs. Once you have assigned the pins, you can",
- "compile PIC or AVR code for your program. The compiler output is a .hex",
- "file that you can program into your microcontroller using any PIC/AVR",
- "programmer.",
- "",
- "LDmicro is designed to be somewhat similar to most commercial PLC",
- "programming systems. There are some exceptions, and a lot of things",
- "aren't standard in industry anyways. Carefully read the description",
- "of each instruction, even if it looks familiar. This document assumes",
- "basic knowledge of ladder logic and of the structure of PLC software",
- "(the execution cycle: read inputs, compute, write outputs).",
- "",
- "",
- "ADDITIONAL TARGETS",
- "==================",
- "",
- "It is also possible to generate ANSI C code. You could use this with any",
- "processor for which you have a C compiler, but you are responsible for",
- "supplying the runtime. That means that LDmicro just generates source",
- "for a function PlcCycle(). You are responsible for calling PlcCycle",
- "every cycle time, and you are responsible for implementing all the I/O",
- "(read/write digital input, etc.) functions that the PlcCycle() calls. See",
- "the comments in the generated source for more details.",
- "",
- "Finally, LDmicro can generate processor-independent bytecode for a",
- "virtual machine designed to run ladder logic code. I have provided a",
- "sample implementation of the interpreter/VM, written in fairly portable",
- "C. This target will work for just about any platform, as long as you",
- "can supply your own VM. This might be useful for applications where you",
- "wish to use ladder logic as a `scripting language' to customize a larger",
- "program. See the comments in the sample interpreter for details.",
- "",
- "",
- "COMMAND LINE OPTIONS",
- "====================",
- "",
- "ldmicro.exe is typically run with no command line options. That means",
- "that you can just make a shortcut to the program, or save it to your",
- "desktop and double-click the icon when you want to run it, and then you",
- "can do everything from within the GUI.",
- "",
- "If LDmicro is passed a single filename on the command line",
- "(e.g. `ldmicro.exe asd.ld'), then LDmicro will try to open `asd.ld',",
- "if it exists. An error is produced if `asd.ld' does not exist. This",
- "means that you can associate ldmicro.exe with .ld files, so that it runs",
- "automatically when you double-click a .ld file.",
- "",
- "If LDmicro is passed command line arguments in the form",
- "`ldmicro.exe /c src.ld dest.hex', then it tries to compile `src.ld',",
- "and save the output as `dest.hex'. LDmicro exits after compiling,",
- "whether the compile was successful or not. Any messages are printed",
- "to the console. This mode is useful only when running LDmicro from the",
- "command line.",
- "",
- "",
- "BASICS",
- "======",
- "",
- "If you run LDmicro with no arguments then it starts with an empty",
- "program. If you run LDmicro with the name of a ladder program (xxx.ld)",
- "on the command line then it will try to load that program at startup.",
- "LDmicro uses its own internal format for the program; it cannot import",
- "logic from any other tool.",
- "",
- "If you did not load an existing program then you will be given a program",
- "with one empty rung. You could add an instruction to it; for example",
- "you could add a set of contacts (Instruction -> Insert Contacts) named",
- "`Xnew'. `X' means that the contacts will be tied to an input pin on the",
- "microcontroller. You could assign a pin to it later, after choosing a",
- "microcontroller and renaming the contacts. The first letter of a name",
- "indicates what kind of object it is. For example:",
- "",
- " * Xname -- tied to an input pin on the microcontroller",
- " * Yname -- tied to an output pin on the microcontroller",
- " * Rname -- `internal relay': a bit in memory",
- " * Tname -- a timer; turn-on delay, turn-off delay, or retentive",
- " * Cname -- a counter, either count-up or count-down",
- " * Aname -- an integer read from an A/D converter",
- " * name -- a general-purpose (integer) variable",
- "",
- "Choose the rest of the name so that it describes what the object does,",
- "and so that it is unique within the program. The same name always refers",
- "to the same object within the program. For example, it would be an error",
- "to have a turn-on delay (TON) called `Tdelay' and a turn-off delay (TOF)",
- "called `Tdelay' in the same program, since each counter needs its own",
- "memory. On the other hand, it would be correct to have a retentive timer",
- "(RTO) called `Tdelay' and a reset instruction (RES) associated with",
- "`Tdelay', since it that case you want both instructions to work with",
- "the same timer.",
- "",
- "Variable names can consist of letters, numbers, and underscores",
- "(_). A variable name must not start with a number. Variable names are",
- "case-sensitive.",
- "",
- "The general variable instructions (MOV, ADD, EQU, etc.) can work on",
- "variables with any name. This means that they can access timer and",
- "counter accumulators. This may sometimes be useful; for example, you",
- "could check if the count of a timer is in a particular range.",
- "",
- "Variables are always 16 bit integers. This means that they can go",
- "from -32768 to 32767. Variables are always treated as signed. You can",
- "specify literals as normal decimal numbers (0, 1234, -56). You can also",
- "specify ASCII character values ('A', 'z') by putting the character in",
- "single-quotes. You can use an ASCII character code in most places that",
- "you could use a decimal number.",
- "",
- "At the bottom of the screen you will see a list of all the objects in",
- "the program. This list is automatically generated from the program;",
- "there is no need to keep it up to date by hand. Most objects do not",
- "need any configuration. `Xname', `Yname', and `Aname' objects must be",
- "assigned to a pin on the microcontroller, however. First choose which",
- "microcontroller you are using (Settings -> Microcontroller). Then assign",
- "your I/O pins by double-clicking them on the list.",
- "",
- "You can modify the program by inserting or deleting instructions. The",
- "cursor in the program display blinks to indicate the currently selected",
- "instruction and the current insertion point. If it is not blinking then",
- "press <Tab> or click on an instruction. Now you can delete the current",
- "instruction, or you can insert a new instruction to the right or left",
- "(in series with) or above or below (in parallel with) the selected",
- "instruction. Some operations are not allowed. For example, no instructions",
- "are allowed to the right of a coil.",
- "",
- "The program starts with just one rung. You can add more rungs by selecting",
- "Insert Rung Before/After in the Logic menu. You could get the same effect",
- "by placing many complicated subcircuits in parallel within one rung,",
- "but it is more clear to use multiple rungs.",
- "",
- "Once you have written a program, you can test it in simulation, and then",
- "you can compile it to a HEX file for the target microcontroller.",
- "",
- "",
- "SIMULATION",
- "==========",
- "",
- "To enter simulation mode, choose Simulate -> Simulation Mode or press",
- "<Ctrl+M>. The program is shown differently in simulation mode. There is",
- "no longer a cursor. The instructions that are energized show up bright",
- "red; the instructions that are not appear greyed. Press the space bar to",
- "run the PLC one cycle. To cycle continuously in real time, choose",
- "Simulate -> Start Real-Time Simulation, or press <Ctrl+R>. The display of",
- "the program will be updated in real time as the program state changes.",
- "",
- "You can set the state of the inputs to the program by double-clicking",
- "them in the list at the bottom of the screen, or by double-clicking an",
- "`Xname' contacts instruction in the program. If you change the state of",
- "an input pin then that change will not be reflected in how the program",
- "is displayed until the PLC cycles; this will happen automatically if",
- "you are running a real time simulation, or when you press the space bar.",
- "",
- "",
- "COMPILING TO NATIVE CODE",
- "========================",
- "",
- "Ultimately the point is to generate a .hex file that you can program",
- "into your microcontroller. First you must select the part number of the",
- "microcontroller, under the Settings -> Microcontroller menu. Then you",
- "must assign an I/O pin to each `Xname' or `Yname' object. Do this by",
- "double-clicking the object name in the list at the bottom of the screen.",
- "A dialog will pop up where you can choose an unallocated pin from a list.",
- "",
- "Then you must choose the cycle time that you will run with, and you must",
- "tell the compiler what clock speed the micro will be running at. These",
- "are set under the Settings -> MCU Parameters... menu. In general you",
- "should not need to change the cycle time; 10 ms is a good value for most",
- "applications. Type in the frequency of the crystal that you will use",
- "with the microcontroller (or the ceramic resonator, etc.) and click okay.",
- "",
- "Now you can generate code from your program. Choose Compile -> Compile,",
- "or Compile -> Compile As... if you have previously compiled this program",
- "and you want to specify a different output file name. If there are no",
- "errors then LDmicro will generate an Intel IHEX file ready for",
- "programming into your chip.",
- "",
- "Use whatever programming software and hardware you have to load the hex",
- "file into the microcontroller. Remember to set the configuration bits",
- "(fuses)! For PIC16 processors, the configuration bits are included in the",
- "hex file, and most programming software will look there automatically.",
- "For AVR processors you must set the configuration bits by hand.",
- "",
- "",
- "INSTRUCTIONS REFERENCE",
- "======================",
- "",
- "> CONTACT, NORMALLY OPEN Xname Rname Yname",
- " ----] [---- ----] [---- ----] [----",
- "",
- " If the signal going into the instruction is false, then the output",
- " signal is false. If the signal going into the instruction is true,",
- " then the output signal is true if and only if the given input pin,",
- " output pin, or internal relay is true, else it is false. This",
- " instruction can examine the state of an input pin, an output pin,",
- " or an internal relay.",
- "",
- "",
- "> CONTACT, NORMALLY CLOSED Xname Rname Yname",
- " ----]/[---- ----]/[---- ----]/[----",
- "",
- " If the signal going into the instruction is false, then the output",
- " signal is false. If the signal going into the instruction is true,",
- " then the output signal is true if and only if the given input pin,",
- " output pin, or internal relay is false, else it is false. This",
- " instruction can examine the state of an input pin, an output pin,",
- " or an internal relay. This is the opposite of a normally open contact.",
- "",
- "",
- "> COIL, NORMAL Rname Yname",
- " ----( )---- ----( )----",
- "",
- " If the signal going into the instruction is false, then the given",
- " internal relay or output pin is cleared false. If the signal going",
- " into this instruction is true, then the given internal relay or output",
- " pin is set true. It is not meaningful to assign an input variable to a",
- " coil. This instruction must be the rightmost instruction in its rung.",
- "",
- "",
- "> COIL, NEGATED Rname Yname",
- " ----(/)---- ----(/)----",
- "",
- " If the signal going into the instruction is true, then the given",
- " internal relay or output pin is cleared false. If the signal going",
- " into this instruction is false, then the given internal relay or",
- " output pin is set true. It is not meaningful to assign an input",
- " variable to a coil. This is the opposite of a normal coil. This",
- " instruction must be the rightmost instruction in its rung.",
- "",
- "",
- "> COIL, SET-ONLY Rname Yname",
- " ----(S)---- ----(S)----",
- "",
- " If the signal going into the instruction is true, then the given",
- " internal relay or output pin is set true. Otherwise the internal",
- " relay or output pin state is not changed. This instruction can only",
- " change the state of a coil from false to true, so it is typically",
- " used in combination with a reset-only coil. This instruction must",
- " be the rightmost instruction in its rung.",
- "",
- "",
- "> COIL, RESET-ONLY Rname Yname",
- " ----(R)---- ----(R)----",
- "",
- " If the signal going into the instruction is true, then the given",
- " internal relay or output pin is cleared false. Otherwise the",
- " internal relay or output pin state is not changed. This instruction",
- " instruction can only change the state of a coil from true to false,",
- " so it is typically used in combination with a set-only coil. This",
- " instruction must be the rightmost instruction in its rung.",
- "",
- "",
- "> TURN-ON DELAY Tdon ",
- " -[TON 1.000 s]-",
- "",
- " When the signal going into the instruction goes from false to true,",
- " the output signal stays false for 1.000 s before going true. When the",
- " signal going into the instruction goes from true to false, the output",
- " signal goes false immediately. The timer is reset every time the input",
- " goes false; the input must stay true for 1000 consecutive milliseconds",
- " before the output will go true. The delay is configurable.",
- "",
- " The `Tname' variable counts up from zero in units of scan times. The",
- " TON instruction outputs true when the counter variable is greater",
- " than or equal to the given delay. It is possible to manipulate the",
- " counter variable elsewhere, for example with a MOV instruction.",
- "",
- "",
- "> TURN-OFF DELAY Tdoff ",
- " -[TOF 1.000 s]-",
- "",
- " When the signal going into the instruction goes from true to false,",
- " the output signal stays true for 1.000 s before going false. When",
- " the signal going into the instruction goes from false to true,",
- " the output signal goes true immediately. The timer is reset every",
- " time the input goes false; the input must stay false for 1000",
- " consecutive milliseconds before the output will go false. The delay",
- " is configurable.",
- "",
- " The `Tname' variable counts up from zero in units of scan times. The",
- " TON instruction outputs true when the counter variable is greater",
- " than or equal to the given delay. It is possible to manipulate the",
- " counter variable elsewhere, for example with a MOV instruction.",
- "",
- "",
- "> RETENTIVE TIMER Trto ",
- " -[RTO 1.000 s]-",
- "",
- " This instruction keeps track of how long its input has been true. If",
- " its input has been true for at least 1.000 s, then the output is",
- " true. Otherwise the output is false. The input need not have been",
- " true for 1000 consecutive milliseconds; if the input goes true",
- " for 0.6 s, then false for 2.0 s, and then true for 0.4 s, then the",
- " output will go true. After the output goes true it will stay true",
- " even after the input goes false, as long as the input has been true",
- " for longer than 1.000 s. This timer must therefore be reset manually,",
- " using the reset instruction.",
- "",
- " The `Tname' variable counts up from zero in units of scan times. The",
- " TON instruction outputs true when the counter variable is greater",
- " than or equal to the given delay. It is possible to manipulate the",
- " counter variable elsewhere, for example with a MOV instruction.",
- "",
- "",
- "> RESET Trto Citems",
- " ----{RES}---- ----{RES}----",
- "",
- " This instruction resets a timer or a counter. TON and TOF timers are",
- " automatically reset when their input goes false or true, so RES is",
- " not required for these timers. RTO timers and CTU/CTD counters are",
- " not reset automatically, so they must be reset by hand using a RES",
- " instruction. When the input is true, the counter or timer is reset;",
- " when the input is false, no action is taken. This instruction must",
- " be the rightmost instruction in its rung.",
- "",
- "",
- "> ONE-SHOT RISING _",
- " --[OSR_/ ]--",
- "",
- " This instruction normally outputs false. If the instruction's input",
- " is true during this scan and it was false during the previous scan",
- " then the output is true. It therefore generates a pulse one scan",
- " wide on each rising edge of its input signal. This instruction is",
- " useful if you want to trigger events off the rising edge of a signal.",
- "",
- "",
- "> ONE-SHOT FALLING _",
- " --[OSF \\_]--",
- "",
- " This instruction normally outputs false. If the instruction's input",
- " is false during this scan and it was true during the previous scan",
- " then the output is true. It therefore generates a pulse one scan",
- " wide on each falling edge of its input signal. This instruction is",
- " useful if you want to trigger events off the falling edge of a signal.",
- "",
- "",
- "> SHORT CIRCUIT, OPEN CIRCUIT",
- " ----+----+---- ----+ +----",
- "",
- " The output condition of a short-circuit is always equal to its",
- " input condition. The output condition of an open-circuit is always",
- " false. These are mostly useful for debugging.",
- "",
- "",
- "> MASTER CONTROL RELAY",
- " -{MASTER RLY}-",
- "",
- " By default, the rung-in condition of every rung is true. If a master",
- " control relay instruction is executed with a rung-in condition of",
- " false, then the rung-in condition for all following rungs becomes",
- " false. This will continue until the next master control relay",
- " instruction is reached (regardless of the rung-in condition of that",
- " instruction). These instructions must therefore be used in pairs:",
- " one to (maybe conditionally) start the possibly-disabled section,",
- " and one to end it.",
- "",
- "",
- "> MOVE {destvar := } {Tret := }",
- " -{ 123 MOV}- -{ srcvar MOV}-",
- "",
- " When the input to this instruction is true, it sets the given",
- " destination variable equal to the given source variable or",
- " constant. When the input to this instruction is false nothing",
- " happens. You can assign to any variable with the move instruction;",
- " this includes timer and counter state variables, which can be",
- " distinguished by the leading `T' or `C'. For example, an instruction",
- " moving 0 into `Tretentive' is equivalent to a reset (RES) instruction",
- " for that timer. This instruction must be the rightmost instruction",
- " in its rung.",
- "",
- "",
- "> ARITHMETIC OPERATION {ADD kay :=} {SUB Ccnt :=}",
- " -{ 'a' + 10 }- -{ Ccnt - 10 }-",
- "",
- "> {MUL dest :=} {DIV dv := }",
- " -{ var * -990 }- -{ dv / -10000}-",
- "",
- " When the input to this instruction is true, it sets the given",
- " destination variable equal to the given expression. The operands",
- " can be either variables (including timer and counter variables)",
- " or constants. These instructions use 16 bit signed math. Remember",
- " that the result is evaluated every cycle when the input condition",
- " true. If you are incrementing or decrementing a variable (i.e. if",
- " the destination variable is also one of the operands) then you",
- " probably don't want that; typically you would use a one-shot so that",
- " it is evaluated only on the rising or falling edge of the input",
- " condition. Divide truncates; 8 / 3 = 2. This instruction must be",
- " the rightmost instruction in its rung.",
- "",
- "",
- "> COMPARE [var ==] [var >] [1 >=]",
- " -[ var2 ]- -[ 1 ]- -[ Ton]-",
- "",
- "> [var /=] [-4 < ] [1 <=]",
- " -[ var2 ]- -[ vartwo]- -[ Cup]-",
- "",
- " If the input to this instruction is false then the output is false. If",
- " the input is true then the output is true if and only if the given",
- " condition is true. This instruction can be used to compare (equals,",
- " is greater than, is greater than or equal to, does not equal,",
- " is less than, is less than or equal to) a variable to a variable,",
- " or to compare a variable to a 16-bit signed constant.",
- "",
- "",
- "> COUNTER Cname Cname",
- " --[CTU >=5]-- --[CTD >=5]--",
- "",
- " A counter increments (CTU, count up) or decrements (CTD, count",
- " down) the associated count on every rising edge of the rung input",
- " condition (i.e. what the rung input condition goes from false to",
- " true). The output condition from the counter is true if the counter",
- " variable is greater than or equal to 5, and false otherwise. The",
- " rung output condition may be true even if the input condition is",
- " false; it only depends on the counter variable. You can have CTU",
- " and CTD instructions with the same name, in order to increment and",
- " decrement the same counter. The RES instruction can reset a counter,",
- " or you can perform general variable operations on the count variable.",
- "",
- "",
- "> CIRCULAR COUNTER Cname",
- " --{CTC 0:7}--",
- "",
- " A circular counter works like a normal CTU counter, except that",
- " after reaching its upper limit, it resets its counter variable",
- " back to 0. For example, the counter shown above would count 0, 1,",
- " 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 2,.... This is useful in",
- " combination with conditional statements on the variable `Cname';",
- " you can use this like a sequencer. CTC counters clock on the rising",
- " edge of the rung input condition condition. This instruction must",
- " be the rightmost instruction in its rung.",
- "",
- "",
- "> SHIFT REGISTER {SHIFT REG }",
- " -{ reg0..3 }-",
- "",
- " A shift register is associated with a set of variables. For example,",
- " this shift register is associated with the variables `reg0', `reg1',",
- " `reg2', and `reg3'. The input to the shift register is `reg0'. On",
- " every rising edge of the rung-in condition, the shift register will",
- " shift right. That means that it assigns `reg3 := reg2', `reg2 :=",
- " reg1'. and `reg1 := reg0'. `reg0' is left unchanged. A large shift",
- " register can easily consume a lot of memory. This instruction must",
- " be the rightmost instruction in its rung.",
- "",
- "",
- "> LOOK-UP TABLE {dest := }",
- " -{ LUT[i] }-",
- "",
- " A look-up table is an ordered set of n values. When the rung-in",
- " condition is true, the integer variable `dest' is set equal to the",
- " entry in the lookup table corresponding to the integer variable",
- " `i'. The index starts from zero, so `i' must be between 0 and",
- " (n-1). The behaviour of this instruction is not defined if the",
- " index is outside this range. This instruction must be the rightmost",
- " instruction in its rung.",
- "",
- "",
- "> PIECEWISE LINEAR TABLE {yvar := }",
- " -{ PWL[xvar] }-",
- "",
- " This is a good way to approximate a complicated function or",
- " curve. It might, for example, be useful if you are trying to apply",
- " a calibration curve to convert a raw output voltage from a sensor",
- " into more convenient units.",
- "",
- " Assume that you are trying to approximate a function that converts",
- " an integer input variable, x, to an integer output variable, y. You",
- " know the function at several points; for example, you might know that",
- "",
- " f(0) = 2",
- " f(5) = 10",
- " f(10) = 50",
- " f(100) = 100",
- "",
- " This means that the points",
- "",
- " (x0, y0) = ( 0, 2)",
- " (x1, y1) = ( 5, 10)",
- " (x2, y2) = ( 10, 50)",
- " (x3, y3) = (100, 100)",
- "",
- " lie on that curve. You can enter those 4 points into a table",
- " associated with the piecewise linear instruction. The piecewise linear",
- " instruction will look at the value of xvar, and set the value of",
- " yvar. It will set yvar in such a way that the piecewise linear curve",
- " will pass through all of the points that you give it; for example,",
- " if you set xvar = 10, then the instruction will set yvar = 50.",
- "",
- " If you give the instruction a value of xvar that lies between two",
- " of the values of x for which you have given it points, then the",
- " instruction will set yvar so that (xvar, yvar) lies on the straight",
- " line connecting those two points in the table. For example, xvar =",
- " 55 gives an output of yvar = 75. (The two points in the table are",
- " (10, 50) and (100, 100). 55 is half-way between 10 and 100, and 75",
- " is half-way between 50 and 100, so (55, 75) lies on the line that",
- " connects those two points.)",
- "",
- " The points must be specified in ascending order by x coordinate. It",
- " may not be possible to perform mathematical operations required for",
- " certain look-up tables using 16-bit integer math; if this is the",
- " case, then LDmicro will warn you. For example, this look up table",
- " will produce an error:",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (300, 300)",
- "",
- " You can fix these errors by making the distance between points in",
- " the table smaller. For example, this table is equivalent to the one",
- " given above, and it does not produce an error:",
- "",
- " (x0, y0) = ( 0, 0)",
- " (x1, y1) = (150, 150)",
- " (x2, y2) = (300, 300)",
- "",
- " It should hardly ever be necessary to use more than five or six",
- " points. Adding more points makes your code larger and slower to",
- " execute. The behaviour if you pass a value of `xvar' greater than",
- " the greatest x coordinate in the table or less than the smallest x",
- " coordinate in the table is undefined. This instruction must be the",
- " rightmost instruction in its rung.",
- "",
- "",
- "> A/D CONVERTER READ Aname",
- " --{READ ADC}--",
- "",
- " LDmicro can generate code to use the A/D converters built in to",
- " certain microcontrollers. If the input condition to this instruction",
- " is true, then a single sample from the A/D converter is acquired and",
- " stored in the variable `Aname'. This variable can subsequently be",
- " manipulated with general variable operations (less than, greater than,",
- " arithmetic, and so on). Assign a pin to the `Axxx' variable in the",
- " same way that you would assign a pin to a digital input or output,",
- " by double-clicking it in the list at the bottom of the screen. If",
- " the input condition to this rung is false then the variable `Aname'",
- " is left unchanged.",
- "",
- " For all currently-supported devices, 0 volts input corresponds to",
- " an ADC reading of 0, and an input equal to Vdd (the supply voltage)",
- " corresponds to an ADC reading of 1023. If you are using an AVR, then",
- " connect AREF to Vdd. You can use arithmetic operations to scale the",
- " reading to more convenient units afterwards, but remember that you",
- " are using integer math. In general not all pins will be available",
- " for use with the A/D converter. The software will not allow you to",
- " assign non-A/D pins to an analog input. This instruction must be",
- " the rightmost instruction in its rung.",
- "",
- "",
- "> SET PWM DUTY CYCLE duty_cycle",
- " -{PWM 32.8 kHz}-",
- "",
- " LDmicro can generate code to use the PWM peripheral built in to",
- " certain microcontrollers. If the input condition to this instruction",
- " is true, then the duty cycle of the PWM peripheral is set to the",
- " value of the variable duty_cycle. The duty cycle must be a number",
- " between 0 and 100; 0 corresponds to always low, and 100 corresponds to",
- " always high. (If you are familiar with how the PWM peripheral works,",
- " then notice that that means that LDmicro automatically scales the",
- " duty cycle variable from percent to PWM clock periods.)",
- "",
- " You can specify the target PWM frequency, in Hz. The frequency that",
- " you specify might not be exactly achievable, depending on how it",
- " divides into the microcontroller's clock frequency. LDmicro will",
- " choose the closest achievable frequency; if the error is large then",
- " it will warn you. Faster speeds may sacrifice resolution.",
- "",
- " This instruction must be the rightmost instruction in its rung.",
- " The ladder logic runtime consumes one timer to measure the cycle",
- " time. That means that PWM is only available on microcontrollers",
- " with at least two suitable timers. PWM uses pin CCP2 (not CCP1)",
- " on PIC16 chips and OC2 (not OC1A) on AVRs.",
- "",
- "",
- "> MAKE PERSISTENT saved_var",
- " --{PERSIST}--",
- "",
- " When the rung-in condition of this instruction is true, it causes the",
- " specified integer variable to be automatically saved to EEPROM. That",
- " means that its value will persist, even when the micro loses",
- " power. There is no need to explicitly save the variable to EEPROM;",
- " that will happen automatically, whenever the variable changes. The",
- " variable is automatically loaded from EEPROM after power-on reset. If",
- " a variable that changes frequently is made persistent, then the",
- " EEPROM in your micro may wear out very quickly, because it is only",
- " good for a limited (~100 000) number of writes. When the rung-in",
- " condition is false, nothing happens. This instruction must be the",
- " rightmost instruction in its rung.",
- "",
- "",
- "> UART (SERIAL) RECEIVE var",
- " --{UART RECV}--",
- "",
- " LDmicro can generate code to use the UART built in to certain",
- " microcontrollers. On AVRs with multiple UARTs only UART1 (not",
- " UART0) is supported. Configure the baud rate using Settings -> MCU",
- " Parameters. Certain baud rates may not be achievable with certain",
- " crystal frequencies; LDmicro will warn you if this is the case.",
- "",
- " If the input condition to this instruction is false, then nothing",
- " happens. If the input condition is true then this instruction tries",
- " to receive a single character from the UART. If no character is read",
- " then the output condition is false. If a character is read then its",
- " ASCII value is stored in `var', and the output condition is true",
- " for a single PLC cycle.",
- "",
- "",
- "> UART (SERIAL) SEND var",
- " --{UART SEND}--",
- "",
- " LDmicro can generate code to use the UARTs built in to certain",
- " microcontrollers. On AVRS with multiple UARTs only UART1 (not",
- " UART0) is supported. Configure the baud rate using Settings -> MCU",
- " Parameters. Certain baud rates may not be achievable with certain",
- " crystal frequencies; LDmicro will warn you if this is the case.",
- "",
- " If the input condition to this instruction is false, then nothing",
- " happens. If the input condition is true then this instruction writes",
- " a single character to the UART. The ASCII value of the character to",
- " send must previously have been stored in `var'. The output condition",
- " of the rung is true if the UART is busy (currently transmitting a",
- " character), and false otherwise.",
- "",
- " Remember that characters take some time to transmit. Check the output",
- " condition of this instruction to ensure that the first character has",
- " been transmitted before trying to send a second character, or use",
- " a timer to insert a delay between characters. You must only bring",
- " the input condition true (try to send a character) when the output",
- " condition is false (UART is not busy).",
- "",
- " Investigate the formatted string instruction (next) before using this",
- " instruction. The formatted string instruction is much easier to use,",
- " and it is almost certainly capable of doing what you want.",
- "",
- "",
- "> FORMATTED STRING OVER UART var",
- " -{\"Pressure: \\3\\r\\n\"}-",
- "",
- " LDmicro can generate code to use the UARTs built in to certain",
- " microcontrollers. On AVRS with multiple UARTs only UART1 (not",
- " UART0) is supported. Configure the baud rate using Settings -> MCU",
- " Parameters. Certain baud rates may not be achievable with certain",
- " crystal frequencies; LDmicro will warn you if this is the case.",
- "",
- " When the rung-in condition for this instruction goes from false to",
- " true, it starts to send an entire string over the serial port. If",
- " the string contains the special sequence `\\3', then that sequence",
- " will be replaced with the value of `var', which is automatically",
- " converted into a string. The variable will be formatted to take",
- " exactly 3 characters; for example, if `var' is equal to 35, then",
- " the exact string printed will be `Pressure: 35\\r\\n' (note the extra",
- " space). If instead `var' were equal to 1432, then the behaviour would",
- " be undefined, because 1432 has more than three digits. In that case",
- " it would be necessary to use `\\4' instead.",
- "",
- " If the variable might be negative, then use `\\-3d' (or `\\-4d'",
- " etc.) instead. That will cause LDmicro to print a leading space for",
- " positive numbers, and a leading minus sign for negative numbers.",
- "",
- " If multiple formatted string instructions are energized at once",
- " (or if one is energized before another completes), or if these",
- " instructions are intermixed with the UART TX instructions, then the",
- " behaviour is undefined.",
- "",
- " It is also possible to use this instruction to output a fixed string,",
- " without interpolating an integer variable's value into the text that",
- " is sent over serial. In that case simply do not include the special",
- " escape sequence.",
- "",
- " Use `\\\\' for a literal backslash. In addition to the escape sequence",
- " for interpolating an integer variable, the following control",
- " characters are available:",
- " * \\r -- carriage return",
- " * \\n -- newline",
- " * \\f -- formfeed",
- " * \\b -- backspace",
- " * \\xAB -- character with ASCII value 0xAB (hex)",
- "",
- " The rung-out condition of this instruction is true while it is",
- " transmitting data, else false. This instruction consumes a very",
- " large amount of program memory, so it should be used sparingly. The",
- " present implementation is not efficient, but a better one will",
- " require modifications to all the back-ends.",
- "",
- "",
- "A NOTE ON USING MATH",
- "====================",
- "",
- "Remember that LDmicro performs only 16-bit integer math. That means",
- "that the final result of any calculation that you perform must be an",
- "integer between -32768 and 32767. It also mean that the intermediate",
- "results of your calculation must all be within that range.",
- "",
- "For example, let us say that you wanted to calculate y = (1/x)*1200,",
- "where x is between 1 and 20. Then y goes between 1200 and 60, which",
- "fits into a 16-bit integer, so it is at least in theory possible to",
- "perform the calculation. There are two ways that you might code this:",
- "you can perform the reciprocal, and then multiply:",
- "",
- " || {DIV temp :=} ||",
- " ||---------{ 1 / x }----------||",
- " || ||",
- " || {MUL y := } ||",
- " ||----------{ temp * 1200}----------||",
- " || ||",
- "",
- "Or you could just do the division directly, in a single step:",
- "",
- " || {DIV y :=} ||",
- " ||-----------{ 1200 / x }-----------||",
- "",
- "Mathematically, these two are equivalent; but if you try them, then you",
- "will find that the first one gives an incorrect result of y = 0. That",
- "is because the variable `temp' underflows. For example, when x = 3,",
- "(1 / x) = 0.333, but that is not an integer; the division operation",
- "approximates this as temp = 0. Then y = temp * 1200 = 0. In the second",
- "case there is no intermediate result to underflow, so everything works.",
- "",
- "If you are seeing problems with your math, then check intermediate",
- "results for underflow (or overflow, which `wraps around'; for example,",
- "32767 + 1 = -32768). When possible, choose units that put values in",
- "a range of -100 to 100.",
- "",
- "When you need to scale a variable by some factor, do it using a multiply",
- "and a divide. For example, to scale y = 1.8*x, calculate y = (9/5)*x",
- "(which is the same, since 1.8 = 9/5), and code this as y = (9*x)/5,",
- "performing the multiplication first:",
- "",
- " || {MUL temp :=} ||",
- " ||---------{ x * 9 }----------||",
- " || ||",
- " || {DIV y :=} ||",
- " ||-----------{ temp / 5 }-----------||",
- "",
- "This works for all x < (32767 / 9), or x < 3640. For larger values of x,",
- "the variable `temp' would overflow. There is a similar lower limit on x.",
- "",
- "",
- "CODING STYLE",
- "============",
- "",
- "I allow multiple coils in parallel in a single rung. This means that",
- "you can do things like this:",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || Xb Yb ||",
- " ||-------] [------+-------( )-------||",
- " || | ||",
- " || | Yc ||",
- " || +-------( )-------||",
- " || ||",
- "",
- "Instead of this:",
- "",
- " || Xa Ya ||",
- " 1 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yb ||",
- " 2 ||-------] [--------------( )-------||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || Xb Yc ||",
- " 3 ||-------] [--------------( )-------||",
- " || ||",
- "",
- "This means that in theory you could write any program as one giant rung,",
- "and there is no need to use multiple rungs at all. In practice that",
- "would be a bad idea, because as rungs become more complex they become",
- "more difficult to edit without deleting and redrawing a lot of logic.",
- "",
- "Still, it is often a good idea to group related logic together as a single",
- "rung. This generates nearly identical code to if you made separate rungs,",
- "but it shows that they are related when you look at them on the ladder",
- "diagram.",
- "",
- " * * *",
- "",
- "In general, it is considered poor form to write code in such a way that",
- "its output depends on the order of the rungs. For example, this code",
- "isn't very good if both Xa and Xb might ever be true:",
- "",
- " || Xa {v := } ||",
- " 1 ||-------] [--------{ 12 MOV}--||",
- " || ||",
- " || Xb {v := } ||",
- " ||-------] [--------{ 23 MOV}--||",
- " || ||",
- " || ||",
- " || ||",
- " || ||",
- " || [v >] Yc ||",
- " 2 ||------[ 15]-------------( )-------||",
- " || ||",
- "",
- "I will break this rule if in doing so I can make a piece of code",
- "significantly more compact, though. For example, here is how I would",
- "convert a 4-bit binary quantity on Xb3:0 into an integer:",
- "",
- " || {v := } ||",
- " 3 ||-----------------------------------{ 0 MOV}--||",
- " || ||",
- " || Xb0 {ADD v :=} ||",
- " ||-------] [------------------{ v + 1 }-----------||",
- " || ||",
- " || Xb1 {ADD v :=} ||",
- " ||-------] [------------------{ v + 2 }-----------||",
- " || ||",
- " || Xb2 {ADD v :=} ||",
- " ||-------] [------------------{ v + 4 }-----------||",
- " || ||",
- " || Xb3 {ADD v :=} ||",
- " ||-------] [------------------{ v + 8 }-----------||",
- " || ||",
- "",
- "If the MOV statement were moved to the bottom of the rung instead of the",
- "top, then the value of v when it is read elsewhere in the program would",
- "be 0. The output of this code therefore depends on the order in which",
- "the instructions are evaluated. Considering how cumbersome it would be",
- "to code this any other way, I accept that.",
- "",
- "",
- "BUGS",
- "====",
- "",
- "LDmicro does not generate very efficient code; it is slow to execute, and",
- "wasteful of flash and RAM. In spite of this, a mid-sized PIC or AVR can",
- "do everything that a small PLC can, so this does not bother me very much.",
- "",
- "The maximum length of variable names is highly limited. This is so that",
- "they fit nicely onto the ladder diagram, so I don't see a good solution",
- "to that.",
- "",
- "If your program is too big for the time, program memory, or data memory",
- "constraints of the device that you have chosen then you probably won't",
- "get an error. It will just screw up somewhere.",
- "",
- "Careless programming in the file load/save routines probably makes it",
- "possible to crash or execute arbitrary code given a corrupt or malicious",
- ".ld file.",
- "",
- "Please report additional bugs or feature requests to the author.",
- "",
- "Thanks to:",
- " * Marcelo Solano, for reporting a UI bug under Win98",
- " * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
- " PIC16F628 didn't work but also telling me how to fix it",
- " * Maxim Ibragimov, for reporting and diagnosing major problems",
- " with the till-then-untested ATmega16 and ATmega162 targets",
- " * Bill Kishonti, for reporting that the simulator crashed when the",
- " ladder logic program divided by zero",
- " * Mohamed Tayae, for reporting that persistent variables were broken",
- " on the PIC16F628",
- " * David Rothwell, for reporting several user interface bugs and a",
- " problem with the \"Export as Text\" function",
- "",
- "",
- "COPYING, AND DISCLAIMER",
- "=======================",
- "",
- "DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
- "FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
- "AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
- "OF LDMICRO OR CODE GENERATED BY LDMICRO.",
- "",
- "This program is free software: you can redistribute it and/or modify it",
- "under the terms of the GNU General Public License as published by the",
- "Free Software Foundation, either version 3 of the License, or (at your",
- "option) any later version.",
- "",
- "This program is distributed in the hope that it will be useful, but",
- "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
- "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
- "for more details.",
- "",
- "You should have received a copy of the GNU General Public License along",
- "with this program. If not, see <http://www.gnu.org/licenses/>.",
- "",
- "",
- "Jonathan Westhues",
- "",
- "Rijswijk -- Dec 2004",
- "Waterloo ON -- Jun, Jul 2005",
- "Cambridge MA -- Sep, Dec 2005",
- " Feb, Mar 2006",
- " Feb 2007",
- "Seattle WA -- Feb 2009",
- "",
- "Email: user jwesthues, at host cq.cx",
- "",
- "",
- NULL
-};
-#endif
-
diff --git a/ldmicro/obj/lang-tables.h b/ldmicro/obj/lang-tables.h
deleted file mode 100644
index 8b290d6..0000000
--- a/ldmicro/obj/lang-tables.h
+++ /dev/null
@@ -1,1568 +0,0 @@
-#ifdef LDLANG_DE
-static LangTable LangDeTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Zielfrequenz %d Hz, n�chste erreichbare ist %d Hz (Warnung, >5% Abweichung)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Kompilierung war erfolgreich. IHEX f�r AVR gespeichert unter '%s'.\r\n\r\n Die Prozessor-Konfigurationsbits m�ssen richtig gesetzt werden. Dies geschieht nicht automatisch" },
- { "( ) Normal", "( ) Normal" },
- { "(/) Negated", "(/) Negiert" },
- { "(S) Set-Only", "(S) Setzen" },
- { "(R) Reset-Only", "(R) R�cksetzen" },
- { "Pin on MCU", "Prozessorpin" },
- { "Coil", "Spule" },
- { "Comment", "Kommentar" },
- { "Cycle Time (ms):", "Zykluszeit (ms):" },
- { "Crystal Frequency (MHz):", "Quarzfrequenz (MHz):" },
- { "UART Baud Rate (bps):", "UART Baudrate (bps):" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "Serielles (UART) verwendet die Pins %d und %d.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "Einen Prozessor mit UART w�hlen.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "Keine UART-Anweisung Senden/Empfangen gefunden; die Baudrate festlegen, wenn diese Anweisung verwendet wird.\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "Die von LDmicro erzeugte Zykluszeit des SPS-Ablaufs ist vom Anwender konfigurierbar. Sehr kurze Zykluszeiten k�nnen wegen Prozessorbeschr�nkungen nicht erreichbar sein, und sehr lange Zykluszeiten k�nnen wegen Hardware-�berlaufs nicht erreichbar sein. Zykluszeiten zwischen 10 ms und 100 ms sind �blich.\r\n\r\nF�r die Umrechnung des Taktzykluses und der Zeitberechnung in Sekunden, muss der Compiler wissen, welche Quarzfrequenz beim Prozessor verwendet wird. Ein Quarz mit 4 bis 20 MHz ist �blich; �berpr�fen Sie die Geschwindigkeit Ihres Prozessors, um die maximal erlaubte Taktgeschwindigkeit zu bestimmen, bevor Sie einen Quarz w�hlen." },
- { "PLC Configuration", "SPS-Konfiguration" },
- { "Zero cycle time not valid; resetting to 10 ms.", "Zykluszeit = 0, nicht zul�ssig; wird auf 10 ms gesetzt." },
- { "Source", "Quelle" },
- { "Internal Relay", "Merker" },
- { "Input pin", "Eingangspin" },
- { "Output pin", "Ausgangspin" },
- { "|/| Negated", "|/| Negiert" },
- { "Contacts", "Kontakte" },
- { "No ADC or ADC not supported for selected micro.", "Kein A/D-Wandler vorhanden oder A/D-Wandler wird vom gew�hlten Prozessor nicht unterst�tzt." },
- { "Assign:", "Zuweisen:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "Kein Prozessor gew�hlt. Sie m�ssen einen Prozessor w�hlen, bevor Sie E/A Pins zuweisen k�nnen.\r\n\r\nW�hlen Sie einen Prozessor im Voreinstellungs-Menu und versuchen es noch mal." },
- { "I/O Pin Assignment", "E/A Pin Zuweisung" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "Keine E/A Zuweisung f�r ANSI C-Ziel m�glich; kompilieren Sie und beachten die Kommentare im erzeugten Quellcode." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "Keine E/A Zuweisung f�r ANSI C-Ziel m�glich; beachten Sie die Kommentare der Referenz-Ausf�hrung des Interpreters." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Nur f�r Ein- und Ausgangspins k�nnen Pin-Nummern vergeben werden (XName oder YName oder AName)." },
- { "No ADC or ADC not supported for this micro.", "Kein A/D-Wandler vorhanden oder A/D-Wandler wird vom gew�hlten Prozessor nicht unterst�tzt." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "Die Standardbezeichnung ('%s') des E/A�s vor der Zuweisung des Prozessorpins �ndern." },
- { "I/O Pin", "E/A Pin" },
- { "(no pin)", "(kein Pin)" },
- { "<UART needs!>", "<UART ben�tigt!>" },
- { "<PWM needs!>", "<PWM ben�tigt!>" },
- { "<not an I/O!>", "<kein E/A!>" },
- { "Export As Text", "Als Text exportieren" },
- { "Couldn't write to '%s'.", "Speichern nicht m�glich unter '%s'." },
- { "Compile To", "Kompilieren unter" },
- { "Must choose a target microcontroller before compiling.", "Vor dem Kompilieren muss ein Prozessor gew�hlt werden." },
- { "UART function used but not supported for this micro.", "Dieser Prozessor unterst�tzt keine UART-Funktion." },
- { "PWM function used but not supported for this micro.", "Dieser Prozessor unterst�tzt keine PWM-Funktion." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "Das Programm wurde nach dem letzten Speichern ge�ndert.\r\n\r\n M�chten Sie die �nderungen speichern?" },
- { "--add comment here--", "--Hier Komentar einf�gen--" },
- { "Start new program?", "Neues Programm starten?" },
- { "Couldn't open '%s'.", "Kann nicht ge�ffnet werden '%s'." },
- { "Name", "Name" },
- { "State", "Status" },
- { "Pin on Processor", "Prozessorpin" },
- { "MCU Port", "Prozessor-Port" },
- { "LDmicro - Simulation (Running)", "LDmicro - Simulation (am Laufen)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Simulation (Angehalten)" },
- { "LDmicro - Program Editor", "LDmicro � Programm-Editor" },
- { " - (not yet saved)", " - (noch nicht gespeichert)" },
- { "&New\tCtrl+N", "&Neu\tStrg+N" },
- { "&Open...\tCtrl+O", "&�ffnen...\tStrg+O" },
- { "&Save\tCtrl+S", "&Speichern\tStrg+S" },
- { "Save &As...", "Speichern &unter..." },
- { "&Export As Text...\tCtrl+E", "&Als Text exportieren...\tStrg+E" },
- { "E&xit", "&Beenden" },
- { "&Undo\tCtrl+Z", "&Aufheben\tStrg+Z" },
- { "&Redo\tCtrl+Y", "&Wiederherstellen\tStrg+Y" },
- { "Insert Rung &Before\tShift+6", "Netzwerk Einf�gen &Davor\tShift+6" },
- { "Insert Rung &After\tShift+V", "Netzwerk Einf�gen &Danach\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "Gew�hltes Netzwerk schieben &nach oben\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "Gew�hltes Netzwerk schieben &nach unten\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Gew�hltes Element l�schen\tEntf" },
- { "D&elete Rung\tShift+Del", "Netzwerk l�schen\tShift+Entf" },
- { "Insert Co&mment\t;", "Kommentar &einf�gen\t;" },
- { "Insert &Contacts\tC", "Kontakt &einf�gen\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "OSR einf�gen (Steigende Flanke)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "OSF einf�gen (Fallende Flanke)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "T&ON einf�gen (Anzugsverz�gerung)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "TO&F einf�gen (Abfallverz�gerung)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "R&TO einf�gen (Speichernde Anzugsverz�gerung)\tT" },
- { "Insert CT&U (Count Up)\tU", "CT&U einf�gen (Aufw�rtsz�hler)\tU" },
- { "Insert CT&D (Count Down)\tI", "CT&D einf�gen (Abw�rtsz�hler)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "CT&C einf�gen (Zirkulierender Z�hler)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "EQU einf�gen (Vergleich auf gleich)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "NEQ einf�gen (Vergleich auf ungleich)" },
- { "Insert GRT (Compare for Greater Than)\t>", "GRT einf�gen (Vergleich auf gr��er)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "GEQ einf�gen (Vergleich auf gr��er oder gleich)\t." },
- { "Insert LES (Compare for Less Than)\t<", "LES einf�gen (Vergleich auf kleiner)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "LEQ einf�gen (Vergleich auf kleiner oder gleich)\t," },
- { "Insert Open-Circuit", "�ffnung einf�gen" },
- { "Insert Short-Circuit", "Br�cke einf�gen" },
- { "Insert Master Control Relay", "Master Control Relais einf�gen" },
- { "Insert Coi&l\tL", "Spule einf�gen \tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "R&ES einf�gen (RTO/Z�hler r�cksetzen)\tE" },
- { "Insert MOV (Move)\tM", "Transferieren (Move) einf�gen\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "ADD einf�gen (16-bit Ganzzahl Addierer)\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "SUB einf�gen (16-bit Ganzzahl Subtrahierer)\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "MUL einf�gen (16-bit Ganzzahl Multiplizierer)\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "DIV einf�gen (16-bit Ganzzahl Dividierer)\tD" },
- { "Insert Shift Register", "Schieberegister einf�gen" },
- { "Insert Look-Up Table", "Nachschlag-Tabelle einf�gen" },
- { "Insert Piecewise Linear", "N�herungs-Linear-Tabelle einf�gen" },
- { "Insert Formatted String Over UART", "Formatierte Zeichenfolge �ber UART einf�gen" },
- { "Insert &UART Send", "&UART Senden einf�gen" },
- { "Insert &UART Receive", "&UART Empfangen einf�gen" },
- { "Insert Set PWM Output", "PWM Ausgang einf�gen" },
- { "Insert A/D Converter Read\tP", "A/D-Wandler Einlesen einf�gen\tP" },
- { "Insert Make Persistent", "Remanent machen einf�gen" },
- { "Make Norm&al\tA", "Auf Normal �ndern\tA" },
- { "Make &Negated\tN", "Auf &Negieren �ndern\tN" },
- { "Make &Set-Only\tS", "Auf &Setzen �ndern\tS" },
- { "Make &Reset-Only\tR", "Auf &R�cksetzen �ndern\tR" },
- { "&MCU Parameters...", "&Prozessor-Parameter..." },
- { "(no microcontroller)", "(kein Prozessor)" },
- { "&Microcontroller", "&Mikroprozessor" },
- { "Si&mulation Mode\tCtrl+M", "Simulationsbetrieb\tStrg+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Start &Echtzeit- Simulation\tStrg+R" },
- { "&Halt Simulation\tCtrl+H", "&Simulation Anhalten\tStrg+H" },
- { "Single &Cycle\tSpace", "&Einzelzyklus\tLeertaste" },
- { "&Compile\tF5", "&Kompilieren\tF5" },
- { "Compile &As...", "Kompilieren &unter..." },
- { "&Manual...\tF1", "&Handbuch...\tF1" },
- { "&About...", "&�ber LDmicro..." },
- { "&File", "&Datei" },
- { "&Edit", "&Bearbeiten" },
- { "&Settings", "&Voreinstellungen" },
- { "&Instruction", "&Anweisung" },
- { "Si&mulate", "Simulieren" },
- { "&Compile", "&Kompilieren" },
- { "&Help", "&Hilfe" },
- { "no MCU selected", "kein Prozessor gew�hlt" },
- { "cycle time %.2f ms", "Zykluszeit %.2f ms" },
- { "processor clock %.4f MHz", "Taktfrequenz Prozessor %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "Interner Fehler beim PIC paging Seitenwechsel; Programm verkleinern oder umbilden" },
- { "PWM frequency too fast.", "PWM Frequenz zu schnell." },
- { "PWM frequency too slow.", "PWM Frequenz zu langsam." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "Zykluszeit zu schnell; Zykluszeit vergr��ern oder schnelleren Quarz w�hlen." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "Zykluszeit zu langsam; Zykluszeit verringern oder langsameren Quarz w�hlen." },
- { "Couldn't open file '%s'", "Datei konnte nicht ge�ffnet werden '%s'" },
- { "Zero baud rate not possible.", "Baudrate = 0 nicht m�glich" },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Kompilierung war erfolgreich; IHEX f�r PIC16 gespeichert unter '%s'.\r\n\r\nKonfigurations-Wort (fuse) f�r Quarz-Oszillator festgelegt, BOD aktiviert, LVP gesperrt, PWRT aktiviert, Verschl�sselungsschutz aus.\r\n\r\nVerwendete %d/%d Worte des Flash-Speichers (Chip %d%% voll)." },
- { "Type", "Typ" },
- { "Timer", "Timer" },
- { "Counter", "Z�hler" },
- { "Reset", "R�cksetzen" },
- { "OK", "OK" },
- { "Cancel", "Abbrechen" },
- { "Empty textbox; not permitted.", "Leere Testbox; nicht erlaubt" },
- { "Bad use of quotes: <%s>", "Quoten falsch verwendet: <%s>" },
- { "Turn-On Delay", "Anzugsverz�gerung" },
- { "Turn-Off Delay", "Abfallverz�gerung" },
- { "Retentive Turn-On Delay", "Speichernde Anzugsverz�gerung" },
- { "Delay (ms):", "Verz�gerung (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Verz�gerung zu lang; maximal 2**31 us." },
- { "Delay cannot be zero or negative.", "Verz�gerung kann nicht gleich Null oder negativ sein." },
- { "Count Up", "Aufw�rtsz�hlen" },
- { "Count Down", "Abw�rtsz�hlen" },
- { "Circular Counter", "Zirkulierender Z�hler" },
- { "Max value:", "Maximalwert:" },
- { "True if >= :", "Wahr wenn >= :" },
- { "If Equals", "Wenn gleich" },
- { "If Not Equals", "Wenn ungleich" },
- { "If Greater Than", "Wenn gr��er als" },
- { "If Greater Than or Equal To", "Wenn gr��er als oder gleich" },
- { "If Less Than", "Wenn kleiner als" },
- { "If Less Than or Equal To", "Wenn kleiner als oder gleich" },
- { "'Closed' if:", "'Geschlossen' wenn:" },
- { "Move", "Transferieren" },
- { "Read A/D Converter", "A/D-Wandler einlesen" },
- { "Duty cycle var:", "Einsatzzyklus Var:" },
- { "Frequency (Hz):", "Frequenz (Hz):" },
- { "Set PWM Duty Cycle", "PWM Einsatzzyklus eingeben" },
- { "Source:", "Quelle:" },
- { "Receive from UART", "Mit UART empfangen" },
- { "Send to UART", "Mit UART senden" },
- { "Add", "Addieren" },
- { "Subtract", "Subtrahieren" },
- { "Multiply", "Multiplizieren" },
- { "Divide", "Dividieren" },
- { "Destination:", "Ziel:" },
- { "is set := :", "gesetzt auf := :" },
- { "Name:", "Name:" },
- { "Stages:", "Stufen:" },
- { "Shift Register", "Schieberegister" },
- { "Not a reasonable size for a shift register.", "Kein angemessenes Format f�r ein Schieberegister." },
- { "String:", "Zeichensatz:" },
- { "Formatted String Over UART", "Formatierter Zeichensatz �ber UART" },
- { "Variable:", "Variable:" },
- { "Make Persistent", "Remanent machen" },
- { "Too many elements in subcircuit!", "Zu viele Elemente im Netzwerk!" },
- { "Too many rungs!", "Zu viele Netzwerke!" },
- { "Error", "Fehler" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "ANSI C Zieldatei unterst�tzt keine Peripherien (wie UART, ADC, EEPROM). Die Anweisung wird ausgelassen." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Die Kompilierung war erfolgreich; der C-Quellcode wurde gespeichert unter '%s'.\r\n\r\nDies ist kein komplettes C-Programm. Sie m�ssen die Laufzeit und alle E/A Routinen vorgeben. Siehe die Kommentare im Quellcode f�r Informationen, wie man das macht." },
- { "Cannot delete rung; program must have at least one rung.", "Das Netzwerk nicht l�schbar, das Programm muss mindestens ein Netzwerk haben." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "Speicher voll; vereinfachen Sie das Programm oder w�hlen Sie einen Prozessor mit mehr Speicherkapazit�t." },
- { "Must assign pins for all ADC inputs (name '%s').", "F�r alle ADC-Eing�nge m�ssen Pins zugewiesen werden (Name '%s')." },
- { "Internal limit exceeded (number of vars)", "Interne Begrenzung �berschritten (Anzahl der Variablen)" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "Keine Zuweisung f�r Merker '%s', vergeben Sie eine Spule im Programm." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "F�r alle E/A's m�ssen Pins zugewiesen werden.\r\n\r\n'%s' ist nicht zugewiesen." },
- { "UART in use; pins %d and %d reserved for that.", "UART in Verwendung; Pins %d und %d sind hierf�r reserviert." },
- { "PWM in use; pin %d reserved for that.", "PWM in Verwendung; Pin %d hierf�r reserviert." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "UART Baudraten-Generator: Divisor=%d aktuell=%.4f f�r %.2f%% Fehler.\r\n\r\nDiese ist zu hoch; versuchen Sie es mit einer anderen Baudrate (wahrscheinlich langsamer), oder eine Quarzfrequenz w�hlen die von vielen �blichen Baudraten teilbar ist (wie 3.6864MHz, 14.7456MHz).\r\n\r\nCode wird trotzdem erzeugt, aber er kann unzuverl�ssig oder besch�digt sein." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "UART Baudraten-Generator: Zu langsam, der Divisor hat �berlauf. Einen langsameren Quarz oder schnellere Baudrate verwenden.\r\n\r\nCode wird trotzdem erzeugt, aber er wird wahrscheinlich besch�digt sein." },
- { "Couldn't open '%s'\n", "Konnte nicht ge�ffnet werden '%s'\n" },
- { "Timer period too short (needs faster cycle time).", "Timer-Intervall zu kurz (schnellere Zykluszeit n�tig)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "Timer-Intervall zu lang (max. 32767mal die Zykluszeit); langsamere Zykluszeit verwenden." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "Konstante %d au�erhalb des Bereichs: -32768 bis 32767 inklusive." },
- { "Move instruction: '%s' not a valid destination.", "Transfer-Anweisung: '%s' ist keine g�ltige Zieladresse." },
- { "Math instruction: '%s' not a valid destination.", "Mathem. Anweisung: '%s'keine g�ltige Zieladresse." },
- { "Piecewise linear lookup table with zero elements!", "N�herungs-Linear-Tabelle ohne Elemente!" },
- { "x values in piecewise linear table must be strictly increasing.", "Die x-Werte in der N�herungs-Linear-Tabelle m�ssen strikt aufsteigend sein." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Zahlenm��iges Problem mit der N�herungs-Linear-Tabelle. Entweder die Eingangswerte der Tabelle verringern, oder die Punkte n�her zusammen legen.\r\n\r\nF�r Details siehe unter Hilfe." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "Mehrfacher Zeilenumbruch (\\0-9)in formatierter Zeichenfolge nicht gestattet." },
- { "Bad escape: correct form is \\xAB.", "Falscher Zeilenumbruch: Korrekte Form = \\xAB." },
- { "Bad escape '\\%c'", "Falscher Zeilenumbruch '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "Formatierte Zeichenfolge enth�lt Variable, aber keine ist angegeben." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "Keine Variable in formatierter Zeichenfolge eingef�gt, aber ein Variabelen-Name wurde vergeben. Geben Sie eine Zeichenfolge ein, wie z.B. '\\-3', oder den Variabelen-Namen unausgef�llt lassen." },
- { "Empty row; delete it or add instructions before compiling.", "Leere Reihe; vor dem Kompilieren l�schen oder Anweisungen einf�gen." },
- { "Couldn't write to '%s'", "Nicht m�glich, speichern unter '%s'." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Keine unterst�tzte Operation der interpretierbaren Zieldatei (kein ADC, PWM, UART, EEPROM m�glich)." },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Kompilierung war erfolgreich; interpretierbarer Code gespeichert unter '%s'.\r\n\r\nWahrscheinlich m�ssen Sie den Interpreter an Ihre Anwendung anpassen. Siehe Dokumentation." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "Prozessor '%s' nicht unterst�tzt.\r\n\r\nZur�ck zu: Kein Prozessor gew�hlt." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Fehler beim Dateiformat; vielleicht ist dies ein Programm f�r eine neuere Version von LDmicro." },
- { "Index:", "Liste:" },
- { "Points:", "Punkte:" },
- { "Count:", "Berechnung:" },
- { "Edit table of ASCII values like a string", "ASCII-Werte Tabelle als Zeichenfolge ausgeben" },
- { "Look-Up Table", "Nachschlag-Tabelle" },
- { "Piecewise Linear Table", "N�herungs-Linear-Tabelle" },
- { "LDmicro Error", "Fehler LDmicro" },
- { "Compile Successful", "Kompilierung war erfolgreich" },
- { "digital in", "Digitaler Eingang" },
- { "digital out", "Digitaler Ausgang" },
- { "int. relay", "Merker" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "PWM Ausgang" },
- { "turn-on delay", "Anzugsverz�gerung" },
- { "turn-off delay", "Abfallverz�gerung" },
- { "retentive timer", "Speichernder Timer" },
- { "counter", "Z�hler" },
- { "general var", "Allg. Variable" },
- { "adc input", "ADC Eingang" },
- { "<corrupt!>", "<besch�digt!>" },
- { "(not assigned)", "(nicht zugewiesen)" },
- { "<no UART!>", "<kein UART!>" },
- { "<no PWM!>", "<kein PWM!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: Variable kann andernorts nicht verwendet werden" },
- { "TON: variable cannot be used elsewhere", "TON: Variable kann andernorts nicht verwendet werden" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: Variable kann andernorts nur f�r RES verwendet werden" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "Variable '%s' nicht zugewiesen, z.B. zu einer Transfer- oder ADD-Anweisung usw.\r\n\r\nDas ist vermutlich ein Programmierungsfehler; jetzt wird sie immer Null sein." },
- { "Variable for '%s' incorrectly assigned: %s.", "Variable f�r '%s' falsch zugewiesen: %s." },
- { "Division by zero; halting simulation", "Division durch Null; Simulation gestoppt" },
- { "!!!too long!!!", " !!!zu lang!!!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nE/A Zuweisungen:\n\n" },
- { " Name | Type | Pin\n", " Name | Typ | Pin\n" },
-};
-static Lang LangDe = {
- LangDeTable, sizeof(LangDeTable)/sizeof(LangDeTable[0])
-};
-#endif
-#ifdef LDLANG_ES
-static LangTable LangEsTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Frecuencia Micro %d Hz, la mejor aproximaci�n es %d Hz (aviso, >5%% error)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Compilaci�n correcta; se escribi� IHEX para AVR en '%s'.\r\n\r\nRecuerde marcar la configuraci�n (fuses) del micro correctamente. Esto NO se hace automaticamente." },
- { "( ) Normal", "( ) Normal" },
- { "(/) Negated", "(/) Negado" },
- { "(S) Set-Only", "(S) Activar" },
- { "(R) Reset-Only", "(R) Desactivar" },
- { "Pin on MCU", "Pata del Micro" },
- { "Coil", "Bobina" },
- { "Comment", "Comentario" },
- { "Cycle Time (ms):", "Tiempo Ciclo (ms):" },
- { "Crystal Frequency (MHz):", "Frecuencia Cristal (MHz):" },
- { "UART Baud Rate (bps):", "Baudios UART (bps):" },
- { "Serie (UART) will use pins %d and %d.\r\n\r\n", "Puerto Serie (UART) usar� las patas %d y %d.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "Por favor. Seleccione un micro con UART.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "No se han usado instrucciones (UART Enviar/UART Recibir) para el puerto serie aun; A�ada una al programa antes de configurar los baudios.\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "El tiempo de ciclo de ejecuci�n para el 'PLC' es configurable. Un tiempo de ciclo muy corto puede no funcionar debido a la baja velocidad del micro, y un tiempo de ciclo muy largo puede no funcionar por limitaciones del temporizador del micro. Ciclos de tiempo entre 10 y 100 ms suele ser lo normal.\r\n\r\nEl compilador debe conocer la velocidad del cristal que estas usando para poder convertir entre tiempo en ciclos de reloj y tiempo en segundos. Un cristal entre 4 Mhz y 20 Mhz es lo t�pico; Comprueba la velocidad a la que puede funcionar tu micro y calcula la velocidad m�xima del reloj antes de elegir el cristal." },
- { "PLC Configuration", "Configuraci�n PLC" },
- { "Zero cycle time not valid; resetting to 10 ms.", "No es valido un tiempo de ciclo 0; forzado a 10 ms." },
- { "Source", "Fuente" },
- { "Internal Relay", "Rele Interno" },
- { "Input pin", "Pata Entrada" },
- { "Output pin", "Pata Salida" },
- { "|/| Negated", "|/| Negado" },
- { "Contacts", "Contacto" },
- { "No ADC or ADC not supported for selected micro.", "El micro seleccionado no tiene ADC o no esta soportado." },
- { "Assign:", "Asignar:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "No se ha seleccionado micro. Debes seleccionar un micro antes de asignar patas E/S.\r\n\r\nElije un micro en el menu de configuraci�n y prueba otra vez." },
- { "I/O Pin Assignment", "Asignaci�n de pata E/S" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "No se puede asignar la E/S especificadas para el ANSI C generado; compile y vea los comentarios generados en el c�digo fuente." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "No se puede asignar la E/S especificadas para el c�digo generado para el interprete; vea los comentarios en la implementaci�n del interprete." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Solo puede asignar numero de pata a las patas de Entrada/Salida (Xname o Yname o Aname)." },
- { "No ADC or ADC not supported for this micro.", "Este micro no tiene ADC o no esta soportado." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "Cambie el nombre por defecto ('%s') antes de asignarle una pata del micro." },
- { "I/O Pin", "E/S Pata" },
- { "(no pin)", "(falta pata)" },
- { "<UART needs!>", "<Se necesita UART!>" },
- { "<PWM needs!>", "<Se necesita PWM!>" },
- { "<not an I/O!>", "<No es una E/S!>" },
- { "Export As Text", "Exportar como Texto" },
- { "Couldn't write to '%s'.", "No puedo escribir en '%s'." },
- { "Compile To", "Compilar" },
- { "Must choose a target microcontroller before compiling.", "Debe elegir un micro antes de compilar." },
- { "UART function used but not supported for this micro.", "Usadas Funciones para UART. Este micro no las soporta." },
- { "PWM function used but not supported for this micro.", "Usadas Funciones para PWM. Este micro no las soporta." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "El programa ha cambiado desde la �ltima vez que los guardo.\r\n\r\n�Quieres guardar los cambios?" },
- { "--add comment here--", "--a�ade el comentario aqu�--" },
- { "Start new program?", "�Empezar un nuevo programa?" },
- { "Couldn't open '%s'.", "No puedo abrir '%s'." },
- { "Name", "Nombre" },
- { "State", "Estado" },
- { "Pin on Processor", "Pata del Micro" },
- { "MCU Port", "Puerto del Micro" },
- { "LDmicro - Simulation (Running)", "LDmicro - Simulaci�n (Ejecutando)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Simulaci�n (Parada)" },
- { "LDmicro - Program Editor", "LDmicro � Editor de Programa" },
- { " - (not yet saved)", " - (no guardado a�n)" },
- { "&New\tCtrl+N", "&Nuevo\tCtrl+N" },
- { "&Open...\tCtrl+O", "&Abrir...\tCtrl+O" },
- { "&Save\tCtrl+S", "&Guardar\tCtrl+S" },
- { "Save &As...", "Guardar &Como..." },
- { "&Export As Text...\tCtrl+E", "&Exportar a Texto...\tCtrl+E" },
- { "E&xit", "&Salir" },
- { "&Undo\tCtrl+Z", "&Deshacer\tCtrl+Z" },
- { "&Redo\tCtrl+Y", "&Rehacer\tCtrl+Y" },
- { "Insert Rung &Before\tShift+6", "Insertar L�nea (Rung) &Antes\tShift+6" },
- { "Insert Rung &After\tShift+V", "Insertar L�nea (Rung) &Despues\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "Subir L�nea (Rung) Seleccionada\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "Bajar L�nea (Rung) Seleccionada\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Borrar Elemento Seleccionado\tSupr" },
- { "D&elete Rung\tShift+Del", "B&orrar L�nea (Rung) Seleccionada\tShift+Supr" },
- { "Insert Co&mment\t;", "Insertar Co&mentario\t;" },
- { "Insert &Contacts\tC", "Insertar &Contacto\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "Insertar OSR (Flanco de Subida)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "Insertar OSF (Flanco de Bajada)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "Insertar T&ON (Encendido Retardado)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "Insertar TO&F (Apagado Retardado)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "Insertar R&TO (Encendido Retardado con Memoria)\tT" },
- { "Insert CT&U (Count Up)\tU", "Insertar CT&U (Contador Incremental)\tU" },
- { "Insert CT&D (Count Down)\tI", "Insertar CT&D (Contador Decremental)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "Insertar CT&C (Contador Circular)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "Insertar EQU (Comparador si Igual)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "Insertar NEQ (Comparador si NO Igual)" },
- { "Insert GRT (Compare for Greater Than)\t>", "Insertar GRT (Comparador si Mayor que)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "Insertar GEQ (Comparador si Mayor o Igual que)\t." },
- { "Insert LES (Compare for Less Than)\t<", "Insertar LES (Comparador si Menor que)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "Insertar LEQ (Comparador si Menor o Igual que)\t," },
- { "Insert Open-Circuit", "Insertar Circuito-Abierto" },
- { "Insert Short-Circuit", "Insertar Circuito-Cerrado" },
- { "Insert Master Control Relay", "Insertar Rele de Control Maestro" },
- { "Insert Coi&l\tL", "Insertar &Bobina\tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "Insertar R&ES (Contador/RTO Reinicio)\tE" },
- { "Insert MOV (Move)\tM", "Insertar MOV (Mover)\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "Insertar ADD (Suma Entero 16-bit)\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "Insertar SUB (Resta Entero 16-bit)\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "Insertar MUL (Multiplica Entero 16-bit)\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "Insertar DIV (Divide Entero 16-bit)\tD" },
- { "Insert Shift Register", "Insertar Registro de Desplazamiento" },
- { "Insert Look-Up Table", "Insertar Tabla de Busqueda" },
- { "Insert Piecewise Linear", "Insertar Linealizaci�n por Segmentos" },
- { "Insert Formatted String Over UART", "Insertar Cadena Formateada en la UART" },
- { "Insert &UART Send", "Insertar &UART Enviar" },
- { "Insert &UART Receive", "Insertar &UART Recibir" },
- { "Insert Set PWM Output", "Insertar Valor Salida PWM" },
- { "Insert A/D Converter Read\tP", "Insertar Lectura Conversor A/D\tP" },
- { "Insert Make Persistent", "Insertar Hacer Permanente" },
- { "Make Norm&al\tA", "Hacer Norm&al\tA" },
- { "Make &Negated\tN", "Hacer &Negado\tN" },
- { "Make &Set-Only\tS", "Hacer &Solo-Activar\tS" },
- { "Make &Reset-Only\tR", "Hace&r Solo-Desactivar\tR" },
- { "&MCU Parameters...", "&Parametros del Micro..." },
- { "(no microcontroller)", "(no microcontrolador)" },
- { "&Microcontroller", "&Microcontrolador" },
- { "Si&mulation Mode\tCtrl+M", "Modo Si&mulaci�n \tCtrl+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Empezar Simulaci�n en Tiempo &Real\tCtrl+R" },
- { "&Halt Simulation\tCtrl+H", "Parar Simulaci�n\tCtrl+H" },
- { "Single &Cycle\tSpace", "Solo un &Ciclo\tSpace" },
- { "&Compile\tF5", "&Compilar\tF5" },
- { "Compile &As...", "Compilar &Como..." },
- { "&Manual...\tF1", "&Manual...\tF1" },
- { "&About...", "&Acerca de..." },
- { "&File", "&Archivo" },
- { "&Edit", "&Editar" },
- { "&Settings", "&Configuraciones" },
- { "&Instruction", "&Instrucci�n" },
- { "Si&mulate", "Si&mular" },
- { "&Compile", "&Compilar" },
- { "&Help", "&Ayuda" },
- { "no MCU selected", "micro no seleccionado" },
- { "cycle time %.2f ms", "tiempo ciclo %.2f ms" },
- { "processor clock %.4f MHz", "reloj procesador %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "Error interno relativo a la paginaci�n del PIC; Haz el programa mas peque�o o reorganizalo" },
- { "PWM frequency too fast.", "Frecuencia del PWM demasiado alta." },
- { "PWM frequency too slow.", "Frecuencia del PWM demasiado baja." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "Tiempo del Ciclo demasiado rapido; aumenta el tiempo de ciclo, o usa un cristal de mas Mhz." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "Tiempo del Ciclo demasiado lento; incrementa el tiempo de ciclo, o usa un cristal de menos Mhz." },
- { "Couldn't open file '%s'", "No puedo abrir el archivo '%s'" },
- { "Zero baud rate not possible.", "Cero baudios no es posible." },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Compilaci�n correcta; escrito IHEX para PIC16 en '%s'.\r\n\r\nBits de Configurari�n (fuses) han sido establecidos para oscilador a cristal, BOD activado, LVP desactivado, PWRT activado, Todos los bits de protecci�n desactivados.\r\n\r\nUsadas %d/%d palabras de programa en flash (Chip %d%% lleno)." },
- { "Type", "Tipo" },
- { "Timer", "Temporizador" },
- { "Counter", "Contador" },
- { "Reset", "Reiniciar" },
- { "OK", "OK" },
- { "Cancel", "Cancelar" },
- { "Empty textbox; not permitted.", "Texto vacio; no permitido" },
- { "Bad use of quotes: <%s>", "Mal uso de las comillas: <%s>" },
- { "Turn-On Delay", "Activar Retardado" },
- { "Turn-Off Delay", "Desactivar Retardado" },
- { "Retentive Turn-On Delay", "Activar Retardado con Memoria" },
- { "Delay (ms):", "Retardo (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Retardo demasiado largo; maximo 2**31 us." },
- { "Delay cannot be zero or negative.", "El retardo no puede ser cero o negativo." },
- { "Count Up", "Contador Creciente" },
- { "Count Down", "Contador Decreciente" },
- { "Circular Counter", "Contador Circular" },
- { "Max value:", "Valor Max:" },
- { "True if >= :", "Verdad si >= :" },
- { "If Equals", "Si igual" },
- { "If Not Equals", "Si NO igual" },
- { "If Greater Than", "Si mayor que" },
- { "If Greater Than or Equal To", "Si mayor o igual que" },
- { "If Less Than", "Si menor que" },
- { "If Less Than or Equal To", "Si menor o igual que" },
- { "'Closed' if:", "'Cerrado' si:" },
- { "Move", "Mover" },
- { "Read A/D Converter", "Leer Conversor A/D" },
- { "Duty cycle var:", "Var Ancho Ciclo:" },
- { "Frequency (Hz):", "Frecuencia (Hz):" },
- { "Set PWM Duty Cycle", "Poner Ancho de Pulso PWM" },
- { "Source:", "Fuente:" },
- { "Receive from UART", "Recibido en la UART" },
- { "Send to UART", "Enviado a la UART" },
- { "Add", "Sumar" },
- { "Subtract", "Restar" },
- { "Multiply", "Multiplicar" },
- { "Divide", "Dividir" },
- { "Destination:", "Destino:" },
- { "is set := :", "esta puesto := :" },
- { "Name:", "Nombre:" },
- { "Stages:", "Fases:" },
- { "Shift Register", "Registro Desplazamiento" },
- { "Not a reasonable size for a shift register.", "No es un tama�o razonable para el Registro de Desplazamiento." },
- { "String:", "Cadena:" },
- { "Formatted String Over UART", "Cadena Formateada para UART" },
- { "Variable:", "Variable:" },
- { "Make Persistent", "Hacer permanente" },
- { "Too many elements in subcircuit!", "Demasiados elementos en un SubCircuito!" },
- { "Too many rungs!", "Demasiadas Lineas (rungs)!" },
- { "Error", "Error" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "ANSI C de destino no soporta perifericos (UART, PWM, ADC, EEPROM). Evite esa instrucci�n." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Compilaci�n correcta: Escrito C�digo Fuente en C en '%s'.\r\n\r\nNo es un programa completo en C. Tiene que a�adirle el procedimiento principal y todas las rutinas de E/S. Vea los comentarios en el c�digo fuente para mas informaci�n sobre como hacer esto" },
- { "Cannot delete rung; program must have at least one rung.", "No puedo borrar la Linea (rung); el programa debe tener al menos una Linea (rung)." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "Fuera de Memoria; Simplifique el programa o elija un micro con mas memoria.." },
- { "Must assign pins for all ADC inputs (name '%s').", "Debe asignar patas para todas las entradas del ADC (nombre '%s')." },
- { "Internal limit exceeded (number of vars)", "Limite interno superado (numero de variables)" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "No ha asignado el rele interno '%s'; a�ada la bobina en cualquier parte del programa." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "Debe asignar patas a todas las E/S.\r\n\r\n'%s' no esta asignada." },
- { "UART in use; pins %d and %d reserved for that.", "UART en uso; patas %d y %d reservadas para eso." },
- { "PWM in use; pin %d reserved for that.", "PWM en uso; pata %d reservada para eso." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "UART generador de baudios: divisor=%d actual=%.4f para %.2f%% error.\r\n\r\nEs demasiado grande; Prueba con otro valor de baudios (probablemente menor), o un cristal cuya frecuencia sea divible por los baudios mas comunes (p.e. 3.6864MHz, 14.7456MHz).\r\n\r\nEl c�digo se genera de todas formas pero las tramas serie sean inestable o no entendible." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "UART generador de baudios: demasiado lento, divisor demasiado grande. Use un cristal mas lento o mayor baudios.\r\n\r\nEl c�digo se genera de todas formas pero las tramas serie ser�n no entendible.." },
- { "Couldn't open '%s'\n", "No puedo abrir '%s'\n" },
- { "Timer period too short (needs faster cycle time).", "Periodo de Tiempo demasiado corto (se necesita un tiempo de ciclo menor)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "Periodo del temporizador demasiado largo (max. 32767 veces el tiempo de ciclo); use un tiempo de ciclo mayor." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "Constante %d fuera de rango: -32768 a 32767 inclusive." },
- { "Move instruction: '%s' not a valid destination.", "Instrucci�n Move: '%s' no es valido el destino." },
- { "Math instruction: '%s' not a valid destination.", "Instrucci�n Math: '%s' no es valido el destino." },
- { "Piecewise linear lookup table with zero elements!", "tabla de linealizacion por segmentos con cero elementos!" },
- { "x values in piecewise linear table must be strictly increasing.", "Los valores X en la tabla de linealizaci�n por segmentos deben ser estrictamente incrementales." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Problema num�rico con la tabla de linealizaci�n por segmentos. Haz la tabla de entradas mas peque�a, o aleja mas los puntos juntos.\r\n\r\nMira la ayuda para mas detalles." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "No esta permitido mas de un caracter especial (\\0-9) dentro de la cadena de caractares." },
- { "Bad escape: correct form is \\xAB.", "Caracter Especial Erroneo: la forma correcta es = \\xAB." },
- { "Bad escape '\\%c'", "Caracter Especial Erroneo '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "Se ha declarado un parametro dentro la cadena de caracteres, pero falta especificar la variable." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "No se ha declarado un parametro dentro de la cadena de caractares pero sin embargo se ha especificado una variable. A�ada un cadena como '\\-3', o quite el nombre de la variable." },
- { "Empty row; delete it or add instructions before compiling.", "Fila vacia; borrela o a�ada instrucciones antes de compilar." },
- { "Couldn't write to '%s'", "No puedo escribir en '%s'." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Op no soportada en el interprete (algun ADC, PWM, UART, EEPROM)." },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Compilaci�n correcta: C�digo para interprete escrito en '%s'.\r\n\r\nProblablemente tengas que adaptar el interprete a tu aplicaci�n. Mira la documentaci�n." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "Microcontrolador '%s' no sorportado.\r\n\r\nForzando ninguna CPU." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Error en el formato de archivo; quizas este programa es una version mas moderna de LDmicro?." },
- { "Index:", "Indice:" },
- { "Points:", "Puntos:" },
- { "Count:", "Cantidad:" },
- { "Edit table of ASCII values like a string", "Editar tabla de valores ascii como una cadena" },
- { "Look-Up Table", "Buscar en Tabla" },
- { "Piecewise Linear Table", "Tabla de linealizaci�n por segmentos" },
- { "LDmicro Error", "LDmicro Error" },
- { "Compile Successful", "Compilaci�n Correcta" },
- { "digital in", "entrada digital" },
- { "digital out", "salida digital" },
- { "int. relay", "rele interno" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "salida PWM" },
- { "turn-on delay", "activar retardo" },
- { "turn-off delay", "desactivar retardo" },
- { "retentive timer", "temporizador con memoria" },
- { "counter", "contador" },
- { "general var", "var general" },
- { "adc input", "entrada adc" },
- { "<corrupt!>", "<estropeado!>" },
- { "(not assigned)", "(no asignado)" },
- { "<no UART!>", "<no UART!>" },
- { "<no PWM!>", "<no PWM!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: la variable no puede ser usada en otra parte" },
- { "TON: variable cannot be used elsewhere", "TON: la variable no puede ser usada en otra parte" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: la variable solo puede ser usada como RES en otra parte" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "Variable '%s' no asignada, p.e. con el comando MOV, una instrucci�n ADD, etc.\r\n\r\nEsto es probablemente un error de programaci�n; valdr� cero." },
- { "Variable for '%s' incorrectly assigned: %s.", "Variable para '%s' incorrectamente asignada: %s." },
- { "Division by zero; halting simulation", "Divisi�n por cero; Parando simulaci�n" },
- { "!!!too long!!!", "!!Muy grande!!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nE/S ASIGNACI�N:\n\n" },
- { " Name | Type | Pin\n", " Nombre | Tipo | Pata\n" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "El Puerto Serie (UART) usar� los pines %d y %d.\r\n\r\n" },
-};
-static Lang LangEs = {
- LangEsTable, sizeof(LangEsTable)/sizeof(LangEsTable[0])
-};
-#endif
-#ifdef LDLANG_FR
-static LangTable LangFrTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Fr�quence de la cible %d Hz, fonction accomplie � %d Hz (ATTENTION, >5% erreur)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Compil� avec succ�s. Ecriture du fichier IHEX pour AVR sous '%s'.\r\n\r\nVous devez configurer manuellement les Bits de configuration (fusibles). Ceci n'est pas accompli automatiquement." },
- { "( ) Normal", "( ) Normal" },
- { "(/) Negated", "(/) Invers�e" },
- { "(S) Set-Only", "(S) Activer" },
- { "(R) Reset-Only", "(R) RAZ" },
- { "Pin on MCU", "Broche MCU" },
- { "Coil", "Bobine" },
- { "Comment", "Commentaire" },
- { "Cycle Time (ms):", "Temps de cycle (ms):" },
- { "Crystal Frequency (MHz):", "Fr�quence quartz (MHz):" },
- { "UART Baud Rate (bps):", "UART Vitesse (bps):" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "Communication s�rie utilisera broches %d et %d.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "S�lectionnez un processeur avec UART.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "Aucune instruction (�mission ou r�ception UART) n'est utilis�e; ajouter une instruction avant de fixer les vitesses.\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "Le temps de cycle de l'API (automate programmable) est configurable par l'utilisateur. Un temps trop court n'est pas utilisable d� � des contraintes de vitesse du processeur. Des temps de cycle trop longs ne sont pas utilisables � cause du d�passement de capacit� des registres. Des temps de cycle compris entre 10 ms et 100 ms sont g�neralement utilisables.\r\n\r\nLe compilateur doit connaitre la fr�quence du quartz utilis� pour d�finir les temps de cycles d'horloge ainsi que les temporisations, les fr�quences de 4 � 20 mhz sont typiques. D�terminer la vitesse d�sir�e avant de choisir le quartz." },
- { "PLC Configuration", "Configuration API" },
- { "Zero cycle time not valid; resetting to 10 ms.", "Temps de cycle non valide ; remis � 10 ms." },
- { "Source", "Source" },
- { "Internal Relay", "Relais interne" },
- { "Input pin", "Entr�e" },
- { "Output pin", "Sortie" },
- { "|/| Negated", "|/| Normalement ferm�" },
- { "Contacts", "Contacts" },
- { "No ADC or ADC not supported for selected micro.", "Pas de convertisseur A/D ou convertisseur non support� pour le MCU s�lectionn�." },
- { "Assign:", "Affectations:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "Aucun microcontrolleur s�lectionn�. Vous devez s�lectionner un microcontroleur avant de d�finir l'utilisation des broches.\r\n\r\nS�lectionnez un micro dans le menu et essayez � nouveau." },
- { "I/O Pin Assignment", "Affectation broches E/S" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "Ne pas sp�cifier les E/S pour code en ANSI C; Compiler et voir les commentaires dans le code source g�n�r�." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "Ne pas sp�cifier les E/S pour sortie en code interpr�t�; Voir les commentaires pour l'impl�mentation de l'interpr�teur ." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Vous pouvez uniquement affecter les broches Entr�es/Sorties (XName , YName ou AName)." },
- { "No ADC or ADC not supported for this micro.", "Pas de convertisseur A/D ou convertisseur non support� pour ce micro." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "Changer les noms par d�fauts des E/S ('%s') avant de leur affecter une broche MCU." },
- { "I/O Pin", "Broches E/S" },
- { "(no pin)", "(Aucune broche)" },
- { "<UART needs!>", "<UART n�cessaire!>" },
- { "<PWM needs!>", "<PWM n�cessaire!>" },
- { "<not an I/O!>", "<Pas une E/S!>" },
- { "Export As Text", "Exporter en texte" },
- { "Couldn't write to '%s'.", "Impossible d'�crire '%s'." },
- { "Compile To", "Compiler sous" },
- { "Must choose a target microcontroller before compiling.", "Choisir un microcontrolleur avant de compiler." },
- { "UART function used but not supported for this micro.", "Des fonctions UART sont utilis�es, mais non support�es par ce micro." },
- { "PWM function used but not supported for this micro.", "Fonctions PWM utilis�es mais non support�es par ce micro." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "Le programme a chang� depuis la derni�re sauvegarde.\r\n\r\nVoulez-vous sauvegarder les changements?" },
- { "--add comment here--", "--Ajouter les commentaires ICI--" },
- { "Start new program?", "Commencer un nouveau programme?" },
- { "Couldn't open '%s'.", "Impossible d'ouvrir '%s'." },
- { "Name", "Nom" },
- { "State", "Etat" },
- { "Pin on Processor", "Broche du Micro" },
- { "MCU Port", "Port du processeur" },
- { "LDmicro - Simulation (Running)", "LDmicro - Simulation (en cours)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Simulation (Arr�t�e)" },
- { "LDmicro - Program Editor", "LDmicro � Edition du programme " },
- { " - (not yet saved)", " - (fichier non sauvegard�)" },
- { "&New\tCtrl+N", "&Nouveau\tCtrl+N" },
- { "&Open...\tCtrl+O", "&Ouvrir...\tCtrl+O" },
- { "&Save\tCtrl+S", "&Sauvegarder\tCtrl+S" },
- { "Save &As...", "S&auvegarder sous..." },
- { "&Export As Text...\tCtrl+E", "&Exporter en texte...\tCtrl+E" },
- { "E&xit", "Quitter" },
- { "&Undo\tCtrl+Z", "Annuler\tCtrl+Z" },
- { "&Redo\tCtrl+Y", "&Refaire\tCtrl+Y" },
- { "Insert Rung &Before\tShift+6", "Ins�rer ligne avant\tShift+6" },
- { "Insert Rung &After\tShift+V", "Ins�rer ligne &apr�s\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "D�placer la ligne s�lectionn�e au dessus\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "D�placer la ligne s�lectionn�e au dessous\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Effacer l'�lement s�lectionn�\tSuppr" },
- { "D&elete Rung\tShift+Del", "Supprimer la ligne\tShift+Suppr" },
- { "Insert Co&mment\t;", "Ins�rer commentaire\t;" },
- { "Insert &Contacts\tC", "Ins�rer &contact\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "Ins�rer OSR (Front montant)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "Ins�rer OSF (Front descendant)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "Ins�rer T&ON (Tempo travail)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "Ins�rer TO&F (Tempo repos)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "Ins�rer R&TO (Tempo totalisatrice)\tT" },
- { "Insert CT&U (Count Up)\tU", "Ins�rer CT&U (Compteur)\tU" },
- { "Insert CT&D (Count Down)\tI", "Ins�rer CT&D (D�compteur)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "Ins�rer CT&C (Compteur cyclique)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "Ins�rer EQU (Compare pour �galit�)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "Ins�rer NEQ (Compare pour in�galit�)" },
- { "Insert GRT (Compare for Greater Than)\t>", "Ins�rer GRT (Compare plus grand que)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "Ins�rer GEQ (Compare plus grand ou �gal �)\t." },
- { "Insert LES (Compare for Less Than)\t<", "Ins�rer LES (Compare plus petit que)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "Ins�rer LEQ (Compare plus petit ou �gal �)\t," },
- { "Insert Open-Circuit", "Ins�rer circuit ouvert" },
- { "Insert Short-Circuit", "Ins�rer court circuit" },
- { "Insert Master Control Relay", "Ins�rer relais de contr�le maitre" },
- { "Insert Coi&l\tL", "Ins�rer bobine re&lais \tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "Ins�rer R&ES (Remise � z�ro RTO/compteur)\tE" },
- { "Insert MOV (Move)\tM", "Ins�rer MOV (Mouvoir)\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "Ins�rer ADD (Addition entier 16-bit)\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "Ins�rer SUB (Soustraction entier 16-bit)\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "Ins�rer MUL (Multiplication entier 16-bit)\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "Ins�rer DIV (Division entier 16-bit)\tD" },
- { "Insert Shift Register", "Ins�rer registre � d�calage" },
- { "Insert Look-Up Table", "Ins�rer tableau index�" },
- { "Insert Piecewise Linear", "Ins�rer tableau d'�l�ments lin�aires" },
- { "Insert Formatted String Over UART", "Ins�rer chaine formatt�e pour l'UART" },
- { "Insert &UART Send", "Ins�rer �mission &UART" },
- { "Insert &UART Receive", "Ins�rer r�ception &UART" },
- { "Insert Set PWM Output", "Ins�rer fixer sortie PWM" },
- { "Insert A/D Converter Read\tP", "Ins�rer lecture convertisseur A/D\tP" },
- { "Insert Make Persistent", "Ins�rer mettre r�manent" },
- { "Make Norm&al\tA", "Mettre norm&al\tA" },
- { "Make &Negated\tN", "I&nverser\tN" },
- { "Make &Set-Only\tS", "Activer uniquement\tS" },
- { "Make &Reset-Only\tR", "Faire RAZ uniquement\tR" },
- { "&MCU Parameters...", "&Param�tres MCU..." },
- { "(no microcontroller)", "(pas de microcontrolleur)" },
- { "&Microcontroller", "&Microcontrolleur" },
- { "Si&mulation Mode\tCtrl+M", "Mode si&mulation\tCtrl+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Commencer la simulation en temps &r�el\tCtrl+R" },
- { "&Halt Simulation\tCtrl+H", "&Arr�ter la simulation\tCtrl+H" },
- { "Single &Cycle\tSpace", "&Cycle unique\tEspace" },
- { "&Compile\tF5", "&Compiler\tF5" },
- { "Compile &As...", "Compiler sous..." },
- { "&Manual...\tF1", "&Manuel...\tF1" },
- { "&About...", "&A propos..." },
- { "&File", "&Fichier" },
- { "&Edit", "&Edition" },
- { "&Settings", "&Param�tres" },
- { "&Instruction", "&Instruction" },
- { "Si&mulate", "Si&mulation" },
- { "&Compile", "&Compilation" },
- { "&Help", "&Aide" },
- { "no MCU selected", "pas de MCU s�lectionn�" },
- { "cycle time %.2f ms", "cycle %.2f ms" },
- { "processor clock %.4f MHz", "horloge processeur %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "Erreur interne dans l'utilisation des pages du PIC; Diminuer le programme ou le remanier" },
- { "PWM frequency too fast.", "Fr�quence PWM trop rapide." },
- { "PWM frequency too slow.", "Frequence PWM trop lente." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "Temps cycle trop court; augmenter le temps de cycle ou utiliser un quartz plus rapide." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "Temps de cycle trop long ; Diminuer le temps de cycle ou la fr�quence du quartz ." },
- { "Couldn't open file '%s'", "Impossible d'ouvrir le fichier '%s'" },
- { "Zero baud rate not possible.", "Vitesse transmission = 0 : impossible" },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Compil� avec succ�s; Ecriture IHEX pour PIC16 sous '%s'.\r\n\r\nLes bits de configuration (fuse) : Oscillateur quartz, BOD activ�, LVP d�activ�, PWRT activ�, sans code de protection.\r\n\r\nUtilise %d/%d mots du programme flash (Chip %d%% au total)." },
- { "Type", "Type" },
- { "Timer", "Temporisation" },
- { "Counter", "Compteur" },
- { "Reset", "RAZ" },
- { "OK", "OK" },
- { "Cancel", "Annuler" },
- { "Empty textbox; not permitted.", "Zone de texte vide; interdite" },
- { "Bad use of quotes: <%s>", "Utilisation incorrecte des guillemets: <%s>" },
- { "Turn-On Delay", "Tempo travail" },
- { "Turn-Off Delay", "Tempo repos" },
- { "Retentive Turn-On Delay", "Temporisation totalisatrice" },
- { "Delay (ms):", "Temps (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Temps trop long; maximum 2**31 us." },
- { "Delay cannot be zero or negative.", "Tempo ne peut �tre � ZERO ou NEGATIF." },
- { "Count Up", "Compteur" },
- { "Count Down", "D�compteur" },
- { "Circular Counter", "Compteur cyclique" },
- { "Max value:", "Valeur max.:" },
- { "True if >= :", "Vrai si >= :" },
- { "If Equals", "Si EGAL" },
- { "If Not Equals", "Si non EGAL �" },
- { "If Greater Than", "Si plus grand que" },
- { "If Greater Than or Equal To", "Si plus grand ou �gal �" },
- { "If Less Than", "Si plus petit que" },
- { "If Less Than or Equal To", "Si plus petit ou �gal �" },
- { "'Closed' if:", "'Ferm�' si:" },
- { "Move", "Mouvoir" },
- { "Read A/D Converter", "Lecture du convertisseur A/D" },
- { "Duty cycle var:", "Utilisation:" },
- { "Frequency (Hz):", "Frequence (Hz):" },
- { "Set PWM Duty Cycle", "Fixer le rapport de cycle PWM" },
- { "Source:", "Source:" },
- { "Receive from UART", "Reception depuis l'UART" },
- { "Send to UART", "Envoyer vers l'UART" },
- { "Add", "Addition" },
- { "Subtract", "Soustraction" },
- { "Multiply", "Multiplication" },
- { "Divide", "Division" },
- { "Destination:", "Destination:" },
- { "is set := :", "Valeur := :" },
- { "Name:", "Nom:" },
- { "Stages:", "Etapes:" },
- { "Shift Register", "Registre � d�calage" },
- { "Not a reasonable size for a shift register.", "N'est pas une bonne taille pour un registre � d�calage." },
- { "String:", "Chaine:" },
- { "Formatted String Over UART", "Chaine format�e pour l'UART" },
- { "Variable:", "Variable:" },
- { "Make Persistent", "Mettre r�manent" },
- { "Too many elements in subcircuit!", "Trop d'�l�ments dans le circuit secondaire !" },
- { "Too many rungs!", "Trop de s�quences!" },
- { "Error", "Erreur" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "La sortie en code ANSI C ne supporte pas les p�riph�riques (UART, ADC, EEPROM). Ne pas utiliser ces instructions." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Compil� avec succ�s; Le code source C enregistr� sous '%s'.\r\n\r\nCe programme n'est pas complet. Vous devez pr�voir le runtime ainsi que toutes les routines d'entr�es/sorties. Voir les commentaires pour connaitre la fa�on de proc�der." },
- { "Cannot delete rung; program must have at least one rung.", "Impossible de supprimer la ligne, le programme doit avoir au moins une ligne." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "M�moire insuffisante; simplifiez le programme ou utiliser un controleur avec plus de m�moire." },
- { "Must assign pins for all ADC inputs (name '%s').", "Vous devez sp�cifier une broche pour toutes les entr�es ADC (nom '%s')." },
- { "Internal limit exceeded (number of vars)", "Vous d�passez la limite interne du nombre de variables" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "Relais internes '%s', jamais utilis�s, � utiliser pour la commande de bobines dans le programme." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "Vous devez sp�cifier les broches pour toutes les E/S.\r\n\r\n'%s' ." },
- { "UART in use; pins %d and %d reserved for that.", "UART utilis�; broches %d et %d r�serv�e pour cette fonction." },
- { "PWM in use; pin %d reserved for that.", "PWM utilis�; broche %d r�serv�e pour cela." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "UART G�n�rateur vitesse: Diviseur=%d actuel=%.4f pour %.2f%% Erreur.\r\n\r\nCeci est trop important; Essayez une autre vitesse (probablement plus lente), ou choisir un quartz divisible par plus de vitesses de transmission (comme 3.6864MHz, 14.7456MHz).\r\n\r\nCode est tout de m�me g�n�r�, mais la liaison peut �tre inutilisable ou la transmission erron�e." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "G�n�rateur vitesse UART trop lent, d�passement de capacit� du diviseur. Utiliser un quartz plus lent ou une vitesse plus �lev�e.\r\n\r\nCode est g�n�r� mais la liaison semble inutilisable." },
- { "Couldn't open '%s'\n", "Impossible d'ouvrir '%s'\n" },
- { "Timer period too short (needs faster cycle time).", "P�riode temporisation trop courte (Diminuer le temps de cycle)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "P�riode de tempo trop longue (max. 32767 fois le temps de cycle); utiliser un temps de cycle plus long." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "Constante %d hors limites: -32768 � 32767 inclus." },
- { "Move instruction: '%s' not a valid destination.", "Instruction 'Mouvoir': '%s' n'est pas une destination valide." },
- { "Math instruction: '%s' not a valid destination.", "Instruction Math: '%s' n'est pas une destination valide." },
- { "Piecewise linear lookup table with zero elements!", "Le tableau index� lin�aire ne comporte aucun �l�ment!" },
- { "x values in piecewise linear table must be strictly increasing.", "Les valeurs x du tableau index� lin�aire doivent �tre obligatoirement dans un ordre croissant." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Probl�me num�rique avec le tableau. Commencer par les faibles valeurs ou rapprocher les points du tableau .\r\n\r\nVoir fichier d'aide pour plus de d�tails." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "Multiples ESC (\\0-9)pr�sents dans un format chaines non permit." },
- { "Bad escape: correct form is \\xAB.", "ESC incorrect: Forme correcte = \\xAB." },
- { "Bad escape '\\%c'", "ESC incorrect '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "Une variable est appell�e dans une chaine formatt�e, mais n'est pas sp�cifi�e." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "Aucune variable n'est appel�e dans une chaine formatt�e, mais un nom de variable est sp�cifi� . Ins�rer une chaine comme: '\\-3', ou laisser le nom de variable vide." },
- { "Empty row; delete it or add instructions before compiling.", "Ligne vide; la supprimer ou ajouter instructions avant compilation." },
- { "Couldn't write to '%s'", "Impossible d'�crire sous '%s'." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Instructions non support�es (comme ADC, PWM, UART, EEPROM ) pour sortie en code interpr�t�." },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Compil� avec succ�s; Code interpr�t� �crit sous '%s'.\r\n\r\nQue vous devez adapter probablement pour votre application. Voir documentation." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "Microcontrolleur '%s' non support�.\r\n\r\nErreur pas de MCU s�lectionn�." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Erreur format du fichier; ce programme est pour une nouvelle version de LDmicro." },
- { "Index:", "Index:" },
- { "Points:", "Points:" },
- { "Count:", "Compteur:" },
- { "Edit table of ASCII values like a string", "Editer tableau de valeur ASCII comme chaine" },
- { "Look-Up Table", "Tableau index�" },
- { "Piecewise Linear Table", "Tableau d'�l�ments lin�aire" },
- { "LDmicro Error", "Erreur LDmicro" },
- { "Compile Successful", "Compil� avec succ�s" },
- { "digital in", "Entr�e digitale" },
- { "digital out", "Sortie digitale" },
- { "int. relay", "Relais interne" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "Sortie PWM" },
- { "turn-on delay", "Tempo travail" },
- { "turn-off delay", "Tempo repos" },
- { "retentive timer", "Tempo totalisatrice" },
- { "counter", "Compteur" },
- { "general var", "Var. g�n�rale" },
- { "adc input", "Entr�e ADC" },
- { "<corrupt!>", "<Corrompu!>" },
- { "(not assigned)", "(Non affect�)" },
- { "<no UART!>", "<Pas UART!>" },
- { "<no PWM!>", "<Pas de PWM!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: Variable ne peut �tre utilis�e nullepart ailleurs" },
- { "TON: variable cannot be used elsewhere", "TON: Variable ne peut �tre utilis�e nullepart ailleurs" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: Variable ne peut �tre uniquement utilis�e que pour RAZ" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "Variable '%s' non affect�e, ex: avec une commande MOV, une instruction ADD-etc.\r\n\r\nCeci est probablement une erreur de programmation; elle reste toujours � z�ro." },
- { "Variable for '%s' incorrectly assigned: %s.", "Variable pour '%s' Affectation incorrecte: %s." },
- { "Division by zero; halting simulation", "Division par z�ro; Simulation arr�t�e" },
- { "!!!too long!!!", "!!!trop long!!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nE/S AFFECTATIONS:\n\n" },
- { " Name | Type | Pin\n", " Nom | Type | Broche\n" },
-};
-static Lang LangFr = {
- LangFrTable, sizeof(LangFrTable)/sizeof(LangFrTable[0])
-};
-#endif
-#ifdef LDLANG_IT
-static LangTable LangItTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Target frequenza %d Hz, il pi� vicino realizzabile � %d Hz (avvertimento, >5%% di errore)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Compilazione ok; scritto IHEX per AVR a '%s'.\r\n\r\nRicorda di impostare il processore (Configurazione fusibili) correttamente. Questo non avviene automaticamente." },
- { "( ) Normal", "( ) Aperto" },
- { "(/) Negated", "(/) Negato" },
- { "(S) Set-Only", "(S) Setta" },
- { "(R) Reset-Only", "(R) Resetta" },
- { "Pin on MCU", "Pin MCU" },
- { "Coil", "Bobina" },
- { "Comment", "Commento" },
- { "Cycle Time (ms):", "Tempo di ciclo (ms):" },
- { "Crystal Frequency (MHz):", "Frequenza quarzo (MHz):" },
- { "UART Baud Rate (bps):", "UART Baud Rate (bps):" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "Comunicazione seriale pin utilizzati %d et %d.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "Selezionare un processore dotato di UART.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "Nessuna istruzione (UART trasmetti o UART ricevi) � utilizzata; aggiungere un istruzione prima di settare il baud rate.\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "Il tempo di ciclo per il 'PLC' LDmicro � configurabile dall' utente. Tempi di ciclo molto brevi possono non essere realizzabili a causa di vincoli di velocit� del processore, e tempi di ciclo molto lunghi possono essere causa di overflow. Tempi di ciclo tra i 10 ms e di 100 ms di solito sono usuali.\r\n\r\nIl compilatore deve sapere che velocit� di cristallo stai usando con il micro per convertire in cicli di clock i Tempi. Da 4 MHz a 20 MHz, � il cristallo tipico; determinare la velocit� massima consentita prima di scegliere un cristallo." },
- { "PLC Configuration", "Configurazione PLC" },
- { "Zero cycle time not valid; resetting to 10 ms.", "Tempo di ciclo non valido; reimpostare a 10 ms." },
- { "Source", "Sorgente" },
- { "Internal Relay", "Rel� interno" },
- { "Input pin", "Input pin" },
- { "Output pin", "Output pin" },
- { "|/| Negated", "|/| Normalmente chiuso" },
- { "Contacts", "Contatto" },
- { "No ADC or ADC not supported for selected micro.", "Questo micro non suppota l'ADC." },
- { "Assign:", "Assegna:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "Microcontrollore non selezionato. Selezionare un microcontrollore prima di assegnare i pin.\r\n\r\nSeleziona un microcontrollore dal il menu Impostazioni e riprova." },
- { "I/O Pin Assignment", "Assegnazione Pin I/O" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "Non specificare l'assegnazione dell' I/O per la generazione di ANSI C; compilare e visualizzare i commenti nel codice sorgente." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "Non specificare l'assegnazione dell' I/O per la generazione di codice interpretabile; compilare e visualizzare i commenti nel codice sorgente." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Assegnare unicamente il numero di pin input/output (XNome, YNome ou ANome)." },
- { "No ADC or ADC not supported for this micro.", "Questo micro non contiene ADC." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "Rinominare l' I/O per ottenere il nome di defolt ('%s') prima di assegnare i pin del Micro." },
- { "I/O Pin", "I/O Pin" },
- { "(no pin)", "(senza pin)" },
- { "<UART needs!>", "<UART necessario!>" },
- { "<PWM needs!>", "<PWM necessario!>" },
- { "<not an I/O!>", "<nessun I/O!>" },
- { "Export As Text", "Esportare il testo" },
- { "Couldn't write to '%s'.", "Scrittura Impossibile '%s'." },
- { "Compile To", "Per compilare" },
- { "Must choose a target microcontroller before compiling.", "Scegliere un microcontrollore prima di compilare." },
- { "UART function used but not supported for this micro.", "Le funzioni UART sono usate ma non supportate da questo micro." },
- { "PWM function used but not supported for this micro.", "Le funzioni PWM sono usate ma non supportate da questo micro." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "Il programma � cambiato da quando � stato salvato l'ultima volta.\r\n\r\nDo si desidera salvare le modifiche? " },
- { "--add comment here--", "--aggiungere il commento--" },
- { "Start new program?", "Iniziare nuovo programma?" },
- { "Couldn't open '%s'.", "Impossibile aprire '%s'." },
- { "Name", "Nome" },
- { "State", "Stato" },
- { "Pin on Processor", "Pin del Micro" },
- { "MCU Port", "Porta del processore" },
- { "LDmicro - Simulation (Running)", "LDmicro - Simulazione (in corso)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Simulazione (Ferma)" },
- { "LDmicro - Program Editor", "LDmicro - Scrivere il programma" },
- { " - (not yet saved)", " - (non ancora salvato)" },
- { "&New\tCtrl+N", "&Nuovo\tCtrl+N" },
- { "&Open...\tCtrl+O", "&Aprire...\tCtrl+O" },
- { "&Save\tCtrl+S", "&Salva\tCtrl+S" },
- { "Save &As...", "Salva &con nome..." },
- { "&Export As Text...\tCtrl+E", "&Esportare il testo...\tCtrl+E" },
- { "E&xit", "U&scita" },
- { "&Undo\tCtrl+Z", "&Torna indietro\tCtrl+Z" },
- { "&Redo\tCtrl+Y", "&Rifare\tCtrl+Y" },
- { "Insert Rung &Before\tShift+6", "Inserire Ramo &Davanti\tShift+6" },
- { "Insert Rung &After\tShift+V", "Inserire Ramo &Dietro\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "Muove il Ramo selezionato &Su\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "Muove il Ramo selezionato &Gi�\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Cancella l'elemento selezionato\tDel" },
- { "D&elete Rung\tShift+Del", "Cancellare il Ramo\tShift+Del" },
- { "Insert Co&mment\t;", "Inserire Co&mmento\t;" },
- { "Insert &Contacts\tC", "Inserire &Contatto\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "Inserire PULSUP (Fronte di salita)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "Inserire PULSDW (Fronte di discesa)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "Inserire T&ON (Tempo di ritardo On)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "Inserire TO&F (Tempo di ritardo Off)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "Inserire R&TO (Tempo di ritardo ritentivo On)\tT" },
- { "Insert CT&U (Count Up)\tU", "Inserire CT&U (Contatore Up)\tU" },
- { "Insert CT&D (Count Down)\tI", "Inserire CT&D (Contatore Down)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "Inserire CT&C (Contatore ciclico)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "Inserire EQU (Compara per Uguale)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "Inserire NEQ (Compara per Diverso)" },
- { "Insert GRT (Compare for Greater Than)\t>", "Inserire GRT (Compara per Maggiore)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "Inserire GEQ (Compara per Maggiore o Uguale)\t." },
- { "Insert LES (Compare for Less Than)\t<", "Inserire LES (Compara per Minore)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "Inserire LEQ (Compara per Minore o Uguale)\t," },
- { "Insert Open-Circuit", "Inserire Circuito Aperto" },
- { "Insert Short-Circuit", "Inserire Corto Circuito" },
- { "Insert Master Control Relay", "Inserire Master Control Relay" },
- { "Insert Coi&l\tL", "Inserire Bobina Re&l�\tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "Inserire R&ES (Contatore/RTO Reset)\tE" },
- { "Insert MOV (Move)\tM", "Inserire MOV (Spostare)\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "Inserire ADD (Addizione intera 16-bit)\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "Inserire SUB (Sottrazione intera 16-bit)\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "Inserire MUL (Moltiplicazione intera 16-bit)\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "Inserire DIV (Divisione intera 16-bit)\tD" },
- { "Insert Shift Register", "Inserire Shift Register" },
- { "Insert Look-Up Table", "Inserire Tavola Indicizzata" },
- { "Insert Piecewise Linear", "Inserire Tavola di Elementi Lineari" },
- { "Insert Formatted String Over UART", "Inserire Stringhe Formattate per l'UART" },
- { "Insert &UART Send", "Inserire Trasmissione &UART" },
- { "Insert &UART Receive", "Inserire Ricezione &UART" },
- { "Insert Set PWM Output", "Inserire Valore di Uscita PWM" },
- { "Insert A/D Converter Read\tP", "Inserire Lettura del Convertitore A/D\tP" },
- { "Insert Make Persistent", "Inserire Scrittura Permanente" },
- { "Make Norm&al\tA", "Attivazione Norm&ale\tA" },
- { "Make &Negated\tN", "Attivazione &Negata\tN" },
- { "Make &Set-Only\tS", "Attivazione &Solo-Set\tS" },
- { "Make &Reset-Only\tR", "Attivazione &Solo-Reset\tR" },
- { "&MCU Parameters...", "&Parametri MCU..." },
- { "(no microcontroller)", "(nessun microcontroller)" },
- { "&Microcontroller", "&Microcontroller" },
- { "Si&mulation Mode\tCtrl+M", "Modo Si&mulazione\tCtrl+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Avviare la &Simulazione in Tempo Reale\tCtrl+R" },
- { "&Halt Simulation\tCtrl+H", "&Arrestare la Simulazione\tCtrl+H" },
- { "Single &Cycle\tSpace", "Singolo &Ciclo\tSpazio" },
- { "&Compile\tF5", "&Compila\tF5" },
- { "Compile &As...", "Compila &Come..." },
- { "&Manual...\tF1", "&Manuale...\tF1" },
- { "&About...", "&About..." },
- { "&File", "&File" },
- { "&Edit", "&Editazione" },
- { "&Settings", "&Settaggi" },
- { "&Instruction", "&Istruzione" },
- { "Si&mulate", "Si&mulazione" },
- { "&Compile", "&Compilazione" },
- { "&Help", "&Aiuto" },
- { "no MCU selected", "nessuna MCU selezionata" },
- { "cycle time %.2f ms", "tempo ciclo %.2f ms" },
- { "processor clock %.4f MHz", "clock processore %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "Errore interno relativo allla paginazione PIC; rendere il programma pi� piccolo." },
- { "PWM frequency too fast.", "Frequenza PWM troppo alta." },
- { "PWM frequency too slow.", "Frequenza PWM tropppo lenta." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "Tempo di ciclo troppo veloce; aumentare il tempo di ciclo o utilizzare un quarzo pi� veloce." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "Tempo di ciclo troppo lento; diminuire il tempo di ciclo o utilizzare un quarzo pi� lento." },
- { "Couldn't open file '%s'", "Impossibile aprire il file '%s'" },
- { "Zero baud rate not possible.", "baud rate = Zero non � possibile" },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Compilato con successo; scritto IHEX per PIC16 per '%s'.\r\n\r\nConfigurazione word (fusibili), � stato fissato per il cristallo oscillatore, BOD abilitato, LVP disabilitati, PWRT attivato, tutto il codice di protezione off.\r\n\r\nUsed %d/%d word di Programma flash (chip %d%% full)." },
- { "Type", "Tipo" },
- { "Timer", "Temporizzazione" },
- { "Counter", "Contatore" },
- { "Reset", "Reset" },
- { "OK", "OK" },
- { "Cancel", "Cancellare" },
- { "Empty textbox; not permitted.", "Spazio vuoto per testo; non � consentito" },
- { "Bad use of quotes: <%s>", "Quota utilizzata scorretta: <%s>" },
- { "Turn-On Delay", "Ritardo all' eccitazione" },
- { "Turn-Off Delay", "Ritardo alla diseccitazione" },
- { "Retentive Turn-On Delay", "Ritardo Ritentivo all' eccitazione" },
- { "Delay (ms):", "Ritardo (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Ritardo troppo lungo; massimo 2**31 us." },
- { "Delay cannot be zero or negative.", "Ritardo zero o negativo non possibile." },
- { "Count Up", "Contatore in avanti" },
- { "Count Down", "Contatore in discesa" },
- { "Circular Counter", "Contatore ciclico" },
- { "Max value:", "Valore massimo:" },
- { "True if >= :", "Vero se >= :" },
- { "If Equals", "Se Uguale" },
- { "If Not Equals", "Se non Uguale" },
- { "If Greater Than", "Se pi� grande di" },
- { "If Greater Than or Equal To", "Se pi� grande o uguale di" },
- { "If Less Than", "Se pi� piccolo di" },
- { "If Less Than or Equal To", "Se pi� piccolo o uguale di" },
- { "'Closed' if:", "Chiuso se:" },
- { "Move", "Spostare" },
- { "Read A/D Converter", "Lettura del convertitore A/D" },
- { "Duty cycle var:", "Duty cycle var:" },
- { "Frequency (Hz):", "Frequenza (Hz):" },
- { "Set PWM Duty Cycle", "Settare PWM Duty Cycle" },
- { "Source:", "Sorgente:" },
- { "Receive from UART", "Ricezione dall' UART" },
- { "Send to UART", "Trasmissione all' UART" },
- { "Add", "Addizione" },
- { "Subtract", "Sottrazione" },
- { "Multiply", "Moltiplicazione" },
- { "Divide", "Divisione" },
- { "Destination:", "Destinazione:" },
- { "is set := :", "� impostato := :" },
- { "Name:", "Nome:" },
- { "Stages:", "Stati:" },
- { "Shift Register", "Registro a scorrimento" },
- { "Not a reasonable size for a shift register.", "Non � una dimensione ragionevole per un registro scorrimento." },
- { "String:", "Stringhe:" },
- { "Formatted String Over UART", "Stringhe formattate per l'UART" },
- { "Variable:", "Variabile:" },
- { "Make Persistent", "Memoria rimanante" },
- { "Too many elements in subcircuit!", "Troppi elementi nel circuito secondario!" },
- { "Too many rungs!", "Troppi rami!" },
- { "Error", "Errore" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "Il codice in uscita ANSI C non supporta queste istruzioni (UART, PWM, ADC, EEPROM). Non usare queste istruzioni." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Compilato con successo; scritto il codice sorgente in C '%s'.\r\n\r\nIl non � un completo programma in C. Si deve fornire il runtime e tutti gli I / O di routine. Vedere i commenti nel codice sorgente per informazioni su come fare." },
- { "Cannot delete rung; program must have at least one rung.", "Non � in grado di eliminare le linee; il programma deve avere almeno una linea." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "Memoria insufficiente; semplificare il programma oppure scegliere microcontrollori con pi� memoria ." },
- { "Must assign pins for all ADC inputs (name '%s').", "Devi assegnare i pin per tutti gli ingressi ADC (nom '%s')." },
- { "Internal limit exceeded (number of vars)", "Superato il limite interno (numero di variabili)" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "Rel� interno '%s' non assegnato; aggiungere la sua bobina." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "Devi assegnare tutti i pin di I / O.\r\n\r\n'%s' non � stato assegnato." },
- { "UART in use; pins %d and %d reserved for that.", "UART in uso; pins %d et %d riservati per questa." },
- { "PWM in use; pin %d reserved for that.", "PWM utilizzato; pin %d riservati per questo." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "UART generatore di baud rate: divisore = %d effettivo = %.4f per %.2f%% di errore.\r\n\r\nIl � troppo grande; prova un altro baud rate (probabilmente pi� lento), o il quarzo scelto non � divisibile per molti comuni baud (ad esempio, 3.6864 MHz, 14.7456 MHz).\r\n\r\nIl codice verr� generato, ma comunque pu� essere inaffidabile o completamente non funzionante." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "UART generatore di baud rate: troppo lento, overflow. Utilizzare un quarzo pi� lento o una velocit� pi� alta di baud.\r\n\r\nIl codice verr� generato, ma comunque sar� probabilmente completamente inutilizzabile." },
- { "Couldn't open '%s'\n", "Impossibile aprire '%s'\n" },
- { "Timer period too short (needs faster cycle time).", "Periodo troppo corto (Diminuire il tempo de ciclo)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "Tempo troppo lungo (max 32767 volte di ciclo); utilizzare un tempo di ciclo pi� lento." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "Costante %d oltre il limite: -32768 a 32767 inclusi." },
- { "Move instruction: '%s' not a valid destination.", "Sposta istruzione: '%s' non � una destinazione valida." },
- { "Math instruction: '%s' not a valid destination.", "Math istruzione: '%s' non � una destinazione valida" },
- { "Piecewise linear lookup table with zero elements!", "La tabella lineare di ricerca non contiene elementi!" },
- { "x values in piecewise linear table must be strictly increasing.", "X valori nella tabella lineare devono essere crescenti." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Problema numerico con la tabella lineare di ricerca. Sia la tabella voci pi� piccole, o insieme di punti pi� vicini.\r\n\r\nVedere il file di aiuto per ulteriori dettagli." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "Uscita multipla (\\0-9) presente nel formato stringa, non consentito." },
- { "Bad escape: correct form is \\xAB.", "Uscita errata: Forma non corretta = \\xAB." },
- { "Bad escape '\\%c'", "Uscita non corretta '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "Variabile interpolata in formato stringa, ma non � specificata." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "Variabile interpolata non in formato stringa, ma un nome di variabile � stato specificato. Includi una stringa come '\\-3', o lasciare vuoto." },
- { "Empty row; delete it or add instructions before compiling.", "Riga vuota, eliminare o aggiungere istruzioni prima di compilare." },
- { "Couldn't write to '%s'", "Impossibile scrivere qui '%s'." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Istruzioni non supportate (come ADC, PWM, UART, EEPROM ) per il codice interpretato." },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Compilazione riuscita; codice interpretabile scritto per '%s'.\r\n\r\nSi dovr� probabilmente adattare l'interprete per la vostra applicazione. Vedi la documentazione." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "Microcontrollore '%s' non � supportato.\r\n\r\nNessuna MCU selezionata di default." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Errore del formato del file, forse questo � il programma per una nuova versione di LDmicro?" },
- { "Index:", "Indice:" },
- { "Points:", "Punto:" },
- { "Count:", "Contatore:" },
- { "Edit table of ASCII values like a string", "Modifica tabella dei valori ASCII come stringa" },
- { "Look-Up Table", "Tabella indicizzata" },
- { "Piecewise Linear Table", "Tabella di elementi lineari" },
- { "LDmicro Error", "Errore LDmicro" },
- { "Compile Successful", "Compilato con successo" },
- { "digital in", "Input digitale" },
- { "digital out", "Uscita digitale" },
- { "int. relay", "Rel� interno" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "Uscita PWM" },
- { "turn-on delay", "ritardo all' eccitazione" },
- { "turn-off delay", "ritardo alla diseccitazione" },
- { "retentive timer", "ritardo ritentivo" },
- { "counter", "contatore" },
- { "general var", "Var. generale" },
- { "adc input", "Ingrasso ADC" },
- { "<corrupt!>", "<Corrotto!>" },
- { "(not assigned)", "(non assegnato)" },
- { "<no UART!>", "<nessuna UART!>" },
- { "<no PWM!>", "<nessun PWM!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: la variabile non pu� essere utilizzata altrove" },
- { "TON: variable cannot be used elsewhere", "TON: la variabile non pu� essere utilizzata altrove" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: la variabile pu� essere utilizzata altrove solo per il RES" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "Variabile '%s' non assegnate, ad esempio, con una dichiarazione, MOV, una dichiarazione ADD, ecc\r\n\r\nQuesto � probabilmente un errore di programmazione; ora sar� sempre uguale a zero." },
- { "Variable for '%s' incorrectly assigned: %s.", "Variabile per '%s' assegnazione incorretta: %s." },
- { "Division by zero; halting simulation", "Divisione per zero; Simulazione fermata" },
- { "!!!too long!!!", "!troppo lungo!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nE/S ASSEGNAZIONE:\n\n" },
- { " Name | Type | Pin\n", " Nome | Type | Pin\n" },
-};
-static Lang LangIt = {
- LangItTable, sizeof(LangItTable)/sizeof(LangItTable[0])
-};
-#endif
-#ifdef LDLANG_PT
-static LangTable LangPtTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Freq��ncia do Micro %d Hz, a melhor aproxima��o � %d Hz (aviso, >5%% error)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Compila��o sucedida; se escrito em IHEX para AVR para '%s'.\r\n\r\nLembrar de anotar as configura��es (fuses) do micro, corretamente. Isto n�o acontece automaticamente." },
- { "( ) Normal", "( ) Normal" },
- { "(/) Negated", "(/) Negado" },
- { "(S) Set-Only", "(S) Ativar" },
- { "(R) Reset-Only", "(R) Desativar" },
- { "Pin on MCU", "Pino no Micro" },
- { "Coil", "Bobina" },
- { "Comment", "Coment�rio" },
- { "Cycle Time (ms):", "Tempo de Ciclo (ms):" },
- { "Crystal Frequency (MHz):", "Freq��ncia Cristal (MHz):" },
- { "UART Baud Rate (bps):", "Baud Rate UART (bps):" },
- { "Serie (UART) will use pins %d and %d.\r\n\r\n", "Porta Serial (UART) usar� os pinos %d e %d.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "Por favor, selecione um micro com UART.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "Nenhuma instru��o serial (UART Enviar/UART Recebe) est� em uso; adicione uma ao programa antes de configurar a taxa de transmiss�o (baud rate).\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "O tempo de ciclo para o PLC generalizado pelo LDmicro � configuravel pelo usu�rio. Tempos de ciclo muito pequenos podem n�o ser realiz�veis devido a baixa velocidade do processador, e tempos de ciclo muito longos podem n�o ser realiz�veis devido ao temporizador do micro. Ciclos de tempo entre 10 e 100ms s�o mais usuais.\r\n\r\n O compilador tem que saber qual � a freq��ncia do cristal que est� sendo usado para poder converter entre o tempo em ciclos do clock e tempo em segundos. Cristais entre 4 Mhz e 20 Mhz s�o os mais t�picos. Confira a velocidade que pode funcionar seu micro e calcule a velocidade m�xima do clock antes de encolher o cristal." },
- { "PLC Configuration", "Configura��o PLC" },
- { "Zero cycle time not valid; resetting to 10 ms.", "N�o � v�lido um tempo de ciclo 0; retornando a 10 ms." },
- { "Source", "Fonte" },
- { "Internal Relay", "Rele Interno" },
- { "Input pin", "Pino Entrada" },
- { "Output pin", "Pino Saida" },
- { "|/| Negated", "|/| Negado" },
- { "Contacts", "Contatos" },
- { "No ADC or ADC not supported for selected micro.", "O micro selecionado n�o possui ADC ou n�o suporta." },
- { "Assign:", "Atribua:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "Nenhum micro esta selecionado. Voc� deve selecionar um micro antes de atribuir os pinos E/S.\r\n\r\nSelecione um micro no menu de configura��o e tente novamente." },
- { "I/O Pin Assignment", "Atribui��o de Pinos de E/S" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "N�o se pode atribuir as E/S especificadas para o ANSI C gerado; compile e veja os coment�rios gerados no c�digo fonte." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "N�o se pode atribuir as E/S especificadas para o c�digo gerado para o interpretador; veja os coment�rios na implementa��o do interpretador." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Somente pode atribuir n�meros dos pinos aos pinos de Entrada/Sa�da (Xname ou Yname ou Aname)." },
- { "No ADC or ADC not supported for this micro.", "Este micro n�o tem ADC ou n�o � suportado." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "Renomear as E/S para nome padr�o ('%s') antes de atribuir um pino do micro." },
- { "I/O Pin", "Pino E/S" },
- { "(no pin)", "(sem pino)" },
- { "<UART needs!>", "<Se necessitar UART!>" },
- { "<PWM needs!>", "<Se necessitar PWM!>" },
- { "<not an I/O!>", "<N�o � uma E/S!>" },
- { "Export As Text", "Exportar como Texto" },
- { "Couldn't write to '%s'.", "N�o pode gravar para '%s'." },
- { "Compile To", "Compilar Para" },
- { "Must choose a target microcontroller before compiling.", "Deve selecionar um microcontrolador antes de compilar." },
- { "UART function used but not supported for this micro.", "Fun��o UART � usada porem n�o suportada por este micro." },
- { "PWM function used but not supported for this micro.", "Fun��o PWM � usada porem n�o suportada por este micro." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "Este programa contem mudan�as desde a ultima vez salva.\r\n\r\n Voc� quer salvar as mudan�as?" },
- { "--add comment here--", "--Adicione Coment�rios Aqui--" },
- { "Start new program?", "Iniciar um novo programa?" },
- { "Couldn't open '%s'.", "N�o pode abrir '%s'." },
- { "Name", "Nome" },
- { "State", "Estado" },
- { "Pin on Processor", "Pino do Processador" },
- { "MCU Port", "Porta do Micro" },
- { "LDmicro - Simulation (Running)", "LDmicro - Simula��o (Executando)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Simula��o (Parado)" },
- { "LDmicro - Program Editor", "LDmicro - Editor de Programa" },
- { " - (not yet saved)", " - (ainda n�o salvo)" },
- { "&New\tCtrl+N", "&Novo\tCtrl+N" },
- { "&Open...\tCtrl+O", "&Abrir...\tCtrl+O" },
- { "&Save\tCtrl+S", "&Salvar\tCtrl+S" },
- { "Save &As...", "Salvar &Como..." },
- { "&Export As Text...\tCtrl+E", "&Exportar como Texto...\tCtrl+E" },
- { "E&xit", "&Sair" },
- { "&Undo\tCtrl+Z", "&Desfazer\tCtrl+Z" },
- { "&Redo\tCtrl+Y", "&Refazer\tCtrl+Y" },
- { "Insert Rung &Before\tShift+6", "Inserir Linha (Rung) &Antes\tShift+6" },
- { "Insert Rung &After\tShift+V", "Inserir Linha (Rung) &Depois\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "Mover Linha Selecionada (Rung) &Acima\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "Mover Linha Selecionada(Rung) &Abaixo\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Apagar Elemento Selecionado\tDel" },
- { "D&elete Rung\tShift+Del", "A&pagar Linha (Rung) \tShift+Del" },
- { "Insert Co&mment\t;", "Inserir Co&ment�rio\t;" },
- { "Insert &Contacts\tC", "Inserir &Contatos\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "Inserir OSR (Detecta Borda de Subida)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "Inserir OSF (Detecta Borda de Descida)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "Inserir T&ON (Temporizador para Ligar)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "Inserir TO&F (Temporizador para Desligar)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "Inserir R&TO (Temporizar Retentivo para Ligar)\tT" },
- { "Insert CT&U (Count Up)\tU", "Inserir CT&U (Contador Incremental)\tU" },
- { "Insert CT&D (Count Down)\tI", "Inserir CT&D (Contador Decremental)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "Inserir CT&C (Contador Circular)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "Inserir EQU (Comparar se � Igual)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "Inserir NEQ (Comparar se � Diferente)" },
- { "Insert GRT (Compare for Greater Than)\t>", "Inserir GRT (Comparar se Maior Que)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "Inserir GEQ (Comparar se Maior ou Igual Que)\t." },
- { "Insert LES (Compare for Less Than)\t<", "Inserir LES (Comparar se Menor Que)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "Inserir LEQ (Comparar se Menor ou Igual Que)\t," },
- { "Insert Open-Circuit", "Inserir Circuito Aberto" },
- { "Insert Short-Circuit", "Inserir Curto Circuito" },
- { "Insert Master Control Relay", "Inserir Rele de Controle Mestre" },
- { "Insert Coi&l\tL", "Inserir &Bobina\tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "Inserir R&ES (Contador/RTO Reinicia)\tE" },
- { "Insert MOV (Move)\tM", "Inserir MOV (Mover)\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "Inserir ADD (Soma Inteiro 16-bit)\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "Inserir SUB (Subtrair Inteiro 16-bit)\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "Inserir MUL (Multiplica Inteiro 16-bit)\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "Inserir DIV (Divide Inteiro 16-bit)\tD" },
- { "Insert Shift Register", "Inserir Registro de Troca" },
- { "Insert Look-Up Table", "Inserir Tabela de Busca" },
- { "Insert Piecewise Linear", "Inserir Lineariza��o por Segmentos" },
- { "Insert Formatted String Over UART", "Inserir String Formatada na UART" },
- { "Insert &UART Send", "Inserir &UART Enviar" },
- { "Insert &UART Receive", "Inserir &UART Receber" },
- { "Insert Set PWM Output", "Inserir Valor de Sa�da PWM" },
- { "Insert A/D Converter Read\tP", "Inserir Leitura do Conversor A/D\tP" },
- { "Insert Make Persistent", "Inserir Fazer Permanente" },
- { "Make Norm&al\tA", "Fazer Norm&al\tA" },
- { "Make &Negated\tN", "Fazer &Negado\tN" },
- { "Make &Set-Only\tS", "Fazer &Ativar-Somente\tS" },
- { "Make &Reset-Only\tR", "Fazer&Desativar-Somente\tR" },
- { "&MCU Parameters...", "&Par�metros do Micro..." },
- { "(no microcontroller)", "(sem microcontrolador)" },
- { "&Microcontroller", "&Microcontrolador" },
- { "Si&mulation Mode\tCtrl+M", "Modo Si&mula��o \tCtrl+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Iniciar Simula��o em Tempo &Real\tCtrl+R" },
- { "&Halt Simulation\tCtrl+H", "Parar Simula��o\tCtrl+H" },
- { "Single &Cycle\tSpace", "Simples &Ciclo\tEspa�o" },
- { "&Compile\tF5", "&Compilar\tF5" },
- { "Compile &As...", "Compilar &Como..." },
- { "&Manual...\tF1", "&Manual...\tF1" },
- { "&About...", "&Sobre..." },
- { "&File", "&Arquivo" },
- { "&Edit", "&Editar" },
- { "&Settings", "&Configura��es" },
- { "&Instruction", "&Instru��es" },
- { "Si&mulate", "Si&mular" },
- { "&Compile", "&Compilar" },
- { "&Help", "&Ajuda" },
- { "no MCU selected", "Micro n�o selecionado" },
- { "cycle time %.2f ms", "tempo de ciclo %.2f ms" },
- { "processor clock %.4f MHz", "clock do processador %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "Erro interno relativo a pagina��o do PIC; fazer um programa menor ou reorganiza-lo" },
- { "PWM frequency too fast.", "Freq��ncia do PWM muito alta." },
- { "PWM frequency too slow.", "Freq��ncia do PWM muito baixa." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "Tempo de Ciclo muito r�pido; aumentar tempo do ciclo, ou usar um cristal de maior Mhz." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "Tempo de Ciclo muito lento; diminuir tempo do ciclo, ou usar um cristal de menor Mhz." },
- { "Couldn't open file '%s'", "N�o pode abrir o arquivo '%s'" },
- { "Zero baud rate not possible.", "Zero Baud Rate n�o � poss�vel." },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Compila��o sucedida; escrito IHEX para PIC16 em '%s'.\r\n\r\nBits de Configura��o (fuses) foi estabelecido para o cristal oscilador, BOD ativado, LVP desativado, PWRT ativado, Todos os bits de prote��o desativados.\r\n\r\nUsadas %d/%d palavras de programa em flash (Chip %d%% completo)." },
- { "Type", "Tipo" },
- { "Timer", "Temporizador" },
- { "Counter", "Contador" },
- { "Reset", "Reiniciar" },
- { "OK", "OK" },
- { "Cancel", "Cancelar" },
- { "Empty textbox; not permitted.", "Texto vazio; n�o � permitido" },
- { "Bad use of quotes: <%s>", "Mau uso das aspas: <%s>" },
- { "Turn-On Delay", "Temporizador para Ligar" },
- { "Turn-Off Delay", "Temporizador para Desligar" },
- { "Retentive Turn-On Delay", "Temporizador Retentivo para Ligar" },
- { "Delay (ms):", "Tempo (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Tempo muito longo; Maximo 2**31 us." },
- { "Delay cannot be zero or negative.", "Tempo n�o pode ser zero ou negativo." },
- { "Count Up", "Contador Crescente" },
- { "Count Down", "Contador Decrescente" },
- { "Circular Counter", "Contador Circular" },
- { "Max value:", "Valor Max:" },
- { "True if >= :", "Verdadeiro se >= :" },
- { "If Equals", "Se Igual" },
- { "If Not Equals", " Se Diferente" },
- { "If Greater Than", "Se Maior Que" },
- { "If Greater Than or Equal To", "Se Maior ou Igual Que" },
- { "If Less Than", "Se Menor Que" },
- { "If Less Than or Equal To", "Se Menor ou Igual Que" },
- { "'Closed' if:", "'Fechado' se:" },
- { "Move", "Mover" },
- { "Read A/D Converter", "Ler Conversor A/D" },
- { "Duty cycle var:", "Var Duty cycle:" },
- { "Frequency (Hz):", "Frequencia (Hz):" },
- { "Set PWM Duty Cycle", "Acionar PWM Duty Cycle" },
- { "Source:", "Fonte:" },
- { "Receive from UART", "Recebe da UART" },
- { "Send to UART", "Envia para UART" },
- { "Add", "Somar" },
- { "Subtract", "Subtrair" },
- { "Multiply", "Multiplicar" },
- { "Divide", "Dividir" },
- { "Destination:", "Destino:" },
- { "is set := :", "esta acionado := :" },
- { "Name:", "Nome:" },
- { "Stages:", "Fases:" },
- { "Shift Register", "Deslocar Registro" },
- { "Not a reasonable size for a shift register.", "N�o � um tamanho razo�vel para um registro de deslocamento." },
- { "String:", "String:" },
- { "Formatted String Over UART", "String Formatada para UART" },
- { "Variable:", "Variavel:" },
- { "Make Persistent", "Fazer Permanente" },
- { "Too many elements in subcircuit!", "Excesso de elementos no SubCircuito!" },
- { "Too many rungs!", "Muitas Linhas (rungs)!" },
- { "Error", "Error" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "ANSI C n�o suporta perif�ricos (UART, PWM, ADC, EEPROM). Evite essas instru��es." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Compila��o sucedida: C�digo Fonte escrito em C para '%s'.\r\n\r\nEste programa nao � completo em C. Voc� tem que fornecer o tempo de execu��o e de todas as rotinas de E/S. Veja os coment�rios no c�digo fonte para mais informa��o sobre como fazer isto." },
- { "Cannot delete rung; program must have at least one rung.", "N�o pode apagar a Linha (rung); O programa deve contem pelo menos uma Linha (rung)." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "Fora de Mem�ria; Simplifique o programa ou escolha um microcontrolador com mais mem�ria." },
- { "Must assign pins for all ADC inputs (name '%s').", "Deve associar pinos para todas as entradas do ADC (nome '%s')." },
- { "Internal limit exceeded (number of vars)", "Limite interno excedido (numero de vari�veis)" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "Rele Interno'%s' n�o foi associado; adicione esta bobina em outro lugar." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "Deve associar pinos a todas E/S.\r\n\r\n'%s' n�o esta associado." },
- { "UART in use; pins %d and %d reserved for that.", "UART em uso; pinos %d e %d reservado para isso." },
- { "PWM in use; pin %d reserved for that.", "PWM em uso; pino %d reservada para isso." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "Gerador UART baud rate: divisor=%d atual=%.4f para %.2f%% error.\r\n\r\nEste � muito grande; Tente com outro valor (provavelmente menor), ou um cristal cuja freq��ncia seja divis�vel pelos baud rate mais comuns (p.e. 3.6864MHz, 14.7456MHz).\r\n\r\nO c�digo ser� gerado de qualquer maneira, porem a serial poder� ser incerta ou completamente fragmentada." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "Gerador UART baud rate: muito lento, divisor excedido. Use um cristal mais lento ou um baud rate maior.\r\n\r\nO c�digo ser� gerado de qualquer maneira, porem a serial poder� ser incerta ou completamente fragmentada.." },
- { "Couldn't open '%s'\n", "N�o pode abrir '%s'\n" },
- { "Timer period too short (needs faster cycle time).", "Per�odo de Tempo muito curto (necessitara de um tempo de ciclo maior)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "Tempo do Temporizador muito grande(max. 32767 tempo de ciclo); use um tempo de ciclo menor." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "Constante %d fora do range: -32768 a 32767 inclusive." },
- { "Move instruction: '%s' not a valid destination.", "Instru��o Mover: '%s' o destino n�o � v�lido." },
- { "Math instruction: '%s' not a valid destination.", "Instru��es Math: '%s' o destino n�o � v�lido." },
- { "Piecewise linear lookup table with zero elements!", "Consulta da Tabela de Lineariza��o por Segmentos com elementos zero!" },
- { "x values in piecewise linear table must be strictly increasing.", "Os valores X na Tabela de Lineariza��o por Segmentos deve ser estritamente incrementais." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Problema num�rico com a Tabela de Lineariza��o por segmentos. Fa�a qualquer tabela com entradas menores. ou espace os pontos para mais pr�ximo.\r\n\r\nVeja em ajuda para mais detalhes." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "N�o � permitido mais de um caractere especial (\\0-9) dentro da string formatada." },
- { "Bad escape: correct form is \\xAB.", "Caractere Especial com Erro: A forma correta � \\xAB." },
- { "Bad escape '\\%c'", "Caractere Especial com Erro '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "A vari�vel � interpolada dentro da string formatada, mas nenhuma � especificado." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "Nenhuma vari�vel esta interpolada dentro da string formatada, porem um nome de vari�vel � especificada. Inclua uma string como '\\-3', ou deixe o nome da vari�vel em branco." },
- { "Empty row; delete it or add instructions before compiling.", "Linha Vazia; apague ou adicione instru��es antes de compilar." },
- { "Couldn't write to '%s'", "N�o pode ser gravado para '%s'." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Op n�o suportada no interpretador (algum ADC, PWM, UART, EEPROM)." },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Compila��o sucedida: C�digo para interpretador escrito para '%s'.\r\n\r\nVoc� provavelmente tem que adaptar o interpretador para sua aplica��o. Veja a documenta��o." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "Microcontrolador '%s' n�o suportado.\r\n\r\nFalha nenhum Micro selecionado." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Erro no formato de arquivo; talvez este programa � para uma vers�o mais nova do LDmicro?." },
- { "Index:", "�ndice:" },
- { "Points:", "Pontos:" },
- { "Count:", "Contador:" },
- { "Edit table of ASCII values like a string", "Editar tabela do ASCII, valores como uma string" },
- { "Look-Up Table", "Buscar na Tabela" },
- { "Piecewise Linear Table", "Tabela de Lineariza��o por Segmentos" },
- { "LDmicro Error", "LDmicro Error" },
- { "Compile Successful", "Compila��o Sucedida" },
- { "digital in", "entrada digital" },
- { "digital out", "sa�da digital" },
- { "int. relay", "rele interno" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "sa�da PWM" },
- { "turn-on delay", "ativar atraso" },
- { "turn-off delay", "desativar atraso" },
- { "retentive timer", "temporizador com mem�ria" },
- { "counter", "contador" },
- { "general var", "var geral" },
- { "adc input", "entrada adc" },
- { "<corrupt!>", "<corrompido!>" },
- { "(not assigned)", "(sem atribui��o)" },
- { "<no UART!>", "<sem UART!>" },
- { "<no PWM!>", "<sem PWM!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: a vari�vel n�o pode ser usada em outra parte" },
- { "TON: variable cannot be used elsewhere", "TON: a vari�vel n�o pode ser usada em outra parte" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: a vari�vel somente pode ser usada como RES em outra parte" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "vari�vel '%s' n�o atribu�da, p.e. com o comando MOV, comando ADD, etc.\r\n\r\nIsto � provavelmente um erro de programa��o; ser� sempre zero." },
- { "Variable for '%s' incorrectly assigned: %s.", "Vari�vel para '%s' atribu�da incorretamente : %s." },
- { "Division by zero; halting simulation", "Divis�o por zero; Parando simula��o" },
- { "!!!too long!!!", "!Muito longo!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nE/S ATRIBUIDA:\n\n" },
- { " Name | Type | Pin\n", " Nome | Tipo | Pino\n" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "A porta Serial (UART) usar� os pinos %d e %d.\r\n\r\n" },
-};
-static Lang LangPt = {
- LangPtTable, sizeof(LangPtTable)/sizeof(LangPtTable[0])
-};
-#endif
-#ifdef LDLANG_TR
-static LangTable LangTrTable[] = {
- { "Target frequency %d Hz, closest achievable is %d Hz (warning, >5%% error).", "Hedef frekans %d Hz, bu de�ere en yak�n olas� de�er %d Hz (Uyar�, >5% hatas�)." },
- { "Compile successful; wrote IHEX for AVR to '%s'.\r\n\r\nRemember to set the processor configuration (fuses) correctly. This does not happen automatically.", "Derleme ba�ar�l�. AVR i�in derlenen '%s' IHEX dosyas�na kaydedildi.\r\n\r\n M�B konfig�rasyonunu ayarlamay� unutmay�n. Bu i�lem otomatik olarak yap�lmamaktad�r." },
- { "( ) Normal", "( ) Normal" },
- { "(/) Negated", "(/) Terslenmi�" },
- { "(S) Set-Only", "(S) Set" },
- { "(R) Reset-Only", "(R) Reset" },
- { "Pin on MCU", "M�B Baca��" },
- { "Coil", "Bobin" },
- { "Comment", "A��klama" },
- { "Cycle Time (ms):", "�evrim S�resi (ms):" },
- { "Crystal Frequency (MHz):", "Kristal Frekans� (MHz):" },
- { "UART Baud Rate (bps):", "UART Baud Rate (bps):" },
- { "Serial (UART) will use pins %d and %d.\r\n\r\n", "Seri ileti�im i�in (UART) %d ve %d bacaklar� kullan�lacakt�r.\r\n\r\n" },
- { "Please select a micro with a UART.\r\n\r\n", "L�tfen UART olan bir M�B se�iniz.\r\n\r\n" },
- { "No serial instructions (UART Send/UART Receive) are in use; add one to program before setting baud rate.\r\n\r\n", "Seri ileti�im komutu kullanmad�n�z. H�z� ayarlamadan �nce komut kullanmal�s�n�z.\r\n\r\n" },
- { "The cycle time for the 'PLC' runtime generated by LDmicro is user-configurable. Very short cycle times may not be achievable due to processor speed constraints, and very long cycle times may not be achievable due to hardware overflows. Cycle times between 10 ms and 100 ms will usually be practical.\r\n\r\nThe compiler must know what speed crystal you are using with the micro to convert between timing in clock cycles and timing in seconds. A 4 MHz to 20 MHz crystal is typical; check the speed grade of the part you are using to determine the maximum allowable clock speed before choosing a crystal.", "PLC i�in LDMicro taraf�ndan verilen �evrim s�resi kullan�c� taraf�ndan de�i�tirilebilir. �ok k�sa s�reler i�lemcinin h�z�ndan kaynaklanan sebeplerden dolay� verilemeyebilir. 10ms ile 100ms aras�ndaki de�erler �evrim s�resi i�in genellikle uygun de�erlerdir.\r\n\r\n.LDMicro kullan�lan kristalin h�z�n� bilmelidir. Bu de�er program i�erisinde kullan�l�r. Bilindi�i �zere genellikle 4MHz ile 20MHz aras�nda de�ere sahip kristaller kullan�lmaktad�r. Kulland���n�z kristalin de�erini ayarlamal�s�n�z." },
- { "PLC Configuration", "PLC Ayarlar�" },
- { "Zero cycle time not valid; resetting to 10 ms.", "�evrim s�resi s�f�r olamaz. 10ms olarak de�i�tirildi." },
- { "Source", "Kaynak" },
- { "Internal Relay", "Dahili R�le" },
- { "Input pin", "Giri� Baca��" },
- { "Output pin", "��k�� Baca��" },
- { "|/| Negated", "|/| Terslenmi�" },
- { "Contacts", "Kontak" },
- { "No ADC or ADC not supported for selected micro.", "Bu i�lemcide ADC yok yada ADC desteklenmiyor." },
- { "Assign:", "De�eri:" },
- { "No microcontroller has been selected. You must select a microcontroller before you can assign I/O pins.\r\n\r\nSelect a microcontroller under the Settings menu and try again.", "��lemci se�mediniz.\r\n\r\n G/� u�lar�n� se�meden �nce Ayarlar men�s�nden i�lemci se�iniz." },
- { "I/O Pin Assignment", "G/� Bacak Tan�m�" },
- { "Can't specify I/O assignment for ANSI C target; compile and see comments in generated source code.", "ANSI C hedef i�in G/� tan�mlamas� yap�lamad�. Dosyay� derleyerek olu�turulan kaynak kodundaki yorumlar� inceleyiniz." },
- { "Can't specify I/O assignment for interpretable target; see comments in reference implementation of interpreter.", "Hedef i�in G/� tan�m� yap�lamad�. Derleyicinin kullan�m kitap����n� inceleyiniz." },
- { "Can only assign pin number to input/output pins (Xname or Yname or Aname).", "Sadece giri�/��k�� u�lar� i�in bacak tan�mlamas� yap�labilir. (XName veya YName veya AName)." },
- { "No ADC or ADC not supported for this micro.", "Bu i�lemcide ADC yok yada ADC desteklenmiyor." },
- { "Rename I/O from default name ('%s') before assigning MCU pin.", "('%s') �ntan�ml� isimdir. M�B baca�� tan�mlamadan �nce bu ismi de�i�tiriniz." },
- { "I/O Pin", "G/� Bacaklar�" },
- { "(no pin)", "(Bacak Yok)" },
- { "<UART needs!>", "<UART gerekli!>" },
- { "<PWM needs!>", "<PWM gerekli!>" },
- { "<not an I/O!>", "<G/� de�il>" },
- { "Export As Text", "Yaz� dosyas� olarak ver" },
- { "Couldn't write to '%s'.", "'%s' dosyas�na yaz�lamad�." },
- { "Compile To", "Derlenecek Yer" },
- { "Must choose a target microcontroller before compiling.", "Derlemeden �nce i�lemci se�ilmelidir." },
- { "UART function used but not supported for this micro.", "Komut kullanm��s�n�z, ancak UART i�lemleri bu i�lemci i�in desteklenmiyor." },
- { "PWM function used but not supported for this micro.", "Komut kullanm��s�n�z, ancak PWM i�lemleri bu i�lemci i�in desteklenmiyor." },
- { "The program has changed since it was last saved.\r\n\r\nDo you want to save the changes?", "Dosyada de�i�iklik yapt�n�z.\r\n\r\n Kaydetmek ister misiniz?" },
- { "--add comment here--", "--aciklamanizi buraya ekleyiniz--" },
- { "Start new program?", "Yeni dosya olu�turulsun mu?" },
- { "Couldn't open '%s'.", "'%s' dosyas�na kay�t yap�lam�yor." },
- { "Name", "�sim" },
- { "State", "Durum/De�er" },
- { "Pin on Processor", "��lemci Bacak No" },
- { "MCU Port", "��lemci Portu" },
- { "LDmicro - Simulation (Running)", "LDmicro - Sim�lasyon (�al���yor)" },
- { "LDmicro - Simulation (Stopped)", "LDmicro - Sim�lasyon (Durduruldu)" },
- { "LDmicro - Program Editor", "LDmicro � Program Edit�r� " },
- { " - (not yet saved)", " - (de�i�iklikler kaydedilmedi)" },
- { "&New\tCtrl+N", "&Yeni Dosya\tCtrl+N" },
- { "&Open...\tCtrl+O", "&Dosya A�\tCtrl+O" },
- { "&Save\tCtrl+S", "&Dosyay� Kaydet\tCtrl+S" },
- { "Save &As...", "Dosyay� Farkl� Kaydet" },
- { "&Export As Text...\tCtrl+E", "&Metin Dosyas� Olarak Kaydet\tCtrl+E" },
- { "E&xit", "��k��" },
- { "&Undo\tCtrl+Z", "De�i�ikli�i Geri Al\tCtrl+Z" },
- { "&Redo\tCtrl+Y", "&De�i�ikli�i Tekrarla\tCtrl+Y" },
- { "Insert Rung &Before\tShift+6", "�st k�sma sat�r (Rung) ekle\tShift+6" },
- { "Insert Rung &After\tShift+V", "Alt k�sma sat�r (Rung) ekle\tShift+V" },
- { "Move Selected Rung &Up\tShift+Up", "Se�ili sat�r� �ste ta��\tShift+Up" },
- { "Move Selected Rung &Down\tShift+Down", "Se�ili sat�r� alta ta��\tShift+Down" },
- { "&Delete Selected Element\tDel", "&Se�ili Eleman� Sil\tDel" },
- { "D&elete Rung\tShift+Del", "Se�ili Sat�r� Sil\tShift+Del" },
- { "Insert Co&mment\t;", "A��klama Ekle\t;" },
- { "Insert &Contacts\tC", "Kontak Eekle\tC" },
- { "Insert OSR (One Shot Rising)\t&/", "OSR ekle (Y�kselen Kenar)\t&/" },
- { "Insert OSF (One Shot Falling)\t&\\", "OSF ekle (D��en Kenar)\t&\\" },
- { "Insert T&ON (Delayed Turn On)\tO", "T&ON ekle (Turn-On Gecikme)\tO" },
- { "Insert TO&F (Delayed Turn Off)\tF", "T&OF ekle (Turn-Off Gecikme)\tF" },
- { "Insert R&TO (Retentive Delayed Turn On)\tT", "R&TO ekle (S�re Sayan Turn-On Gecikme)\tT" },
- { "Insert CT&U (Count Up)\tU", "CT&U ekle (Yukar� Say�c�)\tU" },
- { "Insert CT&D (Count Down)\tI", "CT&D ekle (A�a�� Say�c�)\tI" },
- { "Insert CT&C (Count Circular)\tJ", "CT&C ekle (D�ng�sel Say�c�)\tJ" },
- { "Insert EQU (Compare for Equals)\t=", "EQU ekle (E�itlik Kontrol�)\t=" },
- { "Insert NEQ (Compare for Not Equals)", "NEQ ekle (Farkl�l�k Kontrol�)" },
- { "Insert GRT (Compare for Greater Than)\t>", "GRT ekle (B�y�k Kontrol�)\t>" },
- { "Insert GEQ (Compare for Greater Than or Equal)\t.", "GEQ ekle (B�y�k yada E�it Kontrol�)\t." },
- { "Insert LES (Compare for Less Than)\t<", "LES ekle (K���k Kontrol�)\t<" },
- { "Insert LEQ (Compare for Less Than or Equal)\t,", "LEQ ekle (K���k yada E�it Kontrol�)\t," },
- { "Insert Open-Circuit", "A��k Devre ekle" },
- { "Insert Short-Circuit", "Kapal� Devre ekle" },
- { "Insert Master Control Relay", "Ana Kontrol R�lesi ekle" },
- { "Insert Coi&l\tL", "Bobin ek&le\tL" },
- { "Insert R&ES (Counter/RTO Reset)\tE", "R&ES ekle (RTO/Say�c� S�f�rlamas�)\tE" },
- { "Insert MOV (Move)\tM", "MOV (Ta��) ekle\tM" },
- { "Insert ADD (16-bit Integer Add)\t+", "ADD (16 bit Toplama)ekle\t+" },
- { "Insert SUB (16-bit Integer Subtract)\t-", "SUB (16 bit ��karma) ekle\t-" },
- { "Insert MUL (16-bit Integer Multiply)\t*", "MUL (16 bit �arpma) ekle\t*" },
- { "Insert DIV (16-bit Integer Divide)\tD", "DIV (16 bit b�lme) ekle\tD" },
- { "Insert Shift Register", "Shift Register ekle" },
- { "Insert Look-Up Table", "De�er Tablosu ekle" },
- { "Insert Piecewise Linear", "Par�al� Lineer ekle" },
- { "Insert Formatted String Over UART", "UART �zerinden Bi�imlendirilmi� Kelime Ekle" },
- { "Insert &UART Send", "&UART'dan G�nderme ekle" },
- { "Insert &UART Receive", "&UART'dan Alma ekle" },
- { "Insert Set PWM Output", "PWM ��k��� Akit Et ekle" },
- { "Insert A/D Converter Read\tP", "A/D �eviriciden Oku ekle\tP" },
- { "Insert Make Persistent", "EPROM'da Sakla ekle" },
- { "Make Norm&al\tA", "Normale �evir\tA" },
- { "Make &Negated\tN", "Terslenmi� Yap\tN" },
- { "Make &Set-Only\tS", "Set Yap\tS" },
- { "Make &Reset-Only\tR", "Reset Yap\tR" },
- { "&MCU Parameters...", "&��lemci Ayarlar�..." },
- { "(no microcontroller)", "(i�lemci yok)" },
- { "&Microcontroller", "��lemci Se�imi" },
- { "Si&mulation Mode\tCtrl+M", "Si&m�lasyon Modu\tCtrl+M" },
- { "Start &Real-Time Simulation\tCtrl+R", "Ge&r�ek Zamanl� Sim�lasyonu Ba�lat\tCtrl+R" },
- { "&Halt Simulation\tCtrl+H", "Sim�lasyonu Durdur\tCtrl+H" },
- { "Single &Cycle\tSpace", "Sat�r Sat�r Sim�lasyon\tEspace" },
- { "&Compile\tF5", "&Derle\tF5" },
- { "Compile &As...", "Farkl� Derle..." },
- { "&Manual...\tF1", "&Kitap��k...\tF1" },
- { "&About...", "&Bilgi..." },
- { "&File", "&Dosya" },
- { "&Edit", "&D�zen" },
- { "&Settings", "&Ayarlar" },
- { "&Instruction", "K&omutlar" },
- { "Si&mulate", "Si&m�lasyon" },
- { "&Compile", "&Derle" },
- { "&Help", "&Yard�m" },
- { "no MCU selected", "��lemci Se�ilmedi" },
- { "cycle time %.2f ms", "�evrim s�resi %.2f ms" },
- { "processor clock %.4f MHz", "i�lemci frekans� %.4f MHz" },
- { "Internal error relating to PIC paging; make program smaller or reshuffle it.", "PIC sayfalamas� ile ilgili dahili hata olu�tu. Program� k�salt�n�z yada de�i�tiriniz." },
- { "PWM frequency too fast.", "PWM frekans� �ok h�zl�." },
- { "PWM frequency too slow.", "PWM frekans� �ok yava�." },
- { "Cycle time too fast; increase cycle time, or use faster crystal.", "�evrim s�resi �ok k�sa. S�reyi yada kristal frekans�n� art�r�n�z." },
- { "Cycle time too slow; decrease cycle time, or use slower crystal.", "�evrim s�resi �ok uzun. S�reyi yada kristal frekans�n� azalt�n�z.." },
- { "Couldn't open file '%s'", "'%s' dosyas� a��lamad�." },
- { "Zero baud rate not possible.", "�leti�im h�z� (Baudrate) s�f�r olamaz." },
- { "Compile successful; wrote IHEX for PIC16 to '%s'.\r\n\r\nConfiguration word (fuses) has been set for crystal oscillator, BOD enabled, LVP disabled, PWRT enabled, all code protection off.\r\n\r\nUsed %d/%d words of program flash (chip %d%% full).", "Derleme ba�ar�yla yap�ld�; PIC16 i�in IHEX dosyas� '%s' dosyas�na kaydedildi.\r\n\r\nAyarlar: (PIC konfig�rasyonu) kristal osilat�r, BOD aktif, LVP pasif, PWRT aktif, t�m kod korumas� kapal�.\r\n\r\nPIC haf�zas�n�n %d/%d kelimesi kullan�ld�. (Haf�za %d%% dolu)." },
- { "Type", "Tipi" },
- { "Timer", "Zamanlay�c�" },
- { "Counter", "Say�c�" },
- { "Reset", "Reset" },
- { "OK", "Tamam" },
- { "Cancel", "Vazge�" },
- { "Empty textbox; not permitted.", "Yaz� kutusu bo� olamaz" },
- { "Bad use of quotes: <%s>", "T�rnaklar yanl�� kullan�lm��: <%s>" },
- { "Turn-On Delay", "Turn-On Gecikme Devresi" },
- { "Turn-Off Delay", "Turn-Off Gecikme Devresi" },
- { "Retentive Turn-On Delay", "De�eri Saklanan Turn-On Gecikme" },
- { "Delay (ms):", "Gecikme (ms):" },
- { "Delay too long; maximum is 2**31 us.", "Gecikme �ok fazla. En fazla 2**31 us olabilir." },
- { "Delay cannot be zero or negative.", "Gecikme s�f�r yada eksi de�er olamaz." },
- { "Count Up", "Yukar� Say" },
- { "Count Down", "A�a�� Say" },
- { "Circular Counter", "Dairesel Say�c�" },
- { "Max value:", "En Y�ksek De�er:" },
- { "True if >= :", "Do�ru E�er >= :" },
- { "If Equals", "E�itse" },
- { "If Not Equals", "E�it De�ilse" },
- { "If Greater Than", "B�y�kse" },
- { "If Greater Than or Equal To", "B�y�k yada E�itse" },
- { "If Less Than", "K���kse" },
- { "If Less Than or Equal To", "K���k yada E�itse" },
- { "'Closed' if:", "'Kapal�' E�er:" },
- { "Move", "Ta��" },
- { "Read A/D Converter", "A/D �eviriciyi Oku" },
- { "Duty cycle var:", "Pals Geni�li�i De�eri:" },
- { "Frequency (Hz):", "Frekans (Hz):" },
- { "Set PWM Duty Cycle", "PWM Pals Geni�li�i De�eri" },
- { "Source:", "Kaynak:" },
- { "Receive from UART", "UART'dan bilgi al" },
- { "Send to UART", "UART'dan bilgi g�nder" },
- { "Add", "Topla" },
- { "Subtract", "��kar" },
- { "Multiply", "�arp" },
- { "Divide", "B�l" },
- { "Destination:", "Hedef:" },
- { "is set := :", "Verilen De�er := :" },
- { "Name:", "�sim:" },
- { "Stages:", "A�amalar:" },
- { "Shift Register", "Shift Register" },
- { "Not a reasonable size for a shift register.", "Shift Register i�in kabul edilebilir de�er de�il." },
- { "String:", "Karakter Dizisi:" },
- { "Formatted String Over UART", "UART �zerinden Bi�imlendirilmi� Karakter Dizisi" },
- { "Variable:", "De�i�ken:" },
- { "Make Persistent", "EEPROM'da Sakla" },
- { "Too many elements in subcircuit!", "Alt devrede �ok fazla eleman var!" },
- { "Too many rungs!", "Sat�r say�s� (Rung) fazla!" },
- { "Error", "Hata" },
- { "ANSI C target does not support peripherals (UART, PWM, ADC, EEPROM). Skipping that instruction.", "ANSI C hedef �zellikleri desteklemiyor.(UART, ADC, EEPROM). �lgili komutlar i�lenmeyecek." },
- { "Compile successful; wrote C source code to '%s'.\r\n\r\nThis is not a complete C program. You have to provide the runtime and all the I/O routines. See the comments in the source code for information about how to do this.", "Derleme ba�ar�yla tamamland�. C kaynak kodu '%s' dosyas�na yaz�ld�.\r\n\r\nBu dosya tam bir C dosyas� de�ildir. G/� rutinlerini kendiniz sa�lamal�s�n�z. Dosyay� incelemeniz faydal� olacakt�r." },
- { "Cannot delete rung; program must have at least one rung.", "Bu sat�r silinemez. Programda en az bir tane sat�r (Rung) olmal�d�r." },
- { "Out of memory; simplify program or choose microcontroller with more memory.", "��lemci haf�zas� doldu; Program� k�salt�n�z yada daha y�ksek haf�zas� olan bir i�lemci se�iniz." },
- { "Must assign pins for all ADC inputs (name '%s').", "T�m ADC giri�lerinin bacaklar� belirtilmelidir (ADC '%s')." },
- { "Internal limit exceeded (number of vars)", "Dahili s�n�r a��ld� (De�i�ken Say�s�)" },
- { "Internal relay '%s' never assigned; add its coil somewhere.", "'%s' dahili r�lesine de�er verilmedi, Bu r�le i�in bir bobin ekleyiniz." },
- { "Must assign pins for all I/O.\r\n\r\n'%s' is not assigned.", "T�m G/� u�lar� i�in bacaklar belirtilmelidir.\r\n\r\n'%s' ucuna de�er verilmemi�." },
- { "UART in use; pins %d and %d reserved for that.", "UART Kullan�mda; %d ve %d bacaklar� bunun i�in kullan�lmaktad�r. Siz kullanamazs�n�z." },
- { "PWM in use; pin %d reserved for that.", "PWM Kullan�mda; %d baca�� bunun i�in ayr�lm��t�r. Siz kullanamazs�n�z.." },
- { "UART baud rate generator: divisor=%d actual=%.4f for %.2f%% error.\r\n\r\nThis is too large; try a different baud rate (slower probably), or a crystal frequency chosen to be divisible by many common baud rates (e.g. 3.6864 MHz, 14.7456 MHz).\r\n\r\nCode will be generated anyways but serial may be unreliable or completely broken.", "UART H�z Hesaplay�c�s�: B�len=%d Ger�ekte=%.4f (%.2f%% hata pay� ile).\r\n\r\nBu de�er �ok y�ksektir. De�i�ik bir de�er denemelisiniz yada kristal frekans�n� s�k kullan�lan ve bu de�erlere b�l�nebilen bir de�er se�iniz. (Mesela 3.6864MHz, 14.7456MHz gibi).\r\n\r\nHer durumda kod olu�turulacakt�r; ancak seri ileti�im d�zg�n �al��mayabilir yada tamamen durabilir." },
- { "UART baud rate generator: too slow, divisor overflows. Use a slower crystal or a faster baud rate.\r\n\r\nCode will be generated anyways but serial will likely be completely broken.", "UART H�z Hesaplay�c�s�: H�z �ok d���k. Bu nedenle b�len ta�ma yap�yor. Ya kristal frekans�n� d���r�n�z yada h�z� (baudrate) art�r�n�z.\r\n\r\nHer durumda kod olu�turulacakt�r; ancak seri ileti�im d�zg�n �al��mayabilir yada tamamen durabilir." },
- { "Couldn't open '%s'\n", "'%s' dosyas� a��lamad�\n" },
- { "Timer period too short (needs faster cycle time).", "Zamanlay�c� peryodu �ok k�sa (daha y�ksek �evrim s�resi gerekli)." },
- { "Timer period too long (max 32767 times cycle time); use a slower cycle time.", "Zamanlay�c� peryodu �ok k�sa(en fazla. �evrim s�resinin 32767 kat� olabilir); �evrim s�resini d���r�n�z." },
- { "Constant %d out of range: -32768 to 32767 inclusive.", "%d sabiti aral���n d���nda: -32768 ile 32767 aras�nda olmal�d�r." },
- { "Move instruction: '%s' not a valid destination.", "Ta��ma Komutu: '%s' ge�erli bir hedef adresi de�il." },
- { "Math instruction: '%s' not a valid destination.", "Matematik Komutu: '%s'ge�erli bir hedef adresi de�il." },
- { "Piecewise linear lookup table with zero elements!", "Par�al� do�rusal arama tablosunda de�er yok!" },
- { "x values in piecewise linear table must be strictly increasing.", "Par�al� do�rusal arama tablosundaki x de�erleri artan s�ralamal� olmal�." },
- { "Numerical problem with piecewise linear lookup table. Either make the table entries smaller, or space the points together more closely.\r\n\r\nSee the help file for details.", "Par�al� do�rusal arama tablosunda say�sal hata.\r\n\r\nDetaylar i�in yard�m men�s�n� inceleyiniz." },
- { "Multiple escapes (\\0-9) present in format string, not allowed.", "Bi�imli karakter dizisinde birden �ok escape kodu var(\\0-9)." },
- { "Bad escape: correct form is \\xAB.", "Yanl�� ESC komutu: do�ru �ekil = \\xAB." },
- { "Bad escape '\\%c'", "Yanl�� ESC komutu '\\%c'" },
- { "Variable is interpolated into formatted string, but none is specified.", "Bi�imlendirilmi� karakter k�mesine de�i�ken tan�mlanm�� ama hi� belirtilmemi�." },
- { "No variable is interpolated into formatted string, but a variable name is specified. Include a string like '\\-3', or leave variable name blank.", "Bi�imlendirilmi� karakter k�mesine de�i�ken atanmam�� ama de�i�ken ismi belirtilmi�. Ya de�i�ken ismini belirtiniz yada '\\-3' gibi bir de�er veriniz.." },
- { "Empty row; delete it or add instructions before compiling.", "Sat�r bo�; Sat�r� silmeli yada komut eklemelisiniz." },
- { "Couldn't write to '%s'", "'%s' dosyas�na kay�t yap�lam�yor." },
- { "Unsupported op (anything ADC, PWM, UART, EEPROM) for interpretable target.", "Komut desteklenmiyor. (ADC, PWM, UART, EEPROM ile ilgili komutlardan herhangi biri)" },
- { "Compile successful; wrote interpretable code to '%s'.\r\n\r\nYou probably have to adapt the interpreter to your application. See the documentation.", "Derleme ba�ar�yla tamamland�. Kod '%s' dosyas�na yaz�ld�.\r\n\r\nDerleyiciyi uygulaman�za g�re de�i�tirmeniz gerekebilir. Geni� bilgi i�in LDMicro belgelerine ba�vurabilirsiniz." },
- { "Microcontroller '%s' not supported.\r\n\r\nDefaulting to no selected MCU.", "'%s' desteklenen bir i�lemci de�il.\r\n\r\n��lemci ayar� i�lemci yok �eklinde de�i�tirilmi�tir." },
- { "File format error; perhaps this program is for a newer version of LDmicro?", "Dosya bi�imi hatas�. A�maya �al��t���n�z dosya ya LDMicro dosyas� de�il yada yeni bir s�r�m ile yaz�lm��." },
- { "Index:", "Liste:" },
- { "Points:", "De�er Say�s�:" },
- { "Count:", "Adet:" },
- { "Edit table of ASCII values like a string", "ASCII de�er tablosunu karakter dizisi gibi d�zenle." },
- { "Look-Up Table", "Arama Tablosu" },
- { "Piecewise Linear Table", "Par�al� Lineer Tablo" },
- { "LDmicro Error", "LDmicro Hatas�" },
- { "Compile Successful", "Derleme Ba�ar�l�" },
- { "digital in", "Dijital Giri�" },
- { "digital out", "Dijital ��k��" },
- { "int. relay", "Dahili R�le" },
- { "UART tx", "UART tx" },
- { "UART rx", "UART rx" },
- { "PWM out", "PWM ��k���" },
- { "turn-on delay", "Turn-On Gecikme" },
- { "turn-off delay", "Turn-Off Gecikme" },
- { "retentive timer", "de�eri saklanan zamanlay�c�" },
- { "counter", "Say�c�" },
- { "general var", "Genel De�i�ken" },
- { "adc input", "ADC Giri�i" },
- { "<corrupt!>", "<bozuk>" },
- { "(not assigned)", "(tan�ml� de�il)" },
- { "<no UART!>", "<UART Yok!>" },
- { "<no PWM!>", "<PWM Yok!>" },
- { "TOF: variable cannot be used elsewhere", "TOF: De�i�ken ba�ka bir yerde kullan�lamaz" },
- { "TON: variable cannot be used elsewhere", "TON: De�i�ken ba�ka bir yerde kullan�lamaz" },
- { "RTO: variable can only be used for RES elsewhere", "RTO: De�i�ken sadece RES i�in kullan�labilir" },
- { "Variable '%s' not assigned to, e.g. with a MOV statement, an ADD statement, etc.\r\n\r\nThis is probably a programming error; now it will always be zero.", "'%s' de�er atanmam��.�rne�in, MOV, ADD komutlar� ile de�er atanabilir.\r\n\r\nMuhtemelen bu bir programlama hatas�d�r. Bu nedenle de�i�kenin de�eri 0 olarak kullan�lacakt�r." },
- { "Variable for '%s' incorrectly assigned: %s.", "'%s' i�in de�i�ken hatal� atanm��: %s." },
- { "Division by zero; halting simulation", "S�f�ra b�l�m; Sim�lasyon durduruldu." },
- { "!!!too long!!!", "!!!�ok uzun!!" },
- { "\n\nI/O ASSIGNMENT:\n\n", "\n\nG/� TANIMI:\n\n" },
- { " Name | Type | Pin\n", " �sim | Tipi | Bacak\n" },
-};
-static Lang LangTr = {
- LangTrTable, sizeof(LangTrTable)/sizeof(LangTrTable[0])
-};
-#endif
diff --git a/ldmicro/resetdialog.cpp b/ldmicro/resetdialog.cpp
index b83cd42..70a5218 100644
--- a/ldmicro/resetdialog.cpp
+++ b/ldmicro/resetdialog.cpp
@@ -38,111 +38,111 @@ static LONG_PTR PrevNameProc;
//-----------------------------------------------------------------------------
// Don't allow any characters other than A-Za-z0-9_ in the name.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
- wParam == '\b'))
- {
- return 0;
- }
- }
-
- return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
-}
-
-static void MakeControls(void)
-{
- HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Type"),
- WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
- 7, 3, 120, 65, ResetDialog, NULL, Instance, NULL);
- NiceFont(grouper);
-
- TypeTimerRadio = CreateWindowEx(0, WC_BUTTON, _("Timer"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 21, 100, 20, ResetDialog, NULL, Instance, NULL);
- NiceFont(TypeTimerRadio);
-
- TypeCounterRadio = CreateWindowEx(0, WC_BUTTON, _("Counter"),
- WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
- 16, 41, 100, 20, ResetDialog, NULL, Instance, NULL);
- NiceFont(TypeCounterRadio);
-
- HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
- WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
- 135, 16, 50, 21, ResetDialog, NULL, Instance, NULL);
- NiceFont(textLabel);
-
- NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 190, 16, 115, 21, ResetDialog, NULL, Instance, NULL);
- FixedFont(NameTextbox);
-
- OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
- 321, 10, 70, 23, ResetDialog, NULL, Instance, NULL);
- NiceFont(OkButton);
-
- CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 321, 40, 70, 23, ResetDialog, NULL, Instance, NULL);
- NiceFont(CancelButton);
-
- PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
- (LONG_PTR)MyNameProc);
-}
-
-void ShowResetDialog(char *name)
-{
- ResetDialog = CreateWindowClient(0, "LDmicroDialog",
- _("Reset"), WS_OVERLAPPED | WS_SYSMENU,
- 100, 100, 404, 75, NULL, NULL, Instance, NULL);
-
- MakeControls();
+// static LRESULT CALLBACK MyNameProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
+// wParam == '\b'))
+// {
+// return 0;
+// }
+// }
+
+// return CallWindowProc((WNDPROC)PrevNameProc, hwnd, msg, wParam, lParam);
+// }
+
+// static void MakeControls(void)
+// {
+// HWND grouper = CreateWindowEx(0, WC_BUTTON, _("Type"),
+// WS_CHILD | BS_GROUPBOX | WS_VISIBLE,
+// 7, 3, 120, 65, ResetDialog, NULL, Instance, NULL);
+// NiceFont(grouper);
+
+// TypeTimerRadio = CreateWindowEx(0, WC_BUTTON, _("Timer"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 21, 100, 20, ResetDialog, NULL, Instance, NULL);
+// NiceFont(TypeTimerRadio);
+
+// TypeCounterRadio = CreateWindowEx(0, WC_BUTTON, _("Counter"),
+// WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE,
+// 16, 41, 100, 20, ResetDialog, NULL, Instance, NULL);
+// NiceFont(TypeCounterRadio);
+
+// HWND textLabel = CreateWindowEx(0, WC_STATIC, _("Name:"),
+// WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_RIGHT,
+// 135, 16, 50, 21, ResetDialog, NULL, Instance, NULL);
+// NiceFont(textLabel);
+
+// NameTextbox = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
+// WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 190, 16, 115, 21, ResetDialog, NULL, Instance, NULL);
+// FixedFont(NameTextbox);
+
+// OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
+// 321, 10, 70, 23, ResetDialog, NULL, Instance, NULL);
+// NiceFont(OkButton);
+
+// CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 321, 40, 70, 23, ResetDialog, NULL, Instance, NULL);
+// NiceFont(CancelButton);
+
+// PrevNameProc = SetWindowLongPtr(NameTextbox, GWLP_WNDPROC,
+// (LONG_PTR)MyNameProc);
+// }
+
+// void ShowResetDialog(char *name)
+// {
+// ResetDialog = CreateWindowClient(0, "LDmicroDialog",
+// _("Reset"), WS_OVERLAPPED | WS_SYSMENU,
+// 100, 100, 404, 75, NULL, NULL, Instance, NULL);
+
+// MakeControls();
- if(name[0] == 'T') {
- SendMessage(TypeTimerRadio, BM_SETCHECK, BST_CHECKED, 0);
- } else {
- SendMessage(TypeCounterRadio, BM_SETCHECK, BST_CHECKED, 0);
- }
- SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
-
- EnableWindow(MainWindow, FALSE);
- ShowWindow(ResetDialog, TRUE);
- SetFocus(NameTextbox);
- SendMessage(NameTextbox, EM_SETSEL, 0, -1);
-
- MSG msg;
- DWORD ret;
- DialogDone = FALSE;
- DialogCancel = FALSE;
- while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- if(msg.message == WM_KEYDOWN) {
- if(msg.wParam == VK_RETURN) {
- DialogDone = TRUE;
- break;
- } else if(msg.wParam == VK_ESCAPE) {
- DialogDone = TRUE;
- DialogCancel = TRUE;
- break;
- }
- }
-
- if(IsDialogMessage(ResetDialog, &msg)) continue;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- if(!DialogCancel) {
- if(SendMessage(TypeTimerRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
- name[0] = 'T';
- } else {
- name[0] = 'C';
- }
- SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
- }
-
- EnableWindow(MainWindow, TRUE);
- DestroyWindow(ResetDialog);
-}
+// if(name[0] == 'T') {
+// SendMessage(TypeTimerRadio, BM_SETCHECK, BST_CHECKED, 0);
+// } else {
+// SendMessage(TypeCounterRadio, BM_SETCHECK, BST_CHECKED, 0);
+// }
+// SendMessage(NameTextbox, WM_SETTEXT, 0, (LPARAM)(name + 1));
+
+// EnableWindow(MainWindow, FALSE);
+// ShowWindow(ResetDialog, TRUE);
+// SetFocus(NameTextbox);
+// SendMessage(NameTextbox, EM_SETSEL, 0, -1);
+
+// MSG msg;
+// DWORD ret;
+// DialogDone = FALSE;
+// DialogCancel = FALSE;
+// while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
+// if(msg.message == WM_KEYDOWN) {
+// if(msg.wParam == VK_RETURN) {
+// DialogDone = TRUE;
+// break;
+// } else if(msg.wParam == VK_ESCAPE) {
+// DialogDone = TRUE;
+// DialogCancel = TRUE;
+// break;
+// }
+// }
+
+// if(IsDialogMessage(ResetDialog, &msg)) continue;
+// TranslateMessage(&msg);
+// DispatchMessage(&msg);
+// }
+
+// if(!DialogCancel) {
+// if(SendMessage(TypeTimerRadio, BM_GETSTATE, 0, 0) & BST_CHECKED) {
+// name[0] = 'T';
+// } else {
+// name[0] = 'C';
+// }
+// SendMessage(NameTextbox, WM_GETTEXT, (WPARAM)16, (LPARAM)(name+1));
+// }
+
+// EnableWindow(MainWindow, TRUE);
+// DestroyWindow(ResetDialog);
+// }
diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp
index 7edfc5c..14aab25 100644
--- a/ldmicro/simpledialog.cpp
+++ b/ldmicro/simpledialog.cpp
@@ -44,379 +44,379 @@ static BOOL NoCheckingOnBox[MAX_BOXES];
//-----------------------------------------------------------------------------
// Don't allow any characters other than -A-Za-z0-9_ in the box.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK MyAlnumOnlyProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
- wParam == '\b' || wParam == '-' || wParam == '\''))
- {
- return 0;
- }
- }
-
- int i;
- for(i = 0; i < MAX_BOXES; i++) {
- if(hwnd == Textboxes[i]) {
- return CallWindowProc((WNDPROC)PrevAlnumOnlyProc[i], hwnd, msg,
- wParam, lParam);
- }
- }
- oops();
-}
+// static LRESULT CALLBACK MyAlnumOnlyProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// if(!(isalpha(wParam) || isdigit(wParam) || wParam == '_' ||
+// wParam == '\b' || wParam == '-' || wParam == '\''))
+// {
+// return 0;
+// }
+// }
+
+// int i;
+// for(i = 0; i < MAX_BOXES; i++) {
+// if(hwnd == Textboxes[i]) {
+// return CallWindowProc((WNDPROC)PrevAlnumOnlyProc[i], hwnd, msg,
+// wParam, lParam);
+// }
+// }
+// oops();
+// }
//-----------------------------------------------------------------------------
// Don't allow any characters other than -0-9. in the box.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK MyNumOnlyProc(HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- if(!(isdigit(wParam) || wParam == '.' || wParam == '\b'
- || wParam == '-'))
- {
- return 0;
- }
- }
-
- int i;
- for(i = 0; i < MAX_BOXES; i++) {
- if(hwnd == Textboxes[i]) {
- return CallWindowProc((WNDPROC)PrevNumOnlyProc[i], hwnd, msg,
- wParam, lParam);
- }
- }
- oops();
-}
-
-static void MakeControls(int boxes, char **labels, DWORD fixedFontMask)
-{
- int i;
- HDC hdc = GetDC(SimpleDialog);
- SelectObject(hdc, MyNiceFont);
-
- SIZE si;
-
- int maxLen = 0;
- for(i = 0; i < boxes; i++) {
- GetTextExtentPoint32(hdc, labels[i], strlen(labels[i]), &si);
- if(si.cx > maxLen) maxLen = si.cx;
- }
-
- int adj;
- if(maxLen > 70) {
- adj = maxLen - 70;
- } else {
- adj = 0;
- }
-
- for(i = 0; i < boxes; i++) {
- GetTextExtentPoint32(hdc, labels[i], strlen(labels[i]), &si);
-
- Labels[i] = CreateWindowEx(0, WC_STATIC, labels[i],
- WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
- (80 + adj) - si.cx - 4, 13 + i*30, si.cx, 21,
- SimpleDialog, NULL, Instance, NULL);
- NiceFont(Labels[i]);
-
- Textboxes[i] = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
- WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS |
- WS_VISIBLE,
- 80 + adj, 12 + 30*i, 120 - adj, 21,
- SimpleDialog, NULL, Instance, NULL);
-
- if(fixedFontMask & (1 << i)) {
- FixedFont(Textboxes[i]);
- } else {
- NiceFont(Textboxes[i]);
- }
- }
- ReleaseDC(SimpleDialog, hdc);
-
- OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
- 218, 11, 70, 23, SimpleDialog, NULL, Instance, NULL);
- NiceFont(OkButton);
-
- CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
- WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
- 218, 41, 70, 23, SimpleDialog, NULL, Instance, NULL);
- NiceFont(CancelButton);
-}
-
-BOOL ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask,
- DWORD alnumOnlyMask, DWORD fixedFontMask, char **dests)
-{
- BOOL didCancel;
-
- if(boxes > MAX_BOXES) oops();
-
- SimpleDialog = CreateWindowClient(0, "LDmicroDialog", title,
- WS_OVERLAPPED | WS_SYSMENU,
- 100, 100, 304, 15 + 30*(boxes < 2 ? 2 : boxes), NULL, NULL,
- Instance, NULL);
-
- MakeControls(boxes, labels, fixedFontMask);
+// static LRESULT CALLBACK MyNumOnlyProc(HWND hwnd, UINT msg, WPARAM wParam,
+// LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// if(!(isdigit(wParam) || wParam == '.' || wParam == '\b'
+// || wParam == '-'))
+// {
+// return 0;
+// }
+// }
+
+// int i;
+// for(i = 0; i < MAX_BOXES; i++) {
+// if(hwnd == Textboxes[i]) {
+// return CallWindowProc((WNDPROC)PrevNumOnlyProc[i], hwnd, msg,
+// wParam, lParam);
+// }
+// }
+// oops();
+// }
+
+// static void MakeControls(int boxes, char **labels, DWORD fixedFontMask)
+// {
+// int i;
+// HDC hdc = GetDC(SimpleDialog);
+// SelectObject(hdc, MyNiceFont);
+
+// SIZE si;
+
+// int maxLen = 0;
+// for(i = 0; i < boxes; i++) {
+// GetTextExtentPoint32(hdc, labels[i], strlen(labels[i]), &si);
+// if(si.cx > maxLen) maxLen = si.cx;
+// }
+
+// int adj;
+// if(maxLen > 70) {
+// adj = maxLen - 70;
+// } else {
+// adj = 0;
+// }
+
+// for(i = 0; i < boxes; i++) {
+// GetTextExtentPoint32(hdc, labels[i], strlen(labels[i]), &si);
+
+// Labels[i] = CreateWindowEx(0, WC_STATIC, labels[i],
+// WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
+// (80 + adj) - si.cx - 4, 13 + i*30, si.cx, 21,
+// SimpleDialog, NULL, Instance, NULL);
+// NiceFont(Labels[i]);
+
+// Textboxes[i] = CreateWindowEx(WS_EX_CLIENTEDGE, WC_EDIT, "",
+// WS_CHILD | ES_AUTOHSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS |
+// WS_VISIBLE,
+// 80 + adj, 12 + 30*i, 120 - adj, 21,
+// SimpleDialog, NULL, Instance, NULL);
+
+// if(fixedFontMask & (1 << i)) {
+// FixedFont(Textboxes[i]);
+// } else {
+// NiceFont(Textboxes[i]);
+// }
+// }
+// ReleaseDC(SimpleDialog, hdc);
+
+// OkButton = CreateWindowEx(0, WC_BUTTON, _("OK"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE | BS_DEFPUSHBUTTON,
+// 218, 11, 70, 23, SimpleDialog, NULL, Instance, NULL);
+// NiceFont(OkButton);
+
+// CancelButton = CreateWindowEx(0, WC_BUTTON, _("Cancel"),
+// WS_CHILD | WS_TABSTOP | WS_CLIPSIBLINGS | WS_VISIBLE,
+// 218, 41, 70, 23, SimpleDialog, NULL, Instance, NULL);
+// NiceFont(CancelButton);
+// }
+
+// BOOL ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask,
+// DWORD alnumOnlyMask, DWORD fixedFontMask, char **dests)
+// {
+// BOOL didCancel;
+
+// if(boxes > MAX_BOXES) oops();
+
+// SimpleDialog = CreateWindowClient(0, "LDmicroDialog", title,
+// WS_OVERLAPPED | WS_SYSMENU,
+// 100, 100, 304, 15 + 30*(boxes < 2 ? 2 : boxes), NULL, NULL,
+// Instance, NULL);
+
+// MakeControls(boxes, labels, fixedFontMask);
- int i;
- for(i = 0; i < boxes; i++) {
- SendMessage(Textboxes[i], WM_SETTEXT, 0, (LPARAM)dests[i]);
-
- if(numOnlyMask & (1 << i)) {
- PrevNumOnlyProc[i] = SetWindowLongPtr(Textboxes[i], GWLP_WNDPROC,
- (LONG_PTR)MyNumOnlyProc);
- }
- if(alnumOnlyMask & (1 << i)) {
- PrevAlnumOnlyProc[i] = SetWindowLongPtr(Textboxes[i], GWLP_WNDPROC,
- (LONG_PTR)MyAlnumOnlyProc);
- }
- }
-
- EnableWindow(MainWindow, FALSE);
- ShowWindow(SimpleDialog, TRUE);
- SetFocus(Textboxes[0]);
- SendMessage(Textboxes[0], EM_SETSEL, 0, -1);
-
- MSG msg;
- DWORD ret;
- DialogDone = FALSE;
- DialogCancel = FALSE;
- while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
- if(msg.message == WM_KEYDOWN) {
- if(msg.wParam == VK_RETURN) {
- DialogDone = TRUE;
- break;
- } else if(msg.wParam == VK_ESCAPE) {
- DialogDone = TRUE;
- DialogCancel = TRUE;
- break;
- }
- }
-
- if(IsDialogMessage(SimpleDialog, &msg)) continue;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- didCancel = DialogCancel;
-
- if(!didCancel) {
- for(i = 0; i < boxes; i++) {
- if(NoCheckingOnBox[i]) {
- char get[64];
- SendMessage(Textboxes[i], WM_GETTEXT, 60, (LPARAM)get);
- strcpy(dests[i], get);
- } else {
- char get[20];
- SendMessage(Textboxes[i], WM_GETTEXT, 15, (LPARAM)get);
-
- if( (!strchr(get, '\'')) ||
- (get[0] == '\'' && get[2] == '\'' && strlen(get)==3) )
- {
- if(strlen(get) == 0) {
- Error(_("Empty textbox; not permitted."));
- } else {
- strcpy(dests[i], get);
- }
- } else {
- Error(_("Bad use of quotes: <%s>"), get);
- }
- }
- }
- }
-
- EnableWindow(MainWindow, TRUE);
- DestroyWindow(SimpleDialog);
-
- return !didCancel;
-}
-
-void ShowTimerDialog(int which, int *delay, char *name)
-{
- char *s;
- switch(which) {
- case ELEM_TON: s = _("Turn-On Delay"); break;
- case ELEM_TOF: s = _("Turn-Off Delay"); break;
- case ELEM_RTO: s = _("Retentive Turn-On Delay"); break;
- default: oops(); break;
- }
+// int i;
+// for(i = 0; i < boxes; i++) {
+// SendMessage(Textboxes[i], WM_SETTEXT, 0, (LPARAM)dests[i]);
+
+// if(numOnlyMask & (1 << i)) {
+// PrevNumOnlyProc[i] = SetWindowLongPtr(Textboxes[i], GWLP_WNDPROC,
+// (LONG_PTR)MyNumOnlyProc);
+// }
+// if(alnumOnlyMask & (1 << i)) {
+// PrevAlnumOnlyProc[i] = SetWindowLongPtr(Textboxes[i], GWLP_WNDPROC,
+// (LONG_PTR)MyAlnumOnlyProc);
+// }
+// }
+
+// EnableWindow(MainWindow, FALSE);
+// ShowWindow(SimpleDialog, TRUE);
+// SetFocus(Textboxes[0]);
+// SendMessage(Textboxes[0], EM_SETSEL, 0, -1);
+
+// MSG msg;
+// DWORD ret;
+// DialogDone = FALSE;
+// DialogCancel = FALSE;
+// while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) {
+// if(msg.message == WM_KEYDOWN) {
+// if(msg.wParam == VK_RETURN) {
+// DialogDone = TRUE;
+// break;
+// } else if(msg.wParam == VK_ESCAPE) {
+// DialogDone = TRUE;
+// DialogCancel = TRUE;
+// break;
+// }
+// }
+
+// if(IsDialogMessage(SimpleDialog, &msg)) continue;
+// TranslateMessage(&msg);
+// DispatchMessage(&msg);
+// }
+
+// didCancel = DialogCancel;
+
+// if(!didCancel) {
+// for(i = 0; i < boxes; i++) {
+// if(NoCheckingOnBox[i]) {
+// char get[64];
+// SendMessage(Textboxes[i], WM_GETTEXT, 60, (LPARAM)get);
+// strcpy(dests[i], get);
+// } else {
+// char get[20];
+// SendMessage(Textboxes[i], WM_GETTEXT, 15, (LPARAM)get);
+
+// if( (!strchr(get, '\'')) ||
+// (get[0] == '\'' && get[2] == '\'' && strlen(get)==3) )
+// {
+// if(strlen(get) == 0) {
+// Error(_("Empty textbox; not permitted."));
+// } else {
+// strcpy(dests[i], get);
+// }
+// } else {
+// Error(_("Bad use of quotes: <%s>"), get);
+// }
+// }
+// }
+// }
+
+// EnableWindow(MainWindow, TRUE);
+// DestroyWindow(SimpleDialog);
+
+// return !didCancel;
+// }
+
+// void ShowTimerDialog(int which, int *delay, char *name)
+// {
+// char *s;
+// switch(which) {
+// case ELEM_TON: s = _("Turn-On Delay"); break;
+// case ELEM_TOF: s = _("Turn-Off Delay"); break;
+// case ELEM_RTO: s = _("Retentive Turn-On Delay"); break;
+// default: oops(); break;
+// }
- char *labels[] = { _("Name:"), _("Delay (ms):") };
-
- char delBuf[16];
- char nameBuf[16];
- sprintf(delBuf, "%.3f", (*delay / 1000.0));
- strcpy(nameBuf, name+1);
- char *dests[] = { nameBuf, delBuf };
-
- if(ShowSimpleDialog(s, 2, labels, (1 << 1), (1 << 0), (1 << 0), dests)) {
- name[0] = 'T';
- strcpy(name+1, nameBuf);
- double del = atof(delBuf);
- if(del > 2140000) { // 2**31/1000, don't overflow signed int
- Error(_("Delay too long; maximum is 2**31 us."));
- } else if(del <= 0) {
- Error(_("Delay cannot be zero or negative."));
- } else {
- *delay = (int)(1000*del + 0.5);
- }
- }
-}
-
-void ShowCounterDialog(int which, int *maxV, char *name)
-{
- char *title;
-
- switch(which) {
- case ELEM_CTU: title = _("Count Up"); break;
- case ELEM_CTD: title = _("Count Down"); break;
- case ELEM_CTC: title = _("Circular Counter"); break;
-
- default: oops();
- }
-
- char *labels[] = { _("Name:"), (which == ELEM_CTC ? _("Max value:") :
- _("True if >= :")) };
- char maxS[128];
- sprintf(maxS, "%d", *maxV);
- char *dests[] = { name+1, maxS };
- ShowSimpleDialog(title, 2, labels, 0x2, 0x1, 0x1, dests);
- *maxV = atoi(maxS);
-}
-
-void ShowCmpDialog(int which, char *op1, char *op2)
-{
- char *title;
- char *l2;
- switch(which) {
- case ELEM_EQU:
- title = _("If Equals");
- l2 = "= :";
- break;
-
- case ELEM_NEQ:
- title = _("If Not Equals");
- l2 = "/= :";
- break;
-
- case ELEM_GRT:
- title = _("If Greater Than");
- l2 = "> :";
- break;
-
- case ELEM_GEQ:
- title = _("If Greater Than or Equal To");
- l2 = ">= :";
- break;
-
- case ELEM_LES:
- title = _("If Less Than");
- l2 = "< :";
- break;
-
- case ELEM_LEQ:
- title = _("If Less Than or Equal To");
- l2 = "<= :";
- break;
-
- default:
- oops();
- }
- char *labels[] = { _("'Closed' if:"), l2 };
- char *dests[] = { op1, op2 };
- ShowSimpleDialog(title, 2, labels, 0, 0x3, 0x3, dests);
-}
-
-void ShowMoveDialog(char *dest, char *src)
-{
- char *labels[] = { _("Destination:"), _("Source:") };
- char *dests[] = { dest, src };
- ShowSimpleDialog(_("Move"), 2, labels, 0, 0x3, 0x3, dests);
-}
-
-void ShowReadAdcDialog(char *name)
-{
- char *labels[] = { _("Destination:") };
- char *dests[] = { name };
- ShowSimpleDialog(_("Read A/D Converter"), 1, labels, 0, 0x1, 0x1, dests);
-}
-
-void ShowSetPwmDialog(char *name, int *targetFreq)
-{
- char freq[100];
- sprintf(freq, "%d", *targetFreq);
-
- char *labels[] = { _("Duty cycle var:"), _("Frequency (Hz):") };
- char *dests[] = { name, freq };
- ShowSimpleDialog(_("Set PWM Duty Cycle"), 2, labels, 0x2, 0x1, 0x1, dests);
-
- *targetFreq = atoi(freq);
-}
-
-void ShowUartDialog(int which, char *name)
-{
- char *labels[] = { (which == ELEM_UART_RECV) ? _("Destination:") :
- _("Source:") };
- char *dests[] = { name };
-
- ShowSimpleDialog((which == ELEM_UART_RECV) ? _("Receive from UART") :
- _("Send to UART"), 1, labels, 0, 0x1, 0x1, dests);
-}
-
-void ShowMathDialog(int which, char *dest, char *op1, char *op2)
-{
- char *l2, *title;
- if(which == ELEM_ADD) {
- l2 = "+ :";
- title = _("Add");
- } else if(which == ELEM_SUB) {
- l2 = "- :";
- title = _("Subtract");
- } else if(which == ELEM_MUL) {
- l2 = "* :";
- title = _("Multiply");
- } else if(which == ELEM_DIV) {
- l2 = "/ :";
- title = _("Divide");
- } else oops();
-
- char *labels[] = { _("Destination:"), _("is set := :"), l2 };
- char *dests[] = { dest, op1, op2 };
- ShowSimpleDialog(title, 3, labels, 0, 0x7, 0x7, dests);
-}
-
-void ShowShiftRegisterDialog(char *name, int *stages)
-{
- char stagesStr[20];
- sprintf(stagesStr, "%d", *stages);
-
- char *labels[] = { _("Name:"), _("Stages:") };
- char *dests[] = { name, stagesStr };
- ShowSimpleDialog(_("Shift Register"), 2, labels, 0x2, 0x1, 0x1, dests);
-
- *stages = atoi(stagesStr);
-
- if(*stages <= 0 || *stages >= 200) {
- Error(_("Not a reasonable size for a shift register."));
- *stages = 1;
- }
-}
-
-void ShowFormattedStringDialog(char *var, char *string)
-{
- char *labels[] = { _("Variable:"), _("String:") };
- char *dests[] = { var, string };
- NoCheckingOnBox[0] = TRUE;
- NoCheckingOnBox[1] = TRUE;
- ShowSimpleDialog(_("Formatted String Over UART"), 2, labels, 0x0,
- 0x1, 0x3, dests);
- NoCheckingOnBox[0] = FALSE;
- NoCheckingOnBox[1] = FALSE;
-}
-
-void ShowPersistDialog(char *var)
-{
- char *labels[] = { _("Variable:") };
- char *dests[] = { var };
- ShowSimpleDialog(_("Make Persistent"), 1, labels, 0, 1, 1, dests);
-}
+// char *labels[] = { _("Name:"), _("Delay (ms):") };
+
+// char delBuf[16];
+// char nameBuf[16];
+// sprintf(delBuf, "%.3f", (*delay / 1000.0));
+// strcpy(nameBuf, name+1);
+// char *dests[] = { nameBuf, delBuf };
+
+// if(ShowSimpleDialog(s, 2, labels, (1 << 1), (1 << 0), (1 << 0), dests)) {
+// name[0] = 'T';
+// strcpy(name+1, nameBuf);
+// double del = atof(delBuf);
+// if(del > 2140000) { // 2**31/1000, don't overflow signed int
+// Error(_("Delay too long; maximum is 2**31 us."));
+// } else if(del <= 0) {
+// Error(_("Delay cannot be zero or negative."));
+// } else {
+// *delay = (int)(1000*del + 0.5);
+// }
+// }
+// }
+
+// void ShowCounterDialog(int which, int *maxV, char *name)
+// {
+// char *title;
+
+// switch(which) {
+// case ELEM_CTU: title = _("Count Up"); break;
+// case ELEM_CTD: title = _("Count Down"); break;
+// case ELEM_CTC: title = _("Circular Counter"); break;
+
+// default: oops();
+// }
+
+// char *labels[] = { _("Name:"), (which == ELEM_CTC ? _("Max value:") :
+// _("True if >= :")) };
+// char maxS[128];
+// sprintf(maxS, "%d", *maxV);
+// char *dests[] = { name+1, maxS };
+// ShowSimpleDialog(title, 2, labels, 0x2, 0x1, 0x1, dests);
+// *maxV = atoi(maxS);
+// }
+
+// void ShowCmpDialog(int which, char *op1, char *op2)
+// {
+// char *title;
+// char *l2;
+// switch(which) {
+// case ELEM_EQU:
+// title = _("If Equals");
+// l2 = "= :";
+// break;
+
+// case ELEM_NEQ:
+// title = _("If Not Equals");
+// l2 = "/= :";
+// break;
+
+// case ELEM_GRT:
+// title = _("If Greater Than");
+// l2 = "> :";
+// break;
+
+// case ELEM_GEQ:
+// title = _("If Greater Than or Equal To");
+// l2 = ">= :";
+// break;
+
+// case ELEM_LES:
+// title = _("If Less Than");
+// l2 = "< :";
+// break;
+
+// case ELEM_LEQ:
+// title = _("If Less Than or Equal To");
+// l2 = "<= :";
+// break;
+
+// default:
+// oops();
+// }
+// char *labels[] = { _("'Closed' if:"), l2 };
+// char *dests[] = { op1, op2 };
+// ShowSimpleDialog(title, 2, labels, 0, 0x3, 0x3, dests);
+// }
+
+// void ShowMoveDialog(char *dest, char *src)
+// {
+// char *labels[] = { _("Destination:"), _("Source:") };
+// char *dests[] = { dest, src };
+// ShowSimpleDialog(_("Move"), 2, labels, 0, 0x3, 0x3, dests);
+// }
+
+// void ShowReadAdcDialog(char *name)
+// {
+// char *labels[] = { _("Destination:") };
+// char *dests[] = { name };
+// ShowSimpleDialog(_("Read A/D Converter"), 1, labels, 0, 0x1, 0x1, dests);
+// }
+
+// void ShowSetPwmDialog(char *name, int *targetFreq)
+// {
+// char freq[100];
+// sprintf(freq, "%d", *targetFreq);
+
+// char *labels[] = { _("Duty cycle var:"), _("Frequency (Hz):") };
+// char *dests[] = { name, freq };
+// ShowSimpleDialog(_("Set PWM Duty Cycle"), 2, labels, 0x2, 0x1, 0x1, dests);
+
+// *targetFreq = atoi(freq);
+// }
+
+// void ShowUartDialog(int which, char *name)
+// {
+// char *labels[] = { (which == ELEM_UART_RECV) ? _("Destination:") :
+// _("Source:") };
+// char *dests[] = { name };
+
+// ShowSimpleDialog((which == ELEM_UART_RECV) ? _("Receive from UART") :
+// _("Send to UART"), 1, labels, 0, 0x1, 0x1, dests);
+// }
+
+// void ShowMathDialog(int which, char *dest, char *op1, char *op2)
+// {
+// char *l2, *title;
+// if(which == ELEM_ADD) {
+// l2 = "+ :";
+// title = _("Add");
+// } else if(which == ELEM_SUB) {
+// l2 = "- :";
+// title = _("Subtract");
+// } else if(which == ELEM_MUL) {
+// l2 = "* :";
+// title = _("Multiply");
+// } else if(which == ELEM_DIV) {
+// l2 = "/ :";
+// title = _("Divide");
+// } else oops();
+
+// char *labels[] = { _("Destination:"), _("is set := :"), l2 };
+// char *dests[] = { dest, op1, op2 };
+// ShowSimpleDialog(title, 3, labels, 0, 0x7, 0x7, dests);
+// }
+
+// void ShowShiftRegisterDialog(char *name, int *stages)
+// {
+// char stagesStr[20];
+// sprintf(stagesStr, "%d", *stages);
+
+// char *labels[] = { _("Name:"), _("Stages:") };
+// char *dests[] = { name, stagesStr };
+// ShowSimpleDialog(_("Shift Register"), 2, labels, 0x2, 0x1, 0x1, dests);
+
+// *stages = atoi(stagesStr);
+
+// if(*stages <= 0 || *stages >= 200) {
+// Error(_("Not a reasonable size for a shift register."));
+// *stages = 1;
+// }
+// }
+
+// void ShowFormattedStringDialog(char *var, char *string)
+// {
+// char *labels[] = { _("Variable:"), _("String:") };
+// char *dests[] = { var, string };
+// NoCheckingOnBox[0] = TRUE;
+// NoCheckingOnBox[1] = TRUE;
+// ShowSimpleDialog(_("Formatted String Over UART"), 2, labels, 0x0,
+// 0x1, 0x3, dests);
+// NoCheckingOnBox[0] = FALSE;
+// NoCheckingOnBox[1] = FALSE;
+// }
+
+// void ShowPersistDialog(char *var)
+// {
+// char *labels[] = { _("Variable:") };
+// char *dests[] = { var };
+// ShowSimpleDialog(_("Make Persistent"), 1, labels, 0, 1, 1, dests);
+// }
diff --git a/ldmicro/simulate.cpp b/ldmicro/simulate.cpp
index 57da046..ecb9b0e 100644
--- a/ldmicro/simulate.cpp
+++ b/ldmicro/simulate.cpp
@@ -31,9 +31,8 @@
#include <limits.h>
#include "ldmicro.h"
-#include "simulate.h"
#include "intcode.h"
-#include "freeze.h"
+#include "freezeLD.h"
static struct {
char name[MAX_NAME_LEN];
@@ -107,125 +106,117 @@ static char *MarkUsedVariable(char *name, DWORD flag);
// Looks in the SingleBitItems list; if an item is not present then it is
// FALSE by default.
//-----------------------------------------------------------------------------
-static BOOL SingleBitOn(char *name)
-{
- int i;
- for(i = 0; i < SingleBitItemsCount; i++) {
- if(strcmp(SingleBitItems[i].name, name)==0) {
- return SingleBitItems[i].powered;
- }
- }
- return FALSE;
-}
+// static BOOL SingleBitOn(char *name)
+// {
+// int i;
+// for(i = 0; i < SingleBitItemsCount; i++) {
+// if(strcmp(SingleBitItems[i].name, name)==0) {
+// return SingleBitItems[i].powered;
+// }
+// }
+// return FALSE;
+// }
//-----------------------------------------------------------------------------
// Set the state of a single-bit item. Adds it to the list if it is not there
// already.
//-----------------------------------------------------------------------------
-static void SetSingleBit(char *name, BOOL state)
-{
- int i;
- for(i = 0; i < SingleBitItemsCount; i++) {
- if(strcmp(SingleBitItems[i].name, name)==0) {
- if((name[0] == 'Y') && (SingleBitItems[i].powered != state))
- {
- TranslateState(name, state);
- /*char Debug[256];
- sprintf_s(Debug, "SetSingleBit: \tname: %s \t state: %d\n",
- name, state);
- OutputDebugString(Debug);*/
- }
- SingleBitItems[i].powered = state;
- return;
- }
- }
- if(i < MAX_IO) {
- strcpy(SingleBitItems[i].name, name);
- SingleBitItems[i].powered = state;
- SingleBitItemsCount++;
- }
-}
+// static void SetSingleBit(char *name, BOOL state)
+// {
+// int i;
+// for(i = 0; i < SingleBitItemsCount; i++) {
+// if(strcmp(SingleBitItems[i].name, name)==0) {
+// SingleBitItems[i].powered = state;
+// return;
+// }
+// }
+// if(i < MAX_IO) {
+// strcpy(SingleBitItems[i].name, name);
+// SingleBitItems[i].powered = state;
+// SingleBitItemsCount++;
+// }
+// }
//-----------------------------------------------------------------------------
// Count a timer up (i.e. increment its associated count by 1). Must already
// exist in the table.
//-----------------------------------------------------------------------------
-static void IncrementVariable(char *name)
-{
- int i;
- for(i = 0; i < VariablesCount; i++) {
- if(strcmp(Variables[i].name, name)==0) {
- (Variables[i].val)++;
- return;
- }
- }
- oops();
-}
+// static void IncrementVariable(char *name)
+// {
+// int i;
+// for(i = 0; i < VariablesCount; i++) {
+// if(strcmp(Variables[i].name, name)==0) {
+// (Variables[i].val)++;
+// return;
+// }
+// }
+// oops();
+// }
//-----------------------------------------------------------------------------
// Set a variable to a value.
//-----------------------------------------------------------------------------
-static void SetSimulationVariable(char *name, SWORD val)
-{
- int i;
- for(i = 0; i < VariablesCount; i++) {
- if(strcmp(Variables[i].name, name)==0) {
- Variables[i].val = val;
- return;
- }
- }
- MarkUsedVariable(name, VAR_FLAG_OTHERWISE_FORGOTTEN);
- SetSimulationVariable(name, val);
-}
+// static void SetSimulationVariable(char *name, SWORD val)
+// {
+// int i;
+// for(i = 0; i < VariablesCount; i++) {
+// if(strcmp(Variables[i].name, name)==0) {
+// Variables[i].val = val;
+// return;
+// }
+// }
+// MarkUsedVariable(name, VAR_FLAG_OTHERWISE_FORGOTTEN);
+// SetSimulationVariable(name, val);
+// }
//-----------------------------------------------------------------------------
// Read a variable's value.
//-----------------------------------------------------------------------------
-SWORD GetSimulationVariable(char *name)
-{
- int i;
- for(i = 0; i < VariablesCount; i++) {
- if(strcmp(Variables[i].name, name)==0) {
- return Variables[i].val;
- }
- }
- MarkUsedVariable(name, VAR_FLAG_OTHERWISE_FORGOTTEN);
- return GetSimulationVariable(name);
-}
+// SWORD GetSimulationVariable(char *name)
+// {
+// int i;
+// for(i = 0; i < VariablesCount; i++) {
+// if(strcmp(Variables[i].name, name)==0) {
+// return Variables[i].val;
+// }
+// }
+// MarkUsedVariable(name, VAR_FLAG_OTHERWISE_FORGOTTEN);
+// return GetSimulationVariable(name);
+// }
//-----------------------------------------------------------------------------
// Set the shadow copy of a variable associated with a READ ADC operation. This
// will get committed to the real copy when the rung-in condition to the
// READ ADC is true.
//-----------------------------------------------------------------------------
-void SetAdcShadow(char *name, SWORD val)
-{
- int i;
- for(i = 0; i < AdcShadowsCount; i++) {
- if(strcmp(AdcShadows[i].name, name)==0) {
- AdcShadows[i].val = val;
- return;
- }
- }
- strcpy(AdcShadows[i].name, name);
- AdcShadows[i].val = val;
- AdcShadowsCount++;
-}
+// void SetAdcShadow(char *name, SWORD val)
+// {
+// int i;
+// for(i = 0; i < AdcShadowsCount; i++) {
+// if(strcmp(AdcShadows[i].name, name)==0) {
+// AdcShadows[i].val = val;
+// return;
+// }
+// }
+// strcpy(AdcShadows[i].name, name);
+// AdcShadows[i].val = val;
+// AdcShadowsCount++;
+// }
//-----------------------------------------------------------------------------
// Return the shadow value of a variable associated with a READ ADC. This is
// what gets copied into the real variable when an ADC read is simulated.
//-----------------------------------------------------------------------------
-SWORD GetAdcShadow(char *name)
-{
- int i;
- for(i = 0; i < AdcShadowsCount; i++) {
- if(strcmp(AdcShadows[i].name, name)==0) {
- return AdcShadows[i].val;
- }
- }
- return 0;
-}
+// SWORD GetAdcShadow(char *name)
+// {
+// int i;
+// for(i = 0; i < AdcShadowsCount; i++) {
+// if(strcmp(AdcShadows[i].name, name)==0) {
+// return AdcShadows[i].val;
+// }
+// }
+// return 0;
+// }
//-----------------------------------------------------------------------------
// Mark how a variable is used; a series of flags that we can OR together,
@@ -233,62 +224,62 @@ SWORD GetAdcShadow(char *name)
// (e.g. just a TON, an RTO with its reset, etc.). Returns NULL for success,
// else an error string.
//-----------------------------------------------------------------------------
-static char *MarkUsedVariable(char *name, DWORD flag)
-{
- int i;
- for(i = 0; i < VariablesCount; i++) {
- if(strcmp(Variables[i].name, name)==0) {
- break;
- }
- }
- if(i >= MAX_IO) return "";
-
- if(i == VariablesCount) {
- strcpy(Variables[i].name, name);
- Variables[i].usedFlags = 0;
- Variables[i].val = 0;
- VariablesCount++;
- }
-
- switch(flag) {
- case VAR_FLAG_TOF:
- if(Variables[i].usedFlags != 0)
- return _("TOF: variable cannot be used elsewhere");
- break;
-
- case VAR_FLAG_TON:
- if(Variables[i].usedFlags != 0)
- return _("TON: variable cannot be used elsewhere");
- break;
+// static char *MarkUsedVariable(char *name, DWORD flag)
+// {
+// int i;
+// for(i = 0; i < VariablesCount; i++) {
+// if(strcmp(Variables[i].name, name)==0) {
+// break;
+// }
+// }
+// if(i >= MAX_IO) return "";
+
+// if(i == VariablesCount) {
+// strcpy(Variables[i].name, name);
+// Variables[i].usedFlags = 0;
+// Variables[i].val = 0;
+// VariablesCount++;
+// }
+
+// switch(flag) {
+// case VAR_FLAG_TOF:
+// if(Variables[i].usedFlags != 0)
+// return _("TOF: variable cannot be used elsewhere");
+// break;
+
+// case VAR_FLAG_TON:
+// if(Variables[i].usedFlags != 0)
+// return _("TON: variable cannot be used elsewhere");
+// break;
- case VAR_FLAG_RTO:
- if(Variables[i].usedFlags & ~VAR_FLAG_RES)
- return _("RTO: variable can only be used for RES elsewhere");
- break;
-
- case VAR_FLAG_CTU:
- case VAR_FLAG_CTD:
- case VAR_FLAG_CTC:
- case VAR_FLAG_RES:
- case VAR_FLAG_ANY:
- break;
-
- case VAR_FLAG_OTHERWISE_FORGOTTEN:
- if(name[0] != '$') {
- Error(_("Variable '%s' not assigned to, e.g. with a "
- "MOV statement, an ADD statement, etc.\r\n\r\n"
- "This is probably a programming error; now it "
- "will always be zero."), name);
- }
- break;
-
- default:
- oops();
- }
-
- Variables[i].usedFlags |= flag;
- return NULL;
-}
+// case VAR_FLAG_RTO:
+// if(Variables[i].usedFlags & ~VAR_FLAG_RES)
+// return _("RTO: variable can only be used for RES elsewhere");
+// break;
+
+// case VAR_FLAG_CTU:
+// case VAR_FLAG_CTD:
+// case VAR_FLAG_CTC:
+// case VAR_FLAG_RES:
+// case VAR_FLAG_ANY:
+// break;
+
+// case VAR_FLAG_OTHERWISE_FORGOTTEN:
+// if(name[0] != '$') {
+// Error(_("Variable '%s' not assigned to, e.g. with a "
+// "MOV statement, an ADD statement, etc.\r\n\r\n"
+// "This is probably a programming error; now it "
+// "will always be zero."), name);
+// }
+// break;
+
+// default:
+// oops();
+// }
+
+// Variables[i].usedFlags |= flag;
+// return NULL;
+// }
//-----------------------------------------------------------------------------
// Check for duplicate uses of a single variable. For example, there should
@@ -296,205 +287,207 @@ static char *MarkUsedVariable(char *name, DWORD flag)
// to have an RTO with the same name as its reset; in fact, verify that
// there must be a reset for each RTO.
//-----------------------------------------------------------------------------
-static void MarkWithCheck(char *name, int flag)
-{
- char *s = MarkUsedVariable(name, flag);
- if(s) {
- Error(_("Variable for '%s' incorrectly assigned: %s."), name, s);
- }
-}
-static void CheckVariableNamesCircuit(int which, void *elem)
-{
- ElemLeaf *l = (ElemLeaf *)elem;
- char *name = NULL;
- DWORD flag;
-
- switch(which) {
- case ELEM_SERIES_SUBCKT: {
- int i;
- ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
- for(i = 0; i < s->count; i++) {
- CheckVariableNamesCircuit(s->contents[i].which,
- s->contents[i].d.any);
- }
- break;
- }
-
- case ELEM_PARALLEL_SUBCKT: {
- int i;
- ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
- for(i = 0; i < p->count; i++) {
- CheckVariableNamesCircuit(p->contents[i].which,
- p->contents[i].d.any);
- }
- break;
- }
+// static void MarkWithCheck(char *name, int flag)
+// {
+// char *s = MarkUsedVariable(name, flag);
+// if(s) {
+// Error(_("Variable for '%s' incorrectly assigned: %s."), name, s);
+// }
+// }
+
+// static void CheckVariableNamesCircuit(int which, void *elem)
+// {
+// ElemLeaf *l = (ElemLeaf *)elem;
+// char *name = NULL;
+// DWORD flag;
+
+// switch(which) {
+// case ELEM_SERIES_SUBCKT: {
+// int i;
+// ElemSubcktSeries *s = (ElemSubcktSeries *)elem;
+// for(i = 0; i < s->count; i++) {
+// CheckVariableNamesCircuit(s->contents[i].which,
+// s->contents[i].d.any);
+// }
+// break;
+// }
+
+// case ELEM_PARALLEL_SUBCKT: {
+// int i;
+// ElemSubcktParallel *p = (ElemSubcktParallel *)elem;
+// for(i = 0; i < p->count; i++) {
+// CheckVariableNamesCircuit(p->contents[i].which,
+// p->contents[i].d.any);
+// }
+// break;
+// }
- case ELEM_RTO:
- case ELEM_TOF:
- case ELEM_TON:
- if(which == ELEM_RTO)
- flag = VAR_FLAG_RTO;
- else if(which == ELEM_TOF)
- flag = VAR_FLAG_TOF;
- else if(which == ELEM_TON)
- flag = VAR_FLAG_TON;
- else oops();
-
- MarkWithCheck(l->d.timer.name, flag);
-
- break;
-
- case ELEM_CTU:
- case ELEM_CTD:
- case ELEM_CTC:
- if(which == ELEM_CTU)
- flag = VAR_FLAG_CTU;
- else if(which == ELEM_CTD)
- flag = VAR_FLAG_CTD;
- else if(which == ELEM_CTC)
- flag = VAR_FLAG_CTC;
- else oops();
-
- MarkWithCheck(l->d.counter.name, flag);
-
- break;
-
- case ELEM_RES:
- MarkWithCheck(l->d.reset.name, VAR_FLAG_RES);
- break;
-
- case ELEM_MOVE:
- MarkWithCheck(l->d.move.dest, VAR_FLAG_ANY);
- break;
-
- case ELEM_LOOK_UP_TABLE:
- MarkWithCheck(l->d.lookUpTable.dest, VAR_FLAG_ANY);
- break;
-
- case ELEM_PIECEWISE_LINEAR:
- MarkWithCheck(l->d.piecewiseLinear.dest, VAR_FLAG_ANY);
- break;
-
- case ELEM_READ_ADC:
- MarkWithCheck(l->d.readAdc.name, VAR_FLAG_ANY);
- break;
-
- case ELEM_ADD:
- case ELEM_SUB:
- case ELEM_MUL:
- case ELEM_DIV:
- MarkWithCheck(l->d.math.dest, VAR_FLAG_ANY);
- break;
-
- case ELEM_UART_RECV:
- MarkWithCheck(l->d.uart.name, VAR_FLAG_ANY);
- break;
-
- case ELEM_SHIFT_REGISTER: {
- int i;
- for(i = 1; i < l->d.shiftRegister.stages; i++) {
- char str[MAX_NAME_LEN+10];
- sprintf(str, "%s%d", l->d.shiftRegister.name, i);
- MarkWithCheck(str, VAR_FLAG_ANY);
- }
- break;
- }
-
- case ELEM_PERSIST:
- case ELEM_FORMATTED_STRING:
- case ELEM_SET_PWM:
- case ELEM_MASTER_RELAY:
- case ELEM_UART_SEND:
- case ELEM_PLACEHOLDER:
- case ELEM_COMMENT:
- case ELEM_OPEN:
- case ELEM_SHORT:
- case ELEM_COIL:
- case ELEM_CONTACTS:
- case ELEM_ONE_SHOT_RISING:
- case ELEM_ONE_SHOT_FALLING:
- case ELEM_EQU:
- case ELEM_NEQ:
- case ELEM_GRT:
- case ELEM_GEQ:
- case ELEM_LES:
- case ELEM_LEQ:
- break;
-
- default:
- oops();
- }
-}
-static void CheckVariableNames(void)
-{
- int i;
- for(i = 0; i < Prog.numRungs; i++) {
- CheckVariableNamesCircuit(ELEM_SERIES_SUBCKT, Prog.rungs[i]);
- }
-}
+// case ELEM_RTO:
+// case ELEM_TOF:
+// case ELEM_TON:
+// if(which == ELEM_RTO)
+// flag = VAR_FLAG_RTO;
+// else if(which == ELEM_TOF)
+// flag = VAR_FLAG_TOF;
+// else if(which == ELEM_TON)
+// flag = VAR_FLAG_TON;
+// else oops();
+
+// MarkWithCheck(l->d.timer.name, flag);
+
+// break;
+
+// case ELEM_CTU:
+// case ELEM_CTD:
+// case ELEM_CTC:
+// if(which == ELEM_CTU)
+// flag = VAR_FLAG_CTU;
+// else if(which == ELEM_CTD)
+// flag = VAR_FLAG_CTD;
+// else if(which == ELEM_CTC)
+// flag = VAR_FLAG_CTC;
+// else oops();
+
+// MarkWithCheck(l->d.counter.name, flag);
+
+// break;
+
+// case ELEM_RES:
+// MarkWithCheck(l->d.reset.name, VAR_FLAG_RES);
+// break;
+
+// case ELEM_MOVE:
+// MarkWithCheck(l->d.move.dest, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_LOOK_UP_TABLE:
+// MarkWithCheck(l->d.lookUpTable.dest, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_PIECEWISE_LINEAR:
+// MarkWithCheck(l->d.piecewiseLinear.dest, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_READ_ADC:
+// MarkWithCheck(l->d.readAdc.name, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_ADD:
+// case ELEM_SUB:
+// case ELEM_MUL:
+// case ELEM_DIV:
+// MarkWithCheck(l->d.math.dest, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_UART_RECV:
+// MarkWithCheck(l->d.uart.name, VAR_FLAG_ANY);
+// break;
+
+// case ELEM_SHIFT_REGISTER: {
+// int i;
+// for(i = 1; i < l->d.shiftRegister.stages; i++) {
+// char str[MAX_NAME_LEN+10];
+// sprintf(str, "%s%d", l->d.shiftRegister.name, i);
+// MarkWithCheck(str, VAR_FLAG_ANY);
+// }
+// break;
+// }
+
+// case ELEM_PERSIST:
+// case ELEM_FORMATTED_STRING:
+// case ELEM_SET_PWM:
+// case ELEM_MASTER_RELAY:
+// case ELEM_UART_SEND:
+// case ELEM_PLACEHOLDER:
+// case ELEM_COMMENT:
+// case ELEM_OPEN:
+// case ELEM_SHORT:
+// case ELEM_COIL:
+// case ELEM_CONTACTS:
+// case ELEM_ONE_SHOT_RISING:
+// case ELEM_ONE_SHOT_FALLING:
+// case ELEM_EQU:
+// case ELEM_NEQ:
+// case ELEM_GRT:
+// case ELEM_GEQ:
+// case ELEM_LES:
+// case ELEM_LEQ:
+// break;
+
+// default:
+// oops();
+// }
+// }
+
+// static void CheckVariableNames(void)
+// {
+// int i;
+// for(i = 0; i < Prog.numRungs; i++) {
+// CheckVariableNamesCircuit(ELEM_SERIES_SUBCKT, Prog.rungs[i]);
+// }
+// }
//-----------------------------------------------------------------------------
// The IF condition is true. Execute the body, up until the ELSE or the
// END IF, and then skip the ELSE if it is present. Called with PC on the
// IF, returns with PC on the END IF.
//-----------------------------------------------------------------------------
-static void IfConditionTrue(void)
-{
- IntPc++;
- // now PC is on the first statement of the IF body
- SimulateIntCode();
- // now PC is on the ELSE or the END IF
- if(IntCode[IntPc].op == INT_ELSE) {
- int nesting = 1;
- for(; ; IntPc++) {
- if(IntPc >= IntCodeLen) oops();
-
- if(IntCode[IntPc].op == INT_END_IF) {
- nesting--;
- } else if(INT_IF_GROUP(IntCode[IntPc].op)) {
- nesting++;
- }
- if(nesting == 0) break;
- }
- } else if(IntCode[IntPc].op == INT_END_IF) {
- return;
- } else {
- oops();
- }
-}
+// static void IfConditionTrue(void)
+// {
+// IntPc++;
+// // now PC is on the first statement of the IF body
+// SimulateIntCode();
+// // now PC is on the ELSE or the END IF
+// if(IntCode[IntPc].op == INT_ELSE) {
+// int nesting = 1;
+// for(; ; IntPc++) {
+// if(IntPc >= IntCodeLen) oops();
+
+// if(IntCode[IntPc].op == INT_END_IF) {
+// nesting--;
+// } else if(INT_IF_GROUP(IntCode[IntPc].op)) {
+// nesting++;
+// }
+// if(nesting == 0) break;
+// }
+// } else if(IntCode[IntPc].op == INT_END_IF) {
+// return;
+// } else {
+// oops();
+// }
+// }
//-----------------------------------------------------------------------------
// The IF condition is false. Skip the body, up until the ELSE or the END
// IF, and then execute the ELSE if it is present. Called with PC on the IF,
// returns with PC on the END IF.
//-----------------------------------------------------------------------------
-static void IfConditionFalse(void)
-{
- int nesting = 0;
- for(; ; IntPc++) {
- if(IntPc >= IntCodeLen) oops();
-
- if(IntCode[IntPc].op == INT_END_IF) {
- nesting--;
- } else if(INT_IF_GROUP(IntCode[IntPc].op)) {
- nesting++;
- } else if(IntCode[IntPc].op == INT_ELSE && nesting == 1) {
- break;
- }
- if(nesting == 0) break;
- }
-
- // now PC is on the ELSE or the END IF
- if(IntCode[IntPc].op == INT_ELSE) {
- IntPc++;
- SimulateIntCode();
- } else if(IntCode[IntPc].op == INT_END_IF) {
- return;
- } else {
- oops();
- }
-}
+// static void IfConditionFalse(void)
+// {
+// int nesting = 0;
+// for(; ; IntPc++) {
+// if(IntPc >= IntCodeLen) oops();
+
+// if(IntCode[IntPc].op == INT_END_IF) {
+// nesting--;
+// } else if(INT_IF_GROUP(IntCode[IntPc].op)) {
+// nesting++;
+// } else if(IntCode[IntPc].op == INT_ELSE && nesting == 1) {
+// break;
+// }
+// if(nesting == 0) break;
+// }
+
+// // now PC is on the ELSE or the END IF
+// if(IntCode[IntPc].op == INT_ELSE) {
+// IntPc++;
+// SimulateIntCode();
+// } else if(IntCode[IntPc].op == INT_END_IF) {
+// return;
+// } else {
+// oops();
+// }
+// }
//-----------------------------------------------------------------------------
// Evaluate a circuit, calling ourselves recursively to evaluate if/else
@@ -502,229 +495,229 @@ static void IfConditionFalse(void)
// internal tables. Returns when it reaches an end if or an else construct,
// or at the end of the program.
//-----------------------------------------------------------------------------
-static void SimulateIntCode(void)
-{
- for(; IntPc < IntCodeLen; IntPc++) {
- IntOp *a = &IntCode[IntPc];
- switch(a->op) {
- case INT_SIMULATE_NODE_STATE:
- if(*(a->poweredAfter) != SingleBitOn(a->name1))
- NeedRedraw = TRUE;
- *(a->poweredAfter) = SingleBitOn(a->name1);
- break;
-
- case INT_SET_BIT:
- SetSingleBit(a->name1, TRUE);
- break;
-
- case INT_CLEAR_BIT:
- SetSingleBit(a->name1, FALSE);
- break;
-
- case INT_COPY_BIT_TO_BIT:
- SetSingleBit(a->name1, SingleBitOn(a->name2));
- break;
-
- case INT_SET_VARIABLE_TO_LITERAL:
- if(GetSimulationVariable(a->name1) !=
- a->literal && a->name1[0] != '$')
- {
- NeedRedraw = TRUE;
- }
- SetSimulationVariable(a->name1, a->literal);
- break;
-
- case INT_SET_VARIABLE_TO_VARIABLE:
- if(GetSimulationVariable(a->name1) !=
- GetSimulationVariable(a->name2))
- {
- NeedRedraw = TRUE;
- }
- SetSimulationVariable(a->name1,
- GetSimulationVariable(a->name2));
- break;
-
- case INT_INCREMENT_VARIABLE:
- IncrementVariable(a->name1);
- break;
-
- {
- SWORD v;
- case INT_SET_VARIABLE_ADD:
- v = GetSimulationVariable(a->name2) +
- GetSimulationVariable(a->name3);
- goto math;
- case INT_SET_VARIABLE_SUBTRACT:
- v = GetSimulationVariable(a->name2) -
- GetSimulationVariable(a->name3);
- goto math;
- case INT_SET_VARIABLE_MULTIPLY:
- v = GetSimulationVariable(a->name2) *
- GetSimulationVariable(a->name3);
- goto math;
- case INT_SET_VARIABLE_DIVIDE:
- if(GetSimulationVariable(a->name3) != 0) {
- v = GetSimulationVariable(a->name2) /
- GetSimulationVariable(a->name3);
- } else {
- v = 0;
- Error(_("Division by zero; halting simulation"));
- StopSimulation();
- }
- goto math;
-math:
- if(GetSimulationVariable(a->name1) != v) {
- NeedRedraw = TRUE;
- SetSimulationVariable(a->name1, v);
- }
- break;
- }
-
-#define IF_BODY \
- { \
- IfConditionTrue(); \
- } else { \
- IfConditionFalse(); \
- }
- case INT_IF_BIT_SET:
- if(SingleBitOn(a->name1))
- IF_BODY
- break;
-
- case INT_IF_BIT_CLEAR:
- if(!SingleBitOn(a->name1))
- IF_BODY
- break;
-
- case INT_IF_VARIABLE_LES_LITERAL:
- if(GetSimulationVariable(a->name1) < a->literal)
- IF_BODY
- break;
-
- case INT_IF_VARIABLE_EQUALS_VARIABLE:
- if(GetSimulationVariable(a->name1) ==
- GetSimulationVariable(a->name2))
- IF_BODY
- break;
-
- case INT_IF_VARIABLE_GRT_VARIABLE:
- if(GetSimulationVariable(a->name1) >
- GetSimulationVariable(a->name2))
- IF_BODY
- break;
-
- case INT_SET_PWM:
- // Dummy call will cause a warning if no one ever assigned
- // to that variable.
- (void)GetSimulationVariable(a->name1);
- break;
-
- // Don't try to simulate the EEPROM stuff: just hold the EEPROM
- // busy all the time, so that the program never does anything
- // with it.
- case INT_EEPROM_BUSY_CHECK:
- SetSingleBit(a->name1, TRUE);
- break;
-
- case INT_EEPROM_READ:
- case INT_EEPROM_WRITE:
- oops();
- break;
-
- case INT_READ_ADC:
- // Keep the shadow copies of the ADC variables because in
- // the real device they will not be updated until an actual
- // read is performed, which occurs only for a true rung-in
- // condition there.
- SetSimulationVariable(a->name1, GetAdcShadow(a->name1));
- break;
-
- case INT_UART_SEND:
- if(SingleBitOn(a->name2) && (SimulateUartTxCountdown == 0)) {
- SimulateUartTxCountdown = 2;
- AppendToUartSimulationTextControl(
- (BYTE)GetSimulationVariable(a->name1));
- }
- if(SimulateUartTxCountdown == 0) {
- SetSingleBit(a->name2, FALSE);
- } else {
- SetSingleBit(a->name2, TRUE);
- }
- break;
-
- case INT_UART_RECV:
- if(QueuedUartCharacter >= 0) {
- SetSingleBit(a->name2, TRUE);
- SetSimulationVariable(a->name1, (SWORD)QueuedUartCharacter);
- QueuedUartCharacter = -1;
- } else {
- SetSingleBit(a->name2, FALSE);
- }
- break;
-
- case INT_END_IF:
- case INT_ELSE:
- return;
-
- case INT_COMMENT:
- break;
+// static void SimulateIntCode(void)
+// {
+// for(; IntPc < IntCodeLen; IntPc++) {
+// IntOp *a = &IntCode[IntPc];
+// switch(a->op) {
+// case INT_SIMULATE_NODE_STATE:
+// if(*(a->poweredAfter) != SingleBitOn(a->name1))
+// NeedRedraw = TRUE;
+// *(a->poweredAfter) = SingleBitOn(a->name1);
+// break;
+
+// case INT_SET_BIT:
+// SetSingleBit(a->name1, TRUE);
+// break;
+
+// case INT_CLEAR_BIT:
+// SetSingleBit(a->name1, FALSE);
+// break;
+
+// case INT_COPY_BIT_TO_BIT:
+// SetSingleBit(a->name1, SingleBitOn(a->name2));
+// break;
+
+// case INT_SET_VARIABLE_TO_LITERAL:
+// if(GetSimulationVariable(a->name1) !=
+// a->literal && a->name1[0] != '$')
+// {
+// NeedRedraw = TRUE;
+// }
+// SetSimulationVariable(a->name1, a->literal);
+// break;
+
+// case INT_SET_VARIABLE_TO_VARIABLE:
+// if(GetSimulationVariable(a->name1) !=
+// GetSimulationVariable(a->name2))
+// {
+// NeedRedraw = TRUE;
+// }
+// SetSimulationVariable(a->name1,
+// GetSimulationVariable(a->name2));
+// break;
+
+// case INT_INCREMENT_VARIABLE:
+// IncrementVariable(a->name1);
+// break;
+
+// {
+// SWORD v;
+// case INT_SET_VARIABLE_ADD:
+// v = GetSimulationVariable(a->name2) +
+// GetSimulationVariable(a->name3);
+// goto math;
+// case INT_SET_VARIABLE_SUBTRACT:
+// v = GetSimulationVariable(a->name2) -
+// GetSimulationVariable(a->name3);
+// goto math;
+// case INT_SET_VARIABLE_MULTIPLY:
+// v = GetSimulationVariable(a->name2) *
+// GetSimulationVariable(a->name3);
+// goto math;
+// case INT_SET_VARIABLE_DIVIDE:
+// if(GetSimulationVariable(a->name3) != 0) {
+// v = GetSimulationVariable(a->name2) /
+// GetSimulationVariable(a->name3);
+// } else {
+// v = 0;
+// Error(_("Division by zero; halting simulation"));
+// StopSimulation();
+// }
+// goto math;
+// math:
+// if(GetSimulationVariable(a->name1) != v) {
+// NeedRedraw = TRUE;
+// SetSimulationVariable(a->name1, v);
+// }
+// break;
+// }
+
+// #define IF_BODY \
+// { \
+// IfConditionTrue(); \
+// } else { \
+// IfConditionFalse(); \
+// }
+// case INT_IF_BIT_SET:
+// if(SingleBitOn(a->name1))
+// IF_BODY
+// break;
+
+// case INT_IF_BIT_CLEAR:
+// if(!SingleBitOn(a->name1))
+// IF_BODY
+// break;
+
+// case INT_IF_VARIABLE_LES_LITERAL:
+// if(GetSimulationVariable(a->name1) < a->literal)
+// IF_BODY
+// break;
+
+// case INT_IF_VARIABLE_EQUALS_VARIABLE:
+// if(GetSimulationVariable(a->name1) ==
+// GetSimulationVariable(a->name2))
+// IF_BODY
+// break;
+
+// case INT_IF_VARIABLE_GRT_VARIABLE:
+// if(GetSimulationVariable(a->name1) >
+// GetSimulationVariable(a->name2))
+// IF_BODY
+// break;
+
+// case INT_SET_PWM:
+// // Dummy call will cause a warning if no one ever assigned
+// // to that variable.
+// (void)GetSimulationVariable(a->name1);
+// break;
+
+// // Don't try to simulate the EEPROM stuff: just hold the EEPROM
+// // busy all the time, so that the program never does anything
+// // with it.
+// case INT_EEPROM_BUSY_CHECK:
+// SetSingleBit(a->name1, TRUE);
+// break;
+
+// case INT_EEPROM_READ:
+// case INT_EEPROM_WRITE:
+// oops();
+// break;
+
+// case INT_READ_ADC:
+// // Keep the shadow copies of the ADC variables because in
+// // the real device they will not be updated until an actual
+// // read is performed, which occurs only for a true rung-in
+// // condition there.
+// SetSimulationVariable(a->name1, GetAdcShadow(a->name1));
+// break;
+
+// case INT_UART_SEND:
+// if(SingleBitOn(a->name2) && (SimulateUartTxCountdown == 0)) {
+// SimulateUartTxCountdown = 2;
+// AppendToUartSimulationTextControl(
+// (BYTE)GetSimulationVariable(a->name1));
+// }
+// if(SimulateUartTxCountdown == 0) {
+// SetSingleBit(a->name2, FALSE);
+// } else {
+// SetSingleBit(a->name2, TRUE);
+// }
+// break;
+
+// case INT_UART_RECV:
+// if(QueuedUartCharacter >= 0) {
+// SetSingleBit(a->name2, TRUE);
+// SetSimulationVariable(a->name1, (SWORD)QueuedUartCharacter);
+// QueuedUartCharacter = -1;
+// } else {
+// SetSingleBit(a->name2, FALSE);
+// }
+// break;
+
+// case INT_END_IF:
+// case INT_ELSE:
+// return;
+
+// case INT_COMMENT:
+// break;
- default:
- oops();
- break;
- }
- }
-}
+// default:
+// oops();
+// break;
+// }
+// }
+// }
//-----------------------------------------------------------------------------
// Called by the Windows timer that triggers cycles when we are running
// in real time.
//-----------------------------------------------------------------------------
-void CALLBACK PlcCycleTimer(HWND hwnd, UINT msg, UINT_PTR id, DWORD time)
-{
- int i;
- for(i = 0; i < CyclesPerTimerTick; i++) {
- SimulateOneCycle(FALSE);
- }
-}
+// void CALLBACK PlcCycleTimer(HWND hwnd, UINT msg, UINT_PTR id, DWORD time)
+// {
+// int i;
+// for(i = 0; i < CyclesPerTimerTick; i++) {
+// SimulateOneCycle(FALSE);
+// }
+// }
//-----------------------------------------------------------------------------
// Simulate one cycle of the PLC. Update everything, and keep track of whether
// any outputs have changed. If so, force a screen refresh. If requested do
// a screen refresh regardless.
//-----------------------------------------------------------------------------
-void SimulateOneCycle(BOOL forceRefresh)
-{
- // When there is an error message up, the modal dialog makes its own
- // event loop, and there is risk that we would go recursive. So let
- // us fix that. (Note that there are no concurrency issues; we really
- // would get called recursively, not just reentrantly.)
- static BOOL Simulating = FALSE;
+// void SimulateOneCycle(BOOL forceRefresh)
+// {
+// // When there is an error message up, the modal dialog makes its own
+// // event loop, and there is risk that we would go recursive. So let
+// // us fix that. (Note that there are no concurrency issues; we really
+// // would get called recursively, not just reentrantly.)
+// static BOOL Simulating = FALSE;
- if(Simulating) return;
- Simulating = TRUE;
+// if(Simulating) return;
+// Simulating = TRUE;
- NeedRedraw = FALSE;
+// NeedRedraw = FALSE;
- if(SimulateUartTxCountdown > 0) {
- SimulateUartTxCountdown--;
- } else {
- SimulateUartTxCountdown = 0;
- }
+// if(SimulateUartTxCountdown > 0) {
+// SimulateUartTxCountdown--;
+// } else {
+// SimulateUartTxCountdown = 0;
+// }
- IntPc = 0;
- SimulateIntCode();
+// IntPc = 0;
+// SimulateIntCode();
- if(NeedRedraw || SimulateRedrawAfterNextCycle || forceRefresh) {
- InvalidateRect(MainWindow, NULL, FALSE);
- ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
- }
+// if(NeedRedraw || SimulateRedrawAfterNextCycle || forceRefresh) {
+// InvalidateRect(MainWindow, NULL, FALSE);
+// ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
+// }
- SimulateRedrawAfterNextCycle = FALSE;
- if(NeedRedraw) SimulateRedrawAfterNextCycle = TRUE;
+// SimulateRedrawAfterNextCycle = FALSE;
+// if(NeedRedraw) SimulateRedrawAfterNextCycle = TRUE;
- Simulating = FALSE;
-}
+// Simulating = FALSE;
+// }
//-----------------------------------------------------------------------------
// Start the timer that we use to trigger PLC cycles in approximately real
@@ -732,270 +725,250 @@ void SimulateOneCycle(BOOL forceRefresh)
// is about as fast as anyone could follow by eye. Faster timers will just
// go instantly.
//-----------------------------------------------------------------------------
-void StartSimulationTimer(void)
-{
- int p = Prog.cycleTime/1000;
- if(p < 5) {
- SetTimer(MainWindow, TIMER_SIMULATE, 10, PlcCycleTimer);
- CyclesPerTimerTick = 10000 / Prog.cycleTime;
- } else {
- SetTimer(MainWindow, TIMER_SIMULATE, p, PlcCycleTimer);
- CyclesPerTimerTick = 1;
- }
-}
+// void StartSimulationTimer(void)
+// {
+// int p = Prog.cycleTime/1000;
+// if(p < 5) {
+// SetTimer(MainWindow, TIMER_SIMULATE, 10, PlcCycleTimer);
+// CyclesPerTimerTick = 10000 / Prog.cycleTime;
+// } else {
+// SetTimer(MainWindow, TIMER_SIMULATE, p, PlcCycleTimer);
+// CyclesPerTimerTick = 1;
+// }
+// }
//-----------------------------------------------------------------------------
// Clear out all the parameters relating to the previous simulation.
//-----------------------------------------------------------------------------
-void ClearSimulationData(void)
-{
- VariablesCount = 0;
- SingleBitItemsCount = 0;
- AdcShadowsCount = 0;
- QueuedUartCharacter = -1;
- SimulateUartTxCountdown = 0;
+// void ClearSimulationData(void)
+// {
+// VariablesCount = 0;
+// SingleBitItemsCount = 0;
+// AdcShadowsCount = 0;
+// QueuedUartCharacter = -1;
+// SimulateUartTxCountdown = 0;
- CheckVariableNames();
+// CheckVariableNames();
- SimulateRedrawAfterNextCycle = TRUE;
+// SimulateRedrawAfterNextCycle = TRUE;
- if(!GenerateIntermediateCode()) {
- ToggleSimulationMode();
- return;
- }
+// if(!GenerateIntermediateCode()) {
+// ToggleSimulationMode();
+// return;
+// }
- SimulateOneCycle(TRUE);
-}
+// SimulateOneCycle(TRUE);
+// }
//-----------------------------------------------------------------------------
// Provide a description for an item (Xcontacts, Ycoil, Rrelay, Ttimer,
// or other) in the I/O list.
//-----------------------------------------------------------------------------
-void DescribeForIoList(char *name, char *out)
-{
- switch(name[0]) {
- case 'R':
- case 'X':
- case 'Y':
- sprintf(out, "%d", SingleBitOn(name));
- break;
-
- case 'T': {
- double dtms = GetSimulationVariable(name) *
- (Prog.cycleTime / 1000.0);
- if(dtms < 1000) {
- sprintf(out, "%.2f ms", dtms);
- } else {
- sprintf(out, "%.3f s", dtms / 1000);
- }
- break;
- }
- default: {
- SWORD v = GetSimulationVariable(name);
- sprintf(out, "%hd (0x%04hx)", v, v);
- break;
- }
- }
-}
+// void DescribeForIoList(char *name, char *out)
+// {
+// switch(name[0]) {
+// case 'R':
+// case 'X':
+// case 'Y':
+// sprintf(out, "%d", SingleBitOn(name));
+// break;
+
+// case 'T': {
+// double dtms = GetSimulationVariable(name) *
+// (Prog.cycleTime / 1000.0);
+// if(dtms < 1000) {
+// sprintf(out, "%.2f ms", dtms);
+// } else {
+// sprintf(out, "%.3f s", dtms / 1000);
+// }
+// break;
+// }
+// default: {
+// SWORD v = GetSimulationVariable(name);
+// sprintf(out, "%hd (0x%04hx)", v, v);
+// break;
+// }
+// }
+// }
//-----------------------------------------------------------------------------
// Toggle the state of a contact input; for simulation purposes, so that we
// can set the input state of the program.
//-----------------------------------------------------------------------------
-void SimulationToggleContact(char *name)
-{
- BOOL value = !SingleBitOn(name);
- SetSingleBit(name, value);
- ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
- // TranslateState(name, value);
-}
-
-void SimulationSetContact(char* name)
-{
- BOOL value = TRUE;
- SetSingleBit(name, value);
- ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
- MCUPinState(name,value);
- // TranslateState(name, value);
-}
-
-void SimulationResetContact(char* name)
-{
- BOOL value = FALSE;
- SetSingleBit(name, value);
- ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
- MCUPinState(name,value);
- // TranslateState(name, value);
-}
+// void SimulationToggleContact(char *name)
+// {
+// SetSingleBit(name, !SingleBitOn(name));
+// ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
+// }
//-----------------------------------------------------------------------------
// Dialog proc for the popup that lets you interact with the UART stuff.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK UartSimulationProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_DESTROY:
- DestroyUartSimulationWindow();
- break;
+// static LRESULT CALLBACK UartSimulationProc(HWND hwnd, UINT msg,
+// WPARAM wParam, LPARAM lParam)
+// {
+// switch (msg) {
+// case WM_DESTROY:
+// DestroyUartSimulationWindow();
+// break;
- case WM_CLOSE:
- break;
+// case WM_CLOSE:
+// break;
- case WM_SIZE:
- MoveWindow(UartSimulationTextControl, 0, 0, LOWORD(lParam),
- HIWORD(lParam), TRUE);
- break;
+// case WM_SIZE:
+// MoveWindow(UartSimulationTextControl, 0, 0, LOWORD(lParam),
+// HIWORD(lParam), TRUE);
+// break;
- case WM_ACTIVATE:
- if(wParam != WA_INACTIVE) {
- SetFocus(UartSimulationTextControl);
- }
- break;
+// case WM_ACTIVATE:
+// if(wParam != WA_INACTIVE) {
+// SetFocus(UartSimulationTextControl);
+// }
+// break;
- default:
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
- return 1;
-}
+// default:
+// return DefWindowProc(hwnd, msg, wParam, lParam);
+// }
+// return 1;
+// }
//-----------------------------------------------------------------------------
// Intercept WM_CHAR messages that to the terminal simulation window so that
// we can redirect them to the PLC program.
//-----------------------------------------------------------------------------
-static LRESULT CALLBACK UartSimulationTextProc(HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
-{
- if(msg == WM_CHAR) {
- QueuedUartCharacter = (BYTE)wParam;
- return 0;
- }
+// static LRESULT CALLBACK UartSimulationTextProc(HWND hwnd, UINT msg,
+// WPARAM wParam, LPARAM lParam)
+// {
+// if(msg == WM_CHAR) {
+// QueuedUartCharacter = (BYTE)wParam;
+// return 0;
+// }
- return CallWindowProc((WNDPROC)PrevTextProc, hwnd, msg, wParam, lParam);
-}
+// return CallWindowProc((WNDPROC)PrevTextProc, hwnd, msg, wParam, lParam);
+// }
//-----------------------------------------------------------------------------
// Pop up the UART simulation window; like a terminal window where the
// characters that you type go into UART RECV instruction and whatever
// the program puts into UART SEND shows up as text.
//-----------------------------------------------------------------------------
-void ShowUartSimulationWindow(void)
-{
- WNDCLASSEX wc;
- memset(&wc, 0, sizeof(wc));
- wc.cbSize = sizeof(wc);
+// void ShowUartSimulationWindow(void)
+// {
+// WNDCLASSEX wc;
+// memset(&wc, 0, sizeof(wc));
+// wc.cbSize = sizeof(wc);
- wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC |
- CS_DBLCLKS;
- wc.lpfnWndProc = (WNDPROC)UartSimulationProc;
- wc.hInstance = Instance;
- wc.hbrBackground = (HBRUSH)COLOR_BTNSHADOW;
- wc.lpszClassName = "LDmicroUartSimulationWindow";
- wc.lpszMenuName = NULL;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+// wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC |
+// CS_DBLCLKS;
+// wc.lpfnWndProc = (WNDPROC)UartSimulationProc;
+// wc.hInstance = Instance;
+// wc.hbrBackground = (HBRUSH)COLOR_BTNSHADOW;
+// wc.lpszClassName = "LDmicroUartSimulationWindow";
+// wc.lpszMenuName = NULL;
+// wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- RegisterClassEx(&wc);
+// RegisterClassEx(&wc);
- DWORD TerminalX = 200, TerminalY = 200, TerminalW = 300, TerminalH = 150;
+// DWORD TerminalX = 200, TerminalY = 200, TerminalW = 300, TerminalH = 150;
- ThawDWORD(TerminalX);
- ThawDWORD(TerminalY);
- ThawDWORD(TerminalW);
- ThawDWORD(TerminalH);
+// ThawDWORD(TerminalX);
+// ThawDWORD(TerminalY);
+// ThawDWORD(TerminalW);
+// ThawDWORD(TerminalH);
- if(TerminalW > 800) TerminalW = 100;
- if(TerminalH > 800) TerminalH = 100;
+// if(TerminalW > 800) TerminalW = 100;
+// if(TerminalH > 800) TerminalH = 100;
- RECT r;
- GetClientRect(GetDesktopWindow(), &r);
- if(TerminalX >= (DWORD)(r.right - 10)) TerminalX = 100;
- if(TerminalY >= (DWORD)(r.bottom - 10)) TerminalY = 100;
+// RECT r;
+// GetClientRect(GetDesktopWindow(), &r);
+// if(TerminalX >= (DWORD)(r.right - 10)) TerminalX = 100;
+// if(TerminalY >= (DWORD)(r.bottom - 10)) TerminalY = 100;
- UartSimulationWindow = CreateWindowClient(WS_EX_TOOLWINDOW |
- WS_EX_APPWINDOW, "LDmicroUartSimulationWindow",
- "UART Simulation (Terminal)", WS_VISIBLE | WS_SIZEBOX,
- TerminalX, TerminalY, TerminalW, TerminalH,
- NULL, NULL, Instance, NULL);
+// UartSimulationWindow = CreateWindowClient(WS_EX_TOOLWINDOW |
+// WS_EX_APPWINDOW, "LDmicroUartSimulationWindow",
+// "UART Simulation (Terminal)", WS_VISIBLE | WS_SIZEBOX,
+// TerminalX, TerminalY, TerminalW, TerminalH,
+// NULL, NULL, Instance, NULL);
- UartSimulationTextControl = CreateWindowEx(0, WC_EDIT, "", WS_CHILD |
- WS_CLIPSIBLINGS | WS_VISIBLE | ES_AUTOVSCROLL | ES_MULTILINE |
- WS_VSCROLL, 0, 0, TerminalW, TerminalH, UartSimulationWindow, NULL,
- Instance, NULL);
+// UartSimulationTextControl = CreateWindowEx(0, WC_EDIT, "", WS_CHILD |
+// WS_CLIPSIBLINGS | WS_VISIBLE | ES_AUTOVSCROLL | ES_MULTILINE |
+// WS_VSCROLL, 0, 0, TerminalW, TerminalH, UartSimulationWindow, NULL,
+// Instance, NULL);
- HFONT fixedFont = CreateFont(14, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE,
- ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
- FF_DONTCARE, "Lucida Console");
- if(!fixedFont)
- fixedFont = (HFONT)GetStockObject(SYSTEM_FONT);
+// HFONT fixedFont = CreateFont(14, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE,
+// ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
+// FF_DONTCARE, "Lucida Console");
+// if(!fixedFont)
+// fixedFont = (HFONT)GetStockObject(SYSTEM_FONT);
- SendMessage((HWND)UartSimulationTextControl, WM_SETFONT, (WPARAM)fixedFont,
- TRUE);
+// SendMessage((HWND)UartSimulationTextControl, WM_SETFONT, (WPARAM)fixedFont,
+// TRUE);
- PrevTextProc = SetWindowLongPtr(UartSimulationTextControl,
- GWLP_WNDPROC, (LONG_PTR)UartSimulationTextProc);
+// PrevTextProc = SetWindowLongPtr(UartSimulationTextControl,
+// GWLP_WNDPROC, (LONG_PTR)UartSimulationTextProc);
- ShowWindow(UartSimulationWindow, TRUE);
- SetFocus(MainWindow);
-}
+// ShowWindow(UartSimulationWindow, TRUE);
+// SetFocus(MainWindow);
+// }
//-----------------------------------------------------------------------------
// Get rid of the UART simulation terminal-type window.
//-----------------------------------------------------------------------------
-void DestroyUartSimulationWindow(void)
-{
- // Try not to destroy the window if it is already destroyed; that is
- // not for the sake of the window, but so that we don't trash the
- // stored position.
- if(UartSimulationWindow == NULL) return;
+// void DestroyUartSimulationWindow(void)
+// {
+// // Try not to destroy the window if it is already destroyed; that is
+// // not for the sake of the window, but so that we don't trash the
+// // stored position.
+// if(UartSimulationWindow == NULL) return;
- DWORD TerminalX, TerminalY, TerminalW, TerminalH;
- RECT r;
+// DWORD TerminalX, TerminalY, TerminalW, TerminalH;
+// RECT r;
- GetClientRect(UartSimulationWindow, &r);
- TerminalW = r.right - r.left;
- TerminalH = r.bottom - r.top;
+// GetClientRect(UartSimulationWindow, &r);
+// TerminalW = r.right - r.left;
+// TerminalH = r.bottom - r.top;
- GetWindowRect(UartSimulationWindow, &r);
- TerminalX = r.left;
- TerminalY = r.top;
+// GetWindowRect(UartSimulationWindow, &r);
+// TerminalX = r.left;
+// TerminalY = r.top;
- FreezeDWORD(TerminalX);
- FreezeDWORD(TerminalY);
- FreezeDWORD(TerminalW);
- FreezeDWORD(TerminalH);
+// FreezeDWORD(TerminalX);
+// FreezeDWORD(TerminalY);
+// FreezeDWORD(TerminalW);
+// FreezeDWORD(TerminalH);
- DestroyWindow(UartSimulationWindow);
- UartSimulationWindow = NULL;
-}
+// DestroyWindow(UartSimulationWindow);
+// UartSimulationWindow = NULL;
+// }
//-----------------------------------------------------------------------------
// Append a received character to the terminal buffer.
//-----------------------------------------------------------------------------
-static void AppendToUartSimulationTextControl(BYTE b)
-{
- char append[5];
-
- if((isalnum(b) || strchr("[]{};':\",.<>/?`~ !@#$%^&*()-=_+|", b) ||
- b == '\r' || b == '\n') && b != '\0')
- {
- append[0] = b;
- append[1] = '\0';
- } else {
- sprintf(append, "\\x%02x", b);
- }
-
-#define MAX_SCROLLBACK 256
- char buf[MAX_SCROLLBACK];
-
- SendMessage(UartSimulationTextControl, WM_GETTEXT, (WPARAM)sizeof(buf),
- (LPARAM)buf);
-
- int overBy = (strlen(buf) + strlen(append) + 1) - sizeof(buf);
- if(overBy > 0) {
- memmove(buf, buf + overBy, strlen(buf));
- }
- strcat(buf, append);
-
- SendMessage(UartSimulationTextControl, WM_SETTEXT, 0, (LPARAM)buf);
- SendMessage(UartSimulationTextControl, EM_LINESCROLL, 0, (LPARAM)INT_MAX);
-}
+// static void AppendToUartSimulationTextControl(BYTE b)
+// {
+// char append[5];
+
+// if((isalnum(b) || strchr("[]{};':\",.<>/?`~ !@#$%^&*()-=_+|", b) ||
+// b == '\r' || b == '\n') && b != '\0')
+// {
+// append[0] = b;
+// append[1] = '\0';
+// } else {
+// sprintf(append, "\\x%02x", b);
+// }
+
+// #define MAX_SCROLLBACK 256
+// char buf[MAX_SCROLLBACK];
+
+// SendMessage(UartSimulationTextControl, WM_GETTEXT, (WPARAM)sizeof(buf),
+// (LPARAM)buf);
+
+// int overBy = (strlen(buf) + strlen(append) + 1) - sizeof(buf);
+// if(overBy > 0) {
+// memmove(buf, buf + overBy, strlen(buf));
+// }
+// strcat(buf, append);
+
+// SendMessage(UartSimulationTextControl, WM_SETTEXT, 0, (LPARAM)buf);
+// SendMessage(UartSimulationTextControl, EM_LINESCROLL, 0, (LPARAM)INT_MAX);
+// }