From 7f57d6a95a62ef3f4c88dd572b7f9d7f45c4a022 Mon Sep 17 00:00:00 2001 From: lbessard Date: Wed, 21 Jun 2006 06:31:34 +0000 Subject: [PATCH] Add incremented index in Add Map Variable Remove jaxe from makefile and configure --- configure | 16 ----- objdictgen/Makefile.in | 29 ++------- objdictgen/nodemanager.py | 10 ++++ objdictgen/objdictedit.py | 122 +++++++++++++++++++++----------------- 4 files changed, 82 insertions(+), 95 deletions(-) diff --git a/configure b/configure index 4d3bf02..bd10242 100755 --- a/configure +++ b/configure @@ -101,8 +101,6 @@ while [ $# -ge 1 ]; do --timers=*) SUB_TIMERS_DRIVER=$optarg;; --disable-Ox) DISABLE_OPT=1; echo "On user request: Won't optimize with \"-Ox\"";; - --enable-jaxe) DISABLE_JAXE=0; - echo "On user request: Will not install jaxe";; --debug) DEBUG=1; echo "Debug messages enabled !!";; --debugPDO) DEBUG=PDO; @@ -135,7 +133,6 @@ while [ $# -ge 1 ]; do echo " --led=foo Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')" echo " --nvram=foo Use 'foo' as NVRAM driver (use 'none' to disable or 'file')" echo " --disable-Ox Disable gcc \"-Ox\" optimizations." - echo " --enable-jaxe Enable \"jaxe\" installation." echo " --debug Enable debug messages." echo " --debugPDO Enable debug messages, using PDO." echo " --enable-lss Enable Auto Baudrate detect Feature" @@ -153,18 +150,6 @@ while [ $# -ge 1 ]; do shift done -if [ "$DISABLE_JAXE" = "1" ]; then - SUB_OPT_JAXE= -else - which java >/dev/null 2>&1 - if (( $? )); then - SUB_OPT_JAXE= - echo "Could not find java VM ! Jaxe XML editor disabled !" - else - SUB_OPT_JAXE=jaxe - fi -fi - ########################################################################### # GUESS OS/ARCH # ########################################################################### @@ -718,7 +703,6 @@ for makefile_in in $MAKEFILES; do s:SUB_OPT_CFLAGS:${SUB_OPT_CFLAGS}: s:SUB_TARGET:${SUB_TARGET}: s:SUB_BINUTILS_PREFIX:${SUB_BINUTILS_PREFIX}: - s:SUB_OPT_JAXE:${SUB_OPT_JAXE}: s:SUB_LSS_ENABLE:${SUB_LSS_ENABLE}: s:SUB_LED_ENABLE:${SUB_LED_ENABLE}: s:SUB_NVRAM_ENABLE:${SUB_NVRAM_ENABLE}: diff --git a/objdictgen/Makefile.in b/objdictgen/Makefile.in index 06c9d0b..25283be 100644 --- a/objdictgen/Makefile.in +++ b/objdictgen/Makefile.in @@ -22,11 +22,8 @@ # PREFIX = SUB_PREFIX -INSTALL_JAXE = SUB_OPT_JAXE -all: jaxe gnosis - -jaxe: jaxe-unix-2.2.tar.gz +all: gnosis gnosis: Gnosis_Utils-1.2.1.tar.gz @@ -36,37 +33,23 @@ Gnosis_Utils-1.2.1.tar.gz: mv Gnosis_Utils-1.2.1/gnosis . rm -rf Gnosis_Utils-1.2.1 -jaxe-unix-2.2.tar.gz: -ifeq ($(INSTALL_JAXE),jaxe) - wget http://dl.sourceforge.net/sourceforge/jaxe/jaxe-unix-2.2.tar.gz - tar xfz jaxe-unix-2.2.tar.gz -endif - -install: jaxe +install: gnosis cp -r ../objdictgen $(PREFIX)/ -ifeq ($(INSTALL_JAXE),jaxe) - rm -f $(PREFIX)/objdictgen/jaxe-unix-2.2.tar.gz -endif - rm -f $(PREFIX)/objdictgen/Gnosis_Utils-current.tar.gz + rm -f $(PREFIX)/objdictgen/Gnosis_Utils-1.2.1.tar.gz chmod -R a+r $(PREFIX)/objdictgen - chmod 755 $(PREFIX)/objdictgen/objdictedit.sh - echo -e "#!/bin/sh\n pushd $(PREFIX)/objdictgen/\n ./objdictedit.sh\n popd\n" > $(PREFIX)/bin/objdictedit - chmod 755 $(PREFIX)/bin/objdictedit + ln -s $(PREFIX)/objdictgen/objdictedit.py $(PREFIX)/bin/objdictedit + chmod 755 $(PREFIX)/objdictgen/objdictedit.py ln -s $(PREFIX)/objdictgen/objdictgen.py $(PREFIX)/bin/objdictgen chmod 755 $(PREFIX)/objdictgen/objdictgen.py uninstall: -rm -rf $(PREFIX)/objdictgen + -rm -f $(PREFIX)/bin/objdictedit -rm -f $(PREFIX)/bin/objdictgen - -rm -f $(PREFIX)/bin/objdictgen.py clean: mrproper: clean -ifeq ($(INSTALL_JAXE),jaxe) - -rm -f jaxe-unix-2.2.tar.gz - -rm -rf jaxe -endif -rm -f Gnosis_Utils-1.2.1.tar.gz -rm -rf gnosis diff --git a/objdictgen/nodemanager.py b/objdictgen/nodemanager.py index 83d9bb9..4cf64c3 100755 --- a/objdictgen/nodemanager.py +++ b/objdictgen/nodemanager.py @@ -969,6 +969,16 @@ class NodeManager: current.append(index) return dictionary, current + def GetCurrentNextMapIndex(self): + if self.CurrentNode: + index = 0x2000 + while self.CurrentNode.IsEntry(index) and index < 0x5FFF: + index += 1 + if index < 0x6000: + return index + else: + return None + def CurrentDS302Defined(self): if self.CurrentNode: return len(self.CurrentNode.GetDS302Profile()) > 0 diff --git a/objdictgen/objdictedit.py b/objdictgen/objdictedit.py index 0838606..a30be84 100755 --- a/objdictgen/objdictedit.py +++ b/objdictgen/objdictedit.py @@ -32,7 +32,7 @@ import wx.grid from types import * import os, re, platform, sys, time, traceback, getopt -__version__ = "$Revision: 1.3 $" +__version__ = "$Revision: 1.4 $" from nodemanager import * from node import OD_Subindex,OD_MultipleSubindexes,OD_IdenticalSubindexes,OD_IdenticalIndexes @@ -1418,18 +1418,25 @@ class objdictedit(wx.Frame): #------------------------------------------------------------------------------- def AddMapVariable(self): - dialog = MapVariableDialog(self) - if dialog.ShowModal() == wxID_OK: - index, name, struct, number = dialog.GetValues() - result = self.Manager.AddMapVariableToCurrent(index, name, struct, number) - if type(result) != StringType: - self.RefreshBufferState() - self.RefreshCurrentIndexList() - else: - message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) - message.ShowModal() - message.Destroy() - dialog.Destroy() + index = self.Manager.GetCurrentNextMapIndex() + if index: + dialog = MapVariableDialog(self) + dialog.SetIndex(index) + if dialog.ShowModal() == wxID_OK: + index, name, struct, number = dialog.GetValues() + result = self.Manager.AddMapVariableToCurrent(index, name, struct, number) + if type(result) != StringType: + self.RefreshBufferState() + self.RefreshCurrentIndexList() + else: + message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) + message.ShowModal() + message.Destroy() + dialog.Destroy() + else: + message = wxMessageDialog(self, result, "No map variable index left!", wxOK|wxICON_ERROR) + message.ShowModal() + message.Destroy() def AddUserType(self): dialog = UserTypeDialog(self) @@ -1634,43 +1641,43 @@ class MapVariableDialog(wx.Dialog): label='Index :', name='staticText1', parent=self.MainPanel, pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) + self.Index = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEX, name='Index', + parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(152, + 25), style=0, value='0x2000') + + self.staticText3 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT3, + label='Name :', name='staticText3', parent=self.MainPanel, + pos=wx.Point(24, 80), size=wx.Size(47, 17), style=0) + + self.IndexName = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEXNAME, + name='IndexName', parent=self.MainPanel, pos=wx.Point(24, 104), + size=wx.Size(152, 24), style=0, value='Undefined') + + self.staticText2 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT2, + label='Type :', name='staticText2', parent=self.MainPanel, + pos=wx.Point(208, 24), size=wx.Size(38, 17), style=0) + self.radioButton1 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON1, label='VAR', name='radioButton1', parent=self.MainPanel, - pos=wx.Point(208, 48), size=wx.Size(72, 24), style=0) + pos=wx.Point(208, 48), size=wx.Size(72, 24), style=wxRB_GROUP) self.radioButton1.SetValue(True) self.radioButton1.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton1Click, id=wxID_MAPVARIABLEDIALOGRADIOBUTTON1) self.radioButton2 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON2, - label='REC', name='radioButton2', parent=self.MainPanel, - pos=wx.Point(208, 96), size=wx.Size(96, 24), style=0) + label='ARRAY', name='radioButton2', parent=self.MainPanel, + pos=wx.Point(208, 72), size=wx.Size(80, 24), style=wxRB_SINGLE) self.radioButton2.SetValue(False) self.radioButton2.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton2Click, id=wxID_MAPVARIABLEDIALOGRADIOBUTTON2) self.radioButton3 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON3, - label='ARRAY', name='radioButton3', parent=self.MainPanel, - pos=wx.Point(208, 72), size=wx.Size(80, 24), style=0) + label='REC', name='radioButton3', parent=self.MainPanel, + pos=wx.Point(208, 96), size=wx.Size(96, 24), style=wxRB_SINGLE) self.radioButton3.SetValue(False) self.radioButton3.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton3Click, id=wxID_MAPVARIABLEDIALOGRADIOBUTTON3) - self.staticText2 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT2, - label='Type :', name='staticText2', parent=self.MainPanel, - pos=wx.Point(208, 24), size=wx.Size(38, 17), style=0) - - self.IndexName = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEXNAME, - name='IndexName', parent=self.MainPanel, pos=wx.Point(24, 104), - size=wx.Size(152, 24), style=0, value='Undefined') - - self.staticText3 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT3, - label='Name :', name='staticText3', parent=self.MainPanel, - pos=wx.Point(24, 80), size=wx.Size(47, 17), style=0) - - self.Index = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEX, name='Index', - parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(152, - 25), style=0, value='0x2000') - self.staticText4 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT4, label='Number :', name='staticText4', parent=self.MainPanel, pos=wx.Point(312, 80), size=wx.Size(88, 16), style=0) @@ -1688,6 +1695,9 @@ class MapVariableDialog(wx.Dialog): self.staticText4.Enable(False) self.Number.Enable(False) + def SetIndex(self, index): + self.Index.SetValue("0x%04X"%index) + def GetValues(self): if self.radioButton1.GetValue(): struct = 1 @@ -1701,20 +1711,20 @@ class MapVariableDialog(wx.Dialog): return index, name, struct, number def OnRadioButton1Click(self, event): - self.staticText4.Enable(False) - self.Number.Enable(False) + self.EnableNumberTyping(False) event.Skip() def OnRadioButton2Click(self, event): - self.staticText4.Enable(True) - self.Number.Enable(True) + self.EnableNumberTyping(True) event.Skip() def OnRadioButton3Click(self, event): - self.staticText4.Enable(True) - self.Number.Enable(True) + self.EnableNumberTyping(True) event.Skip() + def EnableNumberTyping(self, enable): + self.staticText4.Enable(enable) + self.Number.Enable(enable) #------------------------------------------------------------------------------- @@ -1759,6 +1769,12 @@ class UserTypeDialog(wx.Dialog): label='Type :', name='staticText1', parent=self.MainPanel, pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) + self.Type = wx.Choice(choices=[], id=wxID_USERTYPEDIALOGTYPE, + name='Type', parent=self.MainPanel, pos=wx.Point(24, 48), + size=wx.Size(160, 24), style=0) + self.Type.Bind(wx.EVT_CHOICE, self.OnTypeChoice, + id=wxID_USERTYPEDIALOGTYPE) + self.staticBox1 = wx.StaticBox(id=wxID_USERTYPEDIALOGSTATICBOX1, label='Values', name='staticBox1', parent=self.MainPanel, pos=wx.Point(200, 24), size=wx.Size(224, 144), style=0) @@ -1787,12 +1803,6 @@ class UserTypeDialog(wx.Dialog): parent=self.MainPanel, pos=wx.Point(296, 128), size=wx.Size(112, 25), style=wx.TE_RIGHT, value='0') - self.Type = wx.Choice(choices=[], id=wxID_USERTYPEDIALOGTYPE, - name='Type', parent=self.MainPanel, pos=wx.Point(24, 48), - size=wx.Size(160, 24), style=0) - self.Type.Bind(wx.EVT_CHOICE, self.OnTypeChoice, - id=wxID_USERTYPEDIALOGTYPE) - self._init_sizers() def __init__(self, parent): @@ -1905,25 +1915,25 @@ class NodeInfosDialog(wx.Dialog): label='Name :', name='staticText1', parent=self.MainPanel, pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) + self.Name = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNAME, name='Name', + parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(200, + 25), style=0, value='') + self.staticText2 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT2, label='Node ID :', name='staticText2', parent=self.MainPanel, pos=wx.Point(24, 80), size=wx.Size(67, 17), style=0) + self.NodeID = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNODEID, name='NodeID', + parent=self.MainPanel, pos=wx.Point(24, 104), size=wx.Size(200, + 25), style=wx.TE_RIGHT, value='') + self.staticText3 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT3, label='Type :', name='staticText3', parent=self.MainPanel, pos=wx.Point(24, 136), size=wx.Size(71, 17), style=0) self.Type = wx.Choice(choices=[], id=wxID_NODEINFOSDIALOGTYPE, name='Type', parent=self.MainPanel, pos=wx.Point(24, 160), - size=wx.Size(200, 24), style=0) - - self.Name = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNAME, name='Name', - parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(200, - 25), style=0, value='') - - self.NodeID = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNODEID, name='NodeID', - parent=self.MainPanel, pos=wx.Point(24, 104), size=wx.Size(200, - 25), style=wx.TE_RIGHT, value='') + size=wx.Size(200, 25), style=0) self.staticText4 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT4, label='Profile :', name='staticText4', parent=self.MainPanel, @@ -1931,7 +1941,7 @@ class NodeInfosDialog(wx.Dialog): self.Profile = wx.Choice(choices=[], id=wxID_NODEINFOSDIALOGPROFILE, name='Profile', parent=self.MainPanel, pos=wx.Point(24, 216), - size=wx.Size(200, 24), style=0) + size=wx.Size(200, 25), style=0) self._init_sizers() -- 2.39.2