# HG changeset patch # User nico # Date 1181061801 -7200 # Node ID 6b5a4c21e061b72fabff8a650483aa48f02205d7 # Parent 2cb34a4ac65ad2f2cd4c853c797bb157c71418f5 Manual and Documentation finish diff -r 2cb34a4ac65a -r 6b5a4c21e061 Makefile.in --- a/Makefile.in Tue Jun 05 17:34:33 2007 +0200 +++ b/Makefile.in Tue Jun 05 18:43:21 2007 +0200 @@ -26,16 +26,11 @@ examples: canfestival driver $(MAKE) -C examples all -documentation: - echo Doxygen generation!! - doxygen doc/doxygen/Doxyfile +documentation: + $(MAKE) -C doc/doxygen manual: - cd doc/manual/en && \ - pdflatex manual.tex && \ - pdflatex manual.tex && \ - rm manual.aux manual.log manual.out manual.toc && \ - xpdf manual.pdf + $(MAKE) -C doc/manual objdictgen: $(MAKE) -C objdictgen all diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/code_debug.txt --- a/doc/code_debug.txt Tue Jun 05 17:34:33 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ - -# Debug and warning codes -------------------------- - -Errors are managed by the macro -MSG_ERR(nbr, string, value) - -Warnings and Informations are managed by the macro -MSG_WAR(nbr, string, value) - - - -The format of nbr -++++++++++++++++++++ -16 bits, writen in hexadecimal: 0xtfxx - -t : 1 -> Error - 2 -> Warning - 3 -> Information - -f : 0 -> In file sync.c - 1 -> lifegrd.c - 2 -> objacces.c - 3 -> timer.c - 4 -> nmtSlave.c - 5 -> nmtMaster.c - 6 -> canOpenDriver.c, interrupt.c, variahw.c (errors nb 20 .. 30) - 7 -> initObjdict.c - 8 -> Maps_module_utilisé.cpp - 9 -> pdo.c - A -> sdo.c - B -> objacces.c - D -> user's application - E -> user's application - F -> user's application - -xx : a number - - -The format of string -++++++++++++++++++++ -A string, ended by a space, whithout a newline - -The format of value -++++++++++++++++++++ -Unsigned 32 bits or less - - - diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/doxygen/Doxyfile --- a/doc/doxygen/Doxyfile Tue Jun 05 17:34:33 2007 +0200 +++ b/doc/doxygen/Doxyfile Tue Jun 05 18:43:21 2007 +0200 @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- PROJECT_NAME = CanFestival PROJECT_NUMBER = 3 -OUTPUT_DIRECTORY = ./doc/doxygen +OUTPUT_DIRECTORY = ./ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO @@ -72,7 +72,7 @@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ./src +INPUT = ./../../src FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py *.C *.CC *.C++ *.II *.I++ *.H *.HH *.H++ *.CS *.PHP *.PHP3 *.M *.MM *.PY RECURSIVE = YES EXCLUDE = @@ -125,7 +125,7 @@ #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -GENERATE_LATEX = YES +GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/doxygen/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/doxygen/Makefile Tue Jun 05 18:43:21 2007 +0200 @@ -0,0 +1,29 @@ +#! gmake + +# +# Copyright (C) 2006 Nicolas GRANDEMANGE +# +# This file is part of canfestival, a library implementing the canopen +# stack +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser 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 +# + +documentation: + echo "Doxygen generation!!" + rm -rf html + doxygen Doxyfile + firefox html/index.html& + diff -r 2cb34a4ac65a -r 6b5a4c21e061 doc/doxygen/html/DS301__index_8py-source.html --- a/doc/doxygen/html/DS301__index_8py-source.html Tue Jun 05 17:34:33 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - -
-00001 #!/usr/bin/env python -00002 # -*- coding: utf-8 -*- -00003 -00004 import os -00005 -00006 DS301_PDF_INDEX = {0x1000: 86, 0x1001: 87, 0x1002: 87, 0x1003: 88, 0x1005: 89, 0x1006: 90, 0x1007: 90, 0x1008: 91, 0x1009: 91, 0x100A: 91, 0x100C: 92, 0x100D: 92, 0x1010: 92, 0x1011: 94, 0x1012: 97, 0x1013: 98, 0x1014: 98, 0x1015: 99, 0x1016: 100, 0x1017: 101, 0x1018: 101, 0x1020: 117, 0x1200: 103, 0x1201: 103, 0x1280: 105, 0x1400: 106, 0x1600: 109, 0x1800: 111, 0x1A00: 112} -00007 -00008 def OpenPDFDocIndex(index, cwd): -00009 if not os.path.isfile(os.path.join(cwd, "doc/301_v04000201.pdf")): -00010 return """No documentation file available. -00011 Please read can festival documentation to know how to obtain one.""" -00012 try: -00013 if index in DS301_PDF_INDEX: -00014 os.system("xpdf -remote DS301 %s %d &"%(os.path.join(cwd, "doc/301_v04000201.pdf"), DS301_PDF_INDEX[index])) -00015 else: -00016 os.system("xpdf -remote DS301 %s &"%os.path.join(cwd, "doc/301_v04000201.pdf")) -00017 return True -00018 except: -00019 return """Check if xpdf is correctly installed on your computer""" -00020 -
-Go to the source code of this file.
Namespaces | |
namespace | doc_index::DS301_index |
Functions | |
def | doc_index::DS301_index::OpenPDFDocIndex |
#include "Master.h"
#include "Slave.h"
#include "TestMasterSlave.h"
Functions | |
void | TestMaster_heartbeatError (UNS8 heartbeatID) |
void | TestMaster_initialisation () |
static void | ConfigureSlaveNode (CO_Data *d, UNS8 nodeId) |
static void | CheckSDOAndContinue (CO_Data *d, UNS8 nodeId) |
void | TestMaster_preOperational () |
void | TestMaster_operational () |
void | TestMaster_stopped () |
void | TestMaster_post_sync () |
void | TestMaster_post_TPDO () |
Variables | |
static | init_step = 0 |
char | query_result = 0 |
char | waiting_answer = 0 |
static void CheckSDOAndContinue | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | - [static] |
-
- -
static void ConfigureSlaveNode | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | - [static] |
-
- -
void TestMaster_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
- -
void TestMaster_initialisation | -( | -void | -- | ) | -- |
- -
void TestMaster_operational | -( | -void | -- | ) | -- |
- -
void TestMaster_post_sync | -( | -void | -- | ) | -- |
- -
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
- -
void TestMaster_preOperational | -( | -void | -- | ) | -- |
- -
void TestMaster_stopped | -( | -void | -- | ) | -- |
- -
-
init_step = 0 [static] |
-
- -
char query_result = 0 | -
- -
char waiting_answer = 0 | -
- -
-
#include "TestMaster.h"
Functions | |
void | TestMaster_heartbeatError (UNS8) |
UNS8 | TestMaster_canSend (Message *) |
void | TestMaster_initialisation (void) |
void | TestMaster_preOperational (void) |
void | TestMaster_operational (void) |
void | TestMaster_stopped (void) |
void | TestMaster_post_sync (void) |
void | TestMaster_post_TPDO (void) |
UNS8 TestMaster_canSend | -( | -Message * | -- | ) | -- |
- -
void TestMaster_heartbeatError | -( | -UNS8 | -- | ) | -- |
- -
void TestMaster_initialisation | -( | -void | -- | ) | -- |
- -
void TestMaster_operational | -( | -void | -- | ) | -- |
- -
void TestMaster_post_sync | -( | -void | -- | ) | -- |
- -
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
- -
void TestMaster_preOperational | -( | -void | -- | ) | -- |
- -
void TestMaster_stopped | -( | -void | -- | ) | -- |
- -
-
#include "Slave.h"
#include "Master.h"
#include "TestMasterSlave.h"
Functions | |
void | TestSlave_heartbeatError (UNS8 heartbeatID) |
void | TestSlave_initialisation () |
void | TestSlave_preOperational () |
void | TestSlave_operational () |
void | TestSlave_stopped () |
void | TestSlave_post_sync () |
void | TestSlave_post_TPDO () |
void | TestSlave_storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
void TestSlave_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
- -
void TestSlave_initialisation | -( | -void | -- | ) | -- |
- -
void TestSlave_operational | -( | -void | -- | ) | -- |
- -
void TestSlave_post_sync | -( | -void | -- | ) | -- |
- -
void TestSlave_post_TPDO | -( | -void | -- | ) | -- |
- -
void TestSlave_preOperational | -( | -void | -- | ) | -- |
- -
void TestSlave_stopped | -( | -void | -- | ) | -- |
- -
void TestSlave_storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
- -
-
#include "TestSlave.h"
Functions | |
void | TestSlave_heartbeatError (UNS8) |
UNS8 | TestSlave_canSend (Message *) |
void | TestSlave_initialisation (void) |
void | TestSlave_preOperational (void) |
void | TestSlave_operational (void) |
void | TestSlave_stopped (void) |
void | TestSlave_post_sync (void) |
void | TestSlave_post_TPDO (void) |
void | TestSlave_storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
UNS8 TestSlave_canSend | -( | -Message * | -- | ) | -- |
- -
void TestSlave_heartbeatError | -( | -UNS8 | -- | ) | -- |
- -
void TestSlave_initialisation | -( | -void | -- | ) | -- |
- -
void TestSlave_operational | -( | -void | -- | ) | -- |
- -
void TestSlave_post_sync | -( | -void | -- | ) | -- |
- -
void TestSlave_post_TPDO | -( | -void | -- | ) | -- |
- -
void TestSlave_preOperational | -( | -void | -- | ) | -- |
- -
void TestSlave_stopped | -( | -void | -- | ) | -- |
- -
void TestSlave_storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
- -
-
#include "TestMaster.h"
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
UNS8 DI1 = 0x0 | -
- -
UNS8 DI2 = 0x0 | -
- -
UNS8 DI3 = 0x0 | -
- -
UNS8 DI4 = 0x0 | -
- -
UNS8 DI5 = 0x0 | -
- -
UNS8 DI6 = 0x0 | -
- -
UNS8 DI7 = 0x0 | -
- -
UNS8 DI8 = 0x0 | -
- -
UNS8 DO = 0x0 | -
- -
UNS8 TestMaster_bDeviceNodeId = 0x01 | -
- -
UNS8 TestMaster_count_sync[1] = {0,} | -
- -
CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster) | -
- -
quick_index TestMaster_firstIndex | -
-Initial value:
{ - 0, - 6, - 7, - 8, - 9, - 10 -} -
TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,} | -
- -
UNS8 TestMaster_highestSubIndex_obj1016 = 1 | -
- -
UNS8 TestMaster_highestSubIndex_obj1018 = 4 | -
- -
UNS8 TestMaster_highestSubIndex_obj1280 = 3 | -
- -
UNS8 TestMaster_highestSubIndex_obj1400 = 5 | -
- -
UNS8 TestMaster_highestSubIndex_obj1600 = 8 | -
- -
UNS8 TestMaster_highestSubIndex_obj1800 = 5 | -
- -
UNS8 TestMaster_highestSubIndex_obj1A00 = 1 | -
- -
const UNS8 TestMaster_iam_a_slave = 0 | -
- -
subindex TestMaster_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } - } -
subindex TestMaster_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } - } -
subindex TestMaster_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } - } -
ODCallback_t TestMaster_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestMaster_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } - } -
ODCallback_t TestMaster_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestMaster_Index1016[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } - } -
subindex TestMaster_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } - } -
subindex TestMaster_Index1280[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, - { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } - } -
subindex TestMaster_Index1400[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } - } -
subindex TestMaster_Index1600[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] } - } -
subindex TestMaster_Index1800[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1800 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1800_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Event_Timer } - } -
subindex TestMaster_Index1A00[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1A00 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1A00[0] } - } -
subindex TestMaster_Index2000[] | -
subindex TestMaster_Index200F[] | -
subindex TestMaster_Index2010[] | -
subindex TestMaster_Index2011[] | -
subindex TestMaster_Index2012[] | -
subindex TestMaster_Index2013[] | -
subindex TestMaster_Index2014[] | -
subindex TestMaster_Index2015[] | -
subindex TestMaster_Index2016[] | -
quick_index TestMaster_lastIndex | -
-Initial value:
{ - 0, - 6, - 7, - 8, - 9, - 10 -} -
UNS32 TestMaster_obj1000 = 0x191 | -
- -
UNS8 TestMaster_obj1001 = 0x0 | -
- -
UNS32 TestMaster_obj1005 = 0x40000080 | -
- -
UNS32 TestMaster_obj1006 = 0xC350 | -
- -
UNS32 TestMaster_obj1016[] | -
-Initial value:
- { - 0x4005DC - } -
UNS16 TestMaster_obj1017 = 0x0 | -
- -
UNS32 TestMaster_obj1018_Product_Code = 0x0 | -
- -
UNS32 TestMaster_obj1018_Revision_Number = 0x0 | -
- -
UNS32 TestMaster_obj1018_Serial_Number = 0x0 | -
- -
UNS32 TestMaster_obj1018_Vendor_ID = 0x0 | -
- -
UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x640 | -
- -
UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x5C0 | -
- -
INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x40 | -
- -
UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x220 | -
- -
UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0 | -
- -
UNS16 TestMaster_obj1400_Event_Timer = 0x0 | -
- -
UNS16 TestMaster_obj1400_Inhibit_Time = 0x0 | -
- -
UNS8 TestMaster_obj1400_Transmission_Type = 0x1 | -
- -
UNS32 TestMaster_obj1600[] | -
-Initial value:
- { - 0x200F0001, - 0x20100001, - 0x20110001, - 0x20120001, - 0x20130001, - 0x20140001, - 0x20150001, - 0x20160001 - } -
UNS32 TestMaster_obj1800_COB_ID_used_by_PDO = 0x240 | -
- -
UNS8 TestMaster_obj1800_Compatibility_Entry = 0x0 | -
- -
UNS16 TestMaster_obj1800_Event_Timer = 0x0 | -
- -
UNS16 TestMaster_obj1800_Inhibit_Time = 0x0 | -
- -
UNS8 TestMaster_obj1800_Transmission_Type = 0x1 | -
- -
UNS32 TestMaster_obj1A00[] | -
-Initial value:
- { - 0x20000008 - } -
const indextable TestMaster_objdict[] | -
-Initial value:
-{ - { (subindex*)TestMaster_Index1000,sizeof(TestMaster_Index1000)/sizeof(TestMaster_Index1000[0]), 0x1000}, - { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001}, - { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005}, - { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006}, - { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016}, - { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018}, - { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280}, - { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400}, - { (subindex*)TestMaster_Index1600,sizeof(TestMaster_Index1600)/sizeof(TestMaster_Index1600[0]), 0x1600}, - { (subindex*)TestMaster_Index1800,sizeof(TestMaster_Index1800)/sizeof(TestMaster_Index1800[0]), 0x1800}, - { (subindex*)TestMaster_Index1A00,sizeof(TestMaster_Index1A00)/sizeof(TestMaster_Index1A00[0]), 0x1A00}, - { (subindex*)TestMaster_Index2000,sizeof(TestMaster_Index2000)/sizeof(TestMaster_Index2000[0]), 0x2000}, - { (subindex*)TestMaster_Index200F,sizeof(TestMaster_Index200F)/sizeof(TestMaster_Index200F[0]), 0x200F}, - { (subindex*)TestMaster_Index2010,sizeof(TestMaster_Index2010)/sizeof(TestMaster_Index2010[0]), 0x2010}, - { (subindex*)TestMaster_Index2011,sizeof(TestMaster_Index2011)/sizeof(TestMaster_Index2011[0]), 0x2011}, - { (subindex*)TestMaster_Index2012,sizeof(TestMaster_Index2012)/sizeof(TestMaster_Index2012[0]), 0x2012}, - { (subindex*)TestMaster_Index2013,sizeof(TestMaster_Index2013)/sizeof(TestMaster_Index2013[0]), 0x2013}, - { (subindex*)TestMaster_Index2014,sizeof(TestMaster_Index2014)/sizeof(TestMaster_Index2014[0]), 0x2014}, - { (subindex*)TestMaster_Index2015,sizeof(TestMaster_Index2015)/sizeof(TestMaster_Index2015[0]), 0x2015}, - { (subindex*)TestMaster_Index2016,sizeof(TestMaster_Index2016)/sizeof(TestMaster_Index2016[0]), 0x2016}, -} -
UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]) | -
- -
-
#include "data.h"
Functions | |
UNS32 | TestMaster_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestMaster_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestMaster_Data |
UNS8 | DO |
UNS8 | DI1 |
UNS8 | DI2 |
UNS8 | DI3 |
UNS8 | DI4 |
UNS8 | DI5 |
UNS8 | DI6 |
UNS8 | DI7 |
UNS8 | DI8 |
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
UNS8 DI1 | -
- -
UNS8 DI2 | -
- -
UNS8 DI3 | -
- -
UNS8 DI4 | -
- -
UNS8 DI5 | -
- -
UNS8 DI6 | -
- -
UNS8 DI7 | -
- -
UNS8 DI8 | -
- -
UNS8 DO | -
- -
CO_Data TestMaster_Data | -
- -
-
#include <stdio.h>
#include "getopt.h"
#include <strings.h>
Defines | |
#define | GETOPT_INTERFACE_VERSION 2 |
#define | _(msgid) (msgid) |
#define | SWAP_FLAGS(ch1, ch2) |
#define | NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') |
Enumerations | |
enum | { REQUIRE_ORDER, -PERMUTE, -RETURN_IN_ORDER - } |
Functions | |
char * | getenv () |
static char * | my_index (char *str, int chr) const |
static void | exchange (char **argv) |
static const char * | _getopt_initialize (int argc, char *const *argv, const char *optstring) |
int | _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) |
int | getopt (int argc, char *const *argv, const char *optstring) |
Variables | |
char * | optarg |
int | optind = 1 |
int | __getopt_initialized |
static char * | nextchar |
int | opterr = 1 |
int | optopt = '?' |
static enum { ... } | ordering |
static char * | posixly_correct |
static int | first_nonopt |
static int | last_nonopt |
#define _ | -( | -msgid | -- | ) | -(msgid) | -
- -
#define GETOPT_INTERFACE_VERSION 2 | -
- -
#define SWAP_FLAGS | -( | -ch1, | |||
- | - | ch2 | -- | ) | -- |
- -
-
anonymous enum | -
-
static const char* _getopt_initialize | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | - [static] |
-
- -
int _getopt_internal | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring, | -|
- | - | const struct option * | -longopts, | -|
- | - | int * | -longind, | -|
- | - | int | -long_only | - |
- | ) | -- |
- -
static void exchange | -( | -char ** | -argv | -) | - [static] |
-
- -
char* getenv | -( | -- | ) | -- |
- -
int getopt | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | -- |
- -
static char* my_index | -( | -char * | -str, | -|
- | - | int | -chr | - |
- | ) | - const [static] |
-
- -
-
int __getopt_initialized | -
- -
int first_nonopt [static] |
-
- -
int last_nonopt [static] |
-
- -
char* nextchar [static] |
-
- -
char* optarg | -
- -
int opterr = 1 | -
- -
int optind = 1 | -
- -
int optopt = '?' | -
- -
enum { ... } ordering [static] |
-
- -
char* posixly_correct [static] |
-
- -
-
#include <ctype.h>
Data Structures | |
struct | option |
Defines | |
#define | _GETOPT_H 1 |
#define | no_argument 0 |
#define | required_argument 1 |
#define | optional_argument 2 |
Functions | |
int | getopt () |
int | getopt_long () |
int | getopt_long_only () |
int | _getopt_internal () |
Variables | |
char * | optarg |
int | optind |
int | opterr |
int | optopt |
#define _GETOPT_H 1 | -
- -
#define no_argument 0 | -
- -
#define optional_argument 2 | -
- -
#define required_argument 1 | -
- -
-
int _getopt_internal | -( | -- | ) | -- |
- -
int getopt | -( | -- | ) | -- |
- -
int getopt_long | -( | -- | ) | -- |
- -
int getopt_long_only | -( | -- | ) | -- |
- -
-
char* optarg | -
- -
int opterr | -
- -
int optind | -
- -
int optopt | -
- -
-
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include "canfestival.h"
#include "TestMasterMicroMod.h"
#include "TestMaster.h"
Functions | |
void | TestMaster_heartbeatError (UNS8 heartbeatID) |
void | TestMaster_initialisation () |
static void | ConfigureSlaveNode (CO_Data *d, UNS8 nodeId) |
static void | CheckSDOAndContinue (CO_Data *d, UNS8 nodeId) |
void | TestMaster_preOperational () |
void | TestMaster_operational () |
void | TestMaster_stopped () |
void | TestMaster_post_sync () |
void | TestMaster_post_TPDO () |
void | catch_signal (int sig) |
void | help () |
void | InitNodes (CO_Data *d, UNS32 id) |
int | main (int argc, char **argv) |
Variables | |
UNS8 | slavenodeid |
static | init_step = 0 |
s_BOARD | MasterBoard = {"32", "125K"} |
void catch_signal | -( | -int | -sig | -) | -- |
- -
static void CheckSDOAndContinue | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | - [static] |
-
- -
static void ConfigureSlaveNode | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | - [static] |
-
- -
void help | -( | -- | ) | -- |
- -
void InitNodes | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
- -
int main | -( | -int | -argc, | -|
- | - | char ** | -argv | - |
- | ) | -- |
- -
void TestMaster_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
- -
void TestMaster_initialisation | -( | -void | -- | ) | -- |
- -
void TestMaster_operational | -( | -void | -- | ) | -- |
- -
void TestMaster_post_sync | -( | -void | -- | ) | -- |
- -
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
- -
void TestMaster_preOperational | -( | -void | -- | ) | -- |
- -
void TestMaster_stopped | -( | -void | -- | ) | -- |
- -
-
init_step = 0 [static] |
-
- -
s_BOARD MasterBoard = {"32", "125K"} | -
- -
UNS8 slavenodeid | -
- -
-
#include "canfestival.h"
Defines | |
#define | eprintf(...) printf (__VA_ARGS__) |
#define eprintf | -( | -... | -- | ) | -printf (__VA_ARGS__) | -
- -
-
#include "TestMaster.h"
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
UNS8 MasterMap1 = 0x0 | -
- -
UNS32 MasterMap10 = 0x0 | -
- -
UNS16 MasterMap11 = 0x0 | -
- -
UNS8 MasterMap2 = 0x0 | -
- -
UNS8 MasterMap3 = 0x0 | -
- -
UNS8 MasterMap4 = 0x0 | -
- -
UNS8 MasterMap5 = 0x0 | -
- -
UNS8 MasterMap6 = 0x0 | -
- -
UNS8 MasterMap7 = 0x0 | -
- -
UNS8 MasterMap8 = 0x0 | -
- -
UNS8 MasterMap9 = 0x0 | -
- -
UNS8 TestMaster_bDeviceNodeId = 0x01 | -
- -
UNS8 TestMaster_count_sync[1] = {0,} | -
- -
CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster) | -
- -
quick_index TestMaster_firstIndex | -
-Initial value:
{ - 0, - 8, - 9, - 11, - 0, - 0 -} -
TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,} | -
- -
UNS8 TestMaster_highestSubIndex_obj1010 = 4 | -
- -
UNS8 TestMaster_highestSubIndex_obj1011 = 4 | -
- -
UNS8 TestMaster_highestSubIndex_obj1016 = 1 | -
- -
UNS8 TestMaster_highestSubIndex_obj1018 = 4 | -
- -
UNS8 TestMaster_highestSubIndex_obj1280 = 3 | -
- -
UNS8 TestMaster_highestSubIndex_obj1400 = 5 | -
- -
UNS8 TestMaster_highestSubIndex_obj1401 = 5 | -
- -
UNS8 TestMaster_highestSubIndex_obj1600 = 10 | -
- -
UNS8 TestMaster_highestSubIndex_obj1601 = 1 | -
- -
UNS8 TestMaster_highestSubIndex_obj1F22 = 2 | -
- -
const UNS8 TestMaster_iam_a_slave = 0 | -
- -
subindex TestMaster_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } - } -
subindex TestMaster_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } - } -
subindex TestMaster_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } - } -
ODCallback_t TestMaster_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestMaster_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } - } -
ODCallback_t TestMaster_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestMaster_Index1010[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1010 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_All_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Communication_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Application_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Manufacturer_Parameters } - } -
subindex TestMaster_Index1011[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1011 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_All_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters } - } -
subindex TestMaster_Index1016[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } - } -
subindex TestMaster_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } - } -
subindex TestMaster_Index1280[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, - { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } - } -
subindex TestMaster_Index1400[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } - } -
subindex TestMaster_Index1401[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1401 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1401_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Event_Timer } - } -
subindex TestMaster_Index1600[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[8] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[9] } - } -
subindex TestMaster_Index1601[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1601 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1601[0] } - } -
subindex TestMaster_Index1F22[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1F22 }, - { RW, domain, 0, (void*)&TestMaster_obj1F22[0] }, - { RW, domain, 13, (void*)&TestMaster_obj1F22[1] } - } -
subindex TestMaster_Index2000[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap1 } - } -
subindex TestMaster_Index2001[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap2 } - } -
subindex TestMaster_Index2002[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap3 } - } -
subindex TestMaster_Index2003[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap4 } - } -
subindex TestMaster_Index2004[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap5 } - } -
subindex TestMaster_Index2005[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap6 } - } -
subindex TestMaster_Index2006[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap7 } - } -
subindex TestMaster_Index2007[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap8 } - } -
subindex TestMaster_Index2008[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&MasterMap9 } - } -
subindex TestMaster_Index2009[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&MasterMap10 } - } -
subindex TestMaster_Index200A[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&MasterMap11 } - } -
quick_index TestMaster_lastIndex | -
-Initial value:
{ - 0, - 8, - 10, - 12, - 0, - 0 -} -
UNS32 TestMaster_obj1000 = 0x12D | -
- -
UNS8 TestMaster_obj1001 = 0x0 | -
- -
UNS32 TestMaster_obj1005 = 0x40000080 | -
- -
UNS32 TestMaster_obj1006 = 0xC350 | -
- -
UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0 | -
- -
UNS32 TestMaster_obj1016[] | -
-Initial value:
- { - 0x205DC - } -
UNS16 TestMaster_obj1017 = 0x0 | -
- -
UNS32 TestMaster_obj1018_Product_Code = 0x0 | -
- -
UNS32 TestMaster_obj1018_Revision_Number = 0x0 | -
- -
UNS32 TestMaster_obj1018_Serial_Number = 0x0 | -
- -
UNS32 TestMaster_obj1018_Vendor_ID = 0x0 | -
- -
UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602 | -
- -
UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582 | -
- -
INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2 | -
- -
UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x182 | -
- -
UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0 | -
- -
UNS16 TestMaster_obj1400_Event_Timer = 0x0 | -
- -
UNS16 TestMaster_obj1400_Inhibit_Time = 0x0 | -
- -
UNS8 TestMaster_obj1400_Transmission_Type = 0x1 | -
- -
UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x0 | -
- -
UNS8 TestMaster_obj1401_Compatibility_Entry = 0x0 | -
- -
UNS16 TestMaster_obj1401_Event_Timer = 0x0 | -
- -
UNS16 TestMaster_obj1401_Inhibit_Time = 0x0 | -
- -
UNS8 TestMaster_obj1401_Transmission_Type = 0x0 | -
- -
UNS32 TestMaster_obj1600[] | -
-Initial value:
- { - 0x20000001, - 0x20010001, - 0x20020001, - 0x20030001, - 0x20040001, - 0x20050001, - 0x20060001, - 0x20070001, - 0x20080008, - 0x20090020 - } -
UNS32 TestMaster_obj1601[] | -
-Initial value:
- { - 0x200A0010 - } -
UNS8* TestMaster_obj1F22[] | -
-Initial value:
- { - "", - "\x01\x00\x00\x00\x17\x10\x00\x02\x00\x00\x00\xe8\x03" - } -
const indextable TestMaster_objdict[] | -
-Initial value:
-{ - { (subindex*)TestMaster_Index1000,sizeof(TestMaster_Index1000)/sizeof(TestMaster_Index1000[0]), 0x1000}, - { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001}, - { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005}, - { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006}, - { (subindex*)TestMaster_Index1010,sizeof(TestMaster_Index1010)/sizeof(TestMaster_Index1010[0]), 0x1010}, - { (subindex*)TestMaster_Index1011,sizeof(TestMaster_Index1011)/sizeof(TestMaster_Index1011[0]), 0x1011}, - { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016}, - { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018}, - { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280}, - { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400}, - { (subindex*)TestMaster_Index1401,sizeof(TestMaster_Index1401)/sizeof(TestMaster_Index1401[0]), 0x1401}, - { (subindex*)TestMaster_Index1600,sizeof(TestMaster_Index1600)/sizeof(TestMaster_Index1600[0]), 0x1600}, - { (subindex*)TestMaster_Index1601,sizeof(TestMaster_Index1601)/sizeof(TestMaster_Index1601[0]), 0x1601}, - { (subindex*)TestMaster_Index1F22,sizeof(TestMaster_Index1F22)/sizeof(TestMaster_Index1F22[0]), 0x1F22}, - { (subindex*)TestMaster_Index2000,sizeof(TestMaster_Index2000)/sizeof(TestMaster_Index2000[0]), 0x2000}, - { (subindex*)TestMaster_Index2001,sizeof(TestMaster_Index2001)/sizeof(TestMaster_Index2001[0]), 0x2001}, - { (subindex*)TestMaster_Index2002,sizeof(TestMaster_Index2002)/sizeof(TestMaster_Index2002[0]), 0x2002}, - { (subindex*)TestMaster_Index2003,sizeof(TestMaster_Index2003)/sizeof(TestMaster_Index2003[0]), 0x2003}, - { (subindex*)TestMaster_Index2004,sizeof(TestMaster_Index2004)/sizeof(TestMaster_Index2004[0]), 0x2004}, - { (subindex*)TestMaster_Index2005,sizeof(TestMaster_Index2005)/sizeof(TestMaster_Index2005[0]), 0x2005}, - { (subindex*)TestMaster_Index2006,sizeof(TestMaster_Index2006)/sizeof(TestMaster_Index2006[0]), 0x2006}, - { (subindex*)TestMaster_Index2007,sizeof(TestMaster_Index2007)/sizeof(TestMaster_Index2007[0]), 0x2007}, - { (subindex*)TestMaster_Index2008,sizeof(TestMaster_Index2008)/sizeof(TestMaster_Index2008[0]), 0x2008}, - { (subindex*)TestMaster_Index2009,sizeof(TestMaster_Index2009)/sizeof(TestMaster_Index2009[0]), 0x2009}, - { (subindex*)TestMaster_Index200A,sizeof(TestMaster_Index200A)/sizeof(TestMaster_Index200A[0]), 0x200A}, -} -
UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]) | -
- -
-
#include "data.h"
Functions | |
UNS32 | TestMaster_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestMaster_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestMaster_Data |
UNS8 | MasterMap1 |
UNS8 | MasterMap2 |
UNS8 | MasterMap3 |
UNS8 | MasterMap4 |
UNS8 | MasterMap5 |
UNS8 | MasterMap6 |
UNS8 | MasterMap7 |
UNS8 | MasterMap8 |
UNS8 | MasterMap9 |
UNS32 | MasterMap10 |
UNS16 | MasterMap11 |
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
UNS8 MasterMap1 | -
- -
UNS32 MasterMap10 | -
- -
UNS16 MasterMap11 | -
- -
UNS8 MasterMap2 | -
- -
UNS8 MasterMap3 | -
- -
UNS8 MasterMap4 | -
- -
UNS8 MasterMap5 | -
- -
UNS8 MasterMap6 | -
- -
UNS8 MasterMap7 | -
- -
UNS8 MasterMap8 | -
- -
UNS8 MasterMap9 | -
- -
CO_Data TestMaster_Data | -
- -
-
#include <stdio.h>
#include "getopt.h"
#include <strings.h>
Defines | |
#define | GETOPT_INTERFACE_VERSION 2 |
#define | _(msgid) (msgid) |
#define | SWAP_FLAGS(ch1, ch2) |
#define | NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') |
Enumerations | |
enum | { REQUIRE_ORDER, -PERMUTE, -RETURN_IN_ORDER - } |
Functions | |
char * | getenv () |
static char * | my_index (char *str, int chr) const |
static void | exchange (char **argv) |
static const char * | _getopt_initialize (int argc, char *const *argv, const char *optstring) |
int | _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) |
int | getopt (int argc, char *const *argv, const char *optstring) |
Variables | |
char * | optarg |
int | optind = 1 |
int | __getopt_initialized |
static char * | nextchar |
int | opterr = 1 |
int | optopt = '?' |
static enum { ... } | ordering |
static char * | posixly_correct |
static int | first_nonopt |
static int | last_nonopt |
#define _ | -( | -msgid | -- | ) | -(msgid) | -
- -
#define GETOPT_INTERFACE_VERSION 2 | -
- -
#define SWAP_FLAGS | -( | -ch1, | |||
- | - | ch2 | -- | ) | -- |
- -
-
anonymous enum | -
-
static const char* _getopt_initialize | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | - [static] |
-
- -
int _getopt_internal | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring, | -|
- | - | const struct option * | -longopts, | -|
- | - | int * | -longind, | -|
- | - | int | -long_only | - |
- | ) | -- |
- -
static void exchange | -( | -char ** | -argv | -) | - [static] |
-
- -
char* getenv | -( | -- | ) | -- |
- -
int getopt | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | -- |
- -
static char* my_index | -( | -char * | -str, | -|
- | - | int | -chr | - |
- | ) | - const [static] |
-
- -
-
int __getopt_initialized | -
- -
int first_nonopt [static] |
-
- -
int last_nonopt [static] |
-
- -
char* nextchar [static] |
-
- -
char* optarg | -
- -
int opterr = 1 | -
- -
int optind = 1 | -
- -
int optopt = '?' | -
- -
enum { ... } ordering [static] |
-
- -
char* posixly_correct [static] |
-
- -
-
#include <ctype.h>
Data Structures | |
struct | option |
Defines | |
#define | _GETOPT_H 1 |
#define | no_argument 0 |
#define | required_argument 1 |
#define | optional_argument 2 |
Functions | |
int | getopt () |
int | getopt_long () |
int | getopt_long_only () |
int | _getopt_internal () |
Variables | |
char * | optarg |
int | optind |
int | opterr |
int | optopt |
#define _GETOPT_H 1 | -
- -
#define no_argument 0 | -
- -
#define optional_argument 2 | -
- -
#define required_argument 1 | -
- -
-
int _getopt_internal | -( | -- | ) | -- |
- -
int getopt | -( | -- | ) | -- |
- -
int getopt_long | -( | -- | ) | -- |
- -
int getopt_long_only | -( | -- | ) | -- |
- -
-
char* optarg | -
- -
int opterr | -
- -
int optind | -
- -
int optopt | -
- -
-
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include "canfestival.h"
#include "Master.h"
#include "Slave.h"
#include "TestMasterSlave.h"
Functions | |
UNS32 | OnMasterMap1Update (CO_Data *d, const indextable *unsused_indextable, UNS8 unsused_bSubindex) |
void | catch_signal (int sig) |
void | help () |
void | InitNodes (CO_Data *d, UNS32 id) |
int | main (int argc, char **argv) |
Variables | |
s_BOARD | SlaveBoard = {"0", "125K"} |
s_BOARD | MasterBoard = {"1", "125K"} |
void catch_signal | -( | -int | -sig | -) | -- |
- -
void help | -( | -- | ) | -- |
- -
void InitNodes | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
- -
int main | -( | -int | -argc, | -|
- | - | char ** | -argv | - |
- | ) | -- |
- -
UNS32 OnMasterMap1Update | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -unsused_indextable, | -|
- | - | UNS8 | -unsused_bSubindex | - |
- | ) | -- |
- -
-
s_BOARD MasterBoard = {"1", "125K"} | -
- -
s_BOARD SlaveBoard = {"0", "125K"} | -
- -
-
#include "canfestival.h"
Defines | |
#define | eprintf(...) printf (__VA_ARGS__) |
Functions | |
void | print_message (Message *m) |
#define eprintf | -( | -... | -- | ) | -printf (__VA_ARGS__) | -
- -
-
void print_message | -( | -Message * | -m | -) | -- |
- -
-
#include "TestSlave.h"
const indextable* TestSlave_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestSlave_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
UNS8 SlaveMap1 = 0x0 | -
- -
UNS32 SlaveMap10 = 0x0 | -
- -
UNS16 SlaveMap11 = 0x0 | -
- -
UNS8 SlaveMap2 = 0x0 | -
- -
UNS8 SlaveMap3 = 0x0 | -
- -
UNS8 SlaveMap4 = 0x0 | -
- -
UNS8 SlaveMap5 = 0x0 | -
- -
UNS8 SlaveMap6 = 0x0 | -
- -
UNS8 SlaveMap7 = 0x0 | -
- -
UNS8 SlaveMap8 = 0x0 | -
- -
UNS8 SlaveMap9 = 0x0 | -
- -
UNS8 TestSlave_bDeviceNodeId = 0x00 | -
- -
UNS8 TestSlave_count_sync[2] = {0,} | -
- -
CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave) | -
- -
quick_index TestSlave_firstIndex | -
-Initial value:
{ - 8, - 0, - 0, - 0, - 9, - 11 -} -
TIMER_HANDLE TestSlave_heartBeatTimers[1] | -
- -
UNS8 TestSlave_highestSubIndex_obj1010 = 4 | -
- -
UNS8 TestSlave_highestSubIndex_obj1011 = 4 | -
- -
UNS8 TestSlave_highestSubIndex_obj1016 = 0 | -
- -
UNS8 TestSlave_highestSubIndex_obj1018 = 4 | -
- -
UNS8 TestSlave_highestSubIndex_obj1200 = 2 | -
- -
UNS8 TestSlave_highestSubIndex_obj1800 = 5 | -
- -
UNS8 TestSlave_highestSubIndex_obj1801 = 5 | -
- -
UNS8 TestSlave_highestSubIndex_obj1A00 = 10 | -
- -
UNS8 TestSlave_highestSubIndex_obj1A01 = 1 | -
- -
const UNS8 TestSlave_iam_a_slave = 1 | -
- -
subindex TestSlave_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } - } -
subindex TestSlave_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } - } -
subindex TestSlave_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } - } -
ODCallback_t TestSlave_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestSlave_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } - } -
ODCallback_t TestSlave_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestSlave_Index1010[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters } - } -
ODCallback_t TestSlave_Index1010_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - } -
subindex TestSlave_Index1011[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters } - } -
ODCallback_t TestSlave_Index1011_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - } -
subindex TestSlave_Index1017[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } - } -
ODCallback_t TestSlave_Index1017_callbacks[] | -
-Initial value:
- { - NULL, - } -
subindex TestSlave_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } - } -
subindex TestSlave_Index1200[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } - } -
subindex TestSlave_Index1800[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, - { RW|TO_BE_SAVE, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, - { RW|TO_BE_SAVE, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } - } -
subindex TestSlave_Index1801[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer } - } -
subindex TestSlave_Index1A00[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[7] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[8] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[9] } - } -
subindex TestSlave_Index1A01[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] } - } -
subindex TestSlave_Index2000[] | -
subindex TestSlave_Index2001[] | -
subindex TestSlave_Index2002[] | -
subindex TestSlave_Index2003[] | -
subindex TestSlave_Index2004[] | -
subindex TestSlave_Index2005[] | -
subindex TestSlave_Index2006[] | -
subindex TestSlave_Index2007[] | -
subindex TestSlave_Index2008[] | -
subindex TestSlave_Index2009[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&SlaveMap10 } - } -
subindex TestSlave_Index200A[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&SlaveMap11 } - } -
quick_index TestSlave_lastIndex | -
-Initial value:
{ - 8, - 0, - 0, - 0, - 10, - 12 -} -
UNS32 TestSlave_obj1000 = 0x12D | -
- -
UNS8 TestSlave_obj1001 = 0x0 | -
- -
UNS32 TestSlave_obj1005 = 0x80 | -
- -
UNS32 TestSlave_obj1006 = 0x0 | -
- -
UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0 | -
- -
UNS32 TestSlave_obj1016[] = {0} | -
- -
UNS16 TestSlave_obj1017 = 0x0 | -
- -
UNS32 TestSlave_obj1018_Product_Code = 0x0 | -
- -
UNS32 TestSlave_obj1018_Revision_Number = 0x0 | -
- -
UNS32 TestSlave_obj1018_Serial_Number = 0x0 | -
- -
UNS32 TestSlave_obj1018_Vendor_ID = 0x0 | -
- -
UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601 | -
- -
UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581 | -
- -
UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182 | -
- -
UNS8 TestSlave_obj1800_Compatibility_Entry = 0x0 | -
- -
UNS16 TestSlave_obj1800_Event_Timer = 0x0 | -
- -
UNS16 TestSlave_obj1800_Inhibit_Time = 0x0 | -
- -
UNS8 TestSlave_obj1800_Transmission_Type = 0x0 | -
- -
UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x0 | -
- -
UNS8 TestSlave_obj1801_Compatibility_Entry = 0x0 | -
- -
UNS16 TestSlave_obj1801_Event_Timer = 0x0 | -
- -
UNS16 TestSlave_obj1801_Inhibit_Time = 0x0 | -
- -
UNS8 TestSlave_obj1801_Transmission_Type = 0x0 | -
- -
UNS32 TestSlave_obj1A00[] | -
-Initial value:
- { - 0x20000001, - 0x20010001, - 0x20020001, - 0x20030001, - 0x20040001, - 0x20050001, - 0x20060001, - 0x20070001, - 0x20080008, - 0x20090020 - } -
UNS32 TestSlave_obj1A01[] | -
-Initial value:
- { - 0x200A0010 - } -
const indextable TestSlave_objdict[] | -
-Initial value:
-{ - { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, - { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, - { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, - { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, - { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010}, - { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011}, - { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, - { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, - { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, - { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, - { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, - { (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00}, - { (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01}, - { (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000}, - { (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001}, - { (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002}, - { (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003}, - { (subindex*)TestSlave_Index2004,sizeof(TestSlave_Index2004)/sizeof(TestSlave_Index2004[0]), 0x2004}, - { (subindex*)TestSlave_Index2005,sizeof(TestSlave_Index2005)/sizeof(TestSlave_Index2005[0]), 0x2005}, - { (subindex*)TestSlave_Index2006,sizeof(TestSlave_Index2006)/sizeof(TestSlave_Index2006[0]), 0x2006}, - { (subindex*)TestSlave_Index2007,sizeof(TestSlave_Index2007)/sizeof(TestSlave_Index2007[0]), 0x2007}, - { (subindex*)TestSlave_Index2008,sizeof(TestSlave_Index2008)/sizeof(TestSlave_Index2008[0]), 0x2008}, - { (subindex*)TestSlave_Index2009,sizeof(TestSlave_Index2009)/sizeof(TestSlave_Index2009[0]), 0x2009}, - { (subindex*)TestSlave_Index200A,sizeof(TestSlave_Index200A)/sizeof(TestSlave_Index200A[0]), 0x200A}, -} -
UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]) | -
- -
-
#include "data.h"
Functions | |
UNS32 | TestSlave_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestSlave_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestSlave_Data |
ODCallback_t | Store_parameters_callbacks [] |
ODCallback_t | Restore_Default_Parameters_callbacks [] |
UNS8 | SlaveMap1 |
UNS8 | SlaveMap2 |
UNS8 | SlaveMap3 |
UNS8 | SlaveMap4 |
UNS8 | SlaveMap5 |
UNS8 | SlaveMap6 |
UNS8 | SlaveMap7 |
UNS8 | SlaveMap8 |
UNS8 | SlaveMap9 |
UNS32 | SlaveMap10 |
UNS16 | SlaveMap11 |
const indextable* TestSlave_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
UNS32 TestSlave_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-
ODCallback_t Restore_Default_Parameters_callbacks[] | -
- -
UNS8 SlaveMap1 | -
- -
UNS32 SlaveMap10 | -
- -
UNS16 SlaveMap11 | -
- -
UNS8 SlaveMap2 | -
- -
UNS8 SlaveMap3 | -
- -
UNS8 SlaveMap4 | -
- -
UNS8 SlaveMap5 | -
- -
UNS8 SlaveMap6 | -
- -
UNS8 SlaveMap7 | -
- -
UNS8 SlaveMap8 | -
- -
UNS8 SlaveMap9 | -
- -
ODCallback_t Store_parameters_callbacks[] | -
- -
CO_Data TestSlave_Data | -
- -
-
00001 # Package initialisation -00002 -00003 from DS301_index import * -
-Go to the source code of this file.
Namespaces | |
namespace | doc_index::__init__ |
namespace | DS301_index::* |
#include <stddef.h>
#include <asm-m68hc12/portsaccess.h>
#include <asm-m68hc12/ports_def.h>
#include <asm-m68hc12/ports.h>
#include <interrupt.h>
#include "../include/data.h"
#include <applicfg.h>
#include "../include/hcs12/candriver.h"
#include "../include/hcs12/canOpenDriver.h"
#include "../include/def.h"
#include "../include/can.h"
#include "../include/objdictdef.h"
#include "../include/objacces.h"
#include "../include/sdo.h"
#include "../include/pdo.h"
#include "../include/timer.h"
#include "../include/lifegrd.h"
#include "../include/sync.h"
#include "../include/nmtSlave.h"
#include "objdict.h"
Defines | |
#define | DEBUG_WAR_CONSOLE_ON |
#define | DEBUG_ERR_CONSOLE_ON |
Enumerations | |
enum | E_CanBaudrate { CAN_BAUDRATE_250K, -CAN_BAUDRATE_500K, -CAN_BAUDRATE_1M - } |
Functions | |
void | initCanopencapteur (void) |
void | initSensor (void) |
void | initPortB (void) |
void | initPortH (void) |
void | gene_SYNC_heartbeatError (UNS8 heartbeatID) |
void | gene_SYNC_initialisation () |
void | gene_SYNC_preOperational () |
void | gene_SYNC_operational () |
void | gene_SYNC_stopped () |
UNS8 | main (void) |
Variables | |
const canBusTime | CAN_Baudrates [] |
#define DEBUG_ERR_CONSOLE_ON | -
- -
#define DEBUG_WAR_CONSOLE_ON | -
- -
-
enum E_CanBaudrate | -
-
void gene_SYNC_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
- -
void gene_SYNC_initialisation | -( | -void | -- | ) | -- |
- -
void gene_SYNC_operational | -( | -void | -- | ) | -- |
- -
void gene_SYNC_preOperational | -( | -void | -- | ) | -- |
- -
void gene_SYNC_stopped | -( | -void | -- | ) | -- |
- -
void initCanopencapteur | -( | -void | -- | ) | -- |
- -
void initPortB | -( | -void | -- | ) | -- |
- -
void initPortH | -( | -void | -- | ) | -- |
- -
void initSensor | -( | -void | -- | ) | -- |
- -
UNS8 main | -( | -void | -- | ) | -- |
- -
-
const canBusTime CAN_Baudrates[] | -
- -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #define DEBUG_WAR_CONSOLE_ON -00024 #define DEBUG_ERR_CONSOLE_ON -00025 -00026 #include <stddef.h> /* for NULL */ -00027 -00028 #include "../include/hcs12/asm-m68hc12/portsaccess.h" -00029 #include "../include/hcs12/asm-m68hc12/ports_def.h" -00030 #include "../include/hcs12/asm-m68hc12/ports.h" -00031 #include "../include/data.h" -00032 #include "../include/hcs12/applicfg.h" -00033 #include "../include/hcs12/candriver.h" -00034 #include "../include/hcs12/interrupt.h" -00035 #include "../include/hcs12/canOpenDriver.h" -00036 #include "../include/can.h" -00037 #include "../include/objdictdef.h" -00038 #include "../include/timer.h" -00039 -00040 -00041 -00042 -00043 -00044 -00045 volatile static Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV]; -00046 volatile static t_pointerStack ptrMsgRcv[NB_LINE_CAN]; -00047 -00048 volatile static TIMEVAL last_time_set = TIMEVAL_MAX; -00049 static UNS8 timer_is_set = 0; -00050 -00051 /* Prototypes */ -00052 UNS8 f_can_receive(UNS8 notused, Message *m); -00053 UNS8 canSend(UNS8 notused, Message *m); -00054 void __attribute__((interrupt)) timer4Hdl (void); -00055 -00056 #define max(a,b) a>b?a:b -00057 -00058 /******************************************************************************/ -00059 void setTimer(TIMEVAL value) -00060 { -00061 IO_PORTS_16(TC4H) += value; -00062 timer_is_set = 1; -00063 } -00064 -00065 /******************************************************************************/ -00066 TIMEVAL getElapsedTime() -00067 { -00068 return (IO_PORTS_16(TC4H) > last_time_set ? IO_PORTS_16(TC4H) - last_time_set : last_time_set - IO_PORTS_16(TC4H)); -00069 } -00070 -00071 -00072 /******************************************************************************/ -00073 void resetTimer(void) -00074 { -00075 -00076 } -00077 -00078 /******************************************************************************/ -00079 void initTimer(void) -00080 { -00081 lock(); // Inhibition of interruptions -00082 -00083 // Configure the timer channel 4 -00084 IO_PORTS_8(TIOS) |= 0x10; // Canal 4 in output -00085 IO_PORTS_8(TCTL1) &= ~(0x01 + 0x02); // Canal 4 unconnected to pin output -00086 IO_PORTS_8(TIE) |= 0x10; // allow interruption channel 4 -00087 IO_PORTS_8(TSCR2) |= 0X05; // Pre-scaler = 32 -00088 // If this value is changed, change must be done also -00089 // in void __attribute__((interrupt)) timer4Hdl (void) -00090 -00091 IO_PORTS_8(TSCR1) |= 0x80; // Start timer -00092 unlock(); // Allow interruptions -00093 } -00094 -00095 /******************************************************************************/ -00096 void __attribute__((interrupt)) timer4Hdl (void) -00097 { -00098 lock(); -00099 last_time_set = IO_PORTS_16(TC4H); -00100 IO_PORTS_8(TFLG1) = 0x10; // RAZ flag interruption timer channel 4 -00101 // Compute the next event : When the timer reach the value of TC4, an interrupt is -00102 // started -00103 //IO_PORTS_16(TC4H) += 250; // To have an interruption every 1 ms -00104 //timerInterrupt(0); -00105 //MSG_WAR(0xFFFF, "timer4 IT", 0); -00106 { -00107 //MSG_WAR(0xFFFF, "t4 ", IO_PORTS_16(TCNTH) - IO_PORTS_16(TC4H)); -00108 } -00109 TimeDispatch(); -00110 unlock(); -00111 } -00112 -00113 -00114 /******************************************************************************/ -00115 void initSCI_0(void) -00116 { -00117 IO_PORTS_16(SCI0 + SCIBDH) = -00118 ((1000000 / SERIAL_SCI0_BAUD_RATE) * BUS_CLOCK) >> 4 ; -00119 IO_PORTS_8(SCI0 + SCICR1) = 0; // format 8N1 -00120 IO_PORTS_8(SCI0 + SCICR2) = 0x08; // Transmit enable only -00121 } -00122 -00123 /******************************************************************************/ -00124 void initSCI_1(void) -00125 { -00126 IO_PORTS_16(SCI1 + SCIBDH) = -00127 ((1000000 / SERIAL_SCI1_BAUD_RATE) * BUS_CLOCK) >> 4 ; -00128 IO_PORTS_8(SCI1 + SCICR1) = 0; // format 8N1 -00129 IO_PORTS_8(SCI1 + SCICR2) = 0x08; // Transmit enable only -00130 } -00131 -00132 -00133 /******************************************************************************/ -00134 char * -00135 hex_convert (char *buf, unsigned long value, char lastCar) -00136 { -00137 //Thanks to Stéphane Carrez for this function -00138 char num[32]; -00139 int pos; -00140 -00141 *buf++ = '0'; -00142 *buf++ = 'x'; -00143 -00144 pos = 0; -00145 while (value != 0) { -00146 char c = value & 0x0F; -00147 num[pos++] = "0123456789ABCDEF"[(unsigned) c]; -00148 value = (value >> 4) & (0x0fffffffL); -00149 } -00150 if (pos == 0) -00151 num[pos++] = '0'; -00152 -00153 while (--pos >= 0) -00154 *buf++ = num[pos]; -00155 -00156 *buf++ = lastCar; -00157 *buf = 0; -00158 return buf; -00159 } -00160 -00161 /******************************************************************************/ -00162 void printSCI_str(char sci, const char * str) -00163 { -00164 char i = 0; -00165 -00166 while ((*(str + i) != 0) && (i < 0xFF)) { -00167 if (*(str + i) == '\n') -00168 { -00169 while ((IO_PORTS_8(sci + SCISR1) & 0X80) == 0); // wait if buffer not empty -00170 IO_PORTS_8(sci + SCIDRL) = 13; // return to start of line -00171 } -00172 while ((IO_PORTS_8(sci + SCISR1) & 0X80) == 0); // wait if buffer not empty -00173 IO_PORTS_8(sci + SCIDRL) = *(str + i++); -00174 } -00175 -00176 } -00177 -00178 /******************************************************************************/ -00179 void printSCI_nbr(char sci, unsigned long nbr, char lastCar) -00180 { -00181 char strNbr[12]; -00182 hex_convert(strNbr, nbr, lastCar); -00183 printSCI_str(sci, strNbr); -00184 } -00185 -00186 /******************************************************************************/ -00187 // PLL 24 MHZ if quartz on board is 16 MHZ -00188 void initPLL(void) -00189 { -00190 IO_PORTS_8(CLKSEL) &= ~0x80; // unselect the PLL -00191 IO_PORTS_8(PLLCTL) |= 0X60; // PLL ON and bandwidth auto -00192 IO_PORTS_8(SYNR) = 0x02; -00193 IO_PORTS_8(REFDV) = 0x01; -00194 while ((IO_PORTS_8(CRGFLG) & 0x08) == 0); -00195 IO_PORTS_8(CLKSEL) |= 0x80; -00196 } -00197 -00198 /******************************************************************************/ -00199 void initHCS12(void) -00200 { -00201 -00202 # ifdef USE_PLL -00203 MSG_WAR(0x3620, "Use the PLL ", 0); -00204 initPLL(); -00205 # endif -00206 -00207 } -00208 -00209 /***************************************************************************/ -00210 char canAddIdToFilter(UNS16 adrCAN, UNS8 nFilter, UNS16 id) -00211 { -00212 UNS8 fiMsb; -00213 UNS8 fiLsb; -00214 UNS8 idMsb = (UNS8) (id >> 3); -00215 UNS8 idLsb = (UNS8) (id << 5); -00216 -00217 if (! canTestInitMode(adrCAN)) { -00218 /* Error because not init mode */ -00219 MSG_WAR(0X2600, "Not in init mode ", 0); -00220 return 1; -00221 } -00222 switch (nFilter) { -00223 case 0: -00224 nFilter = CANIDAR0; /* First bank */ -00225 break; -00226 case 1: -00227 nFilter = CANIDAR2; /* First bank */ -00228 break; -00229 case 2: -00230 nFilter = CANIDAR4; /* Second bank */ -00231 break; -00232 case 3: -00233 nFilter = CANIDAR6; /* Second bank */ -00234 } -00235 if (! IO_PORTS_16(adrCAN + nFilter)) { -00236 /* if CANIDARx = 0 */ -00237 IO_PORTS_8(adrCAN + nFilter) = idMsb; -00238 IO_PORTS_8(adrCAN + nFilter + 1) = idLsb; -00239 } -00240 fiMsb = IO_PORTS_8(adrCAN + nFilter) ^ idMsb; -00241 fiLsb = IO_PORTS_8(adrCAN + nFilter + 1) ^ idLsb; -00242 /* address of CANIDMRx */ -00243 IO_PORTS_8(adrCAN + nFilter + 4) = IO_PORTS_8(adrCAN + nFilter + 4) | fiMsb; -00244 IO_PORTS_8(adrCAN + nFilter + 5) = IO_PORTS_8(adrCAN + nFilter + 5) | fiLsb; -00245 IO_PORTS_8(adrCAN + nFilter + 5) |= 0x10; /* Not filtering on rtr value */ -00246 return 0; -00247 } -00248 -00249 /***************************************************************************/ -00250 char canChangeFilter(UNS16 adrCAN, canBusFilterInit fi) -00251 { -00252 /* If not in init mode, go to sleep before going in init mode*/ -00253 if (! canTestInitMode(adrCAN)) { -00254 canSleepMode(adrCAN); -00255 canInitMode(adrCAN); -00256 } -00257 //update the filters configuration -00258 canInitFilter(adrCAN, fi); -00259 canInitModeQ(adrCAN); -00260 canSleepModeQ(adrCAN); -00261 canSetInterrupt(adrCAN); -00262 return 0; -00263 } -00264 -00265 /***************************************************************************/ -00266 char canEnable(UNS16 adrCAN) -00267 { -00268 /* Register CANCTL1 -00269 bit 7 : 1 MSCAN enabled -00270 Other bits : default reset values -00271 */ -00272 IO_PORTS_8(adrCAN + CANCTL1) = 0X80; -00273 return 0; -00274 } -00275 -00276 /***************************************************************************/ -00277 char canInit(UNS16 adrCAN, canBusInit bi) -00278 { -00279 /* If not in init mode, go to sleep before going in init mode*/ -00280 if (! canTestInitMode(adrCAN)) { -00281 canSleepMode(adrCAN); -00282 canInitMode(adrCAN); -00283 } -00284 -00285 canEnable(adrCAN); /* Does nothing if already enable */ -00286 /* The most secure way to go in init mode : put before MSCAN in sleep mode */ -00287 //canSleepMode(adrCAN); -00288 /* Put MSCAN in Init mode */ -00289 //canInitMode(adrCAN); -00290 canInitClock(adrCAN, bi.clk); -00291 /* Init CANCTL1 register. Must be in init mode */ -00292 IO_PORTS_8(adrCAN + CANCTL1) &=0xC4;// 0xCB; /* Clr the bits that may be modified */ -00293 IO_PORTS_8(adrCAN + CANCTL1) = (bi.cane << 7) | (bi.loopb << 5 ) | -00294 (bi.listen << 4) | (bi.wupm << 2); -00295 /* Initialize the filters for received msgs */ -00296 /* We should decide to accept all the msgs */ -00297 canInitFilter(adrCAN, bi.fi); -00298 /* Before to modify CANCTL0, we must leave the init mode */ -00299 canInitModeQ(adrCAN); -00300 /* Init CANCTL0 register. MSCAN must not be in init mode */ -00301 /* Do not change the value of wupe (should be 0) and slprq (should be 1) */ -00302 /* Do not change the value of initrq (should be 0) */ -00303 /* rxfrm is cleared, mupe also (should be before)*/ -00304 IO_PORTS_8(adrCAN + CANCTL0) &= 0x53; /* Clr the bits that may be modified */ -00305 IO_PORTS_8(adrCAN + CANCTL0) = (bi.cswai << 5) | (bi.time << 3); -00306 canSetInterrupt(adrCAN); -00307 canInitModeQ(adrCAN); /* Leave the init mode */ -00308 canSleepModeQ(adrCAN); /* Leave the sleep mode */ -00309 return 0; -00310 } -00311 -00312 /***************************************************************************/ -00313 char canInitClock(UNS16 adrCAN, canBusTime clk) -00314 { -00315 if (! canTestInitMode(adrCAN)) { -00316 /* Not in Init mode */ -00317 MSG_WAR(0X2601, "not in init mode ", 0); -00318 return 1; -00319 } -00320 /* Set or reset CLKSRC (register CANCTL1). Does not change the other bits*/ -00321 clk.clksrc = clk.clksrc << 6; -00322 IO_PORTS_8(adrCAN + CANCTL1) &= 0xBF; -00323 IO_PORTS_8(adrCAN + CANCTL1) |= clk.clksrc; -00324 /* Build the CANBTR0 register */ -00325 IO_PORTS_8(adrCAN + CANBTR0) = 0x00; /* Clear before changes */ -00326 IO_PORTS_8(adrCAN + CANBTR0) = (clk.sjw << 6) | (clk.brp); -00327 /* Build the CANBTR1 register */ -00328 IO_PORTS_8(adrCAN + CANBTR1) = 0x00; /* Clear before changes */ -00329 IO_PORTS_8(adrCAN + CANBTR1) = (clk.samp << 7) | (clk.tseg2 << 4) | -00330 (clk.tseg1); -00331 return 0; -00332 } -00333 -00334 /***************************************************************************/ -00335 char canInit1Filter(UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) -00336 { -00337 if (! canTestInitMode(adrCAN)) { -00338 /* Error because not init mode */ -00339 MSG_WAR(0X2602, "not in init mode ", 0); -00340 return 1; -00341 } -00342 switch (nFilter) { -00343 case 0: -00344 nFilter = CANIDAR0; /* First bank */ -00345 break; -00346 case 1: -00347 nFilter = CANIDAR2; /* First bank */ -00348 break; -00349 case 2: -00350 nFilter = CANIDAR4; /* Second bank */ -00351 break; -00352 case 3: -00353 nFilter = CANIDAR6; /* Second bank */ -00354 } -00355 /* address of CANIDARx */ -00356 IO_PORTS_8(adrCAN + nFilter) = (UNS8) (ar >> 8); -00357 IO_PORTS_8(adrCAN + nFilter + 1) = (UNS8) (ar); -00358 IO_PORTS_8(adrCAN + nFilter + 4) = (UNS8) (mr >> 8); -00359 IO_PORTS_8(adrCAN + nFilter + 5) = (UNS8) (mr); -00360 return 0; -00361 } -00362 -00363 /***************************************************************************/ -00364 char canInitFilter(UNS16 adrCAN, canBusFilterInit fi) -00365 { -00366 if (! canTestInitMode(adrCAN)) { -00367 /* Error because not init mode */ -00368 MSG_WAR(0X2603, "not in init mode ", 0); -00369 return 1; -00370 } -00371 IO_PORTS_8(adrCAN + CANIDAC) = fi.idam << 4; -00372 IO_PORTS_8(adrCAN + CANIDAR0) = fi.canidar0; -00373 IO_PORTS_8(adrCAN + CANIDMR0) = fi.canidmr0; -00374 IO_PORTS_8(adrCAN + CANIDAR1) = fi.canidar1; -00375 IO_PORTS_8(adrCAN + CANIDMR1) = fi.canidmr1; -00376 IO_PORTS_8(adrCAN + CANIDAR2) = fi.canidar2; -00377 IO_PORTS_8(adrCAN + CANIDMR2) = fi.canidmr2; -00378 IO_PORTS_8(adrCAN + CANIDAR3) = fi.canidar3; -00379 IO_PORTS_8(adrCAN + CANIDMR3) = fi.canidmr3; -00380 IO_PORTS_8(adrCAN + CANIDAR4) = fi.canidar4; -00381 IO_PORTS_8(adrCAN + CANIDMR4) = fi.canidmr4; -00382 IO_PORTS_8(adrCAN + CANIDAR5) = fi.canidar5; -00383 IO_PORTS_8(adrCAN + CANIDMR5) = fi.canidmr5; -00384 IO_PORTS_8(adrCAN + CANIDAR6) = fi.canidar6; -00385 IO_PORTS_8(adrCAN + CANIDMR6) = fi.canidmr6; -00386 IO_PORTS_8(adrCAN + CANIDAR7) = fi.canidar7; -00387 IO_PORTS_8(adrCAN + CANIDMR7) = fi.canidmr7; -00388 return 0; -00389 } -00390 -00391 /***************************************************************************/ -00392 char canInitMode(UNS16 adrCAN) -00393 { -00394 IO_PORTS_8(adrCAN + CANCTL0) |= 0x01; /* Set the bit INITRQ */ -00395 while (! canTestInitMode(adrCAN)) { -00396 } -00397 return 0; -00398 } -00399 -00400 /***************************************************************************/ -00401 char canInitModeQ(UNS16 adrCAN) -00402 { -00403 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFE; /* Clear the bit INITRQ */ -00404 while (canTestInitMode(adrCAN)) { -00405 } -00406 return 0; -00407 } -00408 -00409 /***************************************************************************/ -00410 char canMsgTransmit(UNS16 adrCAN, Message msg) -00411 { -00412 /* Remind : only CAN A msg implemented. ie id on 11 bits, not 29 */ -00413 UNS8 cantflg; -00414 UNS8 i; -00415 /* Looking for a free buffer */ -00416 cantflg = IO_PORTS_8(adrCAN + CANTFLG); -00417 if ( cantflg == 0) { /* all the TXEx are set */ -00418 MSG_WAR(0X2604, "No buffer free. Msg to transmit is losted ", 0); -00419 return 1; /* No buffer free */ -00420 } -00421 else{ -00422 /* Selecting a buffer */ -00423 IO_PORTS_8(adrCAN + CANTBSEL) = cantflg; -00424 /* We put ide = 0 because id is on 11 bits only */ -00425 IO_PORTS_8(adrCAN + CANTRSID) = (UNS8)(msg.cob_id.w >> 3); -00426 IO_PORTS_8(adrCAN + CANTRSID + 1) = (UNS8)((msg.cob_id.w << 5)| -00427 (msg.rtr << 4)); -00428 -00429 IO_PORTS_8(adrCAN + CANTRSLEN) = msg.len & 0X0F; -00430 /* For the priority, we put the highter bits of the cob_id */ -00431 IO_PORTS_8(adrCAN + CANTRSPRI) = IO_PORTS_8(adrCAN + CANTRSID); -00432 for (i = 0 ; i < msg.len ; i++) { -00433 IO_PORTS_8(adrCAN + CANTRSDTA + i) = msg.data[i]; -00434 } -00435 /* Transmitting the message */ -00436 cantflg = IO_PORTS_8(adrCAN + CANTBSEL);/* to know which buf is selected */ -00437 IO_PORTS_8(adrCAN + CANTBSEL) = 0x00; -00438 IO_PORTS_8(adrCAN + CANTFLG) = cantflg; /* Ready to transmit ! */ -00439 -00440 } -00441 return 0; -00442 } -00443 -00444 /***************************************************************************/ -00445 char canSetInterrupt(UNS16 adrCAN) -00446 { -00447 IO_PORTS_8(adrCAN + CANRIER) = 0X01; /* Allow interruptions on receive */ -00448 IO_PORTS_8(adrCAN + CANTIER) = 0X00; /* disallow interruptions on transmit */ -00449 return 0; -00450 } -00451 /***************************************************************************/ -00452 char canSleepMode(UNS16 adrCAN) -00453 { -00454 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFB; /* clr the bit WUPE to avoid a wake-up*/ -00455 IO_PORTS_8(adrCAN + CANCTL0) |= 0x02; /* Set the bit SLPRQ. go to Sleep !*/ -00456 -00457 // IO_PORTS_8(adrCAN + CANCTL1) |= 0x04; -00458 // IO_PORTS_8(adrCAN + CANCTL0) |= 0x02; /* Set the bit SLPRQ */ -00459 while ( ! canTestSleepMode(adrCAN)) { -00460 } -00461 -00462 return 0; -00463 } -00464 -00465 /***************************************************************************/ -00466 char canSleepModeQ(UNS16 adrCAN) -00467 { -00468 if (canTestInitMode(adrCAN)) { -00469 /* Error because in init mode */ -00470 MSG_WAR(0X2606, "not in init mode ", 0); -00471 return 1; -00472 } -00473 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFD; /* clr the bit SLPRQ */ -00474 while ( canTestSleepMode(adrCAN)) { -00475 } -00476 return 0; -00477 } -00478 -00479 /***************************************************************************/ -00480 char canSleepWupMode(UNS16 adrCAN) -00481 { -00482 if (canTestInitMode(adrCAN)) { -00483 MSG_WAR(0X2607, "not in init mode ", 0); -00484 return 1; -00485 } -00486 IO_PORTS_8(adrCAN + CANCTL0) |= 0x06; /* Set the bits WUPE & SLPRQ */ -00487 while ( ! canTestSleepMode(adrCAN)) { -00488 } -00489 return 0; -00490 } -00491 -00492 /***************************************************************************/ -00493 char canTestInitMode(UNS16 adrCAN) -00494 { -00495 return IO_PORTS_8(adrCAN + CANCTL1) & 0x01; /* Test the bit INITAK */ -00496 } -00497 -00498 /***************************************************************************/ -00499 char canTestSleepMode(UNS16 adrCAN) -00500 { -00501 return IO_PORTS_8(adrCAN + CANCTL1) & 0x02; /* Test the bit SLPAK */ -00502 } -00503 -00504 /***************************************************************************/ -00505 UNS8 canSend(UNS8 notused, Message *m) -00506 { -00507 canMsgTransmit(CANOPEN_LINE_NUMBER_USED, *m); -00508 return 0; -00509 } -00510 -00511 -00512 /**************************************************************************/ -00513 UNS8 f_can_receive(UNS8 notused, Message *msgRcv) -00514 { -00515 UNS8 i, j; -00516 -00517 switch (CANOPEN_LINE_NUMBER_USED) { -00518 case CAN0 : j = 0; break; -00519 case CAN1 : j = 1; break; -00520 case CAN2 : j = 2; break; -00521 case CAN3 : j = 3; break; -00522 case CAN4 : j = 4; break; -00523 } -00524 -00525 /* See if a message is pending in the stack */ -00526 if (ptrMsgRcv[j].r == ptrMsgRcv[j].w) -00527 return 0x0; // No new message -00528 -00529 /* Increment the reading pointer of the stack */ -00530 if (ptrMsgRcv[j].r == (MAX_STACK_MSG_RCV - 1)) -00531 ptrMsgRcv[j].r = 0; -00532 else -00533 ptrMsgRcv[j].r ++; -00534 -00535 /* Store the message from the stack*/ -00536 msgRcv->cob_id.w = stackMsgRcv[j][ptrMsgRcv[j].r].cob_id.w; -00537 msgRcv->len = stackMsgRcv[j][ptrMsgRcv[j].r].len; -00538 msgRcv->rtr = stackMsgRcv[j][ptrMsgRcv[j].r].rtr; -00539 for (i = 0 ; i < stackMsgRcv[j][ptrMsgRcv[j].r].len ; i++) -00540 msgRcv->data[i] = stackMsgRcv[j][ptrMsgRcv[j].r].data[i]; -00541 return 0xFF; -00542 } -00543 -00544 -00545 /****************************************************************************** -00546 ******************************* CAN INTERRUPT *******************************/ -00547 -00548 void __attribute__((interrupt)) can0HdlTra (void) -00549 { -00550 -00551 } -00552 -00553 void __attribute__((interrupt)) can0HdlRcv (void) -00554 { -00555 UNS8 i; -00556 lock(); -00557 IO_PORTS_8(PORTB) &= ~ 0x40; // led 6 port B : ON -00558 UNS8 NewPtrW; -00559 /* We are obliged to save the message while the interruption is pending */ -00560 /* Increment the writing stack pointer before writing the msg */ -00561 if (ptrMsgRcv[0].w == (MAX_STACK_MSG_RCV - 1)) -00562 NewPtrW = 0; -00563 else -00564 NewPtrW = ptrMsgRcv[0].w + 1; -00565 -00566 if (NewPtrW == ptrMsgRcv[0].r) { -00567 /* The stack is full. The last msg received before this one is lost */ -00568 MSG_WAR(0X1620, "Stack for received msg is full", 0); -00569 //IO_PORTS_8(PORTB) &= ~0x40; // led 6 : ON (for debogue) -00570 } -00571 else -00572 ptrMsgRcv[0].w = NewPtrW; -00573 -00574 /* Store the message */ -00575 stackMsgRcv[0][ptrMsgRcv[0].w].cob_id.w = IO_PORTS_16(CAN0 + CANRCVID) >> 5; -00576 stackMsgRcv[0][ptrMsgRcv[0].w].len = IO_PORTS_8(CAN0 + CANRCVLEN) & 0x0F; -00577 stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN0 + CANRCVID + 1) >> 4) & 0x01; -00578 for (i = 0 ; i < stackMsgRcv[0][ptrMsgRcv[0].w].len ; i++) -00579 stackMsgRcv[0][ptrMsgRcv[0].w].data[i] = IO_PORTS_8(CAN0 + CANRCVDTA + i); -00580 -00581 // The message is stored , so -00582 // we can now release the receive foreground buffer -00583 // and acknowledge the interruption -00584 IO_PORTS_8(CAN0 + CANRFLG) |= 0x01; -00585 // Not very usefull -00586 IO_PORTS_8(CAN0 + CANCTL0) |= 0x80; -00587 IO_PORTS_8(PORTB) |= 0x40; // led 6 port B : OFF -00588 unlock(); -00589 } -00590 -00591 void __attribute__((interrupt)) can0HdlWup (void) -00592 { -00593 -00594 } -00595 -00596 void __attribute__((interrupt)) can0HdlErr (void) -00597 { -00598 -00599 } -00600 -00601 void __attribute__((interrupt)) can1HdlTra (void) -00602 { -00603 -00604 } -00605 -00606 void __attribute__((interrupt)) can1HdlRcv (void) -00607 { -00608 UNS8 i; -00609 lock(); -00610 UNS8 NewPtrW; -00611 /* We are obliged to save the message while the interruption is pending */ -00612 /* Increment the writing stack pointer before writing the msg */ -00613 if (ptrMsgRcv[1].w == (MAX_STACK_MSG_RCV - 1)) -00614 NewPtrW = 0; -00615 else -00616 NewPtrW = ptrMsgRcv[1].w + 1; -00617 -00618 if (NewPtrW == ptrMsgRcv[1].r) { -00619 /* The stack is full. The last msg received before this one is lost */ -00620 MSG_WAR(0X2620, "Stack for received msg is full", 0); -00621 } -00622 else -00623 ptrMsgRcv[1].w = NewPtrW; -00624 -00625 /* Store the message */ -00626 stackMsgRcv[1][ptrMsgRcv[1].w].cob_id.w = IO_PORTS_16(CAN1 + CANRCVID) >> 5; -00627 stackMsgRcv[1][ptrMsgRcv[1].w].len = IO_PORTS_8(CAN1 + CANRCVLEN) & 0x0F; -00628 stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN1 + CANRCVID + 1) >> 4) & 0x01; -00629 for (i = 0 ; i < stackMsgRcv[1][ptrMsgRcv[1].w].len ; i++) -00630 stackMsgRcv[1][ptrMsgRcv[1].w].data[i] = IO_PORTS_8(CAN1 + CANRCVDTA + i); -00631 -00632 // The message is stored , so -00633 // we can now release the receive foreground buffer -00634 // and acknowledge the interruption -00635 IO_PORTS_8(CAN1 + CANRFLG) |= 0x01; -00636 // Not very usefull -00637 IO_PORTS_8(CAN1 + CANCTL0) |= 0x80; -00638 unlock(); -00639 } -00640 -00641 void __attribute__((interrupt)) can1HdlWup (void) -00642 { -00643 -00644 } -00645 -00646 void __attribute__((interrupt)) can1HdlErr (void) -00647 { -00648 -00649 } -00650 -00651 void __attribute__((interrupt)) can2HdlTra (void) -00652 { -00653 -00654 } -00655 -00656 void __attribute__((interrupt)) can2HdlRcv (void) -00657 { -00658 -00659 } -00660 -00661 void __attribute__((interrupt)) can2HdlWup (void) -00662 { -00663 -00664 } -00665 -00666 void __attribute__((interrupt)) can2HdlErr (void) -00667 { -00668 -00669 } -00670 -00671 void __attribute__((interrupt)) can3HdlTra (void) -00672 { -00673 -00674 } -00675 -00676 void __attribute__((interrupt)) can3HdlRcv (void) -00677 { -00678 -00679 } -00680 -00681 void __attribute__((interrupt)) can3HdlWup (void) -00682 { -00683 -00684 } -00685 -00686 void __attribute__((interrupt)) can3HdlErr (void) -00687 { -00688 -00689 } -00690 -00691 void __attribute__((interrupt)) can4HdlTra (void) -00692 { -00693 -00694 } -00695 -00696 void __attribute__((interrupt)) can4HdlRcv (void) -00697 { -00698 -00699 } -00700 -00701 void __attribute__((interrupt)) can4HdlWup (void) -00702 { -00703 -00704 } -00705 -00706 void __attribute__((interrupt)) can4HdlErr (void) -00707 { -00708 -00709 } -00710 -00711 -00712 -
#include <stddef.h>
#include "../include/hcs12/asm-m68hc12/portsaccess.h"
#include "../include/hcs12/asm-m68hc12/ports_def.h"
#include "../include/hcs12/asm-m68hc12/ports.h"
#include "../include/data.h"
#include "../include/hcs12/applicfg.h"
#include "../include/hcs12/candriver.h"
#include "../include/hcs12/interrupt.h"
#include "../include/hcs12/canOpenDriver.h"
#include "../include/can.h"
#include "../include/objdictdef.h"
#include "../include/timer.h"
-Go to the source code of this file.
Defines | |
#define | DEBUG_WAR_CONSOLE_ON |
#define | DEBUG_ERR_CONSOLE_ON |
#define | max(a, b) a>b?a:b |
Functions | |
UNS8 | f_can_receive (UNS8 notused, Message *m) |
UNS8 | canSend (UNS8 notused, Message *m) |
void | __attribute__ ((interrupt)) |
TIMEVAL | getElapsedTime () |
void | resetTimer (void) |
void | initTimer (void) |
void | initSCI_0 (void) |
Initialisation of the serial port 0. | |
void | initSCI_1 (void) |
Initialisation of the serial port 1. | |
char * | hex_convert (char *buf, unsigned long value, char lastCar) |
void | printSCI_str (char sci, const char *str) |
void | printSCI_nbr (char sci, unsigned long nbr, char lastCar) |
void | initPLL (void) |
void | initHCS12 (void) |
Put here all the code to init the HCS12. | |
char | canAddIdToFilter (UNS16 adrCAN, UNS8 nFilter, UNS16 id) |
char | canChangeFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canEnable (UNS16 adrCAN) |
char | canInit (UNS16 adrCAN, canBusInit bi) |
char | canInitClock (UNS16 adrCAN, canBusTime clk) |
char | canInit1Filter (UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) |
char | canInitFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canInitMode (UNS16 adrCAN) |
char | canInitModeQ (UNS16 adrCAN) |
char | canMsgTransmit (UNS16 adrCAN, Message msg) |
char | canSetInterrupt (UNS16 adrCAN) |
char | canSleepMode (UNS16 adrCAN) |
char | canSleepModeQ (UNS16 adrCAN) |
char | canSleepWupMode (UNS16 adrCAN) |
char | canTestInitMode (UNS16 adrCAN) |
char | canTestSleepMode (UNS16 adrCAN) |
#define DEBUG_ERR_CONSOLE_ON | -
- -
-Definition at line 24 of file canOpenDriver.c. -
#define DEBUG_WAR_CONSOLE_ON | -
- -
-Definition at line 23 of file canOpenDriver.c. -
#define max | -( | -a, | |||
- | - | b | -- | ) | -a>b?a:b | -
- -
-
void __attribute__ | -( | -(interrupt) | -- | ) | -- |
-Message transmitted on MSCAN 0 -
-Definition at line 54 of file canOpenDriver.c. -
-References IO_PORTS_16, and TC4H. -
char canAddIdToFilter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -id | - |
- | ) | -- |
- -
-Definition at line 210 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_16, IO_PORTS_8, MSG_WAR, and UNS8. -
char canChangeFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 250 of file canOpenDriver.c. -
-References canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), and canTestInitMode(). -
char canEnable | -( | -UNS16 | -adrCAN | -) | -- |
char canInit | -( | -UNS16 | -adrCAN, | -|
- | - | canBusInit | -bi | - |
- | ) | -- |
- -
-Definition at line 277 of file canOpenDriver.c. -
-References CANCTL0, CANCTL1, canBusInit::cane, canEnable(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), canTestInitMode(), canBusInit::clk, canBusInit::cswai, canBusInit::fi, IO_PORTS_8, canBusInit::listen, canBusInit::loopb, canBusInit::time, and canBusInit::wupm. -
char canInit1Filter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -ar, | -|
- | - | UNS16 | -mr | - |
- | ) | -- |
- -
-Definition at line 335 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_8, MSG_WAR, and UNS8. -
char canInitClock | -( | -UNS16 | -adrCAN, | -|
- | - | canBusTime | -clk | - |
- | ) | -- |
- -
-Definition at line 313 of file canOpenDriver.c. -
-References canBusTime::brp, CANBTR0, CANBTR1, CANCTL1, canTestInitMode(), canBusTime::clksrc, IO_PORTS_8, MSG_WAR, canBusTime::samp, canBusTime::sjw, canBusTime::tseg1, and canBusTime::tseg2. -
char canInitFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 364 of file canOpenDriver.c. -
-References CANIDAC, CANIDAR0, canBusFilterInit::canidar0, CANIDAR1, canBusFilterInit::canidar1, CANIDAR2, canBusFilterInit::canidar2, CANIDAR3, canBusFilterInit::canidar3, CANIDAR4, canBusFilterInit::canidar4, CANIDAR5, canBusFilterInit::canidar5, CANIDAR6, canBusFilterInit::canidar6, CANIDAR7, canBusFilterInit::canidar7, CANIDMR0, canBusFilterInit::canidmr0, CANIDMR1, canBusFilterInit::canidmr1, CANIDMR2, canBusFilterInit::canidmr2, CANIDMR3, canBusFilterInit::canidmr3, CANIDMR4, canBusFilterInit::canidmr4, CANIDMR5, canBusFilterInit::canidmr5, CANIDMR6, canBusFilterInit::canidmr6, CANIDMR7, canBusFilterInit::canidmr7, canTestInitMode(), canBusFilterInit::idam, IO_PORTS_8, and MSG_WAR. -
char canInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 392 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
char canInitModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 401 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
char canMsgTransmit | -( | -UNS16 | -adrCAN, | -|
- | - | Message | -msg | - |
- | ) | -- |
- -
-Definition at line 410 of file canOpenDriver.c. -
-References CANTBSEL, CANTFLG, CANTRSDTA, CANTRSID, CANTRSLEN, CANTRSPRI, Message::cob_id, Message::data, IO_PORTS_8, Message::len, MSG_WAR, Message::rtr, UNS8, and SHORT_CAN::w. -
UNS8 canSend | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 505 of file canOpenDriver.c. -
-References canMsgTransmit(), and CANOPEN_LINE_NUMBER_USED. -
char canSetInterrupt | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 445 of file canOpenDriver.c. -
-References CANRIER, CANTIER, and IO_PORTS_8. -
char canSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 452 of file canOpenDriver.c. -
-References CANCTL0, canTestSleepMode(), and IO_PORTS_8. -
char canSleepModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 466 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
char canSleepWupMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 480 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
char canTestInitMode | -( | -UNS16 | -adrCAN | -) | -- |
char canTestSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
UNS8 f_can_receive | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 513 of file canOpenDriver.c. -
-References CAN0, CAN1, CAN2, CAN3, CAN4, CANOPEN_LINE_NUMBER_USED, Message::cob_id, Message::data, Message::len, MAX_STACK_MSG_RCV, t_pointerStack::r, Message::rtr, UNS8, and SHORT_CAN::w. -
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
- -
-Definition at line 66 of file canOpenDriver.c. -
char* hex_convert | -( | -char * | -buf, | -|
- | - | unsigned long | -value, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Convert an integer to a string in hexadecimal format If you do not wants to use a lastCar, put lastCar = '' (end of string) ex : value = 0XABCDEF and lastCar = '
-' buf[0] = '0' buf[1] = 'X' buf[2] = 'A' .... buf[7] = 'F' buf[8] = '
-' buf[9] = ''
-
-Definition at line 135 of file canOpenDriver.c. -
void initHCS12 | -( | -void | -- | ) | -- |
-Put here all the code to init the HCS12. -
- -
-Definition at line 199 of file canOpenDriver.c. -
void initPLL | -( | -void | -- | ) | -- |
-to start using the PLL. Bus clock becomes 24 MHz if the quartz on the board is at 16 MHz -
-Definition at line 188 of file canOpenDriver.c. -
-References CLKSEL, CRGFLG, IO_PORTS_8, PLLCTL, REFDV, and SYNR. -
void initSCI_0 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 0. -
- -
-Definition at line 115 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI0, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI0_BAUD_RATE. -
void initSCI_1 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 1. -
- -
-Definition at line 124 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI1, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI1_BAUD_RATE. -
void initTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 79 of file canOpenDriver.c. -
void printSCI_nbr | -( | -char | -sci, | -|
- | - | unsigned long | -nbr, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Print the number in hexadecimal to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 179 of file canOpenDriver.c. -
-References hex_convert(), and printSCI_str(). -
void printSCI_str | -( | -char | -sci, | -|
- | - | const char * | -str | - |
- | ) | -- |
-Print the string to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 162 of file canOpenDriver.c. -
-References IO_PORTS_8, SCIDRL, and SCISR1. -
void resetTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 73 of file canOpenDriver.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 #ifndef __CANOPENDRIVER__ -00025 #define __CANOPENDRIVER__ -00026 -00027 -00028 -00029 // --------- to be called by user app --------- -00030 -00031 void initTimer(void); -00032 void resetTimer(void); -00033 void TimerLoop(void); -00034 -00041 UNS8 f_can_receive(UNS8 notused, Message *m); -00042 -00043 #endif -
-Go to the source code of this file.
Functions | |
void | initTimer (void) |
void | resetTimer (void) |
void | TimerLoop (void) |
UNS8 | f_can_receive (UNS8 notused, Message *m) |
UNS8 f_can_receive | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
-Returns 0 if no message received, 0xFF if the receiving stack is not empty. May be call in polling. You can also call canDispatch(...) in void __attribute__((interrupt)) can0HdlRcv (void) (see include/hcs12/canOpenDriver.c) -
void initTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 79 of file canOpenDriver.c. -
-References IO_PORTS_8, last_sig, lock(), TCTL1, TIE, timer, timer_notify(), TIOS, TSCR1, TSCR2, and unlock(). -
void resetTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 73 of file canOpenDriver.c. -
void TimerLoop | -( | -void | -- | ) | -- |
- -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __can_h__ -00024 #define __can_h__ -00025 -00026 #include "applicfg.h" -00028 /* -00029 union SHORT_CAN { -00030 struct { UNS8 b0,b1; } b; -00031 UNS32 w; -00032 }; -00033 */ -00034 -00035 typedef struct { -00036 UNS32 w; /* 32 bits */ -00037 } SHORT_CAN; -00038 -00039 -00041 typedef struct { -00042 SHORT_CAN cob_id; /* l'ID du mesg */ -00043 UNS8 rtr; /* remote transmission request. 0 if not rtr, -00044 1 for a rtr message */ -00045 UNS8 len; /* message length (0 to 8) */ -00046 UNS8 data[8]; /* data */ -00047 } Message; -00048 -00049 -00050 typedef UNS8 (*canSend_t)(Message *); -00051 -00052 #endif /* __can_h__ */ -
#include "applicfg.h"
-Go to the source code of this file.
Data Structures | |
struct | SHORT_CAN |
struct | Message |
Typedefs | |
typedef UNS8(*) | canSend_t (Message *) |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __can_driver_h__ -00024 #define __can_driver_h__ -00025 -00026 struct struct_s_BOARD; -00027 -00028 typedef struct struct_s_BOARD s_BOARD; -00029 -00030 #include "applicfg.h" -00031 #include "can.h" -00032 -00033 struct struct_s_BOARD { -00034 char * busname; -00035 char * baudrate; -00036 }; -00037 -00038 #ifndef DLL_CALL -00039 #define DLL_CALL(funcname) funcname##_driver -00040 #endif -00041 -00042 #ifndef FCT_PTR_INIT -00043 #define FCT_PTR_INIT -00044 #endif -00045 -00046 -00047 UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *)FCT_PTR_INIT; -00048 UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *)FCT_PTR_INIT; -00049 CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *)FCT_PTR_INIT; -00050 int DLL_CALL(canClose)(CAN_HANDLE)FCT_PTR_INIT; -00051 -00052 #endif -
#include "applicfg.h"
#include "can.h"
-Go to the source code of this file.
Data Structures | |
struct | struct_s_BOARD |
Defines | |
#define | DLL_CALL(funcname) funcname##_driver |
Typedefs | |
typedef struct_s_BOARD | s_BOARD |
Functions | |
UNS8 DLL_CALL() | canReceive (CAN_HANDLE, Message *) FCT_PTR_INIT |
UNS8 DLL_CALL() | canSend (CAN_HANDLE, Message *) FCT_PTR_INIT |
CAN_HANDLE DLL_CALL() | canOpen (s_BOARD *) FCT_PTR_INIT |
int DLL_CALL() | canClose (CAN_HANDLE) FCT_PTR_INIT |
#define DLL_CALL | -( | -funcname | -- | ) | -funcname##_driver | -
- -
-Definition at line 39 of file can_driver.h. -
-
typedef struct struct_s_BOARD s_BOARD | -
- -
-Definition at line 28 of file can_driver.h. -
-
int DLL_CALL() canClose | -( | -CAN_HANDLE | -- | ) | -- |
- -
CAN_HANDLE DLL_CALL() canOpen | -( | -s_BOARD * | -- | ) | -- |
- -
UNS8 DLL_CALL() canReceive | -( | -CAN_HANDLE | -, | -|
- | - | Message * | -- | |
- | ) | -- |
- -
-Definition at line 124 of file drivers_win32.cpp. -
-References driver_data::inst, driver_procs::m_canReceive, and s_driver_procs. -
UNS8 DLL_CALL() canSend | -( | -CAN_HANDLE | -, | -|
- | - | Message * | -- | |
- | ) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <errno.h> -00026 #include <fcntl.h> -00027 -00028 #include "canmsg.h" -00029 #include "lincan.h" -00030 -00031 #include "can_driver.h" -00032 -00033 /*********functions which permit to communicate with the board****************/ -00034 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00035 { -00036 int res; -00037 struct canmsg_t canmsg; -00038 -00039 canmsg.flags = 0; /* Ensure standard receive, not required for LinCAN>=0.3.1 */ -00040 -00041 do{ -00042 res = read(fd0,&canmsg,sizeof(canmsg_t)); -00043 if((res<0)&&(errno == -EAGAIN)) res = 0; -00044 }while(res==0); -00045 -00046 if(res != sizeof(canmsg_t)) // No new message -00047 return 1; -00048 -00049 if(canmsg.flags&MSG_EXT){ -00050 /* There is no mark for extended messages in CanFestival */; -00051 } -00052 -00053 m->cob_id.w = canmsg.id; -00054 m->len = canmsg.length; -00055 if(canmsg.flags&MSG_RTR){ -00056 m->rtr = 1; -00057 }else{ -00058 m->rtr = 0; -00059 memcpy(m->data,canmsg.data,8); -00060 } -00061 -00062 return 0; -00063 } -00064 -00065 /***************************************************************************/ -00066 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00067 { -00068 int res; -00069 struct canmsg_t canmsg; -00070 -00071 -00072 canmsg.flags = 0; -00073 canmsg.id = m->cob_id.w; -00074 canmsg.length = m->len; -00075 if(m->rtr){ -00076 canmsg.flags |= MSG_RTR; -00077 }else{ -00078 memcpy(canmsg.data,m->data,8); -00079 } -00080 -00081 if(canmsg.id >= 0x800){ -00082 canmsg.flags |= MSG_EXT; -00083 } -00084 -00085 res = write(fd0,&canmsg,sizeof(canmsg_t)); -00086 if(res!=sizeof(canmsg_t)) -00087 return 1; -00088 -00089 return 0; -00090 } -00091 -00092 /***************************************************************************/ -00093 static const char lnx_can_dev_prefix[] = "/dev/can"; -00094 -00095 CAN_HANDLE canOpen_driver(s_BOARD *board) -00096 { -00097 int name_len = strlen(board->busname); -00098 int prefix_len = strlen(lnx_can_dev_prefix); -00099 char dev_name[prefix_len+name_len+1]; -00100 int o_flags = 0; -00101 CAN_HANDLE fd0; -00102 -00103 fd0=malloc(sizeof(*fd0)); -00104 if(fd0==NULL) -00105 return NULL; -00106 -00107 /*o_flags = O_NONBLOCK;*/ -00108 -00109 memcpy(dev_name,lnx_can_dev_prefix,prefix_len); -00110 memcpy(dev_name+prefix_len,board->busname,name_len); -00111 dev_name[prefix_len+name_len] = 0; -00112 -00113 fd0 = open(dev_name, O_RDWR|o_flags); -00114 if(fd0 < 0){ -00115 fprintf(stderr,"!!! Board %s is unknown. See can_lincan.c\n", board->busname); -00116 goto error_ret; -00117 } -00118 -00119 return fd0; -00120 -00121 error_ret: -00122 free(fd0); -00123 return NULL; -00124 } -00125 -00126 /***************************************************************************/ -00127 int canClose_driver(CAN_HANDLE fd0) -00128 { -00129 if(!fd0) -00130 return 0; -00131 close(fd0); -00132 return 0; -00133 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "canmsg.h"
#include "lincan.h"
#include "can_driver.h"
-Go to the source code of this file.
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 127 of file can_lincan.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 34 of file can_lincan.c. -
-References Message::cob_id, canmsg_t::data, Message::data, canmsg_t::flags, canmsg_t::id, Message::len, canmsg_t::length, MSG_EXT, MSG_RTR, Message::rtr, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 66 of file can_lincan.c. -
-References Message::cob_id, Message::data, canmsg_t::data, canmsg_t::flags, canmsg_t::id, Message::len, canmsg_t::length, MSG_EXT, MSG_RTR, Message::rtr, and SHORT_CAN::w. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <errno.h> -00026 #include <fcntl.h> -00027 -00028 /* driver pcan pci for Peak board */ -00029 //#include "libpcan.h" -00030 //#include "pcan.h" -00031 -00032 #include "libpcan.h" // for CAN_HANDLE -00033 -00034 #include "can_driver.h" -00035 -00036 // Define for rtr CAN message -00037 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR -00038 -00039 /*********functions which permit to communicate with the board****************/ -00040 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00041 { -00042 UNS8 data; -00043 TPCANMsg peakMsg; -00044 if ((errno = CAN_Read(fd0, & peakMsg))) { // Blocks until no new message or error. -00045 if(errno != -EIDRM && errno != -EPERM) // error is not "Can Port closed while reading" -00046 { -00047 perror("canReceive_driver (Peak_Linux) : error of reading.\n"); -00048 } -00049 return 1; -00050 } -00051 m->cob_id.w = peakMsg.ID; -00052 if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_*/ -00053 m->rtr = 0; -00054 else -00055 m->rtr = 1; -00056 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ -00057 for(data = 0 ; data < peakMsg.LEN ; data++) -00058 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ -00059 -00060 return 0; -00061 } -00062 -00063 /***************************************************************************/ -00064 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00065 { -00066 UNS8 data; -00067 TPCANMsg peakMsg; -00068 peakMsg.ID=m -> cob_id.w; /* 11/29 bit code */ -00069 if(m->rtr == 0) -00070 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_*/ -00071 else { -00072 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_*/ -00073 } -00074 peakMsg.LEN = m->len; -00075 /* count of data bytes (0..8) */ -00076 for(data = 0 ; data < m->len; data ++) -00077 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ -00078 -00079 if((errno = CAN_Write(fd0, & peakMsg))) { -00080 perror("canSend_driver (Peak_Linux) : error of writing.\n"); -00081 return 1; -00082 } -00083 return 0; -00084 -00085 } -00086 -00087 -00088 /***************************************************************************/ -00089 int TranslateBaudeRate(char* optarg){ -00090 if(!strcmp( optarg, "1M")) return CAN_BAUD_1M; -00091 if(!strcmp( optarg, "500K")) return CAN_BAUD_500K; -00092 if(!strcmp( optarg, "250K")) return CAN_BAUD_250K; -00093 if(!strcmp( optarg, "125K")) return CAN_BAUD_125K; -00094 if(!strcmp( optarg, "100K")) return CAN_BAUD_100K; -00095 if(!strcmp( optarg, "50K")) return CAN_BAUD_50K; -00096 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; -00097 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; -00098 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; -00099 if(!strcmp( optarg, "none")) return 0; -00100 return 0x0000; -00101 } -00102 -00103 /***************************************************************************/ -00104 CAN_HANDLE canOpen_driver(s_BOARD *board) -00105 { -00106 HANDLE fd0 = NULL; -00107 char busname[64]; -00108 char* pEnd; -00109 int i; -00110 int baudrate; -00111 -00112 if(strtol(board->busname, &pEnd,0) >= 0) -00113 { -00114 sprintf(busname,"/dev/pcan%s",board->busname); -00115 fd0 = LINUX_CAN_Open(busname, O_RDWR); -00116 } -00117 -00118 if(fd0 && (baudrate = TranslateBaudeRate(board->baudrate))) -00119 { -00120 CAN_Init(fd0, baudrate, CAN_INIT_TYPE_ST); -00121 }else{ -00122 fprintf(stderr, "canOpen_driver (Peak_Linux) : error opening %s\n", busname); -00123 } -00124 -00125 return (CAN_HANDLE)fd0; -00126 } -00127 -00128 /***************************************************************************/ -00129 int canClose_driver(CAN_HANDLE fd0) -00130 { -00131 CAN_Close(fd0); -00132 return 0; -00133 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "libpcan.h"
#include "can_driver.h"
-Go to the source code of this file.
Defines | |
#define | CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
int | TranslateBaudeRate (char *optarg) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR | -
- -
-Definition at line 37 of file can_peak_linux.c. -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 129 of file can_peak_linux.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 104 of file can_peak_linux.c. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, and TranslateBaudeRate(). -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 40 of file can_peak_linux.c. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 64 of file can_peak_linux.c. -
-References CAN_INIT_TYPE_ST_RTR, Message::data, Message::len, Message::rtr, and UNS8. -
int TranslateBaudeRate | -( | -char * | -optarg | -) | -- |
- -
-Definition at line 89 of file can_peak_linux.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #if defined(WIN32) && !defined(__CYGWIN__) -00024 #define usleep(micro) Sleep(micro%1000 ? (micro/1000) + 1 : (micro/1000)) -00025 #else -00026 #include <stdio.h> -00027 #include <string.h> -00028 #include <errno.h> -00029 #include <fcntl.h> -00030 #endif -00031 -00032 #include "cancfg.h" -00033 #include "can_driver.h" -00034 -00035 #ifndef extra_PCAN_init_params -00036 #define extra_PCAN_init_params -00037 #else -00038 #define extra_PCAN_init_params\ -00039 ,getenv("PCANHwType") ? strtol(getenv("PCANHwType"),NULL,0):0\ -00040 ,getenv("PCANIO_Port") ? strtol(getenv("PCANIO_Port"),NULL,0):0\ -00041 ,getenv("PCANInterupt") ? strtol(getenv("PCANInterupt"),NULL,0):0 -00042 #endif -00043 -00044 static s_BOARD *first_board = NULL; -00045 #ifdef PCAN2_HEADER_ -00046 static s_BOARD *second_board = NULL; -00047 #endif -00048 -00049 //pthread_mutex_t PeakCan_mutex = PTHREAD_MUTEX_INITIALIZER; -00050 -00051 // Define for rtr CAN message -00052 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR -00053 -00054 /***************************************************************************/ -00055 int TranslateBaudeRate(char* optarg){ -00056 if(!strcmp( optarg, "1M")) return CAN_BAUD_1M; -00057 if(!strcmp( optarg, "500K")) return CAN_BAUD_500K; -00058 if(!strcmp( optarg, "250K")) return CAN_BAUD_250K; -00059 if(!strcmp( optarg, "125K")) return CAN_BAUD_125K; -00060 if(!strcmp( optarg, "100K")) return CAN_BAUD_100K; -00061 if(!strcmp( optarg, "50K")) return CAN_BAUD_50K; -00062 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; -00063 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; -00064 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; -00065 if(!strcmp( optarg, "none")) return 0; -00066 return 0x0000; -00067 } -00068 -00069 void -00070 canInit (s_BOARD *board) -00071 { -00072 int baudrate; -00073 -00074 #ifdef PCAN2_HEADER_ -00075 // if not the first handler -00076 if(second_board == (s_BOARD *)board) -00077 if(baudrate = TranslateBaudeRate(board->baudrate)) -00078 CAN2_Init (baudrate, -00079 CAN_INIT_TYPE_ST extra_PCAN_init_params); -00080 #endif -00081 if(first_board == (s_BOARD *)board) -00082 if(baudrate = TranslateBaudeRate(board->baudrate)) -00083 CAN_Init (baudrate, -00084 CAN_INIT_TYPE_ST extra_PCAN_init_params); -00085 } -00086 -00087 /*********functions which permit to communicate with the board****************/ -00088 UNS8 -00089 canReceive_driver (CAN_HANDLE fd0, Message * m) -00090 { -00091 UNS8 data; -00092 TPCANMsg peakMsg; -00093 -00094 DWORD Res; -00095 -00096 do{ -00097 // We read the queue looking for messages. -00098 // -00099 //pthread_mutex_lock (&PeakCan_mutex); -00100 #ifdef PCAN2_HEADER_ -00101 // if not the first handler -00102 if(second_board == (s_BOARD *)fd0) -00103 Res = CAN2_Read (&peakMsg); -00104 else -00105 #endif -00106 if(first_board == (s_BOARD *)fd0) -00107 Res = CAN_Read (&peakMsg); -00108 else -00109 Res = CAN_ERR_BUSOFF; -00110 -00111 // A message was received -00112 // We process the message(s) -00113 // -00114 if (Res == CAN_ERR_OK) -00115 { -00116 // if something different that 11bit or rtr... problem -00117 if (peakMsg.MSGTYPE & ~(MSGTYPE_STANDARD | MSGTYPE_RTR)) -00118 { -00119 if (peakMsg.MSGTYPE == CAN_ERR_BUSOFF) -00120 { -00121 printf ("!!! Peak board read : re-init\n"); -00122 canInit((s_BOARD*) fd0); -00123 usleep (10000); -00124 } -00125 -00126 // If status, return status if 29bit, return overrun -00127 //pthread_mutex_unlock (&PeakCan_mutex); -00128 return peakMsg.MSGTYPE == -00129 MSGTYPE_STATUS ? peakMsg.DATA[2] : CAN_ERR_OVERRUN; -00130 } -00131 m->cob_id.w = peakMsg.ID; -00132 if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_ */ -00133 m->rtr = 0; -00134 else -00135 m->rtr = 1; -00136 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ -00137 for (data = 0; data < peakMsg.LEN; data++) -00138 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ -00139 -00140 }else{ -00141 //pthread_mutex_unlock (&PeakCan_mutex); -00142 //if (Res != CAN_ERR_OK) -00143 //{ -00144 if (! -00145 (Res & CAN_ERR_QRCVEMPTY || Res & CAN_ERR_BUSLIGHT -00146 || Res & CAN_ERR_BUSHEAVY)) -00147 { -00148 printf ("canReceive returned error (%d)\n", Res); -00149 return 1; -00150 } -00151 usleep (1000); -00152 } -00153 }while(Res != CAN_ERR_OK); -00154 return 0; -00155 } -00156 -00157 /***************************************************************************/ -00158 UNS8 -00159 canSend_driver (CAN_HANDLE fd0, Message * m) -00160 { -00161 UNS8 data; -00162 TPCANMsg peakMsg; -00163 peakMsg.ID = m->cob_id.w; /* 11/29 bit code */ -00164 if (m->rtr == 0) -00165 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_ */ -00166 else -00167 { -00168 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_ */ -00169 } -00170 peakMsg.LEN = m->len; -00171 /* count of data bytes (0..8) */ -00172 for (data = 0; data < m->len; data++) -00173 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ -00174 do -00175 { -00176 #ifdef PCAN2_HEADER_ -00177 // if not the first handler -00178 if(second_board == (s_BOARD *)fd0) -00179 errno = CAN2_Write (&peakMsg); -00180 else -00181 #endif -00182 if(first_board == (s_BOARD *)fd0) -00183 errno = CAN_Write (&peakMsg); -00184 else -00185 goto fail; -00186 if (errno) -00187 { -00188 if (errno == CAN_ERR_BUSOFF) -00189 { -00190 printf ("!!! Peak board write : re-init\n"); -00191 canInit((s_BOARD*)fd0); -00192 usleep (10000); -00193 } -00194 usleep (1000); -00195 } -00196 } -00197 while (errno != CAN_ERR_OK); -00198 return 0; -00199 fail: -00200 return 1; -00201 } -00202 -00203 /***************************************************************************/ -00204 CAN_HANDLE -00205 canOpen_driver (s_BOARD * board) -00206 { -00207 #ifdef PCAN2_HEADER_ -00208 if(first_board != NULL && second_board != NULL) -00209 #else -00210 if(first_board != NULL) -00211 #endif -00212 { -00213 fprintf (stderr, "Open failed.\n"); -00214 fprintf (stderr, -00215 "can_peak_win32.c: no more can port available with this pcan library\n"); -00216 fprintf (stderr, -00217 "can_peak_win32.c: please link another executable with another pcan lib\n"); -00218 return NULL; -00219 } -00220 -00221 #ifdef PCAN2_HEADER_ -00222 if(first_board == NULL) -00223 first_board = board; -00224 else -00225 second_board = board; -00226 #else -00227 first_board = board; -00228 #endif -00229 -00230 canInit(board); -00231 -00232 return (CAN_HANDLE)board; -00233 } -00234 -00235 /***************************************************************************/ -00236 int -00237 canClose_driver (CAN_HANDLE fd0) -00238 { -00239 #ifdef PCAN2_HEADER_ -00240 // if not the first handler -00241 if(second_board == (s_BOARD *)fd0) -00242 { -00243 CAN2_Close (); -00244 second_board = (s_BOARD *)NULL; -00245 }else -00246 #endif -00247 if(first_board == (s_BOARD *)fd0) -00248 { -00249 CAN_Close (); -00250 first_board = (s_BOARD *)NULL; -00251 } -00252 return 0; -00253 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "cancfg.h"
#include "can_driver.h"
-Go to the source code of this file.
Defines | |
#define | extra_PCAN_init_params |
#define | CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR |
Functions | |
int | TranslateBaudeRate (char *optarg) |
void | canInit (s_BOARD *board) |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR | -
- -
-Definition at line 52 of file can_peak_win32.c. -
#define extra_PCAN_init_params | -
- -
-Definition at line 36 of file can_peak_win32.c. -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 237 of file can_peak_win32.c. -
void canInit | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 70 of file can_peak_win32.c. -
-References struct_s_BOARD::baudrate, extra_PCAN_init_params, and TranslateBaudeRate(). -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 89 of file can_peak_win32.c. -
-References canInit(), Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 159 of file can_peak_win32.c. -
-References CAN_INIT_TYPE_ST_RTR, canInit(), Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
int TranslateBaudeRate | -( | -char * | -optarg | -) | -- |
- -
-Definition at line 55 of file can_peak_win32.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <stdlib.h> -00026 #include <stddef.h> /* for NULL */ -00027 #include <errno.h> -00028 -00029 #include "config.h" -00030 -00031 #ifdef RTCAN_SOCKET -00032 #include "rtdm/rtcan.h" -00033 #define CAN_IFNAME "rtcan%s" -00034 #define CAN_SOCKET rt_dev_socket -00035 #define CAN_CLOSE rt_dev_close -00036 #define CAN_RECV rt_dev_recv -00037 #define CAN_SEND rt_dev_send -00038 #define CAN_BIND rt_dev_bind -00039 #define CAN_IOCTL rt_dev_ioctl -00040 #define CAN_ERRNO(err) (-err) -00041 #else -00042 #include <sys/socket.h> -00043 #include <sys/ioctl.h> -00044 #include "linux/can.h" -00045 #include "linux/can/raw.h" -00046 #include "net/if.h" -00047 #define PF_CAN 29 -00048 #define AF_CAN PF_CAN -00049 //#include "af_can.h" -00050 #define CAN_IFNAME "can%s" -00051 #define CAN_SOCKET socket -00052 #define CAN_CLOSE close -00053 #define CAN_RECV recv -00054 #define CAN_SEND send -00055 #define CAN_BIND bind -00056 #define CAN_IOCTL ioctl -00057 #define CAN_ERRNO(err) errno -00058 #endif -00059 -00060 #include "can_driver.h" -00061 -00062 /*********functions which permit to communicate with the board****************/ -00063 UNS8 -00064 canReceive_driver (CAN_HANDLE fd0, Message * m) -00065 { -00066 int res; -00067 struct can_frame frame; -00068 -00069 res = CAN_RECV (*(int *) fd0, &frame, sizeof (frame), 0); -00070 if (res < 0) -00071 { -00072 fprintf (stderr, "Recv failed: %s\n", strerror (CAN_ERRNO (res))); -00073 return 1; -00074 } -00075 -00076 m->cob_id.w = frame.can_id & CAN_EFF_MASK; -00077 m->len = frame.can_dlc; -00078 if (frame.can_id & CAN_RTR_FLAG) -00079 m->rtr = 1; -00080 else -00081 m->rtr = 0; -00082 memcpy (m->data, frame.data, 8); -00083 -00084 return 0; -00085 } -00086 -00087 -00088 /***************************************************************************/ -00089 UNS8 -00090 canSend_driver (CAN_HANDLE fd0, Message * m) -00091 { -00092 int res; -00093 struct can_frame frame; -00094 -00095 frame.can_id = m->cob_id.w; -00096 if (frame.can_id >= 0x800) -00097 frame.can_id |= CAN_EFF_FLAG; -00098 frame.can_dlc = m->len; -00099 if (m->rtr) -00100 frame.can_id |= CAN_RTR_FLAG; -00101 else -00102 memcpy (frame.data, m->data, 8); -00103 -00104 res = CAN_SEND (*(int *) fd0, &frame, sizeof (frame), 0); -00105 if (res < 0) -00106 { -00107 fprintf (stderr, "Send failed: %s\n", strerror (CAN_ERRNO (res))); -00108 return 1; -00109 } -00110 -00111 return 0; -00112 } -00113 -00114 /***************************************************************************/ -00115 #ifdef RTCAN_SOCKET -00116 int -00117 TranslateBaudRate (const char *optarg) -00118 { -00119 int baudrate; -00120 int val, len; -00121 char *pos = NULL; -00122 -00123 len = strlen (optarg); -00124 if (!len) -00125 return 0; -00126 -00127 switch ((int) optarg[len - 1]) -00128 { -00129 case 'M': -00130 baudrate = 1000000; -00131 break; -00132 case 'K': -00133 baudrate = 1000; -00134 break; -00135 default: -00136 baudrate = 1; -00137 break; -00138 } -00139 if ((sscanf (optarg, "%i", &val)) == 1) -00140 baudrate *= val; -00141 else -00142 baudrate = 0;; -00143 -00144 return baudrate; -00145 } -00146 #endif -00147 -00148 /***************************************************************************/ -00149 CAN_HANDLE -00150 canOpen_driver (s_BOARD * board) -00151 { -00152 struct ifreq ifr; -00153 struct sockaddr_can addr; -00154 int err; -00155 CAN_HANDLE fd0 = malloc (sizeof (int)); -00156 #ifdef RTCAN_SOCKET -00157 can_baudrate_t *baudrate; -00158 can_mode_t *mode; -00159 #endif -00160 -00161 *(int *) fd0 = CAN_SOCKET (PF_CAN, SOCK_RAW, CAN_RAW); -00162 if (*(int *) fd0 < 0) -00163 { -00164 fprintf (stderr, "Socket creation failed: %s\n", -00165 strerror (CAN_ERRNO (*(int *) fd0))); -00166 goto error_ret; -00167 } -00168 -00169 if (*board->busname >= '0' && *board->busname <= '9') -00170 snprintf (ifr.ifr_name, IFNAMSIZ, CAN_IFNAME, board->busname); -00171 else -00172 strncpy (ifr.ifr_name, board->busname, IFNAMSIZ); -00173 err = CAN_IOCTL (*(int *) fd0, SIOCGIFINDEX, &ifr); -00174 if (err) -00175 { -00176 fprintf (stderr, "Getting IF index for %s failed: %s\n", -00177 ifr.ifr_name, strerror (CAN_ERRNO (err))); -00178 goto error_close; -00179 } -00180 -00181 addr.can_family = AF_CAN; -00182 addr.can_ifindex = ifr.ifr_ifindex; -00183 err = CAN_BIND (*(int *) fd0, (struct sockaddr *) &addr, sizeof (addr)); -00184 if (err) -00185 { -00186 fprintf (stderr, "Binding failed: %s\n", strerror (CAN_ERRNO (err))); -00187 goto error_close; -00188 } -00189 -00190 #ifdef RTCAN_SOCKET -00191 baudrate = (can_baudrate_t *) & ifr.ifr_ifru; -00192 *baudrate = TranslateBaudRate (board->baudrate); -00193 if (!*baudrate) -00194 goto error_close; -00195 -00196 err = CAN_IOCTL (*(int *) fd0, SIOCSCANBAUDRATE, &ifr); -00197 if (err) -00198 { -00199 fprintf (stderr, -00200 "Setting baudrate %d failed: %s\n", -00201 *baudrate, strerror (CAN_ERRNO (err))); -00202 goto error_close; -00203 } -00204 -00205 mode = (can_mode_t *) & ifr.ifr_ifru; -00206 *mode = CAN_MODE_START; -00207 err = CAN_IOCTL (*(int *) fd0, SIOCSCANMODE, &ifr); -00208 if (err) -00209 { -00210 fprintf (stderr, "Starting CAN device failed: %s\n", -00211 strerror (CAN_ERRNO (err))); -00212 goto error_close; -00213 } -00214 #endif -00215 -00216 return fd0; -00217 -00218 error_close: -00219 CAN_CLOSE (*(int *) fd0); -00220 -00221 error_ret: -00222 free (fd0); -00223 return NULL; -00224 } -00225 -00226 /***************************************************************************/ -00227 int -00228 canClose_driver (CAN_HANDLE fd0) -00229 { -00230 if (fd0) -00231 { -00232 CAN_CLOSE (*(int *) fd0); -00233 free (fd0); -00234 } -00235 return 0; -00236 } -
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <errno.h>
#include "config.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include "linux/can.h"
#include "linux/can/raw.h"
#include "net/if.h"
#include "can_driver.h"
-Go to the source code of this file.
Defines | |
#define | PF_CAN 29 |
#define | AF_CAN PF_CAN |
#define | CAN_IFNAME "can%s" |
#define | CAN_SOCKET socket |
#define | CAN_CLOSE close |
#define | CAN_RECV recv |
#define | CAN_SEND send |
#define | CAN_BIND bind |
#define | CAN_IOCTL ioctl |
#define | CAN_ERRNO(err) errno |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define AF_CAN PF_CAN | -
- -
-Definition at line 48 of file can_socket.c. -
#define CAN_BIND bind | -
- -
-Definition at line 55 of file can_socket.c. -
#define CAN_CLOSE close | -
- -
-Definition at line 52 of file can_socket.c. -
#define CAN_ERRNO | -( | -err | -- | ) | -errno | -
- -
-Definition at line 57 of file can_socket.c. -
#define CAN_IFNAME "can%s" | -
- -
-Definition at line 50 of file can_socket.c. -
#define CAN_IOCTL ioctl | -
- -
-Definition at line 56 of file can_socket.c. -
#define CAN_RECV recv | -
- -
-Definition at line 53 of file can_socket.c. -
#define CAN_SEND send | -
- -
-Definition at line 54 of file can_socket.c. -
#define CAN_SOCKET socket | -
- -
-Definition at line 51 of file can_socket.c. -
#define PF_CAN 29 | -
- -
-Definition at line 47 of file can_socket.c. -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 150 of file can_socket.c. -
-References AF_CAN, struct_s_BOARD::baudrate, struct_s_BOARD::busname, CAN_BIND, CAN_CLOSE, CAN_ERRNO, CAN_IFNAME, CAN_IOCTL, CAN_SOCKET, and PF_CAN. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 64 of file can_socket.c. -
-References CAN_ERRNO, CAN_RECV, Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 90 of file can_socket.c. -
-References CAN_ERRNO, CAN_SEND, Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
-
00001 // can_uvccm_win32 adapter (http://www.gridconnect.com) -00002 // driver for CanFestival-3 Win32 port -00003 // Copyright (C) 2007 Leonid Tochinski, ChattenAssociates, Inc. -00004 -00005 -00006 #include <sstream> -00007 #include <iomanip> -00008 #if 0 // change to 1 if you use boost -00009 #include <boost/algorithm/string/case_conv.hpp> -00010 #else -00011 #include <algorithm> -00012 #endif -00013 -00014 extern "C" { -00015 #include "can_driver.h" -00016 } -00017 class can_uvccm_win32 -00018 { -00019 public: -00020 class error -00021 { -00022 }; -00023 can_uvccm_win32(s_BOARD *board); -00024 ~can_uvccm_win32(); -00025 bool send(const Message *m); -00026 bool receive(Message *m); -00027 private: -00028 bool open_rs232(int port = 1, int baud_rate = 57600); -00029 bool close_rs232(); -00030 bool get_can_data(const char* can_cmd_buf, long& bufsize, Message* m); -00031 bool set_can_data(const Message& m, std::string& can_cmd); -00032 private: -00033 HANDLE m_port; -00034 HANDLE m_read_event; -00035 HANDLE m_write_event; -00036 std::string m_residual_buffer; -00037 }; -00038 -00039 can_uvccm_win32::can_uvccm_win32(s_BOARD *board) : m_port(INVALID_HANDLE_VALUE), -00040 m_read_event(0), -00041 m_write_event(0) -00042 { -00043 if (strcmp( board->baudrate, "125K") || !open_rs232(1)) -00044 throw error(); -00045 } -00046 -00047 can_uvccm_win32::~can_uvccm_win32() -00048 { -00049 close_rs232(); -00050 } -00051 -00052 bool can_uvccm_win32::send(const Message *m) -00053 { -00054 if (m_port == INVALID_HANDLE_VALUE) -00055 return false; -00056 -00057 // build can_uvccm_win32 command string -00058 std::string can_cmd; -00059 set_can_data(*m, can_cmd); -00060 -00061 OVERLAPPED overlapped; -00062 ::memset(&overlapped, 0, sizeof overlapped); -00063 overlapped.hEvent = m_write_event; -00064 ::ResetEvent(overlapped.hEvent); -00065 -00066 unsigned long bytes_written = 0; -00067 ::WriteFile(m_port, can_cmd.c_str(), (unsigned long)can_cmd.size(), &bytes_written, &overlapped); -00068 // wait for write operation completion -00069 enum { WRITE_TIMEOUT = 1000 }; -00070 ::WaitForSingleObject(overlapped.hEvent, WRITE_TIMEOUT); -00071 // get number of bytes written -00072 ::GetOverlappedResult(m_port, &overlapped, &bytes_written, FALSE); -00073 -00074 bool result = (bytes_written == can_cmd.size()); -00075 -00076 return result; -00077 } -00078 -00079 -00080 bool can_uvccm_win32::receive(Message *m) -00081 { -00082 if (m_port == INVALID_HANDLE_VALUE) -00083 return false; -00084 -00085 long res_buffer_size = (long)m_residual_buffer.size(); -00086 bool result = get_can_data(m_residual_buffer.c_str(), res_buffer_size, m); -00087 if (result) -00088 { -00089 m_residual_buffer.erase(0, res_buffer_size); -00090 return true; -00091 } -00092 -00093 enum { READ_TIMEOUT = 500 }; -00094 -00095 OVERLAPPED overlapped; -00096 ::memset(&overlapped, 0, sizeof overlapped); -00097 overlapped.hEvent = m_read_event; -00098 ::ResetEvent(overlapped.hEvent); -00099 unsigned long event_mask = 0; -00100 -00101 if (FALSE == ::WaitCommEvent(m_port, &event_mask, &overlapped) && ERROR_IO_PENDING == ::GetLastError()) -00102 { -00103 if (WAIT_TIMEOUT == ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT)) -00104 return false; -00105 } -00106 -00107 // get number of bytes in the input que -00108 COMSTAT stat; -00109 ::memset(&stat, 0, sizeof stat); -00110 unsigned long errors = 0; -00111 ::ClearCommError(m_port, &errors, &stat); -00112 if (stat.cbInQue == 0) -00113 return false; -00114 char buffer[3000]; -00115 -00116 unsigned long bytes_to_read = min(stat.cbInQue, sizeof (buffer)); -00117 -00118 unsigned long bytes_read = 0; -00119 ::ReadFile(m_port, buffer, bytes_to_read, &bytes_read, &overlapped); -00120 // wait for read operation completion -00121 ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT); -00122 // get number of bytes read -00123 ::GetOverlappedResult(m_port, &overlapped, &bytes_read, FALSE); -00124 result = false; -00125 if (bytes_read > 0) -00126 { -00127 m_residual_buffer.append(buffer, bytes_read); -00128 res_buffer_size = (long)m_residual_buffer.size(); -00129 result = get_can_data(m_residual_buffer.c_str(), res_buffer_size, m); -00130 if (result) -00131 m_residual_buffer.erase(0, res_buffer_size); -00132 } -00133 return result; -00134 } -00135 -00136 bool can_uvccm_win32::open_rs232(int port, int baud_rate) -00137 { -00138 if (m_port != INVALID_HANDLE_VALUE) -00139 return true; -00140 -00141 std::ostringstream device_name; -00142 device_name << "COM" << port; -00143 -00144 m_port = ::CreateFile(device_name.str().c_str(), -00145 GENERIC_READ | GENERIC_WRITE, -00146 0, // exclusive access -00147 NULL, // no security -00148 OPEN_EXISTING, -00149 FILE_FLAG_OVERLAPPED, // overlapped I/O -00150 NULL); // null template -00151 -00152 // Check the returned handle for INVALID_HANDLE_VALUE and then set the buffer sizes. -00153 if (m_port == INVALID_HANDLE_VALUE) -00154 return false; -00155 -00156 // SetCommMask(m_hCom,EV_RXCHAR|EV_TXEMPTY|EV_CTS|EV_DSR|EV_RLSD|EV_BREAK|EV_ERR|EV_RING); // -00157 ::SetCommMask(m_port, EV_RXFLAG); -00158 -00159 COMMTIMEOUTS timeouts; -00160 ::memset(&timeouts, 0, sizeof (timeouts)); -00161 timeouts.ReadIntervalTimeout = -1; -00162 timeouts.ReadTotalTimeoutConstant = 0; -00163 timeouts.ReadTotalTimeoutMultiplier = 0; -00164 timeouts.WriteTotalTimeoutConstant = 5000; -00165 timeouts.WriteTotalTimeoutMultiplier = 0; -00166 SetCommTimeouts(m_port, &timeouts); // -00167 -00168 ::SetupComm(m_port, 1024, 512); // set buffer sizes -00169 -00170 // Port settings are specified in a Data Communication Block (DCB). The easiest way to initialize a DCB is to call GetCommState to fill in its default values, override the values that you want to change and then call SetCommState to set the values. -00171 DCB dcb; -00172 ::memset(&dcb, 0, sizeof (dcb)); -00173 ::GetCommState(m_port, &dcb); -00174 dcb.BaudRate = baud_rate; -00175 dcb.ByteSize = 8; -00176 dcb.Parity = NOPARITY; -00177 dcb.StopBits = ONESTOPBIT; -00178 dcb.fAbortOnError = TRUE; -00179 dcb.EvtChar = 0x0A; // '\n' character -00180 ::SetCommState(m_port, &dcb); -00181 -00182 ::PurgeComm(m_port, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR); -00183 -00184 m_read_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); -00185 m_write_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); -00186 -00187 return true; -00188 } -00189 -00190 bool can_uvccm_win32::close_rs232() -00191 { -00192 if (m_port != INVALID_HANDLE_VALUE) -00193 { -00194 ::PurgeComm(m_port, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR); -00195 ::CloseHandle(m_port); -00196 m_port = INVALID_HANDLE_VALUE; -00197 ::CloseHandle(m_read_event); -00198 m_read_event = 0; -00199 ::CloseHandle(m_write_event); -00200 m_write_event = 0; -00201 m_residual_buffer.clear(); -00202 } -00203 return true; -00204 } -00205 -00206 bool can_uvccm_win32::get_can_data(const char* can_cmd_buf, long& bufsize, Message* m) -00207 { -00208 if (bufsize < 5) -00209 { -00210 bufsize = 0; -00211 return false; -00212 } -00213 -00214 Message msg; -00215 ::memset(&msg, 0 , sizeof (msg)); -00216 char colon = 0, type = 0, request = 0; -00217 std::istringstream buf(std::string(can_cmd_buf, bufsize)); -00218 buf >> colon >> type >> std::hex >> msg.cob_id.w >> request; -00219 if (colon != ':' || (type != 'S' && type != 'X')) -00220 { -00221 bufsize = 0; -00222 return false; -00223 } -00224 if (request == 'N') -00225 { -00226 msg.rtr = 0; -00227 for (msg.len = 0; msg.len < 8; ++msg.len) -00228 { -00229 std::string data_byte_str; -00230 buf >> std::setw(2) >> data_byte_str; -00231 if (data_byte_str[0] == ';') -00232 break; -00233 long byte_val = -1; -00234 std::istringstream(data_byte_str) >> std::hex >> byte_val; -00235 if (byte_val == -1) -00236 { -00237 bufsize = 0; -00238 return false; -00239 } -00240 msg.data[msg.len] = (UNS8)byte_val; -00241 } -00242 if (msg.len == 8) -00243 { -00244 char semicolon = 0; -00245 buf >> semicolon; -00246 if (semicolon != ';') -00247 { -00248 bufsize = 0; -00249 return false; -00250 } -00251 } -00252 -00253 } -00254 else if (request == 'R') -00255 { -00256 msg.rtr = 1; -00257 buf >> msg.len; -00258 } -00259 else -00260 { -00261 bufsize = 0; -00262 return false; -00263 } -00264 -00265 bufsize = buf.tellg(); -00266 -00267 *m = msg; -00268 return true; -00269 } -00270 -00271 bool can_uvccm_win32::set_can_data(const Message& m, std::string& can_cmd) -00272 { -00273 // build can_uvccm_win32 command string -00274 std::ostringstream can_cmd_str; -00275 can_cmd_str << ":S" << std::hex << m.cob_id.w; -00276 if (m.rtr == 1) -00277 { -00278 can_cmd_str << 'R' << (long)m.len; -00279 } -00280 else -00281 { -00282 can_cmd_str << 'N'; -00283 for (int i = 0; i < m.len; ++i) -00284 can_cmd_str << std::hex << std::setfill('0') << std::setw(2) << (long)m.data[i]; -00285 } -00286 can_cmd_str << ';'; -00287 can_cmd = can_cmd_str.str(); -00288 #ifdef BOOST_VERSION -00289 boost::to_upper(can_cmd); -00290 #else -00291 std::transform(can_cmd.begin(),can_cmd.end(),can_cmd.begin(),::toupper); -00292 #endif -00293 return true; -00294 } -00295 -00296 -00297 //------------------------------------------------------------------------ -00298 extern "C" -00299 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00300 { -00301 return (UNS8)(!(reinterpret_cast<can_uvccm_win32*>(fd0)->receive(m))); -00302 } -00303 -00304 extern "C" -00305 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00306 { -00307 return (UNS8)reinterpret_cast<can_uvccm_win32*>(fd0)->send(m); -00308 } -00309 -00310 extern "C" -00311 CAN_HANDLE canOpen_driver(s_BOARD *board) -00312 { -00313 try -00314 { -00315 return (CAN_HANDLE) new can_uvccm_win32(board); -00316 } -00317 catch (can_uvccm_win32::error&) -00318 { -00319 return NULL; -00320 } -00321 } -00322 -00323 extern "C" -00324 int canClose_driver(CAN_HANDLE inst) -00325 { -00326 delete reinterpret_cast<can_uvccm_win32*>(inst); -00327 return 1; -00328 } -00329 -00330 -00331 -
#include <sstream>
#include <iomanip>
#include <algorithm>
#include "can_driver.h"
-Go to the source code of this file.
Data Structures | |
class | can_uvccm_win32 |
class | can_uvccm_win32::error |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE inst) |
int canClose_driver | -( | -CAN_HANDLE | -inst | -) | -- |
- -
-Definition at line 324 of file can_uvccm_win32.cpp. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 311 of file can_uvccm_win32.cpp. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* -00024 Virtual CAN driver. -00025 */ -00026 -00027 #include <stdio.h> -00028 #include <unistd.h> -00029 -00030 #include "can_driver.h" -00031 #include "def.h" -00032 -00033 #define MAX_NB_CAN_PIPES 16 -00034 -00035 typedef struct { -00036 char used; -00037 int pipe[2]; -00038 } CANPipe; -00039 -00040 CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},}; -00041 -00042 /*********functions which permit to communicate with the board****************/ -00043 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00044 { -00045 if(read(((CANPipe*)fd0)->pipe[0], m, sizeof(Message)) != (ssize_t)sizeof(Message)) -00046 { -00047 return 1; -00048 } -00049 return 0; -00050 } -00051 -00052 #define MyCase(fc) case fc: printf(#fc);break; -00053 void print_message(Message *m) -00054 { -00055 int i; -00056 switch(m->cob_id.w >> 7) -00057 { -00058 MyCase(SYNC) -00059 MyCase(TIME_STAMP) -00060 MyCase(PDO1tx) -00061 MyCase(PDO1rx) -00062 MyCase(PDO2tx) -00063 MyCase(PDO2rx) -00064 MyCase(PDO3tx) -00065 MyCase(PDO3rx) -00066 MyCase(PDO4tx) -00067 MyCase(PDO4rx) -00068 MyCase(SDOtx) -00069 MyCase(SDOrx) -00070 MyCase(NODE_GUARD) -00071 MyCase(NMT) -00072 } -00073 printf(" rtr:%d", m->rtr); -00074 printf(" len:%d", m->len); -00075 for (i = 0 ; i < m->len ; i++) -00076 printf(" %02x", m->data[i]); -00077 printf("\n"); -00078 } -00079 -00080 /***************************************************************************/ -00081 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00082 { -00083 int i; -00084 -00085 printf("%x->[ ", (CANPipe*)fd0 - &canpipes[0]); -00086 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00087 { -00088 if(canpipes[i].used && &canpipes[i] != (CANPipe*)fd0) -00089 { -00090 printf("%x ",i); -00091 } -00092 } -00093 printf(" ]"); -00094 print_message(m); -00095 -00096 // Send to all readers, except myself -00097 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00098 { -00099 if(canpipes[i].used && &canpipes[i] != (CANPipe*)fd0) -00100 { -00101 write(canpipes[i].pipe[1], m, sizeof(Message)); -00102 } -00103 } -00104 return 0; -00105 } -00106 /* -00107 int TranslateBaudeRate(char* optarg){ -00108 if(!strcmp( optarg, "1M")) return 1000; -00109 if(!strcmp( optarg, "500K")) return 500; -00110 if(!strcmp( optarg, "250K")) return 250; -00111 if(!strcmp( optarg, "125K")) return 125; -00112 if(!strcmp( optarg, "100K")) return 100; -00113 if(!strcmp( optarg, "50K")) return 50; -00114 if(!strcmp( optarg, "20K")) return 20; -00115 if(!strcmp( optarg, "10K")) return 10; -00116 if(!strcmp( optarg, "5K")) return 5; -00117 if(!strcmp( optarg, "none")) return 0; -00118 return 0; -00119 }*/ -00120 /***************************************************************************/ -00121 CAN_HANDLE canOpen_driver(s_BOARD *board) -00122 { -00123 int i; -00124 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00125 { -00126 if(!canpipes[i].used) -00127 break; -00128 } -00129 -00130 /* Create the pipe. */ -00131 if (i==MAX_NB_CAN_PIPES || pipe(canpipes[i].pipe)) -00132 { -00133 fprintf (stderr, "Open failed.\n"); -00134 return (CAN_HANDLE)NULL; -00135 } -00136 -00137 canpipes[i].used = 1; -00138 return (CAN_HANDLE) &canpipes[i]; -00139 } -00140 -00141 /***************************************************************************/ -00142 int canClose_driver(CAN_HANDLE fd0) -00143 { -00144 close(((CANPipe*)fd0)->pipe[0]); -00145 close(((CANPipe*)fd0)->pipe[1]); -00146 ((CANPipe*)fd0)->used = 0; -00147 return 0; -00148 } -00149 -00150 -
#include <stdio.h>
#include <unistd.h>
#include "can_driver.h"
#include "def.h"
-Go to the source code of this file.
Data Structures | |
struct | CANPipe |
Defines | |
#define | MAX_NB_CAN_PIPES 16 |
#define | MyCase(fc) case fc: printf(#fc);break; |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
void | print_message (Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
Variables | |
CANPipe | canpipes [MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},} |
#define MAX_NB_CAN_PIPES 16 | -
- -
-Definition at line 33 of file can_virtual.c. -
#define MyCase | -( | -fc | -- | ) | -case fc: printf(#fc);break; | -
- -
-Definition at line 52 of file can_virtual.c. -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 142 of file can_virtual.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 121 of file can_virtual.c. -
-References canpipes, MAX_NB_CAN_PIPES, and CANPipe::used. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 43 of file can_virtual.c. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 81 of file can_virtual.c. -
-References canpipes, MAX_NB_CAN_PIPES, and print_message(). -
void print_message | -( | -Message * | -m | -) | -- |
- -
-Definition at line 53 of file can_virtual.c. -
-References Message::cob_id, Message::data, Message::len, MyCase, NMT, NODE_GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, Message::rtr, SDOrx, SDOtx, SYNC, TIME_STAMP, and SHORT_CAN::w. -
-
CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},} | -
- -
-Definition at line 40 of file can_virtual.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __CANDRIVER__ -00024 #define __CANDRIVER__ -00025 -00026 //#include DEBUG_CAN -00027 -00028 #include <can.h> -00029 #include <objdictdef.h> -00030 -00031 -00032 /* -00033 The CAN message received are stored in a fifo stack -00034 We consider one stack for all the 5 can devices. It is a choice ! -00035 */ -00036 -00037 /* Be free to change this value */ -00038 #define MAX_STACK_MSG_RCV 5 -00039 -00040 /* Number of incomings and outcomings CAN Line. The layer CanOpen must be -00041 used only for ONE line CAN. But you may used one or more CAN drivers, without -00042 a CanOpen layer. -00043 Only 2 lines are implemented. If more lines are needed, copy void __attribute__((interrupt)) can0HdlRcv (void) to void __attribute__((interrupt)) canXHdlRcv (void) and make -00044 changes : [0] to [x], CAN0 to CANX, etc -00045 */ -00046 #define NB_LINE_CAN 1 -00047 -00048 /* Whose hardware HCS12 CAN block is used for CanOpen ? Chose between CAN0, ..., CAN4 -00049 If you use CANOPEN_LINE_NUMBER_USED = CANI, the value of NB_LINE_CAN must be -00050 more or equal to I + 1 -00051 Value other than CAN0 not tested, but should work fine. -00052 */ -00053 #define CANOPEN_LINE_NUMBER_USED CAN0 -00054 -00055 /* Stack of received messages -00056 MSG received on CAN0 module is stored in stackMsgRcv[0], etc -00057 */ -00058 extern volatile Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV]; -00059 -00060 -00061 /* Copy from the stack of the message to treat */ -00062 extern Message msgRcv; -00063 -00064 -00065 /* To move on the stack of messages -00066 */ -00067 typedef struct { -00068 UNS8 w ; /* received */ -00069 UNS8 r ; /* To transmit */ -00070 } t_pointerStack; -00071 -00072 -00073 /* Pointer for write or read a message in/from the reception stack */ -00074 extern volatile t_pointerStack ptrMsgRcv[NB_LINE_CAN]; -00075 -00076 /* -00077 Parameters to define the clock system for the CAN bus -00078 example : -00079 CAN_BUS_TIME clk = { -00080 1, // clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board -00081 0, // brp : chose btw 0 and 63 (6 bits). freq time quantum = 16MHz / (brp + 1) -00082 1, // sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum -00083 1, // samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit -00084 4, // tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1) tq -00085 9, // tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1) tq -00086 -00087 -00088 With these values, -00089 - The width of the bit time is 16 time quantum : -00090 - 1 tq for the SYNC segment (could not be modified) -00091 - 10 tq for the TIME 1 segment (tseg1 = 9) -00092 - 5 tq for the TIME 2 segment (tseg2 = 4) -00093 - Because the bus clock of the MSCAN is 16 MHZ, and the -00094 freq of the time quantum is 16 MHZ (brp = 0), and there are 16 tq in the bit time, -00095 so the freq of the bit time is 1 MHz. -00096 -00097 }; -00098 */ -00099 typedef struct { -00100 UNS8 clksrc; /* use of internal clock or clock bus */ -00101 UNS8 brp; /* define the bus speed */ -00102 UNS8 sjw; /* Number of time quantum for synchro - 1 */ -00103 UNS8 samp; /* Number of sample per bit (1 or 3) */ -00104 UNS8 tseg2; /* Width of the time segment 2 (in tq) - 1 */ -00105 UNS8 tseg1; /* Width of the time segment 1 (in tq) - 1 */ -00106 } canBusTime; -00107 -00108 /* -00109 Parameters to init the filters for received messages -00110 */ -00111 typedef struct { -00112 UNS8 idam; /* Put 0x01 for 16 bits acceptance filter */ -00113 UNS8 canidar0; -00114 UNS8 canidmr0; -00115 UNS8 canidar1; -00116 UNS8 canidmr1; -00117 UNS8 canidar2; -00118 UNS8 canidmr2; -00119 UNS8 canidar3; -00120 UNS8 canidmr3; -00121 UNS8 canidar4; -00122 UNS8 canidmr4; -00123 UNS8 canidar5; -00124 UNS8 canidmr5; -00125 UNS8 canidar6; -00126 UNS8 canidmr6; -00127 UNS8 canidar7; -00128 UNS8 canidmr7; -00129 } canBusFilterInit; -00130 -00131 /* -00132 Parameters to init MSCAN -00133 Example -00134 CAN_BUS_INIT bi = { -00135 0, no low power -00136 0, no time stamp -00137 1, enable MSCAN -00138 0, clock source : oscillator -00139 0, no loop back -00140 0, no listen only -00141 0, no low pass filter for wk up -00142 { -00143 1, Use the oscillator clock -00144 0, Quartz oscillator : freq time quantum = freq oscillator clock / (0 + 1) -00145 1, Sync on (1 + 1) time quantum -00146 1, 1 sample per bit -00147 4, time segment 2 width : (4 + 1) tq -00148 9, time segment 1 width : (9 + 1) tq -00149 } -00150 }; -00151 */ -00152 -00153 typedef struct { -00154 UNS8 cswai; /* Low power/normal in wait mode (1/0) */ -00155 UNS8 time; /* Timer for time-stamp enable/disable (1/0) */ -00156 UNS8 cane; /* Enable MSCAN (yes=1) Do it ! */ -00157 UNS8 clksrc; /* clock source bus/oscillator (1/0) */ -00158 UNS8 loopb; /* loop back mode for test (yes=1/no=0) */ -00159 UNS8 listen; /* MSCAN is listen only (yes=1/no=0 ie normal)*/ -00160 UNS8 wupm; /* low pas filter for wake up (yes=1/no=0) */ -00161 canBusTime -00162 clk; /* Values for clock system init */ -00163 canBusFilterInit -00164 fi; /* Values for filter acceptance msg init */ -00165 -00166 } canBusInit; -00167 -00168 extern canBusInit bi; -00169 -00170 -00171 -00172 /* -00173 For the received messsage, add a Identificator to -00174 the list of ID to accept. -00175 You can use several times this function to accept several messages. -00176 It configures registers on 16 bits. -00177 Automatically, it configure the filter to -00178 - not accepting the msg on 29 bits (ide=1 refused) -00179 - not filtering on rtr state (rtr = 1 and rtr = 0 are accepted) -00180 Algo : -00181 if CANIDARx = 0 then CANIDARx = id . else do nothing -00182 CANIDMRx = CANIDMRx OR (CANIDARx XOR id ) -00183 nFilter : 0 to 3 -00184 Must be in init mode before. -00185 */ -00186 char canAddIdToFilter ( -00187 UNS16 adrCAN, -00188 UNS8 nFilter, -00189 UNS16 id /* 11 bits, the 5 msb not used */ -00190 ); -00191 -00192 /* -00193 Use this function to change the CAN message acceptance filters and masks. -00194 */ -00195 char canChangeFilter (UNS16 adrCAN, canBusFilterInit fi); -00196 -00197 -00198 /* -00199 Enable one of the 5 MSCAN. -00200 Must be done only one time after a reset of the CPU. -00201 To do before any CAN initialisation -00202 */ -00203 char canEnable ( -00204 UNS16 adrCAN /* First address of MSCANx registers */ -00205 ); -00206 -00207 -00208 /* -00209 Initialize one of the 5 mscan -00210 can be done multiple times in your code -00211 Return 0 : OK -00212 When it return from the function, -00213 mscan is on sleep mode with wake up disabled. -00214 is not on init mode -00215 */ -00216 char canInit ( -00217 UNS16 adrCAN, /* First address of MSCANx registers */ -00218 canBusInit -00219 bi /* All the parameters to init the bus */ -00220 ); -00221 /* -00222 Initialize the parameters of the system clock for the MSCAN -00223 You must put the MSCAN in sleep mode before with canSleepMode() -00224 Return 0 : OK -00225 1 : Not in sleep mode. Unable to init MSCAN -00226 */ -00227 char canInitClock ( -00228 UNS16 adrCAN, /* First address of MSCANx registers */ -00229 canBusTime clk); -00230 -00231 /* -00232 Initialize one filter for acceptance of received msg. -00233 Filters MUST be configured on 16 bits -00234 (See doc Motorola mscan bloc guide fig 4.3) -00235 Must be in init mode before. -00236 adrCAN : adress of the first register of the mscan module -00237 nFilter : the filter : 0 to 3. -00238 ar : Value to write in acceptance register -00239 Beware ! hight byte and low byte inverted. -00240 for example if nFilter = 0, hight byte of ar -> CANIDAR0 -00241 low byte of ar -> CANIDAR1 -00242 mr : Value to write in mask register -00243 Beware ! hight byte and low byte inverted. -00244 for example if nFilter = 2, hight byte of ar -> CANIDMR4 -00245 low byte of ar -> CANIDMR5 -00246 */ -00247 char canInit1Filter ( -00248 UNS16 adrCAN, -00249 UNS8 nFilter, -00250 UNS16 ar, -00251 UNS16 mr -00252 ); -00253 -00254 /* -00255 Initialise the parameters for filtering the messages received. -00256 You must put the MSCAN in init mode before with canInitMode() -00257 Return 0 : OK -00258 1 : Not in init mode. Unable to init MSCAN -00259 */ -00260 -00261 char canInitFilter ( -00262 UNS16 adrCAN, /* First address of MSCANx registers */ -00263 canBusFilterInit fi); -00264 /* -00265 Put one of the 5 mscan in Init mode -00266 Loop until init mode is reached. -00267 */ -00268 -00269 char canInitMode ( -00270 UNS16 adrCAN /* First address of MSCANx registers */ -00271 ); -00272 -00273 /* -00274 Leave the Init mode -00275 loop until init mode leaved. -00276 */ -00277 -00278 char canInitModeQ ( -00279 UNS16 adrCAN /* First address of MSCANx registers */ -00280 ); -00281 -00282 -00283 -00284 /* -00285 Transmit a msg on CAN "adrCan" -00286 Return : 0 No error -00287 other error : no buffer available to make the transmission -00288 */ -00289 -00290 char canMsgTransmit ( -00291 UNS16 adrCAN, /* First address of MSCANx registers */ -00292 Message msg /* Message to transmit */ -00293 ); -00294 -00295 /* -00296 Set the interruptions. Must be call just after having left the init mode. -00297 */ -00298 char canSetInterrupt (UNS16 adrCAN); -00299 -00300 /* -00301 Put one of the 5 mscan in sleep mode -00302 Beware! If some messages are to be sent, -00303 or if it is receiving, going into sleep mode -00304 may take time. -00305 Wake up is disabled : stay in sleep mode even if -00306 bus traffic detected. -00307 return 0 if 0K, other if error : mscan is on init mode. -00308 Stay in this function until the sleep mode -00309 is reached. -00310 */ -00311 char canSleepMode ( -00312 UNS16 adrCAN /* First address of MSCANx registers */ -00313 ); -00314 -00315 /* -00316 Leave the sleep mode -00317 loop until sleep mode leaved. -00318 return 0 : OK -00319 return 1 : error : in init mode -00320 */ -00321 char canSleepModeQ ( -00322 UNS16 adrCAN /* First address of MSCANx registers */ -00323 ); -00324 -00325 /* -00326 Put one of the 5 mscan in sleep mode -00327 MSCAN must not be in init mode. -00328 wake up is enabled : wake up if traffic on CAN is detected -00329 Beware! If some messages are to be sent, -00330 or if it is receiving, going into sleep mode -00331 may take time. -00332 Loop until sleep mode reached. -00333 return 0 if 0K, other if error -00334 */ -00335 char canSleepWupMode ( -00336 UNS16 adrCAN /* First address of MSCANx registers */ -00337 ); -00338 -00339 /* -00340 Test if one of the 5 mscan is in init mode. -00341 Return -00342 0 -> Not in init mode -00343 other -> In init mode -00344 */ -00345 char canTestInitMode ( -00346 UNS16 adrCAN /* First address of MSCANx registers */ -00347 ); -00348 -00349 /* -00350 Test if one of the 5 mscan is in sleep mode. -00351 Return -00352 0 -> Not in sleep mode -00353 other -> In sleep mode -00354 */ -00355 char canTestSleepMode ( -00356 UNS16 adrCAN /* First address of MSCANx registers */ -00357 ); -00358 -00359 -00360 -00361 #endif /*__CANDRIVER__*/ -00362 -
#include <can.h>
#include <objdictdef.h>
-Go to the source code of this file.
Data Structures | |
struct | t_pointerStack |
struct | canBusTime |
struct | canBusFilterInit |
struct | canBusInit |
Defines | |
#define | MAX_STACK_MSG_RCV 5 |
#define | NB_LINE_CAN 1 |
#define | CANOPEN_LINE_NUMBER_USED CAN0 |
Functions | |
char | canAddIdToFilter (UNS16 adrCAN, UNS8 nFilter, UNS16 id) |
char | canChangeFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canEnable (UNS16 adrCAN) |
char | canInit (UNS16 adrCAN, canBusInit bi) |
char | canInitClock (UNS16 adrCAN, canBusTime clk) |
char | canInit1Filter (UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) |
char | canInitFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canInitMode (UNS16 adrCAN) |
char | canInitModeQ (UNS16 adrCAN) |
char | canMsgTransmit (UNS16 adrCAN, Message msg) |
char | canSetInterrupt (UNS16 adrCAN) |
char | canSleepMode (UNS16 adrCAN) |
char | canSleepModeQ (UNS16 adrCAN) |
char | canSleepWupMode (UNS16 adrCAN) |
char | canTestInitMode (UNS16 adrCAN) |
char | canTestSleepMode (UNS16 adrCAN) |
Variables | |
volatile Message | stackMsgRcv [NB_LINE_CAN][MAX_STACK_MSG_RCV] |
Message | msgRcv |
volatile t_pointerStack | ptrMsgRcv [NB_LINE_CAN] |
canBusInit | bi |
#define CANOPEN_LINE_NUMBER_USED CAN0 | -
- -
-Definition at line 53 of file candriver.h. -
#define MAX_STACK_MSG_RCV 5 | -
- -
-Definition at line 38 of file candriver.h. -
#define NB_LINE_CAN 1 | -
- -
-Definition at line 46 of file candriver.h. -
-
char canAddIdToFilter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -id | - |
- | ) | -- |
- -
-Definition at line 210 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_16, IO_PORTS_8, MSG_WAR, and UNS8. -
char canChangeFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 250 of file canOpenDriver.c. -
-References canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), and canTestInitMode(). -
char canEnable | -( | -UNS16 | -adrCAN | -) | -- |
char canInit | -( | -UNS16 | -adrCAN, | -|
- | - | canBusInit | -bi | - |
- | ) | -- |
- -
-Definition at line 277 of file canOpenDriver.c. -
-References CANCTL0, CANCTL1, canBusInit::cane, canEnable(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), canTestInitMode(), canBusInit::clk, canBusInit::cswai, canBusInit::fi, IO_PORTS_8, canBusInit::listen, canBusInit::loopb, canBusInit::time, and canBusInit::wupm. -
char canInit1Filter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -ar, | -|
- | - | UNS16 | -mr | - |
- | ) | -- |
- -
-Definition at line 335 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_8, MSG_WAR, and UNS8. -
char canInitClock | -( | -UNS16 | -adrCAN, | -|
- | - | canBusTime | -clk | - |
- | ) | -- |
- -
-Definition at line 313 of file canOpenDriver.c. -
-References canBusTime::brp, CANBTR0, CANBTR1, CANCTL1, canTestInitMode(), canBusTime::clksrc, IO_PORTS_8, MSG_WAR, canBusTime::samp, canBusTime::sjw, canBusTime::tseg1, and canBusTime::tseg2. -
char canInitFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 364 of file canOpenDriver.c. -
-References CANIDAC, canBusFilterInit::canidar0, CANIDAR0, canBusFilterInit::canidar1, CANIDAR1, canBusFilterInit::canidar2, CANIDAR2, canBusFilterInit::canidar3, CANIDAR3, canBusFilterInit::canidar4, CANIDAR4, canBusFilterInit::canidar5, CANIDAR5, canBusFilterInit::canidar6, CANIDAR6, canBusFilterInit::canidar7, CANIDAR7, canBusFilterInit::canidmr0, CANIDMR0, canBusFilterInit::canidmr1, CANIDMR1, canBusFilterInit::canidmr2, CANIDMR2, canBusFilterInit::canidmr3, CANIDMR3, canBusFilterInit::canidmr4, CANIDMR4, canBusFilterInit::canidmr5, CANIDMR5, canBusFilterInit::canidmr6, CANIDMR6, canBusFilterInit::canidmr7, CANIDMR7, canTestInitMode(), canBusFilterInit::idam, IO_PORTS_8, and MSG_WAR. -
char canInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 392 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
char canInitModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 401 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
char canMsgTransmit | -( | -UNS16 | -adrCAN, | -|
- | - | Message | -msg | - |
- | ) | -- |
- -
-Definition at line 410 of file canOpenDriver.c. -
-References CANTBSEL, CANTFLG, CANTRSDTA, CANTRSID, CANTRSLEN, CANTRSPRI, Message::cob_id, Message::data, IO_PORTS_8, Message::len, MSG_WAR, Message::rtr, UNS8, and SHORT_CAN::w. -
char canSetInterrupt | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 445 of file canOpenDriver.c. -
-References CANRIER, CANTIER, and IO_PORTS_8. -
char canSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 452 of file canOpenDriver.c. -
-References CANCTL0, canTestSleepMode(), and IO_PORTS_8. -
char canSleepModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 466 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
char canSleepWupMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 480 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
char canTestInitMode | -( | -UNS16 | -adrCAN | -) | -- |
char canTestSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
-
canBusInit bi | -
- -
volatile t_pointerStack ptrMsgRcv[NB_LINE_CAN] | -
- -
volatile Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV] | -
- -
-
00001 /* canmsg.h - common kernel-space and user-space CAN message structure -00002 * Linux CAN-bus device driver. -00003 * Written by Pavel Pisa - OCERA team member -00004 * email:pisa@cmp.felk.cvut.cz -00005 * This software is released under the GPL-License. -00006 * Version lincan-0.3 17 Jun 2004 -00007 */ -00008 -00009 #ifndef _CANMSG_T_H -00010 #define _CANMSG_T_H -00011 -00012 #ifdef __KERNEL__ -00013 -00014 #include <linux/time.h> -00015 #include <linux/types.h> -00016 -00017 #else /* __KERNEL__ */ -00018 -00019 #include <sys/time.h> -00020 #include <sys/types.h> -00021 -00022 #endif /* __KERNEL__ */ -00023 -00024 #ifdef __cplusplus -00025 extern "C" { -00026 #endif -00027 -00028 /* -00029 * CAN_MSG_VERSION_2 enables new canmsg_t layout compatible with -00030 * can4linux project from http://www.port.de/ -00031 * -00032 */ -00033 #define CAN_MSG_VERSION_2 -00034 -00035 /* Number of data bytes in one CAN message */ -00036 #define CAN_MSG_LENGTH 8 -00037 -00038 #ifdef CAN_MSG_VERSION_2 -00039 -00040 typedef struct timeval canmsg_tstamp_t ; -00041 -00042 typedef unsigned long canmsg_id_t; -00043 -00059 struct canmsg_t { -00060 int flags; -00061 int cob; -00062 canmsg_id_t id; -00063 canmsg_tstamp_t timestamp; -00064 unsigned short length; -00065 unsigned char data[CAN_MSG_LENGTH]; -00066 }; -00067 -00068 #else /*CAN_MSG_VERSION_2*/ -00069 #ifndef PACKED -00070 #define PACKED __attribute__((packed)) -00071 #endif -00072 /* Old, deprecated version of canmsg_t structure */ -00073 struct canmsg_t { -00074 short flags; -00075 int cob; -00076 canmsg_id_t id; -00077 unsigned long timestamp; -00078 unsigned int length; -00079 unsigned char data[CAN_MSG_LENGTH]; -00080 } PACKED; -00081 #endif /*CAN_MSG_VERSION_2*/ -00082 -00083 typedef struct canmsg_t canmsg_t; -00084 -00105 struct canfilt_t { -00106 int flags; -00107 int queid; -00108 int cob; -00109 canmsg_id_t id; -00110 canmsg_id_t mask; -00111 }; -00112 -00113 typedef struct canfilt_t canfilt_t; -00114 -00115 /* Definitions to use for canmsg_t and canfilt_t flags */ -00116 #define MSG_RTR (1<<0) -00117 #define MSG_OVR (1<<1) -00118 #define MSG_EXT (1<<2) -00119 #define MSG_LOCAL (1<<3) -00120 /* If you change above lines, check canque_filtid2internal function */ -00121 -00122 /* Additional definitions used for canfilt_t only */ -00123 #define MSG_FILT_MASK_SHIFT 8 -00124 #define MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) -00125 #define MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) -00126 #define MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) -00127 #define MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) -00128 -00129 /* Can message ID mask */ -00130 #define MSG_ID_MASK ((1l<<29)-1) -00131 -00132 #ifdef __cplusplus -00133 } /* extern "C"*/ -00134 #endif -00135 -00136 #endif /*_CANMSG_T_H*/ -
#include <sys/time.h>
#include <sys/types.h>
-Go to the source code of this file.
Data Structures | |
struct | canmsg_t |
struct | canfilt_t |
Defines | |
#define | CAN_MSG_VERSION_2 |
#define | CAN_MSG_LENGTH 8 |
#define | MSG_RTR (1<<0) |
#define | MSG_OVR (1<<1) |
#define | MSG_EXT (1<<2) |
#define | MSG_LOCAL (1<<3) |
#define | MSG_FILT_MASK_SHIFT 8 |
#define | MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) |
#define | MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) |
#define | MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) |
#define | MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) |
#define | MSG_ID_MASK ((1l<<29)-1) |
Typedefs | |
typedef timeval | canmsg_tstamp_t |
typedef unsigned long | canmsg_id_t |
typedef canmsg_t | canmsg_t |
typedef canfilt_t | canfilt_t |
#define MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) | -
#define MSG_ID_MASK ((1l<<29)-1) | -
#define MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) | -
#define MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) | -
#define MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) | -
-
typedef unsigned long canmsg_id_t | -
typedef struct timeval canmsg_tstamp_t | -
-
Public Member Functions | |
can_uvccm_win32 (s_BOARD *board) | |
~can_uvccm_win32 () | |
bool | send (const Message *m) |
bool | receive (Message *m) |
Private Member Functions | |
bool | open_rs232 (int port=1, int baud_rate=57600) |
bool | close_rs232 () |
bool | get_can_data (const char *can_cmd_buf, long &bufsize, Message *m) |
bool | set_can_data (const Message &m, std::string &can_cmd) |
Private Attributes | |
HANDLE | m_port |
HANDLE | m_read_event |
HANDLE | m_write_event |
std::string | m_residual_buffer |
Data Structures | |
class | error |
- -
-Definition at line 17 of file can_uvccm_win32.cpp.
can_uvccm_win32::can_uvccm_win32 | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 39 of file can_uvccm_win32.cpp. -
-References struct_s_BOARD::baudrate, and open_rs232(). -
can_uvccm_win32::~can_uvccm_win32 | -( | -- | ) | -- |
-
bool can_uvccm_win32::send | -( | -const Message * | -m | -) | -- |
- -
-Definition at line 52 of file can_uvccm_win32.cpp. -
-References FALSE, m_port, m_write_event, set_can_data(), and eds_utils::WriteFile(). -
bool can_uvccm_win32::receive | -( | -Message * | -m | -) | -- |
- -
-Definition at line 80 of file can_uvccm_win32.cpp. -
-References FALSE, get_can_data(), m_port, m_read_event, and m_residual_buffer. -
bool can_uvccm_win32::open_rs232 | -( | -int | - port = 1 , |
- |
- | - | int | - baud_rate = 57600 | - |
- | ) | - [private] |
-
- -
-Definition at line 136 of file can_uvccm_win32.cpp. -
-References FALSE, m_port, m_read_event, m_write_event, and TRUE. -
bool can_uvccm_win32::close_rs232 | -( | -- | ) | - [private] |
-
- -
-Definition at line 190 of file can_uvccm_win32.cpp. -
-References m_port, m_read_event, m_residual_buffer, and m_write_event. -
bool can_uvccm_win32::get_can_data | -( | -const char * | -can_cmd_buf, | -|
- | - | long & | -bufsize, | -|
- | - | Message * | -m | - |
- | ) | - [private] |
-
- -
-Definition at line 206 of file can_uvccm_win32.cpp. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
bool can_uvccm_win32::set_can_data | -( | -const Message & | -m, | -|
- | - | std::string & | -can_cmd | - |
- | ) | - [private] |
-
- -
-Definition at line 271 of file can_uvccm_win32.cpp. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
-
HANDLE can_uvccm_win32::m_port [private] |
-
- -
-Definition at line 33 of file can_uvccm_win32.cpp. -
HANDLE can_uvccm_win32::m_read_event [private] |
-
- -
-Definition at line 34 of file can_uvccm_win32.cpp. -
HANDLE can_uvccm_win32::m_write_event [private] |
-
- -
-Definition at line 35 of file can_uvccm_win32.cpp. -
std::string can_uvccm_win32::m_residual_buffer [private] |
-
- -
-Definition at line 36 of file can_uvccm_win32.cpp. -
-
- -
-Definition at line 20 of file can_uvccm_win32.cpp.
Public Member Functions | |
ccritical_section () | |
~ccritical_section () | |
void | enter () |
void | leave () |
Private Attributes | |
CRITICAL_SECTION | m_cs |
- -
-Definition at line 38 of file timers_win32.cpp.
ccritical_section::ccritical_section | -( | -- | ) | - [inline] |
-
ccritical_section::~ccritical_section | -( | -- | ) | - [inline] |
-
-
void ccritical_section::enter | -( | -- | ) | - [inline] |
-
void ccritical_section::leave | -( | -- | ) | - [inline] |
-
-
CRITICAL_SECTION ccritical_section::m_cs [private] |
-
- -
-Definition at line 58 of file timers_win32.cpp. -
-
Public Member Functions | |
class_timers () | |
~class_timers () | |
void | start_timer_thread () |
void | resume_timer_thread () |
void | stop_timer_thread () |
void | set_timer (TIMEVAL value) |
TIMEVAL | get_elapsed_time () |
Private Member Functions | |
TIMEVAL | get_timer () const |
Static Private Member Functions | |
static DWORD WINAPI | timer_loop_thread_proc (void *arg) |
Private Attributes | |
TIMEVAL | m_last_occured_alarm_time |
volatile TIMEVAL | m_last_alarm_set_time |
HANDLE | m_timer_thread |
volatile bool | m_continue_timer_loop |
bool | m_use_hi_res_timer |
double | m_counts_per_usec |
- -
-Definition at line 94 of file timers_win32.cpp.
class_timers::class_timers | -( | -- | ) | -- |
- -
-Definition at line 116 of file timers_win32.cpp. -
-References m_counts_per_usec, and m_use_hi_res_timer. -
class_timers::~class_timers | -( | -- | ) | -- |
-
void class_timers::start_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 173 of file timers_win32.cpp. -
-References get_timer(), m_last_alarm_set_time, m_last_occured_alarm_time, m_timer_thread, timer_loop_thread_proc(), and TIMEVAL_MAX. -
void class_timers::resume_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 184 of file timers_win32.cpp. -
-References m_continue_timer_loop, and m_timer_thread. -
void class_timers::stop_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 193 of file timers_win32.cpp. -
-References m_continue_timer_loop, and m_timer_thread. -
void class_timers::set_timer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 204 of file timers_win32.cpp. -
-References get_timer(), m_last_alarm_set_time, and TIMEVAL_MAX. -
TIMEVAL class_timers::get_elapsed_time | -( | -- | ) | -- |
- -
-Definition at line 210 of file timers_win32.cpp. -
-References get_timer(), and m_last_occured_alarm_time. -
TIMEVAL class_timers::get_timer | -( | -- | ) | - const [private] |
-
- -
-Definition at line 139 of file timers_win32.cpp. -
-References m_counts_per_usec, m_use_hi_res_timer, and TIMEVAL. -
DWORD WINAPI class_timers::timer_loop_thread_proc | -( | -void * | -arg | -) | - [static, private] |
-
- -
-Definition at line 151 of file timers_win32.cpp. -
-References EnterMutex(), get_timer(), LeaveMutex(), m_continue_timer_loop, m_last_alarm_set_time, m_last_occured_alarm_time, TimeDispatch(), TIMEVAL, and TIMEVAL_MAX. -
-
TIMEVAL class_timers::m_last_occured_alarm_time [private] |
-
- -
-Definition at line 108 of file timers_win32.cpp. -
volatile TIMEVAL class_timers::m_last_alarm_set_time [private] |
-
- -
-Definition at line 109 of file timers_win32.cpp. -
HANDLE class_timers::m_timer_thread [private] |
-
- -
-Definition at line 110 of file timers_win32.cpp. -
volatile bool class_timers::m_continue_timer_loop [private] |
-
- -
-Definition at line 111 of file timers_win32.cpp. -
bool class_timers::m_use_hi_res_timer [private] |
-
- -
-Definition at line 112 of file timers_win32.cpp. -
double class_timers::m_counts_per_usec [private] |
-
- -
-Definition at line 113 of file timers_win32.cpp. -
-
Public Member Functions | |
def | __init__ |
def | OnOK |
def | OnImportEDSButton |
def | RefreshEDSFile |
def | SetNodeList |
def | GetValues |
Data Fields | |
ButtonSizer | |
NodeList | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 905 of file commondialogs.py.
def commondialogs::AddSlaveDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 906 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 911 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 919 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 964 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::OnOK | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 973 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::OnImportEDSButton | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 1016 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::RefreshEDSFile | -( | -- | self | -) | -- |
- -
-Definition at line 1030 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::SetNodeList | -( | -- | self, | -|
- | - | - | nodelist | - |
- | ) | -- |
- -
-Definition at line 1038 of file commondialogs.py. -
def commondialogs::AddSlaveDialog::GetValues | -( | -- | self | -) | -- |
- -
-Definition at line 1042 of file commondialogs.py. -
-
commondialogs::AddSlaveDialog::ButtonSizer | -
- -
-Definition at line 966 of file commondialogs.py. -
commondialogs::AddSlaveDialog::NodeList | -
- -
-Definition at line 1039 of file commondialogs.py. -
-
Public Member Functions | |
def | __init__ |
def | SetIndexDictionary |
def | SetCurrentList |
def | GetCurrentList |
def | RefreshLists |
def | OnPossibleIndexesDClick |
def | OnCurrentIndexesDClick |
def | OnSelectButton |
def | OnUnselectButton |
def | SelectPossible |
def | UnselectCurrent |
Data Fields | |
ButtonSizer | |
AllList | |
CurrentList | |
IndexDictionary | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 41 of file commondialogs.py.
def commondialogs::CommunicationDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 42 of file commondialogs.py. -
def commondialogs::CommunicationDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 47 of file commondialogs.py. -
def commondialogs::CommunicationDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 55 of file commondialogs.py. -
def commondialogs::CommunicationDialog::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 106 of file commondialogs.py. -
def commondialogs::CommunicationDialog::SetIndexDictionary | -( | -- | self, | -|
- | - | - | dictionary | - |
- | ) | -- |
- -
-Definition at line 114 of file commondialogs.py. -
def commondialogs::CommunicationDialog::SetCurrentList | -( | -- | self, | -|
- | - | - | list | - |
- | ) | -- |
- -
-Definition at line 117 of file commondialogs.py. -
def commondialogs::CommunicationDialog::GetCurrentList | -( | -- | self | -) | -- |
- -
-Definition at line 122 of file commondialogs.py. -
def commondialogs::CommunicationDialog::RefreshLists | -( | -- | self | -) | -- |
- -
-Definition at line 125 of file commondialogs.py. -
def commondialogs::CommunicationDialog::OnPossibleIndexesDClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 139 of file commondialogs.py. -
def commondialogs::CommunicationDialog::OnCurrentIndexesDClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 143 of file commondialogs.py. -
def commondialogs::CommunicationDialog::OnSelectButton | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 147 of file commondialogs.py. -
def commondialogs::CommunicationDialog::OnUnselectButton | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 151 of file commondialogs.py. -
def commondialogs::CommunicationDialog::SelectPossible | -( | -- | self | -) | -- |
- -
-Definition at line 155 of file commondialogs.py. -
def commondialogs::CommunicationDialog::UnselectCurrent | -( | -- | self | -) | -- |
- -
-Definition at line 162 of file commondialogs.py. -
-
commondialogs::CommunicationDialog::ButtonSizer | -
- -
-Definition at line 108 of file commondialogs.py. -
commondialogs::CommunicationDialog::AllList | -
- -
-Definition at line 110 of file commondialogs.py. -
commondialogs::CommunicationDialog::CurrentList | -
- -
-Definition at line 111 of file commondialogs.py. -
- -
-Definition at line 112 of file commondialogs.py. -
-
Public Member Functions | |
def | __init__ |
def | OnOK |
def | GetValues |
def | GetProfile |
def | GetNMTManagement |
def | GetOptions |
def | OnProfileChoice |
Data Fields | |
ButtonSizer | |
ListProfile | |
Directory | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 669 of file commondialogs.py.
def commondialogs::CreateNodeDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 670 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 675 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 683 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::__init__ | -( | -- | self, | -|
- | - | - | parent, | -|
- | - | - | cwd | - |
- | ) | -- |
- -
-Definition at line 795 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::OnOK | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 820 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::GetValues | -( | -- | self | -) | -- |
- -
-Definition at line 842 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::GetProfile | -( | -- | self | -) | -- |
- -
-Definition at line 851 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::GetNMTManagement | -( | -- | self | -) | -- |
- -
-Definition at line 855 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::GetOptions | -( | -- | self | -) | -- |
- -
-Definition at line 864 of file commondialogs.py. -
def commondialogs::CreateNodeDialog::OnProfileChoice | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 878 of file commondialogs.py. -
-
commondialogs::CreateNodeDialog::ButtonSizer | -
- -
-Definition at line 797 of file commondialogs.py. -
commondialogs::CreateNodeDialog::ListProfile | -
- -
-Definition at line 804 of file commondialogs.py. -
commondialogs::CreateNodeDialog::Directory | -
- -
-Definition at line 806 of file commondialogs.py. -
-
Public Member Functions | |
def | __init__ |
def | SetIndex |
def | OnOK |
def | GetValues |
def | OnRadioButton1Click |
def | OnRadioButton2Click |
def | OnRadioButton3Click |
def | EnableNumberTyping |
Data Fields | |
ButtonSizer | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 185 of file commondialogs.py.
def commondialogs::MapVariableDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 186 of file commondialogs.py. -
def commondialogs::MapVariableDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 191 of file commondialogs.py. -
def commondialogs::MapVariableDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 199 of file commondialogs.py. -
def commondialogs::MapVariableDialog::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 263 of file commondialogs.py. -
def commondialogs::MapVariableDialog::SetIndex | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 272 of file commondialogs.py. -
def commondialogs::MapVariableDialog::OnOK | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 275 of file commondialogs.py. -
def commondialogs::MapVariableDialog::GetValues | -( | -- | self | -) | -- |
- -
-Definition at line 305 of file commondialogs.py. -
def commondialogs::MapVariableDialog::OnRadioButton1Click | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 319 of file commondialogs.py. -
def commondialogs::MapVariableDialog::OnRadioButton2Click | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 323 of file commondialogs.py. -
def commondialogs::MapVariableDialog::OnRadioButton3Click | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 327 of file commondialogs.py. -
def commondialogs::MapVariableDialog::EnableNumberTyping | -( | -- | self, | -|
- | - | - | enable | - |
- | ) | -- |
- -
-Definition at line 331 of file commondialogs.py. -
-
commondialogs::MapVariableDialog::ButtonSizer | -
- -
-Definition at line 265 of file commondialogs.py. -
-
Public Member Functions | |
def | __init__ |
def | OnOK |
def | SetValues |
def | GetValues |
Data Fields | |
ButtonSizer | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 543 of file commondialogs.py.
def commondialogs::NodeInfosDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 544 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 549 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 557 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 605 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::OnOK | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 614 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::SetValues | -( | -- | self, | -|
- | - | - | name, | -|
- | - | - | id, | -|
- | - | - | type, | -|
- | - | - | description | - |
- | ) | -- |
- -
-Definition at line 636 of file commondialogs.py. -
def commondialogs::NodeInfosDialog::GetValues | -( | -- | self | -) | -- |
- -
-Definition at line 642 of file commondialogs.py. -
-
commondialogs::NodeInfosDialog::ButtonSizer | -
- -
-Definition at line 607 of file commondialogs.py. -
-
Public Member Functions | |
def | __init__ |
def | OnOK |
def | SetValues |
def | SetTypeList |
def | OnTypeChoice |
def | RefreshValues |
def | GetValues |
Data Fields | |
ButtonSizer | |
TypeDictionary | |
Private Member Functions | |
def | _init_coll_flexGridSizer1_Items |
def | _init_sizers |
def | _init_ctrls |
- -
-Definition at line 348 of file commondialogs.py.
def commondialogs::UserTypeDialog::_init_coll_flexGridSizer1_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 349 of file commondialogs.py. -
def commondialogs::UserTypeDialog::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 354 of file commondialogs.py. -
def commondialogs::UserTypeDialog::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 362 of file commondialogs.py. -
def commondialogs::UserTypeDialog::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 414 of file commondialogs.py. -
def commondialogs::UserTypeDialog::OnOK | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 422 of file commondialogs.py. -
def commondialogs::UserTypeDialog::SetValues | -( | -- | self, | -|
- | - | - | min = None , |
- |
- | - | - | max = None , |
- |
- | - | - | length = None | - |
- | ) | -- |
- -
-Definition at line 470 of file commondialogs.py. -
def commondialogs::UserTypeDialog::SetTypeList | -( | -- | self, | -|
- | - | - | typedic, | -|
- | - | - | type = None | - |
- | ) | -- |
- -
-Definition at line 478 of file commondialogs.py. -
def commondialogs::UserTypeDialog::OnTypeChoice | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 491 of file commondialogs.py. -
def commondialogs::UserTypeDialog::RefreshValues | -( | -- | self | -) | -- |
- -
-Definition at line 495 of file commondialogs.py. -
def commondialogs::UserTypeDialog::GetValues | -( | -- | self | -) | -- |
- -
-Definition at line 521 of file commondialogs.py. -
-
commondialogs::UserTypeDialog::ButtonSizer | -
- -
-Definition at line 416 of file commondialogs.py. -
commondialogs::UserTypeDialog::TypeDictionary | -
- -
-Definition at line 418 of file commondialogs.py. -
-
Public Member Functions | |
driver_procs () | |
~driver_procs () | |
HMODULE | load_canfestival_driver (LPCTSTR driver_name) |
bool | can_driver_valid () const |
Data Fields | |
CANRECEIVE_DRIVER_PROC | m_canReceive |
CANSEND_DRIVER_PROC | m_canSend |
CANOPEN_DRIVER_PROC | m_canOpen |
CANCLOSE_DRIVER_PROC | m_canClose |
HMODULE | m_driver_handle |
- -
-Definition at line 46 of file drivers_win32.cpp.
driver_procs::driver_procs | -( | -- | ) | -- |
- -
-Definition at line 66 of file drivers_win32.cpp. -
driver_procs::~driver_procs | -( | -- | ) | -- |
-
HMODULE driver_procs::load_canfestival_driver | -( | -LPCTSTR | -driver_name | -) | -- |
- -
-Definition at line 94 of file drivers_win32.cpp. -
-References can_driver_valid(), m_canClose, m_canOpen, m_canReceive, m_canSend, m_driver_handle, and myTEXT. -
bool driver_procs::can_driver_valid | -( | -- | ) | -const | -
- -
-Definition at line 79 of file drivers_win32.cpp. -
-References m_canClose, m_canOpen, m_canReceive, and m_canSend. -
-
CANRECEIVE_DRIVER_PROC driver_procs::m_canReceive | -
- -
-Definition at line 57 of file drivers_win32.cpp. -
CANSEND_DRIVER_PROC driver_procs::m_canSend | -
- -
-Definition at line 58 of file drivers_win32.cpp. -
CANOPEN_DRIVER_PROC driver_procs::m_canOpen | -
- -
-Definition at line 59 of file drivers_win32.cpp. -
CANCLOSE_DRIVER_PROC driver_procs::m_canClose | -
- -
-Definition at line 60 of file drivers_win32.cpp. -
HMODULE driver_procs::m_driver_handle | -
- -
-Definition at line 63 of file drivers_win32.cpp. -
-
Private Member Functions | |
def | _init_coll_menuBar1_Menus |
def | _init_coll_EditMenu_Items |
def | _init_coll_HelpMenu_Items |
def | _init_coll_FileMenu_Items |
- -
-Definition at line 168 of file networkedit.py.
def networkedit::networkedit::_init_coll_menuBar1_Menus | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 169 of file networkedit.py. -
def networkedit::networkedit::_init_coll_EditMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 179 of file networkedit.py. -
def networkedit::networkedit::_init_coll_HelpMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 213 of file networkedit.py. -
def networkedit::networkedit::_init_coll_FileMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 230 of file networkedit.py. -
-
Public Member Functions | |
def | __init__ |
Data Fields | |
linkinfo |
- -
-Definition at line 78 of file networkedit.py.
def networkedit::wxHtmlWindowUrlClick::__init__ | -( | -- | self, | -|
- | - | - | linkinfo | - |
- | ) | -- |
- -
-Definition at line 79 of file networkedit.py. -
-
networkedit::wxHtmlWindowUrlClick::linkinfo | -
- -
-Definition at line 82 of file networkedit.py. -
-
Public Member Functions | |
def | OnLinkClicked |
Static Public Attributes | |
Html_Window = True | |
Data Structures | |
class | HtmlFrame |
HTML window that generates and OnLinkClicked event. - -Use this to avoid having to override HTMLWindow -
- -
-Definition at line 84 of file networkedit.py.
def networkedit::wxUrlClickHtmlWindow::OnLinkClicked | -( | -- | self, | -|
- | - | - | linkinfo | - |
- | ) | -- |
- -
-Definition at line 86 of file networkedit.py. -
-
networkedit::wxUrlClickHtmlWindow::Html_Window = True [static] |
-
- -
-Definition at line 131 of file networkedit.py. -
-
Public Member Functions | |
def | __init__ |
def | SetHtmlCode |
def | SetHtmlPage |
def | OnCloseFrame |
def | OnLinkClick |
Data Fields | |
HtmlFrameOpened | |
Private Member Functions | |
def | _init_ctrls |
- -
-Definition at line 95 of file networkedit.py.
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 96 of file networkedit.py. -
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::__init__ | -( | -- | self, | -|
- | - | - | parent, | -|
- | - | - | opened | - |
- | ) | -- |
- -
-Definition at line 108 of file networkedit.py. -
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::SetHtmlCode | -( | -- | self, | -|
- | - | - | htmlcode | - |
- | ) | -- |
- -
-Definition at line 112 of file networkedit.py. -
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::SetHtmlPage | -( | -- | self, | -|
- | - | - | htmlpage | - |
- | ) | -- |
- -
-Definition at line 115 of file networkedit.py. -
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::OnCloseFrame | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 118 of file networkedit.py. -
def networkedit::wxUrlClickHtmlWindow::HtmlFrame::OnLinkClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 122 of file networkedit.py. -
-
- -
-Definition at line 110 of file networkedit.py. -
-
- -
-Definition at line 392 of file node.py.
def node::Node::__init__ | -( | -- | self, | -|
- | - | - | name = "" , |
- |
- | - | - | type = "slave" , |
- |
- | - | - | id = 0 , |
- |
- | - | - | description = "" , |
- |
- | - | - | profilename = "DS-301" , |
- |
- | - | - | profile = {} , |
- |
- | - | - | specificmenu = [] | - |
- | ) | -- |
def node::Node::GetNodeName | -( | -- | self | -) | -- |
def node::Node::SetNodeName | -( | -- | self, | -|
- | - | - | name | - |
- | ) | -- |
def node::Node::GetNodeType | -( | -- | self | -) | -- |
def node::Node::SetNodeType | -( | -- | self, | -|
- | - | - | type | - |
- | ) | -- |
def node::Node::GetNodeID | -( | -- | self | -) | -- |
def node::Node::SetNodeID | -( | -- | self, | -|
- | - | - | id | - |
- | ) | -- |
def node::Node::GetNodeDescription | -( | -- | self | -) | -- |
def node::Node::SetNodeDescription | -( | -- | self, | -|
- | - | - | description | - |
- | ) | -- |
def node::Node::GetProfileName | -( | -- | self | -) | -- |
def node::Node::SetProfileName | -( | -- | self, | -|
- | - | - | profilename | - |
- | ) | -- |
def node::Node::GetProfile | -( | -- | self | -) | -- |
def node::Node::SetProfile | -( | -- | self, | -|
- | - | - | profile | - |
- | ) | -- |
def node::Node::SetDS302Profile | -( | -- | self, | -|
- | - | - | profile | - |
- | ) | -- |
def node::Node::GetDS302Profile | -( | -- | self | -) | -- |
def node::Node::GetSpecificMenu | -( | -- | self | -) | -- |
def node::Node::SetSpecificMenu | -( | -- | self, | -|
- | - | - | specificmenu | - |
- | ) | -- |
def node::Node::ExtendSpecificMenu | -( | -- | self, | -|
- | - | - | specificmenu | - |
- | ) | -- |
def node::Node::GetMappings | -( | -- | self, | -|
- | - | - | userdefinedtoo = True | - |
- | ) | -- |
def node::Node::AddEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None , |
- |
- | - | - | value = None | - |
- | ) | -- |
def node::Node::SetEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None , |
- |
- | - | - | value = None | - |
- | ) | -- |
def node::Node::SetParamsEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None , |
- |
- | - | - | comment = None , |
- |
- | - | - | save = None , |
- |
- | - | - | callback = None | - |
- | ) | -- |
def node::Node::RemoveEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::IsEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::GetEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::GetParamsEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::HasEntryCallbacks | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::IsMappingEntry | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::AddMappingEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None , |
- |
- | - | - | name = "Undefined" , |
- |
- | - | - | struct = 0 , |
- |
- | - | - | size = None , |
- |
- | - | - | nbmax = None , |
- |
- | - | - | default = None , |
- |
- | - | - | values = None | - |
- | ) | -- |
def node::Node::SetMappingEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None , |
- |
- | - | - | name = None , |
- |
- | - | - | struct = None , |
- |
- | - | - | size = None , |
- |
- | - | - | nbmax = None , |
- |
- | - | - | default = None , |
- |
- | - | - | values = None | - |
- | ) | -- |
def node::Node::RemoveMappingEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::RemoveMapVariable | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
def node::Node::UpdateMapVariable | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex, | -|
- | - | - | size | - |
- | ) | -- |
def node::Node::RemoveLine | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | max, | -|
- | - | - | incr = 1 | - |
- | ) | -- |
def node::Node::RemoveUserType | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::Copy | -( | -- | self | -) | -- |
def node::Node::GetIndexes | -( | -- | self | -) | -- |
def node::Node::Print | -( | -- | self | -) | -- |
def node::Node::CompileValue | -( | -- | self, | -|
- | - | - | value, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::GetBaseIndex | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::GetCustomisedTypeValues | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::GetEntryName | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::GetEntryInfos | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
def node::Node::GetSubentryInfos | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex | - |
- | ) | -- |
def node::Node::GetTypeIndex | -( | -- | self, | -|
- | - | - | typename | - |
- | ) | -- |
def node::Node::GetTypeName | -( | -- | self, | -|
- | - | - | typeindex | - |
- | ) | -- |
def node::Node::GetTypeDefaultValue | -( | -- | self, | -|
- | - | - | typeindex | - |
- | ) | -- |
def node::Node::GetMapVariableList | -( | -- | self | -) | -- |
def node::Node::GetMandatoryIndexes | -( | -- | self, | -|
- | - | - | node = None | - |
- | ) | -- |
def node::Node::GetCustomisableTypes | -( | -- | self | -) | -- |
def node::Node::GetTypeList | -( | -- | self | -) | -- |
def node::Node::GenerateMapList | -( | -- | self | -) | -- |
def node::Node::GetMapValue | -( | -- | self, | -|
- | - | - | mapname | - |
- | ) | -- |
def node::Node::GetMapName | -( | -- | self, | -|
- | - | - | value | - |
- | ) | -- |
def node::Node::GetMapList | -( | -- | self | -) | -- |
-
node::Node::Name | -
node::Node::Type | -
node::Node::ID | -
node::Node::Description | -
node::Node::ProfileName | -
node::Node::Profile | -
node::Node::SpecificMenu | -
node::Node::Dictionary | -
node::Node::ParamsDictionary | -
node::Node::DS302 | -
node::Node::UserMapping | -
node::Node::MapList | -
node::Node::NameTranslation | -
node::Node::MapTranslation | -
-
Public Member Functions | |
def | __init__ |
def | GetNetworkName |
def | SetNetworkName |
def | GetManager |
def | GetRoot |
def | GetSlaveNumber |
def | GetSlaveNames |
def | GetSlaveIDs |
def | SetCurrentSelected |
def | GetCurrentSelected |
def | LoadProject |
def | SaveProject |
def | ImportEDSFile |
def | LoadEDS |
def | AddSlaveNode |
def | RemoveSlaveNode |
def | LoadMasterNode |
def | SaveMasterNode |
def | LoadSlaveNodes |
def | SaveNodeList |
def | GetSlaveNodeEntry |
def | GetMasterNodeEntry |
def | SetMasterNodeEntry |
def | GetOrderNumber |
def | GetNodeByOrder |
def | IsCurrentEntry |
def | GetEntryInfos |
def | GetCurrentValidIndexes |
def | GetCurrentEntryValues |
Data Fields | |
Root | |
Manager | |
NetworkName | |
SlaveNodes | |
EDSNodes | |
CurrentSelected | |
EDSFolder |
- -
-Definition at line 40 of file nodelist.py.
def nodelist::NodeList::__init__ | -( | -- | self, | -|
- | - | - | manager | - |
- | ) | -- |
- -
-Definition at line 42 of file nodelist.py. -
def nodelist::NodeList::GetNetworkName | -( | -- | self | -) | -- |
- -
-Definition at line 50 of file nodelist.py. -
def nodelist::NodeList::SetNetworkName | -( | -- | self, | -|
- | - | - | name | - |
- | ) | -- |
- -
-Definition at line 53 of file nodelist.py. -
def nodelist::NodeList::GetManager | -( | -- | self | -) | -- |
- -
-Definition at line 56 of file nodelist.py. -
def nodelist::NodeList::GetRoot | -( | -- | self | -) | -- |
- -
-Definition at line 59 of file nodelist.py. -
def nodelist::NodeList::GetSlaveNumber | -( | -- | self | -) | -- |
- -
-Definition at line 62 of file nodelist.py. -
def nodelist::NodeList::GetSlaveNames | -( | -- | self | -) | -- |
- -
-Definition at line 65 of file nodelist.py. -
def nodelist::NodeList::GetSlaveIDs | -( | -- | self | -) | -- |
- -
-Definition at line 70 of file nodelist.py. -
def nodelist::NodeList::SetCurrentSelected | -( | -- | self, | -|
- | - | - | selected | - |
- | ) | -- |
- -
-Definition at line 75 of file nodelist.py. -
def nodelist::NodeList::GetCurrentSelected | -( | -- | self | -) | -- |
- -
-Definition at line 78 of file nodelist.py. -
def nodelist::NodeList::LoadProject | -( | -- | self, | -|
- | - | - | root | - |
- | ) | -- |
- -
-Definition at line 81 of file nodelist.py. -
def nodelist::NodeList::SaveProject | -( | -- | self | -) | -- |
- -
-Definition at line 107 of file nodelist.py. -
def nodelist::NodeList::ImportEDSFile | -( | -- | self, | -|
- | - | - | edspath | - |
- | ) | -- |
- -
-Definition at line 116 of file nodelist.py. -
def nodelist::NodeList::LoadEDS | -( | -- | self, | -|
- | - | - | eds | - |
- | ) | -- |
- -
-Definition at line 125 of file nodelist.py. -
def nodelist::NodeList::AddSlaveNode | -( | -- | self, | -|
- | - | - | nodeName, | -|
- | - | - | nodeID, | -|
- | - | - | eds | - |
- | ) | -- |
- -
-Definition at line 134 of file nodelist.py. -
def nodelist::NodeList::RemoveSlaveNode | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 142 of file nodelist.py. -
def nodelist::NodeList::LoadMasterNode | -( | -- | self | -) | -- |
- -
-Definition at line 149 of file nodelist.py. -
def nodelist::NodeList::SaveMasterNode | -( | -- | self | -) | -- |
- -
-Definition at line 157 of file nodelist.py. -
def nodelist::NodeList::LoadSlaveNodes | -( | -- | self | -) | -- |
- -
-Definition at line 164 of file nodelist.py. -
def nodelist::NodeList::SaveNodeList | -( | -- | self | -) | -- |
- -
-Definition at line 180 of file nodelist.py. -
def nodelist::NodeList::GetSlaveNodeEntry | -( | -- | self, | -|
- | - | - | nodeid, | -|
- | - | - | index, | -|
- | - | - | subindex = None | - |
- | ) | -- |
- -
-Definition at line 187 of file nodelist.py. -
def nodelist::NodeList::GetMasterNodeEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subindex = None | - |
- | ) | -- |
- -
-Definition at line 194 of file nodelist.py. -
def nodelist::NodeList::SetMasterNodeEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subindex = None , |
- |
- | - | - | value = None | - |
- | ) | -- |
- -
-Definition at line 197 of file nodelist.py. -
def nodelist::NodeList::GetOrderNumber | -( | -- | self, | -|
- | - | - | nodeid | - |
- | ) | -- |
- -
-Definition at line 200 of file nodelist.py. -
def nodelist::NodeList::GetNodeByOrder | -( | -- | self, | -|
- | - | - | order | - |
- | ) | -- |
- -
-Definition at line 205 of file nodelist.py. -
def nodelist::NodeList::IsCurrentEntry | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 214 of file nodelist.py. -
def nodelist::NodeList::GetEntryInfos | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 224 of file nodelist.py. -
def nodelist::NodeList::GetCurrentValidIndexes | -( | -- | self, | -|
- | - | - | min, | -|
- | - | - | max | - |
- | ) | -- |
- -
-Definition at line 234 of file nodelist.py. -
def nodelist::NodeList::GetCurrentEntryValues | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 250 of file nodelist.py. -
-
nodelist::NodeList::Root | -
- -
-Definition at line 43 of file nodelist.py. -
nodelist::NodeList::Manager | -
- -
-Definition at line 44 of file nodelist.py. -
nodelist::NodeList::NetworkName | -
- -
-Definition at line 45 of file nodelist.py. -
nodelist::NodeList::SlaveNodes | -
- -
-Definition at line 46 of file nodelist.py. -
nodelist::NodeList::EDSNodes | -
- -
-Definition at line 47 of file nodelist.py. -
nodelist::NodeList::CurrentSelected | -
- -
-Definition at line 48 of file nodelist.py. -
nodelist::NodeList::EDSFolder | -
- -
-Definition at line 89 of file nodelist.py. -
-
-Constructor -
- -
-Definition at line 148 of file nodemanager.py.
def nodemanager::NodeManager::__init__ | -( | -- | self, | -|
- | - | - | cwd | - |
- | ) | -- |
- -
-Definition at line 151 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentTypeList | -( | -- | self | -) | -- |
- -
-Definition at line 167 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentMapList | -( | -- | self | -) | -- |
- -
-Definition at line 176 of file nodemanager.py. -
def nodemanager::NodeManager::CreateNewNode | -( | -- | self, | -|
- | - | - | name, | -|
- | - | - | id, | -|
- | - | - | type, | -|
- | - | - | description, | -|
- | - | - | profile, | -|
- | - | - | filepath, | -|
- | - | - | NMT, | -|
- | - | - | options | - |
- | ) | -- |
- -
-Definition at line 189 of file nodemanager.py. -
def nodemanager::NodeManager::LoadProfile | -( | -- | self, | -|
- | - | - | profile, | -|
- | - | - | filepath, | -|
- | - | - | node | - |
- | ) | -- |
- -
-Definition at line 239 of file nodemanager.py. -
def nodemanager::NodeManager::OpenFileInCurrent | -( | -- | self, | -|
- | - | - | filepath | - |
- | ) | -- |
- -
-Definition at line 260 of file nodemanager.py. -
def nodemanager::NodeManager::SaveCurrentInFile | -( | -- | self, | -|
- | - | - | filepath = None | - |
- | ) | -- |
- -
-Definition at line 274 of file nodemanager.py. -
def nodemanager::NodeManager::CloseCurrent | -( | -- | self, | -|
- | - | - | ignore = False | - |
- | ) | -- |
- -
-Definition at line 292 of file nodemanager.py. -
def nodemanager::NodeManager::ImportCurrentFromEDSFile | -( | -- | self, | -|
- | - | - | filepath | - |
- | ) | -- |
- -
-Definition at line 302 of file nodemanager.py. -
def nodemanager::NodeManager::ExportCurrentToEDSFile | -( | -- | self, | -|
- | - | - | filepath | - |
- | ) | -- |
- -
-Definition at line 318 of file nodemanager.py. -
def nodemanager::NodeManager::ExportCurrentToCFile | -( | -- | self, | -|
- | - | - | filepath | - |
- | ) | -- |
- -
-Definition at line 324 of file nodemanager.py. -
def nodemanager::NodeManager::AddSubentriesToCurrent | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | number | - |
- | ) | -- |
- -
-Definition at line 335 of file nodemanager.py. -
def nodemanager::NodeManager::RemoveSubentriesFromCurrent | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | number | - |
- | ) | -- |
- -
-Definition at line 362 of file nodemanager.py. -
def nodemanager::NodeManager::AddSDOServerToCurrent | -( | -- | self | -) | -- |
- -
-Definition at line 375 of file nodemanager.py. -
def nodemanager::NodeManager::AddSDOClientToCurrent | -( | -- | self | -) | -- |
- -
-Definition at line 388 of file nodemanager.py. -
def nodemanager::NodeManager::AddPDOTransmitToCurrent | -( | -- | self | -) | -- |
- -
-Definition at line 396 of file nodemanager.py. -
def nodemanager::NodeManager::AddPDOReceiveToCurrent | -( | -- | self | -) | -- |
- -
-Definition at line 404 of file nodemanager.py. -
def nodemanager::NodeManager::AddSpecificEntryToCurrent | -( | -- | self, | -|
- | - | - | menuitem | - |
- | ) | -- |
- -
-Definition at line 412 of file nodemanager.py. -
def nodemanager::NodeManager::GetLineFromIndex | -( | -- | self, | -|
- | - | - | base_index | - |
- | ) | -- |
- -
-Definition at line 424 of file nodemanager.py. -
def nodemanager::NodeManager::ManageEntriesOfCurrent | -( | -- | self, | -|
- | - | - | addinglist, | -|
- | - | - | removinglist | - |
- | ) | -- |
- -
-Definition at line 440 of file nodemanager.py. -
def nodemanager::NodeManager::RemoveCurrentVariable | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
- -
-Definition at line 483 of file nodemanager.py. -
def nodemanager::NodeManager::AddMapVariableToCurrent | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | name, | -|
- | - | - | struct, | -|
- | - | - | number | - |
- | ) | -- |
- -
-Definition at line 529 of file nodemanager.py. -
def nodemanager::NodeManager::AddUserTypeToCurrent | -( | -- | self, | -|
- | - | - | type, | -|
- | - | - | min, | -|
- | - | - | max, | -|
- | - | - | length | - |
- | ) | -- |
- -
-Definition at line 557 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentEntryCallbacks | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | value | - |
- | ) | -- |
- -
-Definition at line 591 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex, | -|
- | - | - | value, | -|
- | - | - | name, | -|
- | - | - | editor | - |
- | ) | -- |
- -
-Definition at line 598 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentEntryName | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | name | - |
- | ) | -- |
- -
-Definition at line 664 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentUserType | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | type, | -|
- | - | - | min, | -|
- | - | - | max, | -|
- | - | - | length | - |
- | ) | -- |
- -
-Definition at line 668 of file nodemanager.py. -
def nodemanager::NodeManager::BufferCurrentNode | -( | -- | self | -) | -- |
- -
-Definition at line 700 of file nodemanager.py. -
def nodemanager::NodeManager::CurrentIsSaved | -( | -- | self | -) | -- |
- -
-Definition at line 703 of file nodemanager.py. -
def nodemanager::NodeManager::OneFileHasChanged | -( | -- | self | -) | -- |
- -
-Definition at line 706 of file nodemanager.py. -
def nodemanager::NodeManager::GetBufferNumber | -( | -- | self | -) | -- |
- -
-Definition at line 712 of file nodemanager.py. -
def nodemanager::NodeManager::LoadCurrentPrevious | -( | -- | self | -) | -- |
- -
-Definition at line 715 of file nodemanager.py. -
def nodemanager::NodeManager::LoadCurrentNext | -( | -- | self | -) | -- |
- -
-Definition at line 718 of file nodemanager.py. -
def nodemanager::NodeManager::AddNodeBuffer | -( | -- | self, | -|
- | - | - | currentstate = None , |
- |
- | - | - | issaved = False | - |
- | ) | -- |
- -
-Definition at line 721 of file nodemanager.py. -
def nodemanager::NodeManager::ChangeCurrentNode | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 728 of file nodemanager.py. -
def nodemanager::NodeManager::RemoveNodeBuffer | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 733 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentNodeIndex | -( | -- | self | -) | -- |
- -
-Definition at line 738 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentFilename | -( | -- | self | -) | -- |
- -
-Definition at line 741 of file nodemanager.py. -
def nodemanager::NodeManager::GetAllFilenames | -( | -- | self | -) | -- |
- -
-Definition at line 744 of file nodemanager.py. -
def nodemanager::NodeManager::GetFilename | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 749 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentFilePath | -( | -- | self, | -|
- | - | - | filepath | - |
- | ) | -- |
- -
-Definition at line 755 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentFilePath | -( | -- | self | -) | -- |
- -
-Definition at line 763 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentBufferState | -( | -- | self | -) | -- |
- -
-Definition at line 769 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentCommunicationLists | -( | -- | self | -) | -- |
- -
-Definition at line 778 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentDS302Lists | -( | -- | self | -) | -- |
- -
-Definition at line 785 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentProfileLists | -( | -- | self | -) | -- |
- -
-Definition at line 788 of file nodemanager.py. -
def nodemanager::NodeManager::GetSpecificProfileLists | -( | -- | self, | -|
- | - | - | mappingdictionary | - |
- | ) | -- |
- -
-Definition at line 791 of file nodemanager.py. -
def nodemanager::NodeManager::GetProfileLists | -( | -- | self, | -|
- | - | - | mappingdictionary, | -|
- | - | - | list | - |
- | ) | -- |
- -
-Definition at line 801 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentNextMapIndex | -( | -- | self | -) | -- |
- -
-Definition at line 810 of file nodemanager.py. -
def nodemanager::NodeManager::CurrentDS302Defined | -( | -- | self | -) | -- |
- -
-Definition at line 820 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentNodeName | -( | -- | self | -) | -- |
- -
-Definition at line 829 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentNodeID | -( | -- | self | -) | -- |
- -
-Definition at line 835 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentNodeInfos | -( | -- | self | -) | -- |
- -
-Definition at line 841 of file nodemanager.py. -
def nodemanager::NodeManager::SetCurrentNodeInfos | -( | -- | self, | -|
- | - | - | name, | -|
- | - | - | id, | -|
- | - | - | type, | -|
- | - | - | description | - |
- | ) | -- |
- -
-Definition at line 848 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentProfileName | -( | -- | self | -) | -- |
- -
-Definition at line 855 of file nodemanager.py. -
def nodemanager::NodeManager::IsCurrentEntry | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 860 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
- -
-Definition at line 865 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentParamsEntry | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subIndex = None | - |
- | ) | -- |
- -
-Definition at line 870 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentValidIndexes | -( | -- | self, | -|
- | - | - | min, | -|
- | - | - | max | - |
- | ) | -- |
- -
-Definition at line 875 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentValidChoices | -( | -- | self, | -|
- | - | - | min, | -|
- | - | - | max | - |
- | ) | -- |
- -
-Definition at line 882 of file nodemanager.py. -
def nodemanager::NodeManager::HasCurrentEntryCallbacks | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 902 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentEntryValues | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 910 of file nodemanager.py. -
def nodemanager::NodeManager::GetNodeEntryValues | -( | -- | self, | -|
- | - | - | node, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 914 of file nodemanager.py. -
def nodemanager::NodeManager::GetCustomisedTypeValues | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 1011 of file nodemanager.py. -
def nodemanager::NodeManager::GetEntryName | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 1019 of file nodemanager.py. -
def nodemanager::NodeManager::GetEntryInfos | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 1025 of file nodemanager.py. -
def nodemanager::NodeManager::GetSubentryInfos | -( | -- | self, | -|
- | - | - | index, | -|
- | - | - | subindex | - |
- | ) | -- |
- -
-Definition at line 1031 of file nodemanager.py. -
def nodemanager::NodeManager::GetTypeIndex | -( | -- | self, | -|
- | - | - | typename | - |
- | ) | -- |
- -
-Definition at line 1040 of file nodemanager.py. -
def nodemanager::NodeManager::GetTypeName | -( | -- | self, | -|
- | - | - | typeindex | - |
- | ) | -- |
- -
-Definition at line 1046 of file nodemanager.py. -
def nodemanager::NodeManager::GetTypeDefaultValue | -( | -- | self, | -|
- | - | - | typeindex | - |
- | ) | -- |
- -
-Definition at line 1052 of file nodemanager.py. -
def nodemanager::NodeManager::GetMapVariableList | -( | -- | self | -) | -- |
- -
-Definition at line 1058 of file nodemanager.py. -
def nodemanager::NodeManager::GetMandatoryIndexes | -( | -- | self, | -|
- | - | - | node = None | - |
- | ) | -- |
- -
-Definition at line 1064 of file nodemanager.py. -
def nodemanager::NodeManager::GetCustomisableTypes | -( | -- | self | -) | -- |
- -
-Definition at line 1070 of file nodemanager.py. -
def nodemanager::NodeManager::GetCurrentSpecificMenu | -( | -- | self | -) | -- |
- -
-Definition at line 1077 of file nodemanager.py. -
-
nodemanager::NodeManager::LastNewIndex | -
- -
-Definition at line 152 of file nodemanager.py. -
nodemanager::NodeManager::FilePaths | -
- -
-Definition at line 153 of file nodemanager.py. -
nodemanager::NodeManager::FileNames | -
- -
-Definition at line 154 of file nodemanager.py. -
nodemanager::NodeManager::NodeIndex | -
- -
-Definition at line 155 of file nodemanager.py. -
nodemanager::NodeManager::CurrentNode | -
- -
-Definition at line 156 of file nodemanager.py. -
nodemanager::NodeManager::ScriptDirectory | -
- -
-Definition at line 157 of file nodemanager.py. -
nodemanager::NodeManager::UndoBuffers | -
- -
-Definition at line 158 of file nodemanager.py. -
-
Public Member Functions | |
def | __init__ |
def | Buffering |
def | Current |
def | Previous |
def | Next |
def | IsFirst |
def | IsLast |
def | CurrentSaved |
def | IsCurrentSaved |
Data Fields | |
Buffer | |
CurrentIndex | |
MinIndex | |
MaxIndex | |
LastSave |
-Constructor initialising buffer -
- -
-Definition at line 52 of file nodemanager.py.
def nodemanager::UndoBuffer::__init__ | -( | -- | self, | -|
- | - | - | currentstate, | -|
- | - | - | issaved = False | - |
- | ) | -- |
- -
-Definition at line 55 of file nodemanager.py. -
def nodemanager::UndoBuffer::Buffering | -( | -- | self, | -|
- | - | - | currentstate | - |
- | ) | -- |
- -
-Definition at line 80 of file nodemanager.py. -
def nodemanager::UndoBuffer::Current | -( | -- | self | -) | -- |
- -
-Definition at line 95 of file nodemanager.py. -
def nodemanager::UndoBuffer::Previous | -( | -- | self | -) | -- |
- -
-Definition at line 101 of file nodemanager.py. -
def nodemanager::UndoBuffer::Next | -( | -- | self | -) | -- |
- -
-Definition at line 110 of file nodemanager.py. -
def nodemanager::UndoBuffer::IsFirst | -( | -- | self | -) | -- |
- -
-Definition at line 119 of file nodemanager.py. -
def nodemanager::UndoBuffer::IsLast | -( | -- | self | -) | -- |
- -
-Definition at line 125 of file nodemanager.py. -
def nodemanager::UndoBuffer::CurrentSaved | -( | -- | self | -) | -- |
- -
-Definition at line 131 of file nodemanager.py. -
def nodemanager::UndoBuffer::IsCurrentSaved | -( | -- | self | -) | -- |
- -
-Definition at line 137 of file nodemanager.py. -
-
nodemanager::UndoBuffer::Buffer | -
- -
-Definition at line 56 of file nodemanager.py. -
nodemanager::UndoBuffer::CurrentIndex | -
- -
-Definition at line 57 of file nodemanager.py. -
nodemanager::UndoBuffer::MinIndex | -
- -
-Definition at line 58 of file nodemanager.py. -
nodemanager::UndoBuffer::MaxIndex | -
- -
-Definition at line 59 of file nodemanager.py. -
nodemanager::UndoBuffer::LastSave | -
- -
-Definition at line 73 of file nodemanager.py. -
-
- -
-Definition at line 158 of file objdictedit.py.
def objdictedit::objdictedit::_init_coll_menuBar1_Menus | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 159 of file objdictedit.py. -
def objdictedit::objdictedit::_init_coll_EditMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 167 of file objdictedit.py. -
def objdictedit::objdictedit::_init_coll_HelpMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 201 of file objdictedit.py. -
def objdictedit::objdictedit::_init_coll_FileMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 218 of file objdictedit.py. -
def objdictedit::objdictedit::_init_coll_AddMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 260 of file objdictedit.py. -
def objdictedit::objdictedit::_init_coll_HelpBar_Fields | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 288 of file objdictedit.py. -
def objdictedit::objdictedit::_init_utils | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 298 of file objdictedit.py. -
def objdictedit::objdictedit::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 317 of file objdictedit.py. -
def objdictedit::objdictedit::__init__ | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | -- |
- -
-Definition at line 338 of file objdictedit.py. -
def objdictedit::objdictedit::GetNoteBook | -( | -- | self | -) | -- |
- -
-Definition at line 358 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddSDOServerMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 361 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddSDOClientMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 367 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddPDOTransmitMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 373 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddPDOReceiveMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 379 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddMapVariableMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 385 of file objdictedit.py. -
def objdictedit::objdictedit::OnAddUserTypeMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 389 of file objdictedit.py. -
def objdictedit::objdictedit::OnFileSelectedChanged | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 393 of file objdictedit.py. -
def objdictedit::objdictedit::OnHelpDS301Menu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 404 of file objdictedit.py. -
def objdictedit::objdictedit::OnHelpCANFestivalMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 426 of file objdictedit.py. -
def objdictedit::objdictedit::OnAboutMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 431 of file objdictedit.py. -
def objdictedit::objdictedit::OpenHtmlFrame | -( | -- | self, | -|
- | - | - | title, | -|
- | - | - | file, | -|
- | - | - | size | - |
- | ) | -- |
- -
-Definition at line 435 of file objdictedit.py. -
def objdictedit::objdictedit::OnQuitMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 444 of file objdictedit.py. -
def objdictedit::objdictedit::OnCloseFrame | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 448 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshTitle | -( | -- | self | -) | -- |
- -
-Definition at line 474 of file objdictedit.py. -
def objdictedit::objdictedit::OnRefreshMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 480 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshCurrentIndexList | -( | -- | self | -) | -- |
- -
-Definition at line 484 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshStatusBar | -( | -- | self | -) | -- |
- -
-Definition at line 489 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshMainMenu | -( | -- | self | -) | -- |
- -
-Definition at line 520 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshEditMenu | -( | -- | self | -) | -- |
- -
-Definition at line 539 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshProfileMenu | -( | -- | self | -) | -- |
- -
-Definition at line 549 of file objdictedit.py. -
def objdictedit::objdictedit::RefreshBufferState | -( | -- | self | -) | -- |
- -
-Definition at line 575 of file objdictedit.py. -
def objdictedit::objdictedit::OnUndoMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 582 of file objdictedit.py. -
def objdictedit::objdictedit::OnRedoMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 588 of file objdictedit.py. -
def objdictedit::objdictedit::OnNewMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 599 of file objdictedit.py. -
def objdictedit::objdictedit::OnOpenMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 625 of file objdictedit.py. -
def objdictedit::objdictedit::OnSaveMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 656 of file objdictedit.py. -
def objdictedit::objdictedit::OnSaveAsMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 660 of file objdictedit.py. -
def objdictedit::objdictedit::Save | -( | -- | self | -) | -- |
- -
-Definition at line 664 of file objdictedit.py. -
def objdictedit::objdictedit::SaveAs | -( | -- | self | -) | -- |
- -
-Definition at line 675 of file objdictedit.py. -
def objdictedit::objdictedit::OnCloseMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 698 of file objdictedit.py. -
def objdictedit::objdictedit::OnImportEDSMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 725 of file objdictedit.py. -
def objdictedit::objdictedit::OnExportEDSMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 755 of file objdictedit.py. -
def objdictedit::objdictedit::OnExportCMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 779 of file objdictedit.py. -
def objdictedit::objdictedit::OnCommunicationMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 807 of file objdictedit.py. -
def objdictedit::objdictedit::OnOtherCommunicationMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 812 of file objdictedit.py. -
def objdictedit::objdictedit::OnEditProfileMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 817 of file objdictedit.py. -
def objdictedit::objdictedit::EditProfile | -( | -- | self, | -|
- | - | - | title, | -|
- | - | - | dictionary, | -|
- | - | - | current | - |
- | ) | -- |
- -
-Definition at line 823 of file objdictedit.py. -
def objdictedit::objdictedit::GetProfileCallBack | -( | -- | self, | -|
- | - | - | text | - |
- | ) | -- |
- -
-Definition at line 846 of file objdictedit.py. -
def objdictedit::objdictedit::OnNodeInfosMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 858 of file objdictedit.py. -
def objdictedit::objdictedit::AddMapVariable | -( | -- | self | -) | -- |
- -
-Definition at line 878 of file objdictedit.py. -
def objdictedit::objdictedit::AddUserType | -( | -- | self | -) | -- |
- -
-Definition at line 899 of file objdictedit.py. -
-
objdictedit::objdictedit::HtmlFrameOpened | -
- -
-Definition at line 340 of file objdictedit.py. -
objdictedit::objdictedit::Manager | -
- -
-Definition at line 342 of file objdictedit.py. -
objdictedit::objdictedit::FilePath | -
- -
-Definition at line 600 of file objdictedit.py. -
-
Public Member Functions | |
def | __init__ |
Data Fields | |
linkinfo |
- -
-Definition at line 49 of file objdictedit.py.
def objdictedit::wxHtmlWindowUrlClick::__init__ | -( | -- | self, | -|
- | - | - | linkinfo | - |
- | ) | -- |
- -
-Definition at line 50 of file objdictedit.py. -
-
objdictedit::wxHtmlWindowUrlClick::linkinfo | -
- -
-Definition at line 53 of file objdictedit.py. -
-
Public Member Functions | |
def | OnLinkClicked |
Static Public Attributes | |
Html_Window = True | |
Data Structures | |
class | HtmlFrame |
HTML window that generates and OnLinkClicked event. - -Use this to avoid having to override HTMLWindow -
- -
-Definition at line 55 of file objdictedit.py.
def objdictedit::wxUrlClickHtmlWindow::OnLinkClicked | -( | -- | self, | -|
- | - | - | linkinfo | - |
- | ) | -- |
- -
-Definition at line 57 of file objdictedit.py. -
-
objdictedit::wxUrlClickHtmlWindow::Html_Window = True [static] |
-
- -
-Definition at line 102 of file objdictedit.py. -
-
Public Member Functions | |
def | __init__ |
def | SetHtmlCode |
def | SetHtmlPage |
def | OnCloseFrame |
def | OnLinkClick |
Data Fields | |
HtmlFrameOpened | |
Private Member Functions | |
def | _init_ctrls |
- -
-Definition at line 66 of file objdictedit.py.
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 67 of file objdictedit.py. -
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::__init__ | -( | -- | self, | -|
- | - | - | parent, | -|
- | - | - | opened | - |
- | ) | -- |
- -
-Definition at line 79 of file objdictedit.py. -
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::SetHtmlCode | -( | -- | self, | -|
- | - | - | htmlcode | - |
- | ) | -- |
- -
-Definition at line 83 of file objdictedit.py. -
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::SetHtmlPage | -( | -- | self, | -|
- | - | - | htmlpage | - |
- | ) | -- |
- -
-Definition at line 86 of file objdictedit.py. -
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::OnCloseFrame | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 89 of file objdictedit.py. -
def objdictedit::wxUrlClickHtmlWindow::HtmlFrame::OnLinkClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 93 of file objdictedit.py. -
-
- -
-Definition at line 81 of file objdictedit.py. -
-
- -
-Definition at line 255 of file subindextable.py.
def subindextable::EditingPanel::_init_coll_AddToListSizer_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 256 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_SubindexGridSizer_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 262 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_IndexListSizer_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 268 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_AddToListSizer_Growables | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 274 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_SubindexGridSizer_Growables | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 279 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_IndexListSizer_Growables | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 285 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_SubindexGridMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 291 of file subindextable.py. -
def subindextable::EditingPanel::_init_coll_IndexListMenu_Items | -( | -- | self, | -|
- | - | - | parent | - |
- | ) | - [private] |
-
- -
-Definition at line 303 of file subindextable.py. -
def subindextable::EditingPanel::_init_utils | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 319 of file subindextable.py. -
def subindextable::EditingPanel::_init_sizers | -( | -- | self | -) | - [private] |
-
- -
-Definition at line 328 of file subindextable.py. -
def subindextable::EditingPanel::_init_ctrls | -( | -- | self, | -|
- | - | - | prnt | - |
- | ) | - [private] |
-
- -
-Definition at line 346 of file subindextable.py. -
def subindextable::EditingPanel::__init__ | -( | -- | self, | -|
- | - | - | parent, | -|
- | - | - | manager, | -|
- | - | - | editable = True | - |
- | ) | -- |
- -
-Definition at line 417 of file subindextable.py. -
def subindextable::EditingPanel::GetIndex | -( | -- | self | -) | -- |
- -
-Definition at line 442 of file subindextable.py. -
def subindextable::EditingPanel::SetIndex | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 445 of file subindextable.py. -
def subindextable::EditingPanel::GetSelection | -( | -- | self | -) | -- |
- -
-Definition at line 448 of file subindextable.py. -
def subindextable::EditingPanel::OnAddButtonClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 456 of file subindextable.py. -
def subindextable::EditingPanel::OnPartListBoxClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 482 of file subindextable.py. -
def subindextable::EditingPanel::OnIndexListClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 487 of file subindextable.py. -
def subindextable::EditingPanel::OnSubindexGridSelectCell | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 492 of file subindextable.py. -
def subindextable::EditingPanel::RefreshIndexList | -( | -- | self | -) | -- |
- -
-Definition at line 500 of file subindextable.py. -
def subindextable::EditingPanel::RefreshTable | -( | -- | self | -) | -- |
- -
-Definition at line 556 of file subindextable.py. -
def subindextable::EditingPanel::OnSubindexGridCellChange | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 576 of file subindextable.py. -
def subindextable::EditingPanel::OnCallbackCheck | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 589 of file subindextable.py. -
def subindextable::EditingPanel::OnIndexListRightUp | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 601 of file subindextable.py. -
def subindextable::EditingPanel::OnSubindexGridRightClick | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 628 of file subindextable.py. -
def subindextable::EditingPanel::OnRenameIndexMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 639 of file subindextable.py. -
def subindextable::EditingPanel::OnModifyIndexMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 655 of file subindextable.py. -
def subindextable::EditingPanel::OnDeleteIndexMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 675 of file subindextable.py. -
def subindextable::EditingPanel::OnAddSubindexMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 686 of file subindextable.py. -
def subindextable::EditingPanel::OnDeleteSubindexMenu | -( | -- | self, | -|
- | - | - | event | - |
- | ) | -- |
- -
-Definition at line 707 of file subindextable.py. -
-
subindextable::EditingPanel::PartList | -
- -
-Definition at line 354 of file subindextable.py. -
subindextable::EditingPanel::SecondSplitter | -
- -
-Definition at line 360 of file subindextable.py. -
subindextable::EditingPanel::SubindexGridPanel | -
- -
-Definition at line 367 of file subindextable.py. -
subindextable::EditingPanel::IndexListPanel | -
- -
-Definition at line 371 of file subindextable.py. -
subindextable::EditingPanel::SubindexGrid | -
- -
-Definition at line 377 of file subindextable.py. -
subindextable::EditingPanel::CallbackCheck | -
- -
-Definition at line 391 of file subindextable.py. -
subindextable::EditingPanel::IndexList | -
- -
-Definition at line 398 of file subindextable.py. -
subindextable::EditingPanel::AddButton | -
- -
-Definition at line 405 of file subindextable.py. -
subindextable::EditingPanel::IndexChoice | -
- -
-Definition at line 411 of file subindextable.py. -
subindextable::EditingPanel::Parent | -
- -
-Definition at line 419 of file subindextable.py. -
subindextable::EditingPanel::Manager | -
- -
-Definition at line 420 of file subindextable.py. -
subindextable::EditingPanel::ListIndex | -
- -
-Definition at line 421 of file subindextable.py. -
subindextable::EditingPanel::ChoiceIndex | -
- -
-Definition at line 422 of file subindextable.py. -
subindextable::EditingPanel::FirstCall | -
- -
-Definition at line 423 of file subindextable.py. -
subindextable::EditingPanel::Editable | -
- -
-Definition at line 424 of file subindextable.py. -
subindextable::EditingPanel::Index | -
- -
-Definition at line 425 of file subindextable.py. -
subindextable::EditingPanel::Table | -
- -
-Definition at line 430 of file subindextable.py. -
-
Public Member Functions | |
def | __init__ |
def | Disable |
def | Enable |
def | GetNumberCols |
def | GetNumberRows |
def | GetColLabelValue |
def | GetRowLabelValues |
def | GetValue |
def | GetEditor |
def | GetValueByName |
def | SetValue |
def | ResetView |
def | UpdateValues |
def | SetData |
def | SetEditors |
def | GetCurrentIndex |
def | SetCurrentIndex |
def | AppendRow |
def | Empty |
Data Fields | |
data | |
editors | |
CurrentIndex | |
colnames | |
Parent | |
Editable | |
Private Member Functions | |
def | _updateColAttrs |
Private Attributes | |
_rows | |
_cols |
-A custom wxGrid Table using user supplied data -
- -
-Definition at line 53 of file subindextable.py.
def subindextable::SubindexTable::__init__ | -( | -- | self, | -|
- | - | - | parent, | -|
- | - | - | data, | -|
- | - | - | editors, | -|
- | - | - | colnames | - |
- | ) | -- |
- -
-Definition at line 56 of file subindextable.py. -
def subindextable::SubindexTable::Disable | -( | -- | self | -) | -- |
- -
-Definition at line 71 of file subindextable.py. -
def subindextable::SubindexTable::Enable | -( | -- | self | -) | -- |
- -
-Definition at line 74 of file subindextable.py. -
def subindextable::SubindexTable::GetNumberCols | -( | -- | self | -) | -- |
- -
-Definition at line 77 of file subindextable.py. -
def subindextable::SubindexTable::GetNumberRows | -( | -- | self | -) | -- |
- -
-Definition at line 80 of file subindextable.py. -
def subindextable::SubindexTable::GetColLabelValue | -( | -- | self, | -|
- | - | - | col | - |
- | ) | -- |
- -
-Definition at line 83 of file subindextable.py. -
def subindextable::SubindexTable::GetRowLabelValues | -( | -- | self, | -|
- | - | - | row | - |
- | ) | -- |
- -
-Definition at line 87 of file subindextable.py. -
def subindextable::SubindexTable::GetValue | -( | -- | self, | -|
- | - | - | row, | -|
- | - | - | col | - |
- | ) | -- |
- -
-Definition at line 90 of file subindextable.py. -
def subindextable::SubindexTable::GetEditor | -( | -- | self, | -|
- | - | - | row, | -|
- | - | - | col | - |
- | ) | -- |
- -
-Definition at line 98 of file subindextable.py. -
def subindextable::SubindexTable::GetValueByName | -( | -- | self, | -|
- | - | - | row, | -|
- | - | - | colname | - |
- | ) | -- |
- -
-Definition at line 102 of file subindextable.py. -
def subindextable::SubindexTable::SetValue | -( | -- | self, | -|
- | - | - | row, | -|
- | - | - | col, | -|
- | - | - | value | - |
- | ) | -- |
- -
-Definition at line 105 of file subindextable.py. -
def subindextable::SubindexTable::ResetView | -( | -- | self, | -|
- | - | - | grid | - |
- | ) | -- |
-
-(wxGrid) -> Reset the grid view. Call this to -update the grid if rows and columns have been added or deleted -
-Definition at line 109 of file subindextable.py. -
def subindextable::SubindexTable::UpdateValues | -( | -- | self, | -|
- | - | - | grid | - |
- | ) | -- |
def subindextable::SubindexTable::_updateColAttrs | -( | -- | self, | -|
- | - | - | grid | - |
- | ) | - [private] |
-
-
-wxGrid -> update the column attributes to add the -appropriate renderer given the column name. - -Otherwise default to the default renderer. -
-Definition at line 144 of file subindextable.py. -
def subindextable::SubindexTable::SetData | -( | -- | self, | -|
- | - | - | data | - |
- | ) | -- |
- -
-Definition at line 221 of file subindextable.py. -
def subindextable::SubindexTable::SetEditors | -( | -- | self, | -|
- | - | - | editors | - |
- | ) | -- |
- -
-Definition at line 224 of file subindextable.py. -
def subindextable::SubindexTable::GetCurrentIndex | -( | -- | self | -) | -- |
- -
-Definition at line 227 of file subindextable.py. -
def subindextable::SubindexTable::SetCurrentIndex | -( | -- | self, | -|
- | - | - | index | - |
- | ) | -- |
- -
-Definition at line 230 of file subindextable.py. -
def subindextable::SubindexTable::AppendRow | -( | -- | self, | -|
- | - | - | row_content | - |
- | ) | -- |
- -
-Definition at line 233 of file subindextable.py. -
def subindextable::SubindexTable::Empty | -( | -- | self | -) | -- |
- -
-Definition at line 236 of file subindextable.py. -
-
subindextable::SubindexTable::data | -
- -
-Definition at line 59 of file subindextable.py. -
subindextable::SubindexTable::editors | -
- -
-Definition at line 60 of file subindextable.py. -
subindextable::SubindexTable::CurrentIndex | -
- -
-Definition at line 61 of file subindextable.py. -
subindextable::SubindexTable::colnames | -
- -
-Definition at line 62 of file subindextable.py. -
subindextable::SubindexTable::Parent | -
- -
-Definition at line 63 of file subindextable.py. -
subindextable::SubindexTable::Editable | -
- -
-Definition at line 64 of file subindextable.py. -
subindextable::SubindexTable::_rows [private] |
-
- -
-Definition at line 68 of file subindextable.py. -
subindextable::SubindexTable::_cols [private] |
-
- -
-Definition at line 69 of file subindextable.py. -
-
00001 #!/usr/bin/env python -00002 # -*- coding: utf-8 -*- -00003 -00004 #This file is part of CanFestival, a library implementing CanOpen Stack. -00005 # -00006 #Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD -00007 # -00008 #See COPYING file for copyrights details. -00009 # -00010 #This library is free software; you can redistribute it and/or -00011 #modify it under the terms of the GNU Lesser General Public -00012 #License as published by the Free Software Foundation; either -00013 #version 2.1 of the License, or (at your option) any later version. -00014 # -00015 #This library is distributed in the hope that it will be useful, -00016 #but WITHOUT ANY WARRANTY; without even the implied warranty of -00017 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00018 #Lesser General Public License for more details. -00019 # -00020 #You should have received a copy of the GNU Lesser General Public -00021 #License along with this library; if not, write to the Free Software -00022 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00023 -00024 from wxPython.wx import * -00025 from wxPython.grid import * -00026 import wx -00027 -00028 import os -00029 -00030 #------------------------------------------------------------------------------- -00031 # Editing Communication Dialog -00032 #------------------------------------------------------------------------------- -00033 -00034 -00035 [wxID_COMMUNICATIONDIALOG, wxID_COMMUNICATIONDIALOGMAINPANEL, -00036 wxID_COMMUNICATIONDIALOGPOSSIBLEINDEXES, wxID_COMMUNICATIONDIALOGCURRENTINDEXES, -00037 wxID_COMMUNICATIONDIALOGSELECT, wxID_COMMUNICATIONDIALOGUNSELECT, -00038 wxID_COMMUNICATIONDIALOGSTATICTEXT1, wxID_COMMUNICATIONDIALOGSTATICTEXT2 -00039 ] = [wx.NewId() for _init_ctrls in range(8)] -00040 -00041 class CommunicationDialog(wx.Dialog): -00042 def _init_coll_flexGridSizer1_Items(self, parent): -00043 # generated method, don't edit -00044 -00045 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00046 -00047 def _init_sizers(self): -00048 # generated method, don't edit -00049 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00050 -00051 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00052 -00053 self.SetSizer(self.flexGridSizer1) -00054 -00055 def _init_ctrls(self, prnt): -00056 # generated method, don't edit -00057 wx.Dialog.__init__(self, id=wxID_COMMUNICATIONDIALOG, -00058 name='CommunicationDialog', parent=prnt, pos=wx.Point(234, 216), -00059 size=wx.Size(726, 437), style=wx.DEFAULT_DIALOG_STYLE, -00060 title='Edit Communication Profile') -00061 self.SetClientSize(wx.Size(726, 437)) -00062 -00063 self.MainPanel = wx.Panel(id=wxID_COMMUNICATIONDIALOGMAINPANEL, -00064 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00065 size=wx.Size(688, 382), style=wx.TAB_TRAVERSAL) -00066 self.MainPanel.SetAutoLayout(True) -00067 -00068 self.PossibleIndexes = wx.ListBox(choices=[], -00069 id=wxID_COMMUNICATIONDIALOGPOSSIBLEINDEXES, -00070 name='PossibleIndexes', parent=self.MainPanel, pos=wx.Point(40, -00071 48), size=wx.Size(280, 320), style=wxLB_EXTENDED) -00072 self.PossibleIndexes.Bind(wx.EVT_LEFT_DCLICK, self.OnPossibleIndexesDClickOnPossibleIndexesDClick, -00073 id=wxID_COMMUNICATIONDIALOGPOSSIBLEINDEXES) -00074 -00075 self.CurrentIndexes = wx.ListBox(choices=[], -00076 id=wxID_COMMUNICATIONDIALOGCURRENTINDEXES, name='CurrentIndexes', -00077 parent=self.MainPanel, pos=wx.Point(400, 48), size=wx.Size(280, -00078 320), style=wxLB_EXTENDED) -00079 self.CurrentIndexes.Bind(wx.EVT_LEFT_DCLICK, self.OnCurrentIndexesDClickOnCurrentIndexesDClick, -00080 id=wxID_COMMUNICATIONDIALOGCURRENTINDEXES) -00081 -00082 self.Select = wx.Button(id=wxID_COMMUNICATIONDIALOGSELECT, label='>>', -00083 name='Select', parent=self.MainPanel, pos=wx.Point(345, 136), -00084 size=wx.Size(32, 32), style=0) -00085 self.Select.Bind(wx.EVT_BUTTON, self.OnSelectButtonOnSelectButton, -00086 id=wxID_COMMUNICATIONDIALOGSELECT) -00087 -00088 self.Unselect = wx.Button(id=wxID_COMMUNICATIONDIALOGUNSELECT, -00089 label='<<', name='Unselect', parent=self.MainPanel, -00090 pos=wx.Point(345, 216), size=wx.Size(32, 30), style=0) -00091 self.Unselect.Bind(wx.EVT_BUTTON, self.OnUnselectButtonOnUnselectButton, -00092 id=wxID_COMMUNICATIONDIALOGUNSELECT) -00093 -00094 self.staticText1 = wx.StaticText(id=wxID_COMMUNICATIONDIALOGSTATICTEXT1, -00095 label='Possible Profile Indexes:', name='staticText1', -00096 parent=self.MainPanel, pos=wx.Point(40, 24), size=wx.Size(156, -00097 17), style=0) -00098 -00099 self.staticText2 = wx.StaticText(id=wxID_COMMUNICATIONDIALOGSTATICTEXT2, -00100 label='Current Profile Indexes:', name='staticText2', -00101 parent=self.MainPanel, pos=wx.Point(400, 24), size=wx.Size(152, -00102 17), style=0) -00103 -00104 self._init_sizers_init_sizers() -00105 -00106 def __init__(self, parent): -00107 self._init_ctrls_init_ctrls(parent) -00108 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL) -00109 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_CENTER) -00110 self.AllListAllList = [] -00111 self.CurrentListCurrentList = [] -00112 self.IndexDictionaryIndexDictionary = {} -00113 -00114 def SetIndexDictionary(self, dictionary): -00115 self.IndexDictionaryIndexDictionary = dictionary -00116 -00117 def SetCurrentList(self, list): -00118 self.CurrentListCurrentList = [] -00119 self.CurrentListCurrentList.extend(list) -00120 self.CurrentListCurrentList.sort() -00121 -00122 def GetCurrentList(self): -00123 return self.CurrentListCurrentList -00124 -00125 def RefreshLists(self): -00126 self.PossibleIndexes.Clear() -00127 self.CurrentIndexes.Clear() -00128 self.AllListAllList = [] -00129 for index in self.IndexDictionaryIndexDictionary.iterkeys(): -00130 if index not in self.CurrentListCurrentList: -00131 self.AllListAllList.append(index) -00132 self.AllListAllList.sort() -00133 for index in self.AllListAllList: -00134 self.PossibleIndexes.Append("0x%04X %s"%(index, self.IndexDictionaryIndexDictionary[index][0])) -00135 for index in self.CurrentListCurrentList: -00136 if index in self.IndexDictionaryIndexDictionary: -00137 self.CurrentIndexes.Append("0x%04X %s"%(index, self.IndexDictionaryIndexDictionary[index][0])) -00138 -00139 def OnPossibleIndexesDClick(self, event): -00140 self.SelectPossibleSelectPossible() -00141 event.Skip() -00142 -00143 def OnCurrentIndexesDClick(self, event): -00144 self.UnselectCurrentUnselectCurrent() -00145 event.Skip() -00146 -00147 def OnSelectButton(self, event): -00148 self.SelectPossibleSelectPossible() -00149 event.Skip() -00150 -00151 def OnUnselectButton(self, event): -00152 self.UnselectCurrentUnselectCurrent() -00153 event.Skip() -00154 -00155 def SelectPossible(self): -00156 selected = self.PossibleIndexes.GetSelections() -00157 for i in selected: -00158 self.CurrentListCurrentList.append(self.AllListAllList[i]) -00159 self.CurrentListCurrentList.sort() -00160 self.RefreshListsRefreshLists() -00161 -00162 def UnselectCurrent(self): -00163 selected = self.CurrentIndexes.GetSelections() -00164 for i in selected: -00165 if not self.IndexDictionaryIndexDictionary[self.CurrentListCurrentList[i]][1]: -00166 self.CurrentListCurrentList.pop(i) -00167 self.CurrentListCurrentList.sort() -00168 self.RefreshListsRefreshLists() -00169 -00170 -00171 -00172 #------------------------------------------------------------------------------- -00173 # Create Map Variable Dialog -00174 #------------------------------------------------------------------------------- -00175 -00176 -00177 [wxID_MAPVARIABLEDIALOG, wxID_MAPVARIABLEDIALOGINDEX, -00178 wxID_MAPVARIABLEDIALOGINDEXNAME, wxID_MAPVARIABLEDIALOGMAINPANEL, -00179 wxID_MAPVARIABLEDIALOGNUMBER, wxID_MAPVARIABLEDIALOGRADIOBUTTON1, -00180 wxID_MAPVARIABLEDIALOGRADIOBUTTON2, wxID_MAPVARIABLEDIALOGRADIOBUTTON3, -00181 wxID_MAPVARIABLEDIALOGSTATICTEXT1, wxID_MAPVARIABLEDIALOGSTATICTEXT2, -00182 wxID_MAPVARIABLEDIALOGSTATICTEXT3, wxID_MAPVARIABLEDIALOGSTATICTEXT4, -00183 ] = [wx.NewId() for _init_ctrls in range(12)] -00184 -00185 class MapVariableDialog(wx.Dialog): -00186 def _init_coll_flexGridSizer1_Items(self, parent): -00187 # generated method, don't edit -00188 -00189 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00190 -00191 def _init_sizers(self): -00192 # generated method, don't edit -00193 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00194 -00195 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00196 -00197 self.SetSizer(self.flexGridSizer1) -00198 -00199 def _init_ctrls(self, prnt): -00200 # generated method, don't edit -00201 wx.Dialog.__init__(self, id=wxID_MAPVARIABLEDIALOG, -00202 name='CommunicationDialog', parent=prnt, pos=wx.Point(376, 223), -00203 size=wx.Size(444, 186), style=wx.DEFAULT_DIALOG_STYLE, -00204 title='Add Map Variable') -00205 self.SetClientSize(wx.Size(444, 186)) -00206 -00207 self.MainPanel = wx.Panel(id=wxID_MAPVARIABLEDIALOGMAINPANEL, -00208 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00209 size=wx.Size(431, 142), style=wx.TAB_TRAVERSAL) -00210 self.MainPanel.SetAutoLayout(True) -00211 -00212 self.staticText1 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT1, -00213 label='Index:', name='staticText1', parent=self.MainPanel, -00214 pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) -00215 -00216 self.Index = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEX, name='Index', -00217 parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(152, -00218 25), style=0, value='0x2000') -00219 -00220 self.staticText3 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT3, -00221 label='Name:', name='staticText3', parent=self.MainPanel, -00222 pos=wx.Point(24, 80), size=wx.Size(47, 17), style=0) -00223 -00224 self.IndexName = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGINDEXNAME, -00225 name='IndexName', parent=self.MainPanel, pos=wx.Point(24, 104), -00226 size=wx.Size(152, 24), style=0, value='Undefined') -00227 -00228 self.staticText2 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT2, -00229 label='Type:', name='staticText2', parent=self.MainPanel, -00230 pos=wx.Point(208, 24), size=wx.Size(38, 17), style=0) -00231 -00232 self.radioButton1 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON1, -00233 label='VAR', name='radioButton1', parent=self.MainPanel, -00234 pos=wx.Point(208, 48), size=wx.Size(72, 24), style=wxRB_GROUP) -00235 self.radioButton1.SetValue(True) -00236 self.radioButton1.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton1ClickOnRadioButton1Click, -00237 id=wxID_MAPVARIABLEDIALOGRADIOBUTTON1) -00238 -00239 self.radioButton2 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON2, -00240 label='ARRAY', name='radioButton2', parent=self.MainPanel, -00241 pos=wx.Point(208, 72), size=wx.Size(80, 24), style=wxRB_SINGLE) -00242 self.radioButton2.SetValue(False) -00243 self.radioButton2.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton2ClickOnRadioButton2Click, -00244 id=wxID_MAPVARIABLEDIALOGRADIOBUTTON2) -00245 -00246 self.radioButton3 = wx.RadioButton(id=wxID_MAPVARIABLEDIALOGRADIOBUTTON3, -00247 label='REC', name='radioButton3', parent=self.MainPanel, -00248 pos=wx.Point(208, 96), size=wx.Size(96, 24), style=wxRB_SINGLE) -00249 self.radioButton3.SetValue(False) -00250 self.radioButton3.Bind(wx.EVT_RADIOBUTTON, self.OnRadioButton3ClickOnRadioButton3Click, -00251 id=wxID_MAPVARIABLEDIALOGRADIOBUTTON3) -00252 -00253 self.staticText4 = wx.StaticText(id=wxID_MAPVARIABLEDIALOGSTATICTEXT4, -00254 label='Number:', name='staticText4', parent=self.MainPanel, -00255 pos=wx.Point(312, 80), size=wx.Size(88, 16), style=0) -00256 -00257 self.Number = wx.TextCtrl(id=wxID_MAPVARIABLEDIALOGNUMBER, -00258 name='Number', parent=self.MainPanel, pos=wx.Point(312, 104), -00259 size=wx.Size(112, 24), style=wx.TE_RIGHT, value='0') -00260 -00261 self._init_sizers_init_sizers() -00262 -00263 def __init__(self, parent): -00264 self._init_ctrls_init_ctrls(parent) -00265 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL) -00266 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_CENTER) -00267 self.staticText4.Enable(False) -00268 self.Number.Enable(False) -00269 -00270 EVT_BUTTON(self, self.ButtonSizerButtonSizer.GetAffirmativeButton().GetId(), self.OnOKOnOK) -00271 -00272 def SetIndex(self, index): -00273 self.Index.SetValue("0x%04X"%index) -00274 -00275 def OnOK(self, event): -00276 error = [] -00277 try: -00278 int(self.Index.GetValue(), 16) -00279 except: -00280 error.append("Index") -00281 if self.radioButton2.GetValue() or self.radioButton3.GetValue(): -00282 try: -00283 int(self.Number.GetValue()) -00284 except: -00285 error.append("Number") -00286 if len(error) > 0: -00287 text = "" -00288 if len(error) > 1: -00289 suffix = "s" -00290 else: -00291 suffix = "" -00292 for i, item in enumerate(error): -00293 if i == 0: -00294 text += item -00295 elif i == len(error) - 1: -00296 text += " and %s"%item -00297 else: -00298 text += ", %s"%item -00299 message = wxMessageDialog(self, "Form isn't valid. %s must be integer%s!"%(text,suffix), "Error", wxOK|wxICON_ERROR) -00300 message.ShowModal() -00301 message.Destroy() -00302 else: -00303 self.EndModal(wxID_OK) -00304 -00305 def GetValues(self): -00306 name = self.IndexName.GetValue() -00307 index = int(self.Index.GetValue(), 16) -00308 if self.radioButton1.GetValue(): -00309 struct = 1 -00310 number = None -00311 elif self.radioButton2.GetValue(): -00312 struct = 3 -00313 number = int(self.Number.GetValue()) -00314 elif self.radioButton3.GetValue(): -00315 struct = 7 -00316 number = int(self.Number.GetValue()) -00317 return index, name, struct, number -00318 -00319 def OnRadioButton1Click(self, event): -00320 self.EnableNumberTypingEnableNumberTyping(False) -00321 event.Skip() -00322 -00323 def OnRadioButton2Click(self, event): -00324 self.EnableNumberTypingEnableNumberTyping(True) -00325 event.Skip() -00326 -00327 def OnRadioButton3Click(self, event): -00328 self.EnableNumberTypingEnableNumberTyping(True) -00329 event.Skip() -00330 -00331 def EnableNumberTyping(self, enable): -00332 self.staticText4.Enable(enable) -00333 self.Number.Enable(enable) -00334 -00335 -00336 #------------------------------------------------------------------------------- -00337 # Create User Type Dialog -00338 #------------------------------------------------------------------------------- -00339 -00340 -00341 [wxID_USERTYPEDIALOG, wxID_USERTYPEDIALOGLENGTH, wxID_USERTYPEDIALOGMAINPANEL, -00342 wxID_USERTYPEDIALOGMAX, wxID_USERTYPEDIALOGMIN, -00343 wxID_USERTYPEDIALOGSTATICBOX1, wxID_USERTYPEDIALOGSTATICTEXT1, -00344 wxID_USERTYPEDIALOGSTATICTEXT2, wxID_USERTYPEDIALOGSTATICTEXT3, -00345 wxID_USERTYPEDIALOGSTATICTEXT4, wxID_USERTYPEDIALOGTYPE, -00346 ] = [wx.NewId() for _init_ctrls in range(11)] -00347 -00348 class UserTypeDialog(wx.Dialog): -00349 def _init_coll_flexGridSizer1_Items(self, parent): -00350 # generated method, don't edit -00351 -00352 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00353 -00354 def _init_sizers(self): -00355 # generated method, don't edit -00356 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00357 -00358 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00359 -00360 self.SetSizer(self.flexGridSizer1) -00361 -00362 def _init_ctrls(self, prnt): -00363 # generated method, don't edit -00364 wx.Dialog.__init__(self, id=wxID_USERTYPEDIALOG, name='UserTypeDialog', -00365 parent=prnt, pos=wx.Point(376, 223), size=wx.Size(444, 228), -00366 style=wx.DEFAULT_DIALOG_STYLE, title='Add User Type') -00367 self.SetClientSize(wx.Size(444, 228)) -00368 -00369 self.MainPanel = wx.Panel(id=wxID_USERTYPEDIALOGMAINPANEL, -00370 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00371 size=wx.Size(431, 182), style=wx.TAB_TRAVERSAL) -00372 self.MainPanel.SetAutoLayout(True) -00373 -00374 self.staticText1 = wx.StaticText(id=wxID_USERTYPEDIALOGSTATICTEXT1, -00375 label='Type:', name='staticText1', parent=self.MainPanel, -00376 pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) -00377 -00378 self.Type = wx.Choice(choices=[], id=wxID_USERTYPEDIALOGTYPE, -00379 name='Type', parent=self.MainPanel, pos=wx.Point(24, 48), -00380 size=wx.Size(160, 24), style=0) -00381 self.Type.Bind(wx.EVT_CHOICE, self.OnTypeChoiceOnTypeChoice, -00382 id=wxID_USERTYPEDIALOGTYPE) -00383 -00384 self.staticBox1 = wx.StaticBox(id=wxID_USERTYPEDIALOGSTATICBOX1, -00385 label='Values', name='staticBox1', parent=self.MainPanel, -00386 pos=wx.Point(200, 24), size=wx.Size(224, 144), style=0) -00387 -00388 self.staticText2 = wx.StaticText(id=wxID_USERTYPEDIALOGSTATICTEXT2, -00389 label='Minimum:', name='staticText2', parent=self.MainPanel, -00390 pos=wx.Point(216, 48), size=wx.Size(67, 17), style=0) -00391 -00392 self.Min = wx.TextCtrl(id=wxID_USERTYPEDIALOGMIN, name='Min', -00393 parent=self.MainPanel, pos=wx.Point(296, 48), size=wx.Size(112, -00394 24), style=wx.TE_RIGHT, value='0') -00395 -00396 self.staticText3 = wx.StaticText(id=wxID_USERTYPEDIALOGSTATICTEXT3, -00397 label='Maximum:', name='staticText3', parent=self.MainPanel, -00398 pos=wx.Point(216, 88), size=wx.Size(71, 17), style=0) -00399 -00400 self.Max = wx.TextCtrl(id=wxID_USERTYPEDIALOGMAX, name='Max', -00401 parent=self.MainPanel, pos=wx.Point(296, 88), size=wx.Size(112, -00402 25), style=wx.TE_RIGHT, value='0') -00403 -00404 self.staticText4 = wx.StaticText(id=wxID_USERTYPEDIALOGSTATICTEXT4, -00405 label='Length:', name='staticText4', parent=self.MainPanel, -00406 pos=wx.Point(216, 128), size=wx.Size(52, 17), style=0) -00407 -00408 self.Length = wx.TextCtrl(id=wxID_USERTYPEDIALOGLENGTH, name='Length', -00409 parent=self.MainPanel, pos=wx.Point(296, 128), size=wx.Size(112, -00410 25), style=wx.TE_RIGHT, value='0') -00411 -00412 self._init_sizers_init_sizers() -00413 -00414 def __init__(self, parent): -00415 self._init_ctrls_init_ctrls(parent) -00416 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL) -00417 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_CENTER) -00418 self.TypeDictionaryTypeDictionary = {} -00419 -00420 EVT_BUTTON(self, self.ButtonSizerButtonSizer.GetAffirmativeButton().GetId(), self.OnOKOnOK) -00421 -00422 def OnOK(self, event): -00423 error = [] -00424 good = True -00425 firstmessage = "" -00426 secondmessage = "" -00427 name = self.Type.GetStringSelection() -00428 if name != "": -00429 valuetype = self.TypeDictionaryTypeDictionary[name][1] -00430 if valuetype == 0: -00431 try: -00432 int(self.Min.GetValue(), 16) -00433 except: -00434 error.append("Minimum") -00435 good = False -00436 try: -00437 int(self.Max.GetValue(), 16) -00438 except: -00439 error.append("Maximum") -00440 good = False -00441 elif valuetype == 1: -00442 try: -00443 int(self.Length.GetValue(), 16) -00444 except: -00445 error.append("Length") -00446 good = False -00447 if len(error) > 0: -00448 secondmessage = ". " -00449 for i, item in enumerate(error): -00450 if i == 0: -00451 secondmessage += item -00452 elif i == len(error) - 1: -00453 secondmessage += " and %s"%item -00454 else: -00455 secondmessage += ", %s"%item -00456 secondmessage += " must be integer" -00457 if len(error) > 1: -00458 secondmessage += "s" -00459 else: -00460 firstmessage = ". A type must be selected" -00461 good = False -00462 if not good: -00463 message = wxMessageDialog(self, "Form isn't valid%s%s%s!"%(firstmessage,secondmessage), "Error", wxOK|wxICON_ERROR) -00464 message.ShowModal() -00465 message.Destroy() -00466 self.Name.SetFocus() -00467 else: -00468 self.EndModal(wxID_OK) -00469 -00470 def SetValues(self, min = None, max = None, length = None): -00471 if min != None: -00472 self.Min.SetValue(str(min)) -00473 if max != None: -00474 self.Max.SetValue(str(max)) -00475 if length != None: -00476 self.Length.SetValue(str(length)) -00477 -00478 def SetTypeList(self, typedic, type = None): -00479 self.Type.Clear() -00480 list = [] -00481 for index, (name, valuetype) in typedic.iteritems(): -00482 self.TypeDictionaryTypeDictionary[name] = (index, valuetype) -00483 list.append((index, name)) -00484 list.sort() -00485 for index, name in list: -00486 self.Type.Append(name) -00487 if type != None: -00488 self.Type.SetStringSelection(typedic[type][0]) -00489 self.RefreshValuesRefreshValues() -00490 -00491 def OnTypeChoice(self, event): -00492 self.RefreshValuesRefreshValues() -00493 event.Skip() -00494 -00495 def RefreshValues(self): -00496 name = self.Type.GetStringSelection() -00497 if name != "": -00498 valuetype = self.TypeDictionaryTypeDictionary[name][1] -00499 if valuetype == 0: -00500 self.staticText2.Enable(True) -00501 self.staticText3.Enable(True) -00502 self.staticText4.Enable(False) -00503 self.Min.Enable(True) -00504 self.Max.Enable(True) -00505 self.Length.Enable(False) -00506 elif valuetype == 1: -00507 self.staticText2.Enable(False) -00508 self.staticText3.Enable(False) -00509 self.staticText4.Enable(True) -00510 self.Min.Enable(False) -00511 self.Max.Enable(False) -00512 self.Length.Enable(True) -00513 else: -00514 self.staticText2.Enable(False) -00515 self.staticText3.Enable(False) -00516 self.staticText4.Enable(False) -00517 self.Min.Enable(False) -00518 self.Max.Enable(False) -00519 self.Length.Enable(False) -00520 -00521 def GetValues(self): -00522 name = self.Type.GetStringSelection() -00523 type = self.TypeDictionaryTypeDictionary[name][0] -00524 min = int(self.Min.GetValue()) -00525 max = int(self.Max.GetValue()) -00526 length = int(self.Length.GetValue()) -00527 return type, min, max, length -00528 -00529 -00530 -00531 #------------------------------------------------------------------------------- -00532 # Editing Node Infos Dialog -00533 #------------------------------------------------------------------------------- -00534 -00535 -00536 [wxID_NODEINFOSDIALOG, wxID_NODEINFOSDIALOGMAINPANEL, -00537 wxID_NODEINFOSDIALOGNAME, wxID_NODEINFOSDIALOGNODEID, -00538 wxID_NODEINFOSDIALOGDESCRIPTION, wxID_NODEINFOSDIALOGSTATICTEXT1, -00539 wxID_NODEINFOSDIALOGSTATICTEXT2, wxID_NODEINFOSDIALOGSTATICTEXT3, -00540 wxID_NODEINFOSDIALOGSTATICTEXT4, wxID_NODEINFOSDIALOGTYPE, -00541 ] = [wx.NewId() for _init_ctrls in range(10)] -00542 -00543 class NodeInfosDialog(wx.Dialog): -00544 def _init_coll_flexGridSizer1_Items(self, parent): -00545 # generated method, don't edit -00546 -00547 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00548 -00549 def _init_sizers(self): -00550 # generated method, don't edit -00551 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00552 -00553 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00554 -00555 self.SetSizer(self.flexGridSizer1) -00556 -00557 def _init_ctrls(self, prnt): -00558 # generated method, don't edit -00559 wx.Dialog.__init__(self, id=wxID_NODEINFOSDIALOG, -00560 name='NodeInfosDialog', parent=prnt, pos=wx.Point(376, 223), -00561 size=wx.Size(300, 300), style=wx.DEFAULT_DIALOG_STYLE, -00562 title='Node Infos') -00563 self.SetClientSize(wx.Size(300, 300)) -00564 -00565 self.MainPanel = wx.Panel(id=wxID_NODEINFOSDIALOGMAINPANEL, -00566 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00567 size=wx.Size(280, 264), style=wx.TAB_TRAVERSAL) -00568 self.MainPanel.SetAutoLayout(True) -00569 -00570 self.staticText1 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT1, -00571 label='Name:', -00572 name='staticText1', parent=self.MainPanel, -00573 pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) -00574 -00575 self.Name = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNAME, name='Name', -00576 parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(250, -00577 25), style=0, value='') -00578 -00579 self.staticText2 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT2, -00580 label='Node ID:', name='staticText2', parent=self.MainPanel, -00581 pos=wx.Point(24, 80), size=wx.Size(67, 17), style=0) -00582 -00583 self.NodeID = wx.TextCtrl(id=wxID_NODEINFOSDIALOGNODEID, name='NodeID', -00584 parent=self.MainPanel, pos=wx.Point(24, 104), size=wx.Size(250, -00585 25), style=wx.TE_RIGHT, value='') -00586 -00587 self.staticText3 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT3, -00588 label='Type:', name='staticText3', parent=self.MainPanel, -00589 pos=wx.Point(24, 136), size=wx.Size(71, 17), style=0) -00590 -00591 self.Type = wx.Choice(choices=[], id=wxID_NODEINFOSDIALOGTYPE, -00592 name='Type', parent=self.MainPanel, pos=wx.Point(24, 160), -00593 size=wx.Size(250, 25), style=0) -00594 -00595 self.staticText4 = wx.StaticText(id=wxID_NODEINFOSDIALOGSTATICTEXT4, -00596 label='Description:', name='staticText4', parent=self.MainPanel, -00597 pos=wx.Point(24, 192), size=wx.Size(71, 17), style=0) -00598 -00599 self.Description = wx.TextCtrl(id=wxID_NODEINFOSDIALOGDESCRIPTION, -00600 name='Description', parent=self.MainPanel, pos=wx.Point(24, 216), -00601 size=wx.Size(250, 25), style=0, value='') -00602 -00603 self._init_sizers_init_sizers() -00604 -00605 def __init__(self, parent): -00606 self._init_ctrls_init_ctrls(parent) -00607 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL) -00608 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_CENTER) -00609 self.Type.Append("master") -00610 self.Type.Append("slave") -00611 -00612 EVT_BUTTON(self, self.ButtonSizerButtonSizer.GetAffirmativeButton().GetId(), self.OnOKOnOK) -00613 -00614 def OnOK(self, event): -00615 name = self.Name.GetValue() -00616 message = "" -00617 if name != "": -00618 good = not name[0].isdigit() -00619 for item in name.split("_"): -00620 good &= item.isalnum() -00621 if not good: -00622 message = "Node name can't be undefined or start with a digit and must be composed of alphanumerical characters or underscore!" -00623 if message != "": -00624 try: -00625 nodeid = int(self.NodeID.GetValue(), 16) -00626 except: -00627 message = "Node ID must be integer!" -00628 if message != "": -00629 message = wxMessageDialog(self, message, "ERROR", wxOK|wxICON_ERROR) -00630 message.ShowModal() -00631 message.Destroy() -00632 self.Name.SetFocus() -00633 else: -00634 self.EndModal(wxID_OK) -00635 -00636 def SetValues(self, name, id, type, description): -00637 self.Name.SetValue(name) -00638 self.NodeID.SetValue("0x%02X"%id) -00639 self.Type.SetStringSelection(type) -00640 self.Description.SetValue(description) -00641 -00642 def GetValues(self): -00643 name = self.Name.GetValue() -00644 nodeid = int(self.NodeID.GetValue(), 16) -00645 type = self.Type.GetStringSelection() -00646 description = self.Description.GetValue() -00647 return name, nodeid, type, description -00648 -00649 -00650 -00651 #------------------------------------------------------------------------------- -00652 # Create New Node Dialog -00653 #------------------------------------------------------------------------------- -00654 -00655 -00656 [wxID_CREATENODEDIALOG, wxID_CREATENODEDIALOGEMERGENCY, -00657 wxID_CREATENODEDIALOGGENSYNC, wxID_CREATENODEDIALOGMAINPANEL, -00658 wxID_CREATENODEDIALOGNAME, wxID_CREATENODEDIALOGNMT_HEARTBEAT, -00659 wxID_CREATENODEDIALOGNMT_NODEGUARDING, wxID_CREATENODEDIALOGNMT_NONE, -00660 wxID_CREATENODEDIALOGNODEID, wxID_CREATENODEDIALOGPROFILE, -00661 wxID_CREATENODEDIALOGSAVECONFIG, wxID_CREATENODEDIALOGSTATICTEXT1, -00662 wxID_CREATENODEDIALOGSTATICTEXT2, wxID_CREATENODEDIALOGSTATICTEXT3, -00663 wxID_CREATENODEDIALOGSTATICTEXT4, wxID_CREATENODEDIALOGSTATICTEXT5, -00664 wxID_CREATENODEDIALOGSTATICTEXT6, wxID_CREATENODEDIALOGSTATICTEXT7, -00665 wxID_CREATENODEDIALOGSTOREEDS, wxID_CREATENODEDIALOGDESCRIPTION, -00666 wxID_CREATENODEDIALOGTYPE, -00667 ] = [wx.NewId() for _init_ctrls in range(21)] -00668 -00669 class CreateNodeDialog(wx.Dialog): -00670 def _init_coll_flexGridSizer1_Items(self, parent): -00671 # generated method, don't edit -00672 -00673 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00674 -00675 def _init_sizers(self): -00676 # generated method, don't edit -00677 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00678 -00679 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00680 -00681 self.SetSizer(self.flexGridSizer1) -00682 -00683 def _init_ctrls(self, prnt): -00684 # generated method, don't edit -00685 wx.Dialog.__init__(self, id=wxID_CREATENODEDIALOG, -00686 name='CreateNodeDialog', parent=prnt, pos=wx.Point(376, 223), -00687 size=wx.Size(451, 376), style=wx.DEFAULT_DIALOG_STYLE, -00688 title='Create a new Node') -00689 self.SetClientSize(wx.Size(451, 376)) -00690 -00691 self.MainPanel = wx.Panel(id=wxID_CREATENODEDIALOGMAINPANEL, -00692 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00693 size=wx.Size(440, 278), style=wx.TAB_TRAVERSAL) -00694 self.MainPanel.SetAutoLayout(True) -00695 -00696 self.staticText1 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT1, -00697 label='Name:', name='staticText1', parent=self.MainPanel, -00698 pos=wx.Point(24, 24), size=wx.Size(156, 17), style=0) -00699 -00700 self.staticText2 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT2, -00701 label='Node ID:', name='staticText2', parent=self.MainPanel, -00702 pos=wx.Point(24, 80), size=wx.Size(67, 17), style=0) -00703 -00704 self.staticText3 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT3, -00705 label='Type:', name='staticText3', parent=self.MainPanel, -00706 pos=wx.Point(24, 136), size=wx.Size(71, 17), style=0) -00707 -00708 self.Type = wx.Choice(choices=[], id=wxID_CREATENODEDIALOGTYPE, -00709 name='Type', parent=self.MainPanel, pos=wx.Point(24, 160), -00710 size=wx.Size(200, 24), style=0) -00711 -00712 self.Name = wx.TextCtrl(id=wxID_CREATENODEDIALOGNAME, name='Name', -00713 parent=self.MainPanel, pos=wx.Point(24, 48), size=wx.Size(200, -00714 25), style=0, value='') -00715 -00716 self.NodeID = wx.TextCtrl(id=wxID_CREATENODEDIALOGNODEID, name='NodeID', -00717 parent=self.MainPanel, pos=wx.Point(24, 104), size=wx.Size(200, -00718 25), style=wx.TE_RIGHT, value='') -00719 -00720 self.staticText4 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT4, -00721 label='Profile:', name='staticText4', parent=self.MainPanel, -00722 pos=wx.Point(24, 192), size=wx.Size(47, 17), style=0) -00723 -00724 self.Profile = wx.Choice(choices=[], id=wxID_CREATENODEDIALOGPROFILE, -00725 name='Profile', parent=self.MainPanel, pos=wx.Point(24, 216), -00726 size=wx.Size(200, 24), style=0) -00727 self.Profile.Bind(wx.EVT_CHOICE, self.OnProfileChoiceOnProfileChoice, -00728 id=wxID_CREATENODEDIALOGPROFILE) -00729 -00730 self.staticText5 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT5, -00731 label='Network Management:', name='staticText5', -00732 parent=self.MainPanel, pos=wx.Point(256, 24), size=wx.Size(152, -00733 16), style=0) -00734 -00735 self.NMT_None = wx.RadioButton(id=wxID_CREATENODEDIALOGNMT_NONE, -00736 label='None', name='NMT_None', parent=self.MainPanel, -00737 pos=wx.Point(256, 40), size=wx.Size(114, 24), style=0) -00738 self.NMT_None.SetValue(True) -00739 -00740 self.NMT_NodeGuarding = wx.RadioButton(id=wxID_CREATENODEDIALOGNMT_NODEGUARDING, -00741 label='Node Guarding', name='NMT_NodeGuarding', -00742 parent=self.MainPanel, pos=wx.Point(256, 64), size=wx.Size(128, -00743 24), style=0) -00744 self.NMT_NodeGuarding.SetValue(False) -00745 -00746 self.NMT_Heartbeat = wx.RadioButton(id=wxID_CREATENODEDIALOGNMT_HEARTBEAT, -00747 label='Heartbeat', name='NMT_Heartbeat', parent=self.MainPanel, -00748 pos=wx.Point(256, 88), size=wx.Size(114, 24), style=0) -00749 self.NMT_Heartbeat.SetValue(False) -00750 -00751 self.staticText6 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT6, -00752 label='Options:', name='staticText6', parent=self.MainPanel, -00753 pos=wx.Point(256, 128), size=wx.Size(72, 17), style=0) -00754 -00755 self.DS302 = wx.CheckBox(id=wxID_CREATENODEDIALOGGENSYNC, -00756 label='DS-302 Profile', name='DS302', parent=self.MainPanel, -00757 pos=wx.Point(256, 144), size=wx.Size(128, 24), style=0) -00758 self.DS302.SetValue(False) -00759 #self.DS302.Enable(False) -00760 -00761 self.GenSYNC = wx.CheckBox(id=wxID_CREATENODEDIALOGGENSYNC, -00762 label='Generate SYNC', name='GenSYNC', parent=self.MainPanel, -00763 pos=wx.Point(256, 168), size=wx.Size(128, 24), style=0) -00764 self.GenSYNC.SetValue(False) -00765 -00766 self.Emergency = wx.CheckBox(id=wxID_CREATENODEDIALOGEMERGENCY, -00767 label='Emergency support', name='Emergency', -00768 parent=self.MainPanel, pos=wx.Point(256, 192), size=wx.Size(152, -00769 24), style=0) -00770 self.Emergency.SetValue(False) -00771 self.Emergency.Enable(False) -00772 -00773 self.SaveConfig = wx.CheckBox(id=wxID_CREATENODEDIALOGSAVECONFIG, -00774 label='Save Configuration', name='SaveConfig', -00775 parent=self.MainPanel, pos=wx.Point(256, 216), size=wx.Size(152, -00776 24), style=0) -00777 self.SaveConfig.SetValue(False) -00778 self.SaveConfig.Enable(False) -00779 -00780 # self.StoreEDS = wx.CheckBox(id=wxID_CREATENODEDIALOGSTOREEDS, -00781 # label='Store EDS', name='StoreEDS', parent=self.MainPanel, -00782 # pos=wx.Point(256, 240), size=wx.Size(144, 24), style=0) -00783 # self.StoreEDS.SetValue(False) -00784 -00785 self.staticText7 = wx.StaticText(id=wxID_CREATENODEDIALOGSTATICTEXT7, -00786 label='Description:', name='staticText7', parent=self.MainPanel, -00787 pos=wx.Point(24, 248), size=wx.Size(71, 17), style=0) -00788 -00789 self.Description = wx.TextCtrl(id=wxID_CREATENODEDIALOGDESCRIPTION, -00790 name='Description', parent=self.MainPanel, pos=wx.Point(24, 272), -00791 size=wx.Size(400, 25), style=0, value='') -00792 -00793 self._init_sizers_init_sizers() -00794 -00795 def __init__(self, parent, cwd): -00796 self._init_ctrls_init_ctrls(parent) -00797 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL) -00798 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_CENTER) -00799 self.NodeID.SetValue("0x00") -00800 self.Type.Append("master") -00801 self.Type.Append("slave") -00802 self.Type.SetStringSelection("slave") -00803 self.Description.SetValue("") -00804 self.ListProfileListProfile = {"None" : ""} -00805 self.Profile.Append("None") -00806 self.DirectoryDirectory = os.path.join(cwd, "config") -00807 listfiles = os.listdir(self.DirectoryDirectory) -00808 listfiles.sort() -00809 for item in listfiles: -00810 name, extend = os.path.splitext(item) -00811 if os.path.isfile(os.path.join(self.DirectoryDirectory, item)) and extend == ".prf" and name != "DS-302": -00812 self.ListProfileListProfile[name] = os.path.join(self.DirectoryDirectory, item) -00813 self.Profile.Append(name) -00814 self.Profile.Append("Other") -00815 self.Profile.SetStringSelection("None") -00816 self.Name.SetFocus() -00817 -00818 EVT_BUTTON(self, self.ButtonSizerButtonSizer.GetAffirmativeButton().GetId(), self.OnOKOnOK) -00819 -00820 def OnOK(self, event): -00821 name = self.Name.GetValue() -00822 message = "" -00823 if name != "": -00824 good = not name[0].isdigit() -00825 for item in name.split("_"): -00826 good &= item.isalnum() -00827 if not good: -00828 message = "Node name can't be undefined or start with a digit and must be composed of alphanumerical characters or underscore!" -00829 if message != "": -00830 try: -00831 nodeid = int(self.NodeID.GetValue(), 16) -00832 except: -00833 message = "Node ID must be an integer!" -00834 if message != "": -00835 message = wxMessageDialog(self, message, "ERROR", wxOK|wxICON_ERROR) -00836 message.ShowModal() -00837 message.Destroy() -00838 self.Name.SetFocus() -00839 else: -00840 self.EndModal(wxID_OK) -00841 -00842 def GetValues(self): -00843 name = self.Name.GetValue() -00844 nodeid = 0 -00845 if self.NodeID.GetValue() != "": -00846 nodeid = int(self.NodeID.GetValue(), 16) -00847 type = self.Type.GetStringSelection() -00848 description = self.Description.GetValue() -00849 return name, nodeid, type, description -00850 -00851 def GetProfile(self): -00852 name = self.Profile.GetStringSelection() -00853 return name, self.ListProfileListProfile[name] -00854 -00855 def GetNMTManagement(self): -00856 if self.NMT_None.GetValue(): -00857 return "None" -00858 elif self.NMT_NodeGuarding.GetValue(): -00859 return "NodeGuarding" -00860 elif self.NMT_Heartbeat.GetValue(): -00861 return "Heartbeat" -00862 return None -00863 -00864 def GetOptions(self): -00865 options = [] -00866 if self.DS302.GetValue(): -00867 options.append("DS302") -00868 if self.GenSYNC.GetValue(): -00869 options.append("GenSYNC") -00870 if self.Emergency.GetValue(): -00871 options.append("Emergency") -00872 if self.SaveConfig.GetValue(): -00873 options.append("SaveConfig") -00874 # if self.StoreEDS.GetValue(): -00875 # options.append("StoreEDS") -00876 return options -00877 -00878 def OnProfileChoice(self, event): -00879 if self.Profile.GetStringSelection() == "Other": -00880 dialog = wxFileDialog(self, "Choose a file", self.DirectoryDirectory, "", "OD Profile files (*.prf)|*.prf|All files|*.*", wxOPEN|wxCHANGE_DIR) -00881 dialog.ShowModal() -00882 filepath = dialog.GetPath() -00883 dialog.Destroy() -00884 if os.path.isfile(filepath): -00885 name = os.path.splitext(os.path.basename(filepath))[0] -00886 self.ListProfileListProfile[name] = filepath -00887 length = self.Profile.GetCount() -00888 self.Profile.Insert(name, length - 2) -00889 self.Profile.SetStringSelection(name) -00890 else: -00891 self.Profile.SetStringSelection("None") -00892 event.Skip() -00893 -00894 -00895 #------------------------------------------------------------------------------- -00896 # ADD Slave to NodeList Dialog -00897 #------------------------------------------------------------------------------- -00898 -00899 [wxID_ADDSLAVEDIALOG, wxID_ADDSLAVEDIALOGMAINPANEL, wxID_ADDSLAVEDIALOGSLAVENAME, -00900 wxID_ADDSLAVEDIALOGSLAVENODEID, wxID_ADDSLAVEDIALOGEDSFILE, -00901 wxID_ADDSLAVEDIALOGIMPORTEDS, wxID_ADDSLAVEDIALOGSTATICTEXT1, -00902 wxID_ADDSLAVEDIALOGSTATICTEXT2, wxID_ADDSLAVEDIALOGSTATICTEXT3, -00903 ] = [wx.NewId() for _init_ctrls in range(9)] -00904 -00905 class AddSlaveDialog(wx.Dialog): -00906 def _init_coll_flexGridSizer1_Items(self, parent): -00907 # generated method, don't edit -00908 -00909 parent.AddWindow(self.MainPanel, 0, border=0, flag=0) -00910 -00911 def _init_sizers(self): -00912 # generated method, don't edit -00913 self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0) -00914 -00915 self._init_coll_flexGridSizer1_Items_init_coll_flexGridSizer1_Items(self.flexGridSizer1) -00916 -00917 self.SetSizer(self.flexGridSizer1) -00918 -00919 def _init_ctrls(self, prnt): -00920 # generated method, don't edit -00921 wx.Dialog.__init__(self, id=wxID_ADDSLAVEDIALOG, -00922 name='AddSlaveDialog', parent=prnt, pos=wx.Point(376, 223), -00923 size=wx.Size(300, 250), style=wx.DEFAULT_DIALOG_STYLE, -00924 title='Add a slave to nodelist') -00925 self.SetClientSize(wx.Size(300, 250)) -00926 -00927 self.MainPanel = wx.Panel(id=wxID_ADDSLAVEDIALOGMAINPANEL, -00928 name='MainPanel', parent=self, pos=wx.Point(0, 0), -00929 size=wx.Size(350, 250), style=wx.TAB_TRAVERSAL) -00930 self.MainPanel.SetAutoLayout(True) -00931 -00932 self.staticText1 = wx.StaticText(id=wxID_ADDSLAVEDIALOGSTATICTEXT1, -00933 label='Slave Name:', name='staticText1', parent=self.MainPanel, -00934 pos=wx.Point(24, 24), size=wx.Size(150, 17), style=0) -00935 -00936 self.SlaveName = wx.TextCtrl(id=wxID_ADDSLAVEDIALOGSLAVENAME, -00937 name='SlaveName', parent=self.MainPanel, pos=wx.Point(24, 48), -00938 size=wx.Size(250, 24), style=0) -00939 -00940 self.staticText2 = wx.StaticText(id=wxID_ADDSLAVEDIALOGSTATICTEXT2, -00941 label='Slave Node ID:', name='staticText2', parent=self.MainPanel, -00942 pos=wx.Point(24, 80), size=wx.Size(150, 17), style=0) -00943 -00944 self.SlaveNodeID = wx.TextCtrl(id=wxID_ADDSLAVEDIALOGSLAVENODEID, -00945 name='SlaveName', parent=self.MainPanel, pos=wx.Point(24, 104), -00946 size=wx.Size(250, 24), style=wxALIGN_RIGHT) -00947 -00948 self.staticText3 = wx.StaticText(id=wxID_ADDSLAVEDIALOGSTATICTEXT3, -00949 label='EDS File:', name='staticText3', parent=self.MainPanel, -00950 pos=wx.Point(24, 136), size=wx.Size(155, 17), style=0) -00951 -00952 self.EDSFile = wx.Choice(id=wxID_ADDSLAVEDIALOGEDSFILE, -00953 name='EDSFile', parent=self.MainPanel, pos=wx.Point(24, 160), -00954 size=wx.Size(145, 24), style=0) -00955 -00956 self.ImportEDS = wxButton(id=wxID_ADDSLAVEDIALOGIMPORTEDS, label='Import EDS', -00957 name='ImportEDS', parent=self.MainPanel, pos=wx.Point(174, 160), -00958 size=wx.Size(100, 32), style=0) -00959 self.ImportEDS.Bind(wx.EVT_BUTTON, self.OnImportEDSButtonOnImportEDSButton, -00960 id=wxID_ADDSLAVEDIALOGIMPORTEDS) -00961 -00962 self._init_sizers_init_sizers() -00963 -00964 def __init__(self, parent): -00965 self._init_ctrls_init_ctrls(parent) -00966 self.ButtonSizerButtonSizer = self.CreateButtonSizer(wxOK|wxCANCEL|wxCENTRE) -00967 self.flexGridSizer1.Add(self.ButtonSizerButtonSizer, 1, wxALIGN_RIGHT) -00968 -00969 self.SlaveNodeID.SetValue("0x00") -00970 -00971 EVT_BUTTON(self, self.ButtonSizerButtonSizer.GetAffirmativeButton().GetId(), self.OnOKOnOK) -00972 -00973 def OnOK(self, event): -00974 error = [] -00975 if self.SlaveName.GetValue() == "": -00976 error.append("Slave Name") -00977 if self.SlaveNodeID.GetValue() == "": -00978 error.append("Slave Node ID") -00979 if self.EDSFile.GetStringSelection() == "": -00980 error.append("EDS File") -00981 if len(error) > 0: -00982 text = "" -00983 for i, item in enumerate(error): -00984 if i == 0: -00985 text += item -00986 elif i == len(error) - 1: -00987 text += " and %s"%item -00988 else: -00989 text += ", %s"%item -00990 message = wxMessageDialog(self, "Form isn't complete. %s must be filled!"%text, "Error", wxOK|wxICON_ERROR) -00991 message.ShowModal() -00992 message.Destroy() -00993 else: -00994 try: -00995 nodeid = self.SlaveNodeID.GetValue() -00996 if nodeid.find("x") != -1: -00997 nodeid = int(nodeid, 16) -00998 else: -00999 nodeid = int(nodeid) -01000 except: -01001 message = wxMessageDialog(self, "Slave Node ID must be a value in decimal or hexadecimal!", "Error", wxOK|wxICON_ERROR) -01002 message.ShowModal() -01003 message.Destroy() -01004 return -01005 if not 0 <= nodeid <= 127: -01006 message = wxMessageDialog(self, "Slave Node ID must be between 0 and 127!", "Error", wxOK|wxICON_ERROR) -01007 message.ShowModal() -01008 message.Destroy() -01009 elif nodeid == 0 or nodeid in self.NodeListNodeList.SlaveNodes.keys(): -01010 message = wxMessageDialog(self, "A Node with this ID already exist in the network!", "Error", wxOK|wxICON_ERROR) -01011 message.ShowModal() -01012 message.Destroy() -01013 else: -01014 self.EndModal(wxID_OK) -01015 -01016 def OnImportEDSButton(self, event): -01017 dialog = wxFileDialog(self, "Choose an EDS file", os.getcwd(), "", "EDS files (*.eds)|*.eds|All files|*.*", wxOPEN|wxCHANGE_DIR) -01018 if dialog.ShowModal() == wxID_OK: -01019 filepath = dialog.GetPath() -01020 if os.path.isfile(filepath): -01021 result = self.NodeListNodeList.ImportEDSFile(filepath) -01022 if result: -01023 message = wxMessageDialog(self, result, "Error", wxOK|wxICON_ERROR) -01024 message.ShowModal() -01025 message.Destroy() -01026 dialog.Destroy() -01027 self.RefreshEDSFileRefreshEDSFile() -01028 event.Skip() -01029 -01030 def RefreshEDSFile(self): -01031 selection = self.EDSFile.GetStringSelection() -01032 self.EDSFile.Clear() -01033 for option in self.NodeListNodeList.EDSNodes.keys(): -01034 self.EDSFile.Append(option) -01035 if self.EDSFile.FindString(selection) != wxNOT_FOUND: -01036 self.EDSFile.SetStringSelection(selection) -01037 -01038 def SetNodeList(self, nodelist): -01039 self.NodeListNodeList = nodelist -01040 self.RefreshEDSFileRefreshEDSFile() -01041 -01042 def GetValues(self): -01043 values = {} -01044 values["slaveName"] = self.SlaveName.GetValue() -01045 nodeid = self.SlaveNodeID.GetValue() -01046 if nodeid.find("x") != -1: -01047 values["slaveNodeID"] = int(nodeid, 16) -01048 else: -01049 values["slaveNodeID"] = int(nodeid) -01050 values["edsFile"] = self.EDSFile.GetStringSelection() -01051 return values -
-Go to the source code of this file.
Namespaces | |
namespace | commondialogs |
namespace | wxPython::wx::* |
namespace | wxPython::grid::* |
Data Structures | |
class | commondialogs::CommunicationDialog |
class | commondialogs::MapVariableDialog |
class | commondialogs::UserTypeDialog |
class | commondialogs::NodeInfosDialog |
class | commondialogs::CreateNodeDialog |
class | commondialogs::AddSlaveDialog |
00001 /* !!!!!!!!!! FILE GENERATED by configure. DO NOT EDIT !!!!!!!!!!*/ -00002 -00003 /* -00004 This file is part of CanFestival, a library implementing CanOpen Stack. -00005 -00006 Copyright (C): Edouard TISSERANT and Francis DUPIN -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 -00024 #ifndef _CONFIG_H_ -00025 #define _CONFIG_H_ -00026 -00027 #define MAX_CAN_BUS_ID 1 -00028 #define SDO_MAX_LENGTH_TRANSFERT 32 -00029 #define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 -00030 #define NMT_MAX_NODE_ID 128 -00031 #define SDO_TIMEOUT_MS 3000 -00032 #define MAX_NB_TIMER 32 -00033 /* CANOPEN_BIG_ENDIAN is not defined */ -00034 /* US_TO_TIMEVAL_FACTOR is not defined */ -00035 /* TIMEVAL is not defined */ -00036 /* TIMEVAL_MAX is not defined */ -00037 /* RTCAN_SOCKET is not defined */ -00038 -00039 #define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat)\ -00040 repeat repeat repeat repeat -00041 #define REPEAT_NMT_MAX_NODE_ID_TIMES(repeat)\ -00042 repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat -00043 #endif /* _CONFIG_H_ */ -
-Go to the source code of this file.
Defines | |
#define | MAX_CAN_BUS_ID 1 |
#define | SDO_MAX_LENGTH_TRANSFERT 32 |
#define | SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 |
#define | NMT_MAX_NODE_ID 128 |
#define | SDO_TIMEOUT_MS 3000 |
#define | MAX_NB_TIMER 32 |
#define | REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat) repeat repeat repeat repeat |
#define | REPEAT_NMT_MAX_NODE_ID_TIMES(repeat) repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat |
#define REPEAT_NMT_MAX_NODE_ID_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat | -
#define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat | -
#define SDO_MAX_LENGTH_TRANSFERT 32 | -
#define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 #ifndef __data_h__ -00025 #define __data_h__ -00026 -00027 /* declaration of CO_Data type let us include all necessary headers -00028 struct struct_CO_Data can then be defined later -00029 */ -00030 typedef struct struct_CO_Data CO_Data; -00031 -00032 #include "applicfg.h" -00033 #include "def.h" -00034 #include "can.h" -00035 #include "objdictdef.h" -00036 #include "objacces.h" -00037 #include "sdo.h" -00038 #include "pdo.h" -00039 #include "states.h" -00040 #include "lifegrd.h" -00041 #include "sync.h" -00042 #include "nmtMaster.h" -00043 -00044 /* This structurs contains all necessary information for a CanOpen node */ -00045 struct struct_CO_Data { -00046 /* Object dictionary */ -00047 UNS8 *bDeviceNodeId; -00048 const indextable *objdict; -00049 UNS8 *count_sync; -00050 quick_index *firstIndex; -00051 quick_index *lastIndex; -00052 UNS16 *ObjdictSize; -00053 const UNS8 *iam_a_slave; -00054 valueRangeTest_t valueRangeTest; -00055 -00056 /* SDO */ -00057 s_transfer transfers[SDO_MAX_SIMULTANEOUS_TRANSFERTS]; -00058 /* s_sdo_parameter *sdo_parameters; */ -00059 -00060 /* State machine */ -00061 e_nodeState nodeState; -00062 s_state_communication CurrentCommunicationState; -00063 initialisation_t initialisation; -00064 preOperational_t preOperational; -00065 operational_t operational; -00066 stopped_t stopped; -00067 -00068 /* NMT-heartbeat */ -00069 UNS8 *ConsumerHeartbeatCount; -00070 UNS32 *ConsumerHeartbeatEntries; -00071 TIMER_HANDLE *ConsumerHeartBeatTimers; -00072 UNS16 *ProducerHeartBeatTime; -00073 TIMER_HANDLE ProducerHeartBeatTimer; -00074 heartbeatError_t heartbeatError; -00075 e_nodeState NMTable[NMT_MAX_NODE_ID]; -00076 -00077 /* SYNC */ -00078 TIMER_HANDLE syncTimer; -00079 UNS32 *COB_ID_Sync; -00080 UNS32 *Sync_Cycle_Period; -00081 /*UNS32 *Sync_window_length;;*/ -00082 post_sync_t post_sync; -00083 post_TPDO_t post_TPDO; -00084 -00085 /* PDO */ -00086 s_process_var process_var; -00087 -00088 /* General */ -00089 UNS8 toggle; -00090 CAN_HANDLE canHandle; -00091 scanIndexOD_t scanIndexOD; -00092 storeODSubIndex_t storeODSubIndex; -00093 -00094 /* DCF concise */ -00095 UNS8* dcf_cursor; -00096 UNS32 dcf_count_targets; -00097 -00098 }; -00099 -00100 #define NMTable_Initializer Unknown_state, -00101 -00102 #define s_transfer_Initializer {\ -00103 0, /* nodeId */\ -00104 0, /* wohami */\ -00105 SDO_RESET, /* state */\ -00106 0, /* toggle */\ -00107 0, /* abortCode */\ -00108 0, /* index */\ -00109 0, /* subIndex */\ -00110 0, /* count */\ -00111 0, /* offset */\ -00112 {0}, /* data (static use, so that all the table is initialize at 0)*/\ -00113 0, /* dataType */\ -00114 -1, /* timer */\ -00115 NULL /* Callback */\ -00116 }, -00117 -00118 /* A macro to initialize the data in client app.*/ -00119 /* CO_Data structure */ -00120 #define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX) {\ -00121 /* Object dictionary*/\ -00122 & NODE_PREFIX ## _bDeviceNodeId, /* bDeviceNodeId */\ -00123 NODE_PREFIX ## _objdict, /* objdict */\ -00124 NODE_PREFIX ## _count_sync, /* count_sync */\ -00125 & NODE_PREFIX ## _firstIndex, /* firstIndex */\ -00126 & NODE_PREFIX ## _lastIndex, /* lastIndex */\ -00127 & NODE_PREFIX ## _ObjdictSize, /* ObjdictSize */\ -00128 & NODE_PREFIX ## _iam_a_slave, /* iam_a_slave */\ -00129 NODE_PREFIX ## _valueRangeTest, /* valueRangeTest */\ -00130 \ -00131 /* SDO, structure s_transfer */\ -00132 {\ -00133 REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(s_transfer_Initializer)\ -00134 },\ -00135 \ -00136 /* State machine*/\ -00137 Unknown_state, /* nodeState */\ -00138 /* structure s_state_communication */\ -00139 {\ -00140 0, /* csBoot_Up */\ -00141 0, /* csSDO */\ -00142 0, /* csEmergency */\ -00143 0, /* csSYNC */\ -00144 0, /* csHeartbeat */\ -00145 0 /* csPDO */\ -00146 },\ -00147 _initialisation, /* initialisation */\ -00148 _preOperational, /* preOperational */\ -00149 _operational, /* operational */\ -00150 _stopped, /* stopped */\ -00151 \ -00152 /* NMT-heartbeat */\ -00153 & NODE_PREFIX ## _highestSubIndex_obj1016, /* ConsumerHeartbeatCount */\ -00154 NODE_PREFIX ## _obj1016, /* ConsumerHeartbeatEntries */\ -00155 NODE_PREFIX ## _heartBeatTimers, /* ConsumerHeartBeatTimers */\ -00156 & NODE_PREFIX ## _obj1017, /* ProducerHeartBeatTime */\ -00157 TIMER_NONE, /* ProducerHeartBeatTimer */\ -00158 _heartbeatError, /* heartbeatError */\ -00159 \ -00160 {REPEAT_NMT_MAX_NODE_ID_TIMES(NMTable_Initializer)},\ -00161 /* is well initialized at "Unknown_state". Is it ok ? (FD)*/\ -00162 \ -00163 /* SYNC */\ -00164 TIMER_NONE, /* syncTimer */\ -00165 & NODE_PREFIX ## _obj1005, /* COB_ID_Sync */\ -00166 & NODE_PREFIX ## _obj1006, /* Sync_Cycle_Period */\ -00167 /*& NODE_PREFIX ## _obj1007, */ /* Sync_window_length */\ -00168 _post_sync, /* post_sync */\ -00169 _post_TPDO, /* post_TPDO */\ -00170 \ -00171 /* PDO, structure s_process_var */\ -00172 {\ -00173 0, /* count */\ -00174 {0} /* data (static use, so that all the table is initialize at 0)*/\ -00175 },\ -00176 \ -00177 /* General */\ -00178 0, /* toggle */\ -00179 NULL, /* canSend */\ -00180 NODE_PREFIX ## _scanIndexOD, /* scanIndexOD */\ -00181 _storeODSubIndex, /* storeODSubIndex */\ -00182 NULL, /*dcf_cursor*/\ -00183 1 /*dcf_count_targets*/\ -00184 } -00185 -00186 #endif /* __data_h__ */ -00187 -00188 -
#include "applicfg.h"
#include "def.h"
#include "can.h"
#include "objdictdef.h"
#include "objacces.h"
#include "sdo.h"
#include "pdo.h"
#include "states.h"
#include "lifegrd.h"
#include "sync.h"
#include "nmtMaster.h"
-Go to the source code of this file.
Data Structures | |
struct | struct_CO_Data |
Typedefs | |
typedef struct_CO_Data | CO_Data |
typedef struct struct_CO_Data CO_Data | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include "objacces.h" -00024 #include "sdo.h" -00025 #include "dcf.h" -00026 #include "sysdep.h" -00027 -00028 -00029 -00030 extern UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -00031 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize); -00032 -00033 const indextable *ptrTable; -00034 -00035 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) -00036 { -00037 UNS32 abortCode; -00038 -00039 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00040 { -00041 MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode); -00042 MSG_WAR(0x2A02, "server node : ", nodeId); -00043 } -00044 -00045 closeSDOtransfer(d, nodeId, SDO_CLIENT); -00046 decompo_dcf(d,nodeId); -00047 } -00048 -00049 UNS32 decompo_dcf(CO_Data* d,UNS8 nodeId) -00050 { -00051 UNS32 errorCode; -00052 UNS16 target_Index; -00053 UNS8 target_Subindex; -00054 UNS32 target_Size; -00055 UNS32 res; -00056 ODCallback_t *Callback; -00057 -00058 ptrTable = (*d->scanIndexOD)(0x1F22, &errorCode, &Callback); -00059 if (errorCode != OD_SUCCESSFUL) -00060 { -00061 return errorCode; -00062 } -00063 -00064 /*Loop on all Nodes supported in DCF subindexes*/ -00065 while (nodeId < ptrTable->bSubCount){ -00066 UNS32 nb_targets; -00067 -00068 UNS8 szData = ptrTable->pSubindex[nodeId].size; -00069 UNS8* dcfend; -00070 -00071 { -00072 UNS8* dcf = *((UNS8**)ptrTable->pSubindex[nodeId].pObject); -00073 dcfend = dcf + szData; -00074 if (!d->dcf_cursor) { -00075 d->dcf_cursor = (UNS8*)dcf + 4; -00076 d->dcf_count_targets = 0; -00077 } -00078 nb_targets = UNS32_LE(*((UNS32*)dcf)); -00079 } -00080 -00081 // condition on consise DCF string for NodeID, if big enough -00082 if((UNS8*)d->dcf_cursor + 7 < (UNS8*)dcfend && d->dcf_count_targets < nb_targets) -00083 { -00084 // pointer to the DCF string for NodeID -00085 target_Index = UNS16_LE(*((UNS16*)(d->dcf_cursor))); d->dcf_cursor += 2; -00086 target_Subindex = *((UNS8*)(((UNS8*)d->dcf_cursor)++)); -00087 target_Size = UNS32_LE(*((UNS32*)(d->dcf_cursor))); d->dcf_cursor += 4; -00088 -00089 /*printf("Master : ConfigureSlaveNode %2.2x (Concise DCF)\n",nodeId);*/ -00090 res = _writeNetworkDict(d, /*CO_Data* d*/ -00091 nodeId, /*UNS8 nodeId*/ -00092 target_Index, /*UNS16 index*/ -00093 target_Subindex, /*UNS8 subindex*/ -00094 target_Size, /*UNS8 count*/ -00095 0, /*UNS8 dataType*/ -00096 d->dcf_cursor,/*void *data*/ -00097 CheckSDOAndContinue,/*SDOCallback_t Callback*/ -00098 0); /* no endianize */ -00099 /*Push d->dcf_cursor to the end of data*/ -00100 -00101 d->dcf_cursor += target_Size; -00102 d->dcf_count_targets++; -00103 -00104 return ; -00105 } -00106 nodeId++; -00107 d->dcf_cursor = NULL; -00108 } -00109 /* Switch Master to preOperational state */ -00110 (*d->preOperational)(); -00111 -00112 } -