--- a/etherlab/CommonEtherCATFunction.py Fri Sep 28 17:20:11 2018 +0300
+++ b/etherlab/CommonEtherCATFunction.py Fri Sep 28 17:48:10 2018 +0300
@@ -44,9 +44,9 @@
-#--------------------------------------------------
+# -------------------------------------------------- # Remote Exec Etherlab Commands
-#--------------------------------------------------
+# -------------------------------------------------- # --------------------- for master ---------------------------
@@ -136,9 +136,9 @@
-#--------------------------------------------------
+# -------------------------------------------------- # Common Method For EtherCAT Management
-#--------------------------------------------------
+# -------------------------------------------------- # ----- Data Structure for ethercat management ----
@@ -181,9 +181,9 @@
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def GetMasterState(self):
Execute "ethercat master" command and parse the execution result
@@ -207,9 +207,9 @@
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def RequestSlaveState(self, command):
Set slave state to the specified one using "ethercat states -p %d %s" command.
@@ -228,9 +228,9 @@
self.SlaveState = return_val
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def GetSlaveSDOFromSlave(self):
Get SDO objects information of current slave using "ethercat sdos -p %d" command.
@@ -270,9 +270,9 @@
self.SaveSDOData.append([])
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def RequestPDOInfo(self):
Load slave information from RootClass (XML data) and parse the information (calling SlavePDOData() method).
@@ -397,9 +397,9 @@
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- # Base data types in ETG2000; format = {"Name": "BitSize"}
BaseDataTypeDict = {"BOOL": "01",
@@ -1519,9 +1519,9 @@
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def RegRead(self, offset, length):
Read slave ESC register content using "ethercat reg_read -p %d %s %s" command.
@@ -1551,9 +1551,9 @@
error, return_val = self.Controler.RemoteExec(RESCAN%(self.Controler.GetSlavePos()), return_val = None)
- #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- - #-------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------- def CheckConnect(self, cyclic_flag):
Check connection status (1) between Beremiz and the master (2) between the master and the slave.
--- a/etherlab/EtherCATManagementEditor.py Fri Sep 28 17:20:11 2018 +0300
+++ b/etherlab/EtherCATManagementEditor.py Fri Sep 28 17:48:10 2018 +0300
@@ -21,11 +21,11 @@
# ------------ for SDO Management --------------------
import wx.grid as gridlib
-#-------------------------------------------------------------
+# ------------------------------------------------------------- # ------------ for register management ---------------
from xml.dom import minidom
-#-------------------------------------------------------------
+# ------------------------------------------------------------- # ----------------------------- For Sync Manager Table -----------------------------------
def GetSyncManagersTableColnames():
@@ -35,9 +35,9 @@
return ["#", _("Name"), _("Start Address"), _("Default Size"), _("Control Byte"), _("Enable")]
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- -#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SyncManagersTable(CustomTable):
def GetValue(self, row, col):
if row < self.GetNumberRows():
@@ -45,9 +45,9 @@
return self.data[row].get(self.GetColLabelValue(col, False), "")
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # EtherCAT Management Treebook
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class EtherCATManagementTreebook(wx.Treebook):
def __init__(self, parent, controler, node_editor):
@@ -91,9 +91,9 @@
sel = event.GetSelection()
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- -#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SlaveStatePanelClass(wx.Panel):
def __init__(self, parent, controler):
@@ -306,9 +306,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For SDO Management Panel
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SDOPanelClass(wx.Panel):
def __init__(self, parent, controler):
@@ -446,8 +446,8 @@
@return result : output data after check
# string.printable is print this result
- #'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
- #!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c
+ # '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + # !"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c allow_range = string.printable
for i in range(0, len(check_string)):
@@ -458,9 +458,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For SDO Notebook (divide category)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SDONoteBook(wx.Notebook):
def __init__(self, parent, controler):
@@ -518,9 +518,9 @@
sel = self.GetSelection()
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For SDO Grid (fill index, subindex, etc...)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SlaveSDOTable(wx.grid.Grid):
def __init__(self, parent, data):
@@ -664,11 +664,11 @@
self.Controler.CommonMethod.CreateErrorDialog('You can input only hex, dec value')
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For PDO Monitoring Panel
# PDO Class UI : Panel -> Choicebook (RxPDO, TxPDO) ->
# Notebook (PDO Index) -> Grid (PDO entry)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class PDOPanelClass(wx.Panel):
def __init__(self, parent, controler):
@@ -699,9 +699,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For PDO Choicebook (divide Tx, Rx PDO)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class PDOChoicebook(wx.Choicebook):
def __init__(self, parent, controler):
@@ -733,9 +733,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For PDO Notebook (divide PDO index)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class PDONoteBook(wx.Notebook):
def __init__(self, parent, name, controler):
@@ -790,9 +790,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For PDO Grid (fill entry index, subindex etc...)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class PDOEntryTable(wx.grid.Grid):
def __init__(self, parent, info, entry, count):
@@ -862,10 +862,10 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For EEPROM Access Main Panel
# (This class explain EEPROM Access)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class EEPROMAccessPanel(wx.Panel):
def __init__(self, parent, controler):
@@ -885,9 +885,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- -#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SlaveSiiSmartView(wx.Panel):
def __init__(self, parent, controler):
@@ -1163,9 +1163,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Smart View TreeListCtrl
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SmartViewTreeListCtrl(wx.Panel):
def __init__(self, parent, Controler):
@@ -1229,10 +1229,10 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # shows EEPROM binary as hex data and characters.
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- def __init__(self, parent, controler):
@@ -1370,9 +1370,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Hex View grid (fill hex data)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class SiiGridTable(wx.grid.Grid):
def __init__(self, parent, controler, row, col):
@@ -1422,9 +1422,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Register Access Panel
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class RegisterAccessPanel(wx.Panel):
def __init__(self, parent, controler):
@@ -1494,9 +1494,9 @@
Get data from the register.
self.Controler.CommonMethod.RegData = ""
- #ex : ethercat reg_read -p 0 0x0000 0x0001
+ # ex : ethercat reg_read -p 0 0x0000 0x0001 self.Controler.CommonMethod.RegData = self.Controler.CommonMethod.RegData + " " + self.Controler.CommonMethod.RegRead("0x"+"{:0>4x}".format(index*1024), "0x0400")
@@ -1783,9 +1783,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Register Access Notebook (divide index range)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class RegisterNotebook(wx.Notebook):
def __init__(self, parent, controler):
@@ -1825,10 +1825,10 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Register Access Notebook Panel
# (Main UI : including main, sub table)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class RegisterNotebookPanel(wx.Panel):
def __init__(self, parent, controler, row, col):
@@ -1894,9 +1894,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Register Access Notebook Panel (Main Table)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class RegisterMainTable(wx.grid.Grid):
def __init__(self, parent, row, col, controler):
@@ -2045,9 +2045,9 @@
self.Controler.CommonMethod.CreateErrorDialog('You entered wrong value. You can enter dec or hex value only.')
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # For Register Access Notebook Panel (Sub Table)
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class RegisterSubTable(wx.grid.Grid):
def __init__(self, parent, row, col):
@@ -2091,9 +2091,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- -#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- class MasterStatePanelClass(wx.Panel):
def __init__(self, parent, controler):
--- a/etherlab/EthercatMaster.py Fri Sep 28 17:20:11 2018 +0300
+++ b/etherlab/EthercatMaster.py Fri Sep 28 17:48:10 2018 +0300
@@ -34,9 +34,9 @@
-#--------------------------------------------------
+# -------------------------------------------------- # Remote Exec Etherlab Commands
-#--------------------------------------------------
+# -------------------------------------------------- @@ -64,9 +64,9 @@
-#--------------------------------------------------
+# -------------------------------------------------- # Etherlab Specific Blocks Library
-#--------------------------------------------------
+# -------------------------------------------------- def GetLocalPath(filename):
return os.path.join(os.path.split(__file__)[0], filename)
@@ -89,9 +89,9 @@
return ((["etherlab_ext"], [(Gen_etherlabfile_path, IECCFLAGS)], True), "",
("runtime_etherlab.py", file(GetLocalPath("runtime_etherlab.py"))))
-#--------------------------------------------------
+# -------------------------------------------------- -#--------------------------------------------------
+# -------------------------------------------------- EtherCATConfigParser = GenerateParserFromXSD(os.path.join(os.path.dirname(__file__), "EtherCATConfig.xsd"))
@@ -571,7 +571,6 @@
device, module_extra_params = self.GetModuleInfos(type_infos)
entries = device.GetEntriesList(limits)
entries_list = entries.items()
@@ -770,9 +769,9 @@
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- # Current Buffering Management Functions
-#-------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------- Return a copy of the config