User Tools

Site Tools


ch10_13_handbook:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ch10_13_handbook:start [2014/08/11 16:41] – [CR031 - XML Mapping to Chapter 10] pferrillch10_13_handbook:start [2014/09/12 15:40] (current) – [SAMPLE CODE] mcferrill
Line 13: Line 13:
  
 [[RECORDER COMMAND AND CONTROL]] [[RECORDER COMMAND AND CONTROL]]
-  * Network Control 
-IRIG 106-09 added the ability to issue Chapter 6 commands via a TELNET interface. It does not specify how this interface is to be configured nor does it provide any specific commands for that purpose. 
  
--------- 
  
-==== CR031 - XML Mapping to Chapter 10 ====+==== SAMPLE CODE ==== 
 +Many if not most programmers learn best from sample code. This update to the IRIG 106 Programmer's Handbook adds a number of new code samples in multiple languages to show how to process different data types and specific features of the Chapter 10 file format. These samples are linked below on individual pages to make it easy to access. A number of these samples use the C library available from [[http://sourceforge.net/projects/irig106/|sourceforge]].
  
-It was decided during an Recorder Vendor Working Group telecon to push CR031 into an appendix of the next release of the programmer's handbook. The work on this was submitted by Christian Rueck of Data Bus Tools GmbH. +[[Python Code using DLL]]
  
-<code XML> +=== Samples Repository === 
-<?xml version="1.0" encoding="UTF-8"?> +The samples repository is hosted on bitbucket [[https://bitbucket.org/pychapter10/handbook-samples|here]]
-<cns:ch10 xmlns:cns="http://www.example.org/XMLCH10Mapping"  +Included in the repository are basic installation and usage directions akin to what is given here.
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +
-  xsi:noNamespaceSchemaLocation="XMLCH10Mapping.xsd"  +
-  xsi:schemaLocation="http://www.example.org/XMLCH10Mapping XMLCH10Mapping.xsd">+
  
-<!-- Include some predefined TMATS file --> +The samples are organized into 3 categories
-    <cns:Packet ChannelID="0" RTC="0" DataType="TMATS"> +  * c - Standard C samples using the Irig 106 library (from irig106.org) 
-        <cns:TMATSData Ch10Version="106-13"> +  * pyi106 Python samples using a wrapper to the above C library. 
-            <cns:IncludeFile>c:\someFile.tma</cns:IncludeFile> +  * pyc10 - Pure Python samples using the PyChapter10 library.
-        </cns:TMATSData> +
-    </cns:Packet>+
  
-<!-Create first time packets --> +Each of the above directories has the same basic samples written as similarly as possible to perform the following tasks: 
-    <cns:Packet ChannelID="1" RTC="0" DataType="Time Format 1"> +  * stat Read a .ch10/.c10 file and display information on the data it contains. Can also filter report based on data type and channel ID. 
-        <cns:TimeData> +  * copy Copy packets from one file to another. Can also filter based on data type and channel ID. 
-            <cns:TimeDataContent Time="11:23:12.000" Date="2012-11-23"/> +  * dump Export packet contents to separate files (eg. export video data to .mpg files). Can also filter based on data type and channel ID. 
-        </cns:TimeData> +  * video Full GUI application that will play split-screen video directly from a chapter 10 file as it is parsed in the background. 
-    </cns:Packet> +  * reindex (C sample still work in progress) Strip index packets from a file and optionally rebuild new indices entirely. 
-     +  * listen (work in progress) Listens for chapter 10 over an ethernet stream and saves to file.
-<!-- Define further time packets relative to first--> +
-    <cns:Packet ChannelID="1" RTC="c+10000000" DataType="Time Format 1"> +
-        <cns:TimeData> +
-            <cns:TimeDataRelativeContent Offset="1000000000"/> +
-        </cns:TimeData> +
-    </cns:Packet> +
-     +
-<!-- Further attributes could be defined but are optional--> +
-    <cns:Packet ChannelID="1" RTC="c+10000000" ChecksumType="CRC16"  +
-      DataType="Time Format 1" DataTypeVersion="106-13"> +
-        <cns:TimeData MonthYearAvailable="True" LeapYear="True" TimeFormat="IRIG B" TimeSource="External"> +
-            <cns:TimeDataRelativeContent Offset="1000000000"/> +
-        </cns:TimeData> +
-        </cns:Packet> +
-         +
-<!-- Errors can be introduced--> +
-    <cns:Packet ChannelID="1" RTC="c+10000000" DataType="Time Format 1" DataLength="+2"  +
-      PacketLength="27" HeaderCRC="+0001" DataOverflow="True" SequenceNumber="+5" DataCRC="1234"> +
-        <cns:GenericData> +
-            <cns:Bytes>0F 12 31 EF 6B</cns:Bytes> +
-        </cns:GenericData> +
-    </cns:Packet>+
  
-<!-- Packets can have secondary headers--> +**Dependencies (C samples)**
-    <cns:Packet ChannelID="1" RTC="c+10000000" DataType="Time Format 1" SecondaryHeaderPresent="True"> +
-        <cns:SecondaryHeader Time="11:23:12.000" Date="2012-11-23"/> +
-        <cns:TimeData> +
-            <cns:TimeDataRelativeContent Offset="1000000000"/> +
-        </cns:TimeData> +
-    </cns:Packet>+
  
-<!-- Secondary headers can have errors too--> +  * Visual studio (developed on VS Ultimate 2013) 
-    <cns:Packet ChannelID="1" RTC="c+10000000" DataType="Time Format 1" SecondaryHeaderPresent="True"> +  * Qt 5 & Qt visual studio plugin (for video sample)
-        <cns:SecondaryHeader ERTC="+0" CRC="-0001" Filler="3E 2F"/> +
-        <cns:TimeData> +
-            <cns:TimeDataRelativeContent Offset="1000000000"/> +
-        </cns:TimeData> +
-    </cns:Packet>+
  
-<!-- raw data like packet flags and CSDW can be defined as a base an modified by further options --> +**Dependencies (Python Samples)**
-    <cns:Packet ChannelID="1" RTC="c+10000000" DataType="Time Format 1" PacketFlags="3F"  +
-      DataOverflow="True" SecondaryHeaderTimeFormat="Chapter 4 Binary"> +
-        <cns:TimeData CSDW="31e5893C" LeapYear="True" TimeSource="Internal From RMM"> +
-            <cns:TimeDataRelativeContent Offset="1000000000"/> +
-        </cns:TimeData> +
-    </cns:Packet>+
  
-<!-- Arbitrary data can be added between packets--> +  * Python 2.7 
-    <cns:Words>e37F 212B</cns:Words> +  * PyChapter10 (see above, for pyc10 samples only) 
-    <cns:Bytes>7F</cns:Bytes>+  * [[http://docopt.org|docopt]] 
 +  * [[http://qt-project.org/wiki/PySide|PySide]] (for video samples)
  
-<!-- New packet types can be created--> +**Building and Running (C samples)** 
-    <cns:Packet ChannelID="12RTC="333DataTypeRaw="8F"> + 
-        <cns:GenericData> +The code for the C samples are (as much as possible) kept in the src directory under C samples. The code has comments outlining the different sections and is written as consistently as possible to the matching samples in the pyc10 and pyi106 sample directories. The visual studio project files are in the vs directory at the top of the c directory structure. Make sure samples/c/src and samples/c/irig106lib/src are in your "Additional Include Directories" and you should be able to compile, debug, etc. 
-            <cns:Bytes>3F 77</cns:Bytes> + 
-        </cns:GenericData> +Once dependencies are installed you should be able to build binaries of the samples. The video sample depends on the mplayer executable (included) located relative to the build and debug directories, but the others are self-contained. 
-    </cns:Packet>+ 
 +All of the samples (again, excluding video since it's a full GUI application) are run from the command line. Each one supports the --help option to view usage, options, etc. for that specific tool. 
 + 
 +**Building and Running (Python samples)** 
 + 
 +Once python and any other dependencies are installed the python samples can be run at the command prompt by prefixing the invocation with "pythonas in: "python stat.py test.c10which would run the stat sample on a file "test.c10". 
 + 
 +-------- 
 +===== APPENDIX ===== 
 + 
 +==== CR031 - XML Mapping to Chapter 10 ====
  
-<!-- Structured definition for specific packet types is available --> +It was decided during a Recorder Vendor Working Group telecon to push CR031 into an appendix of the next release of the programmer's handbook. The work on this was submitted by Christian Rueck of Data Bus Tools GmbH. The XML below presents one example of a file definition based on this concept.
-    <cns:Packet ChannelID="15" RTC="p+300" DataType="1553 Format 1"> +
-        <cns:MilbusData> +
-         +
-            <cns:MilbusMessage RTC="+20"> +
-                <cns:Words>453E 12FD</cns:Words> +
-            </cns:MilbusMessage> +
-             +
-            <cns:MilbusMessage RTC="+20" RTRTTransfer="True" ResponseTimeOut="True"> +
-                <cns:Words>453E 12FD</cns:Words> +
-            </cns:MilbusMessage> +
-             +
-<!-- Any data can be inserted in between --> +
-            <cns:Bytes>3F 21</cns:Bytes> +
-     +
-            <cns:MilbusMessage RTC="+20"> +
-                <cns:Words>453E 12FD</cns:Words> +
-            </cns:MilbusMessage> +
-             +
-        </cns:MilbusData> +
-    </cns:Packet> +
-    <cns:Bytes>3F</cns:Bytes> +
-     +
-</cns:ch10>+
  
-</code>+[[CR31 - XML Sample File]]
ch10_13_handbook/start.1407793310.txt.gz · Last modified: 2014/08/11 16:41 by pferrill

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki