# HG changeset patch # User greg # Date 1205425837 -3600 # Node ID f37abf3ee358708d119321344fc1db3e16b6354d # Parent 43cd3ef83a1f048f3a9f728e00fdd552177a724d added to helpmenu : about + plcopen + plcopeneditor removed old docpf.py and use now docutils diff -r 43cd3ef83a1f -r f37abf3ee358 Images/aboutlogo.png Binary file Images/aboutlogo.png has changed diff -r 43cd3ef83a1f -r f37abf3ee358 PLCOpenEditor.py --- a/PLCOpenEditor.py Thu Mar 13 10:20:23 2008 +0100 +++ b/PLCOpenEditor.py Thu Mar 13 17:30:37 2008 +0100 @@ -35,11 +35,14 @@ from RessourceEditor import * from DataTypeEditor import * from PLCControler import * -from plcopen import OpenPDFDoc from plcopen.structures import LOCATIONDATATYPES import os, re, platform, sys, time, traceback, getopt +base_folder = os.path.split(sys.path[0])[0] +sys.path.append(base_folder) +from docutils import * + __version__ = "$Revision$" CWD = os.path.split(os.path.realpath(__file__))[0] @@ -270,12 +273,14 @@ kind=wx.ITEM_NORMAL, text=u'PLCOpenEditor\tF1') AppendMenu(parent, help='', id=wx.ID_HELP_CONTENTS, kind=wx.ITEM_NORMAL, text=u'PLCOpen\tF2') - AppendMenu(parent, help='', id=wx.ID_HELP_CONTEXT, - kind=wx.ITEM_NORMAL, text=u'IEC 61131-3\tF3') + #AppendMenu(parent, help='', id=wx.ID_HELP_CONTEXT, + # kind=wx.ITEM_NORMAL, text=u'IEC 61131-3\tF3') if self.ModeSolo: AppendMenu(parent, help='', id=wx.ID_ABOUT, kind=wx.ITEM_NORMAL, text=u'About') - self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, id=wx.ID_ABOUT) + self.Bind(wx.EVT_MENU, self.OnPLCOpenEditorMenu, id=wx.ID_HELP) + self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, id=wx.ID_HELP_CONTENTS) + self.Bind(wx.EVT_MENU, self.OnAboutMenu, id=wx.ID_ABOUT) def _init_utils(self): self.MenuBar = wx.MenuBar() @@ -1936,15 +1941,20 @@ self.RefreshEditMenu() self.RefreshProjectTree() event.Skip() - + + def OnPLCOpenEditorMenu(self, event): + wx.MessageBox("No documentation available.\nComing soon.") + event.Skip() + def OnPLCOpenMenu(self, event): - result = OpenPDFDoc() - if type(result) == StringType: - message = wx.MessageDialog(self, result, "ERROR", wx.OK|wx.ICON_ERROR) - message.ShowModal() - message.Destroy() - event.Skip() - + open_pdf(os.path.join(CWD, "plcopen", "TC6_XML_V101.pdf")) + event.Skip() + + def OnAboutMenu(self, event): + OpenHtmlFrame(self,"About PLCOpenEditor", os.path.join(CWD, "doc","about.html"), wx.Size(350, 350)) + event.Skip() + + current_num = 0 def GetNewNum(): global current_num diff -r 43cd3ef83a1f -r f37abf3ee358 doc/about.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/about.html Thu Mar 13 17:30:37 2008 +0100 @@ -0,0 +1,21 @@ + + +
+ +

+The PLCopen Editor saves and loads XML projects,
accordingly to PLCopen TC6-XML Schemes.
+

+More informations on : +http://www.beremiz.org/ +

+ + + Supported by LOLITech : + + + http://www.lolitech.fr + +
+
+ + \ No newline at end of file diff -r 43cd3ef83a1f -r f37abf3ee358 plcopen/__init__.py --- a/plcopen/__init__.py Thu Mar 13 10:20:23 2008 +0100 +++ b/plcopen/__init__.py Thu Mar 13 17:30:37 2008 +0100 @@ -31,4 +31,3 @@ from plcopen import VarOrder from structures import * -from docpdf import * \ No newline at end of file diff -r 43cd3ef83a1f -r f37abf3ee358 plcopen/docpdf.py --- a/plcopen/docpdf.py Thu Mar 13 10:20:23 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -#This file is part of PLCOpenEditor, a library implementing an IEC 61131-3 editor -#based on the plcopen standard. -# -#Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD -# -#See COPYING file for copyrights details. -# -#This library 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 2.1 of the License, or (at your option) any later version. -# -#This library 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 library; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# Package initialisation - -# plcopen module dynamically creates its classes - -import os - -def OpenPDFDoc(): - if not os.path.isfile("plcopen/TC6_XML_V101.pdf"): - return """No documentation file available.""" - try: - os.system("xpdf -remote PLCOpen plcopen/TC6_XML_V101.pdf &") - return True - except: - return """Check if xpdf is correctly installed on your computer""" \ No newline at end of file